/* Types of Bikes Complete Guide — main stylesheet */
:root {
  --bg: #faf8f4;
  --surface: #ffffff;
  --ink: #1b2424;
  --muted: #5b6563;
  --line: #e6e1d8;
  --brand: #1f4d45;
  --brand-soft: #e7f0ed;
  --accent: #d9642b;
  --accent-soft: #fbece3;
  --radius: 14px;
  --shadow: 0 1px 2px rgba(27, 36, 36, .06), 0 6px 20px rgba(27, 36, 36, .06);
  --serif: "Fraunces", Georgia, "Times New Roman", serif;
  --sans: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --wrap: 1180px;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: 84px; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 17px/1.7 var(--sans); overflow-x: hidden; }
img { max-width: 100%; height: auto; display: block; }
a { color: var(--brand); text-underline-offset: 3px; }
a:hover { color: var(--accent); }
h1, h2, h3 { font-family: var(--serif); line-height: 1.2; color: var(--ink); letter-spacing: -.01em; }
h1 { font-size: clamp(2rem, 4.2vw, 3.1rem); margin: .3em 0 .35em; }
h2 { font-size: clamp(1.5rem, 2.6vw, 2rem); margin: 2.2em 0 .6em; }
h3 { font-size: 1.25rem; margin: 1.6em 0 .4em; }
p { margin: 0 0 1.1em; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; border-radius: 4px; }

.wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 20px; }
.narrow { max-width: 820px; }
.skip { position: absolute; left: -999px; top: 8px; background: var(--ink); color: #fff; padding: 8px 14px; z-index: 100; border-radius: 6px; }
.skip:focus { left: 8px; }

/* Header */
.site-header { position: sticky; top: 0; z-index: 50; background: rgba(250, 248, 244, .94); backdrop-filter: blur(8px); border-bottom: 1px solid var(--line); }
.header-inner { display: flex; align-items: center; justify-content: space-between; min-height: 68px; gap: 20px; }
.logo { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--ink); }
.logo:hover { color: var(--ink); }
.logo-mark { width: 40px; height: 40px; color: var(--brand); flex: none; }
.logo-text { display: flex; flex-direction: column; line-height: 1.05; }
.logo-text strong { font-family: var(--serif); font-size: 1.2rem; }
.logo-text small { margin-top: 3px; font-size: .7rem; text-transform: uppercase; letter-spacing: .16em; color: var(--accent); font-weight: 700; }
.site-nav ul { list-style: none; display: flex; gap: 4px; margin: 0; padding: 0; }
.site-nav a { display: block; padding: 8px 11px; border-radius: 8px; text-decoration: none; color: var(--ink); font-size: .92rem; font-weight: 500; white-space: nowrap; }
.site-nav a:hover { background: var(--brand-soft); color: var(--brand); }
.site-nav a[aria-current="page"] { color: var(--brand); background: var(--brand-soft); font-weight: 600; }
.nav-toggle { display: none; background: none; border: 0; padding: 10px; cursor: pointer; }
.nav-toggle span { display: block; width: 24px; height: 2px; background: var(--ink); margin: 5px 0; transition: .2s; }

@media (max-width: 1080px) {
  .nav-toggle { display: block; }
  .site-nav { position: absolute; left: 0; right: 0; top: 100%; background: var(--bg); border-bottom: 1px solid var(--line); display: none; box-shadow: var(--shadow); }
  .site-nav.open { display: block; }
  .site-nav ul { flex-direction: column; padding: 10px 16px 18px; }
  .site-nav a { padding: 12px; font-size: 1rem; }
  .nav-toggle[aria-expanded="true"] span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
  .nav-toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
  .nav-toggle[aria-expanded="true"] span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }
}

/* Buttons */
.btn { display: inline-block; background: var(--brand); color: #fff; padding: 13px 22px; border-radius: 999px; text-decoration: none; font-weight: 600; border: 0; cursor: pointer; font: 600 1rem var(--sans); }
.btn:hover { background: #163a34; color: #fff; }
.btn-ghost { background: transparent; color: var(--brand); box-shadow: inset 0 0 0 2px var(--brand); }
.btn-ghost:hover { background: var(--brand); color: #fff; }

/* Home hero */
.home-hero { padding: 48px 0 56px; }
.home-hero .wrap { display: grid; grid-template-columns: 1.05fr 1fr; gap: 48px; align-items: center; }
.eyebrow { display: inline-block; font-size: .78rem; font-weight: 700; text-transform: uppercase; letter-spacing: .14em; color: var(--accent); margin-bottom: 6px; }
.home-hero p.sub { font-size: 1.15rem; color: var(--muted); max-width: 34em; }
.hero-actions { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 22px; }
.hero-img { border-radius: 20px; box-shadow: var(--shadow); aspect-ratio: 4/3; object-fit: cover; width: 100%; }
@media (max-width: 860px) { .home-hero .wrap { grid-template-columns: 1fr; gap: 28px; } .home-hero { padding-top: 28px; } }

.section { padding: 56px 0; }
.section-alt { background: var(--surface); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.section-head { max-width: 680px; margin-bottom: 28px; }
.section-head h2 { margin-top: 0; }
.section-head p { color: var(--muted); }

/* Cards */
.card-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 24px; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; text-decoration: none; color: var(--ink); display: flex; flex-direction: column; transition: transform .2s, box-shadow .2s; }
.card:hover { transform: translateY(-3px); box-shadow: var(--shadow); color: var(--ink); }
.card img { aspect-ratio: 3/2; object-fit: cover; width: 100%; }
.card-body { padding: 18px 20px 22px; display: flex; flex-direction: column; flex: 1; }
.card h3 { margin: 0 0 6px; font-size: 1.2rem; }
.card p { color: var(--muted); font-size: .95rem; margin-bottom: 14px; }
.card-link { margin-top: auto; color: var(--brand); font-weight: 600; font-size: .92rem; }

.type-strip { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 16px; }
.type-strip a { text-decoration: none; color: var(--ink); font-weight: 600; font-size: .95rem; }
.type-strip img { border-radius: 10px; aspect-ratio: 4/3; object-fit: cover; margin-bottom: 8px; transition: transform .2s; }
.type-strip a:hover img { transform: scale(1.03); }

/* Bike finder */
.finder { background: var(--brand); color: #fff; border-radius: 20px; padding: 36px; display: grid; grid-template-columns: 1fr 1.3fr; gap: 36px; }
.finder h2 { color: #fff; margin: 0 0 10px; }
.finder p { color: #d8e6e2; }
.finder form { display: grid; gap: 14px; }
.finder label { font-weight: 600; font-size: .92rem; display: block; margin-bottom: 4px; }
.finder select { width: 100%; padding: 12px; border-radius: 10px; border: 0; font: 1rem var(--sans); background: #fff; color: var(--ink); }
.finder .btn { background: var(--accent); justify-self: start; }
.finder .btn:hover { background: #bf5220; }
.finder-result { background: rgba(255, 255, 255, .1); border-radius: 12px; padding: 16px 18px; display: none; }
.finder-result.show { display: block; }
.finder-result a { color: #fff; font-weight: 700; }
.finder-result strong { font-family: var(--serif); font-size: 1.3rem; display: block; margin-bottom: 4px; }
@media (max-width: 860px) { .finder { grid-template-columns: 1fr; padding: 26px 20px; } }

/* Article */
.article-hero { padding: 26px 0 10px; }
.breadcrumb { font-size: .88rem; color: var(--muted); }
.breadcrumb a { color: var(--muted); }
.meta { color: var(--muted); font-size: .9rem; }
.lead { font-size: 1.15rem; color: #34403e; }
.hero-figure { margin: 18px auto 0; }
.hero-figure img { border-radius: 18px; width: 100%; aspect-ratio: 16/8; object-fit: cover; }
.article-layout { display: grid; grid-template-columns: 250px minmax(0, 1fr); gap: 56px; padding-top: 34px; padding-bottom: 40px; }
.article-aside { position: relative; }
.toc { position: sticky; top: 92px; font-size: .9rem; border-left: 2px solid var(--line); padding-left: 16px; max-height: calc(100vh - 110px); overflow: auto; }
.toc-title { font-weight: 700; text-transform: uppercase; letter-spacing: .1em; font-size: .75rem; color: var(--muted); margin-bottom: 8px; }
.toc ol { list-style: none; margin: 0; padding: 0; }
.toc li { margin: 0 0 8px; line-height: 1.4; }
.toc a { color: var(--muted); text-decoration: none; }
.toc a:hover, .toc a.active { color: var(--brand); }
.toc a.active { font-weight: 600; }
@media (max-width: 960px) {
  .article-layout { grid-template-columns: minmax(0, 1fr); gap: 0; }
  .toc { position: static; max-height: none; border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px; background: var(--surface); margin-bottom: 10px; }
}

.prose { max-width: 760px; }
.prose > h2:first-of-type { margin-top: 1em; }
.prose ul, .prose ol { padding-left: 1.3em; margin: 0 0 1.2em; }
.prose li { margin-bottom: .45em; }
.prose figure { margin: 1.6em 0; }
.prose figure img { border-radius: 12px; width: 100%; }
.prose figcaption { font-size: .88rem; color: var(--muted); margin-top: 8px; }

.tip, .warn, .key { border-radius: 12px; padding: 16px 20px; margin: 1.5em 0; font-size: .98rem; }
.tip { background: var(--brand-soft); border-left: 4px solid var(--brand); }
.warn { background: var(--accent-soft); border-left: 4px solid var(--accent); }
.key { background: var(--surface); border: 1px solid var(--line); }
.tip p:last-child, .warn p:last-child, .key p:last-child, .key ul:last-child { margin-bottom: 0; }
.tip strong:first-child, .warn strong:first-child { display: block; margin-bottom: 2px; }

.table-wrap { overflow-x: auto; margin: 1.4em 0 1.8em; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); }
table { width: 100%; border-collapse: collapse; font-size: .93rem; min-width: 560px; }
th, td { text-align: left; padding: 11px 14px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { background: #f3f0ea; font-weight: 600; }
tr:last-child td { border-bottom: 0; }

.bike-type { display: grid; grid-template-columns: 260px minmax(0, 1fr); gap: 26px; margin: 2em 0; padding-bottom: 2em; border-bottom: 1px solid var(--line); }
.bike-type img { border-radius: 12px; aspect-ratio: 4/3; object-fit: cover; }
.bike-type h2 { margin-top: 0; }
.bike-type .facts { font-size: .92rem; background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 10px 14px; margin: 0 0 12px; }
.bike-type .facts li { margin: 0; }
.pros-cons { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; font-size: .94rem; }
.pros-cons h4 { margin: 0 0 4px; font-size: .9rem; text-transform: uppercase; letter-spacing: .06em; }
.pros-cons ul { margin: 0; }
@media (max-width: 760px) { .bike-type { grid-template-columns: minmax(0, 1fr); } .pros-cons { grid-template-columns: 1fr; } }

.checklist { list-style: none; padding-left: 0 !important; }
.checklist li { padding-left: 30px; position: relative; }
.checklist li::before { content: ""; position: absolute; left: 0; top: .35em; width: 18px; height: 18px; border-radius: 5px; border: 2px solid var(--brand); background: var(--surface); }

/* FAQ */
details.faq { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 0 18px; margin-bottom: 10px; }
details.faq summary { cursor: pointer; font-weight: 600; padding: 14px 0; list-style: none; position: relative; padding-right: 28px; }
details.faq summary::-webkit-details-marker { display: none; }
details.faq summary::after { content: "+"; position: absolute; right: 0; top: 10px; font-size: 1.4rem; color: var(--brand); }
details.faq[open] summary::after { content: "–"; }
details.faq > div { padding-bottom: 14px; color: #34403e; }

/* Ads — collapsed until an ad unit is configured in js/main.js */
.ad-slot { display: none; margin: 2em 0; min-height: 0; text-align: center; }
.ad-slot.active { display: block; min-height: 280px; }
.ad-slot.active::before { content: "Advertisement"; display: block; font-size: .7rem; letter-spacing: .12em; text-transform: uppercase; color: #9aa3a1; margin-bottom: 6px; }

/* Related */
.related { padding-bottom: 60px; }
.related h2 { margin-top: 10px; }

/* Pages */
.page { padding: 36px 20px 70px; }
.contact-box { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; }

/* Footer */
.site-footer { background: #17201f; color: #c9d1cf; padding: 50px 0 20px; font-size: .94rem; }
.site-footer a { color: #e8eeec; text-decoration: none; }
.site-footer a:hover { color: #f3a172; }
.footer-grid { display: grid; grid-template-columns: 1.5fr 1fr 1fr; gap: 40px; }
.site-footer h2 { font-family: var(--sans); font-size: .8rem; text-transform: uppercase; letter-spacing: .14em; color: #8e9a97; margin: 0 0 12px; }
.site-footer ul { list-style: none; margin: 0; padding: 0; }
.site-footer li { margin-bottom: 7px; }
.logo-light, .logo-light:hover { color: #fff; margin-bottom: 12px; }
.logo-light .logo-mark { color: #fff; }
.logo-light .logo-text strong { color: #fff; }
.footer-bottom { border-top: 1px solid #2c3736; margin-top: 34px; padding-top: 18px; font-size: .82rem; color: #8e9a97; }
@media (max-width: 760px) { .footer-grid { grid-template-columns: 1fr; gap: 26px; } }

@media (max-width: 600px) {
  body { font-size: 16px; }
  .wrap { padding: 0 16px; }
  .hero-figure img { aspect-ratio: 3/2; border-radius: 12px; }
  .card-grid { grid-template-columns: 1fr; }
  .section { padding: 40px 0; }
}
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } * { transition: none !important; } }

/* Home: 7 guide cards — first card featured so the grid fills evenly */
@media (min-width: 1001px) {
  .home .section-alt .card-grid { grid-template-columns: repeat(4, 1fr); }
  .home .section-alt .card-grid .card:first-child { grid-column: span 2; }
}
@media (min-width: 601px) and (max-width: 1000px) {
  .home .section-alt .card-grid { grid-template-columns: repeat(2, 1fr); }
  .home .section-alt .card-grid .card:first-child { grid-column: span 2; }
}
.home .section-alt .card-grid .card:first-child img { aspect-ratio: 16/9; }
