/*
Theme Name: Trailhead
Description: Hiking & off-the-map China. Hand-built theme.
Version: 0.1.0
Text Domain: trailhead
*/

:root {
    --paper: #f5f6f7;     /* snow */
    --paper-2: #e9edf1;
    --card: #ffffff;
    --ink: #1e2733;
    --ink-2: #4a5563;
    --muted: #7b8594;
    --line: #d9dfe6;
    --pine: #2e4d6e;      /* 靛青: primary */
    --pine-2: #223a54;
    --moss: #6f8fae;
    --qing: #4f7489;      /* 石青 */
    --clay: #b5392a;      /* 朱砂 */
    --sand: #c9d4e0;
    --amber: #b9862f;
    --green: #3f7a5e;     /* "open to foreigners" */
    --radius: 12px;
    --serif: "Source Serif 4", Georgia, "Songti SC", serif;
    --sans: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
    --wrap: 1180px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
    margin: 0;
    background-color: var(--paper);
    color: var(--ink);
    font: 16px/1.65 var(--sans);
    -webkit-font-smoothing: antialiased;
}
img, svg { max-width: 100%; display: block; }
a { color: var(--pine); text-underline-offset: 3px; }
a:hover { color: var(--clay); }
h1, h2, h3 { font-family: var(--serif); font-weight: 600; line-height: 1.15; letter-spacing: -0.015em; margin: 0 0 .5em; font-variant-numeric: lining-nums; }
h1 { font-size: clamp(2.1rem, 4.2vw, 3.3rem); }
h2 { font-size: clamp(1.5rem, 2.5vw, 2rem); }
h3 { font-size: 1.2rem; }
p { margin: 0 0 1em; }
.wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 24px; }
.muted { color: var(--muted); }
.skip { position: absolute; left: -999px; top: 8px; background: var(--ink); color: #fff; padding: 8px 14px; border-radius: 8px; z-index: 100; }
.skip:focus { left: 8px; }
:focus-visible { outline: 2px solid var(--clay); outline-offset: 3px; }

.eyebrow { font: 600 .78rem/1.2 var(--sans); text-transform: uppercase; letter-spacing: .12em; color: var(--clay); margin: 0 0 .9em; }
.eyebrow a { color: inherit; text-decoration: none; }
.lead { font-size: 1.15rem; color: var(--ink-2); max-width: 60ch; }

/* Buttons */
.btn { display: inline-block; background: var(--pine); color: #fff; text-decoration: none; padding: 13px 22px; border-radius: 999px; font-weight: 600; border: 1.5px solid var(--pine); transition: background .2s, transform .2s; }
.btn:hover { background: var(--pine-2); color: #fff; transform: translateY(-1px); }
.btn.ghost { background: transparent; color: var(--pine); }
.btn.ghost:hover { background: var(--pine); color: #fff; }
.actions { display: flex; flex-wrap: wrap; gap: 12px; margin: 1.6em 0; }

/* Header */
.site-header { position: sticky; top: 0; z-index: 50; background: color-mix(in srgb, var(--paper) 88%, transparent); backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); }
.header-inner { display: flex; align-items: center; justify-content: space-between; height: 66px; }
.brand { display: flex; align-items: center; gap: 12px; text-decoration: none; color: var(--clay); font: 600 1.3rem/1 var(--serif); }
.brand .mark { width: 32px; height: 32px; }
.brand span { color: var(--ink); }
.nav { display: flex; gap: 28px; }
.nav a { color: var(--ink-2); text-decoration: none; font-weight: 500; font-size: .95rem; padding: 6px 0; border-bottom: 2px solid transparent; }
.nav a:hover, .nav a[aria-current] { color: var(--ink); border-color: var(--clay); }
.nav-toggle { display: none; background: none; border: 0; width: 40px; height: 40px; cursor: pointer; position: relative; }
.nav-toggle span { position: absolute; left: 9px; right: 9px; height: 2px; background: var(--ink); transition: transform .25s; }
.nav-toggle span:first-child { top: 15px; } .nav-toggle span:last-child { top: 23px; }
.nav-toggle[aria-expanded="true"] span:first-child { transform: translateY(4px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] span:last-child { transform: translateY(-4px) rotate(-45deg); }

/* Home hero */
.hero { position: relative; overflow: hidden; min-height: min(88vh, 780px); display: flex; align-items: center; }
.hero-photo { position: absolute; top: 0; left: 0; width: 128%; height: 100%; object-fit: cover; object-position: 50% 58%; max-width: none; }
@media (max-width: 760px) { .hero-photo { width: 100%; object-position: 50% 60%; } }
.hero::before { content: ""; position: absolute; inset: 0; background: linear-gradient(90deg, rgba(245,246,247,.95) 0%, rgba(245,246,247,.88) 32%, rgba(245,246,247,.45) 46%, rgba(245,246,247,0) 58%); pointer-events: none; z-index: 0; }
.hero::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 90px; background: linear-gradient(transparent, var(--paper)); pointer-events: none; }
.topo { position: absolute; inset: 0; width: 100%; height: 100%; }
.hero-inner { position: relative; z-index: 1; padding-top: 70px; padding-bottom: 80px; }
.hero h1 { max-width: 14ch; font-size: clamp(2.4rem, 4.8vw, 3.9rem); line-height: 1.08; }
.hero .lead { max-width: 40ch; }
.hero .lead { font-size: 1.22rem; }
.hero-stats { list-style: none; padding: 0; margin: 2.2em 0 0; display: flex; flex-wrap: wrap; gap: 10px 28px; color: var(--ink-2); font-size: .95rem; }
.hero-stats strong { font-family: var(--serif); color: var(--clay); font-size: 1.15rem; }

/* Sections */
.section { padding: 80px 0; }
.section.tight { padding: 36px 0 80px; }
.band { background: var(--paper-2); }
.section-head { margin: 0 0 28px; max-width: 64ch; }
.section-head p { color: var(--ink-2); }
.section-head.row { display: flex; justify-content: space-between; align-items: flex-end; gap: 24px; max-width: none; }
.section-head + .grid + .section-head, .grid + .section-head { margin-top: 56px; }
.more { white-space: nowrap; font-weight: 600; text-decoration: none; }

/* Grid & cards */
.grid { display: grid; gap: 24px; }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; transition: transform .25s, box-shadow .25s; }
.card:hover { transform: translateY(-3px); box-shadow: 0 14px 30px -18px rgba(34, 48, 44, .4); }
.card-link { display: block; color: inherit; text-decoration: none; height: 100%; }
.card-link:hover { color: inherit; }
.card-media { position: relative; aspect-ratio: 16 / 10; overflow: hidden; background: var(--paper-2); }
.card-media .art, .card-media img { width: 100%; height: 100%; object-fit: cover; transition: transform .6s; }
.card:hover .card-media .art, .card:hover .card-media img { transform: scale(1.04); }
.card-media .pill { position: absolute; left: 12px; top: 12px; }
.card-body { padding: 18px 20px 20px; }
.card-body h3 { margin-bottom: .35em; }
.card-body .eyebrow { margin-bottom: .5em; }
.excerpt { color: var(--ink-2); font-size: .95rem; margin: .4em 0 0; }
.facts { list-style: none; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 4px 14px; color: var(--ink-2); font-size: .9rem; }
.facts li + li::before { content: "·"; margin-right: 14px; color: var(--muted); }
.access { font-size: .85rem; margin: .7em 0 0; color: var(--muted); }
.access::before { content: ""; display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 7px; background: var(--green); vertical-align: 1px; }
.access-check::before { background: var(--amber); }
.access-permit::before, .access-closed::before { background: var(--clay); }

.pill { display: inline-block; font: 600 .74rem/1 var(--sans); letter-spacing: .04em; text-transform: uppercase; padding: 6px 10px; border-radius: 999px; background: var(--card); color: var(--ink); }
.diff-easy { background: #dcebe3; color: #2c5c45; }
.diff-moderate { background: #efe5cc; color: #6b4f17; }
.diff-hard { background: #f0d3cb; color: #8c2a1e; }
.diff-strenuous { background: #1e2733; color: #f5f6f7; }

/* Finder */
.filters { display: flex; flex-wrap: wrap; gap: 12px; align-items: flex-end; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; margin-bottom: 14px; }
.filters label { display: flex; flex-direction: column; gap: 5px; font-size: .78rem; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; flex: 1 1 150px; }
.filters select { font: 500 .95rem var(--sans); color: var(--ink); padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--paper); text-transform: none; letter-spacing: 0; }
.filters .check { flex-direction: row; align-items: center; gap: 8px; text-transform: none; letter-spacing: 0; font-size: .95rem; color: var(--ink); padding-bottom: 10px; }
.filters .check input { width: 18px; height: 18px; accent-color: var(--pine); }
.finder-count { color: var(--muted); font-size: .9rem; margin: 0 0 16px; min-height: 1.5em; }
.finder-empty { padding: 30px; text-align: center; color: var(--ink-2); border: 1px dashed var(--line); border-radius: var(--radius); }
.hike-card[hidden] { display: none; }

/* Guide cards */
.guide-card { display: flex; flex-direction: column; justify-content: space-between; gap: 18px; min-height: 170px; padding: 24px; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); text-decoration: none; color: var(--ink); transition: border-color .2s, transform .25s; }
.guide-card:hover { border-color: var(--pine); transform: translateY(-3px); color: var(--ink); }
.guide-q { font: 600 1.3rem/1.25 var(--serif); }
.guide-t { color: var(--pine); font-weight: 600; font-size: .92rem; }

/* Promise */
.promise { display: grid; grid-template-columns: 1fr 1.4fr; gap: 48px; align-items: start; }
.promise-list { margin: 0; padding: 0; list-style: none; counter-reset: p; }
.promise-list li { counter-increment: p; position: relative; padding: 0 0 22px 56px; color: var(--ink-2); }
.promise-list li::before { content: counter(p); position: absolute; left: 0; top: -2px; width: 36px; height: 36px; border-radius: 4px; background: var(--clay) !important; display: grid; place-items: center; background: var(--pine); color: var(--paper); font: 600 1.15rem var(--serif); }
.promise-list strong { display: block; color: var(--ink); font-family: var(--serif); font-size: 1.15rem; }

/* Inner page hero */
.page-hero { padding: 36px 0 40px; }
.page-hero.narrow { padding-bottom: 20px; }
.page-hero.narrow h1, .page-hero.narrow .lead { max-width: 30ch; }
.page-hero.narrow .lead { max-width: 62ch; }
.hero-grid { display: grid; grid-template-columns: 1.1fr 1fr; gap: 48px; align-items: center; }
.hero-media { border-radius: var(--radius); overflow: hidden; aspect-ratio: 4 / 3; box-shadow: 0 24px 50px -30px rgba(29, 39, 33, .5); }
.hero-media .art, .hero-media img { width: 100%; height: 100%; object-fit: cover; }
.crumbs { font-size: .85rem; color: var(--muted); margin-bottom: 22px; }
.crumbs a { color: var(--muted); text-decoration: none; }
.crumbs a:hover { color: var(--clay); }
.crumbs .sep { margin: 0 8px; opacity: .6; }
.checked { font-size: .85rem; color: var(--muted); }

/* Quick facts */
.quick { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; margin: 0 0 56px; }
.quick > div { background: var(--card); padding: 16px 18px; }
.quick .wide { grid-column: span 2; }
.quick dt { font-size: .74rem; font-weight: 600; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); margin-bottom: 6px; }
.quick dd { margin: 0; font-weight: 600; font-size: 1.02rem; }
.quick dd > span:not(.pill) { display: block; font-weight: 400; font-size: .88rem; color: var(--ink-2); margin-top: 4px; }
.quick .access-open dd strong { color: var(--green); }
.quick .access-check dd strong { color: #8a5d12; }
.quick .access-permit dd strong, .quick .access-closed dd strong { color: var(--clay); }
.months { display: grid; grid-template-columns: repeat(12, 1fr); gap: 3px; max-width: 360px; }
.months span { text-align: center; font-size: .72rem; font-weight: 600; padding: 5px 0; border-radius: 5px; background: var(--paper-2); color: var(--muted); }
.months .ok { background: #d3dde8; color: var(--pine-2); }
.months .best { background: var(--pine); color: #fff; }

/* Article layout */
.article-grid { display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: 56px; padding-bottom: 80px; }
.toc { position: sticky; top: 90px; align-self: start; font-size: .9rem; }
.toc nav a { display: block; color: var(--ink-2); text-decoration: none; padding: 5px 0 5px 12px; border-left: 2px solid var(--line); }
.toc nav a.on, .toc nav a:hover { color: var(--ink); border-color: var(--clay); }
.toc:has(nav:empty) { display: none; }
.foot-h { font: 600 .76rem/1.2 var(--sans); text-transform: uppercase; letter-spacing: .1em; color: var(--muted); margin-bottom: 12px; }
.prose { max-width: 72ch; font-size: 1.05rem; }
.prose.solo { margin: 0 auto 80px; max-width: 72ch; }
.prose h2 { margin-top: 2em; scroll-margin-top: 90px; }
.prose section:first-child h2, .prose > h2:first-child { margin-top: 0; }
.prose h3 { margin-top: 1.6em; }
.prose ul, .prose ol { padding-left: 1.3em; }
.prose li { margin-bottom: .4em; }
.prose .note { background: var(--card); border-left: 4px solid var(--amber); padding: 14px 18px; border-radius: 0 10px 10px 0; font-size: .98rem; }
.prose .note.warn { border-color: var(--clay); }
.prose table { width: 100%; border-collapse: collapse; font-size: .95rem; margin: 1em 0 1.6em; }
.prose th, .prose td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
.prose th { font-size: .78rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }

/* Stages & days */
.profile-fig { margin: 0 0 28px; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 10px 6px; }
.profile-fig figcaption { font-size: .8rem; color: var(--muted); padding: 0 10px 6px; }
.profile .grid { stroke: var(--line); stroke-width: 1; }
.profile .ax { font: 11px var(--sans); fill: var(--muted); }
.profile .area { fill: rgba(46, 77, 110, .12); }
.profile .line { fill: none; stroke: var(--pine); stroke-width: 2.2; stroke-linejoin: round; }
.profile .dot { fill: var(--clay); }
.profile .lbl { font: 600 11px var(--sans); fill: var(--ink); }
.stages, .days { list-style: none; padding: 0; margin: 0; }
.stages > li { position: relative; padding: 0 0 26px 28px; border-left: 2px solid var(--line); margin-left: 8px; }
.stages > li::before { content: ""; position: absolute; left: -9px; top: 4px; width: 16px; height: 16px; border-radius: 50%; background: var(--paper); border: 3px solid var(--pine); }
.stage-head { display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; }
.stage-head h3 { margin: 0 0 .3em; }
.stage-n { font: 600 .74rem var(--sans); text-transform: uppercase; letter-spacing: .1em; color: var(--clay); }
.stages p { margin: .6em 0 0; color: var(--ink-2); }
.days > li { display: grid; grid-template-columns: 58px 1fr; gap: 18px; padding: 20px 0; border-top: 1px solid var(--line); }
.day-n { font: 600 1.15rem/1 var(--serif); color: var(--paper); background: var(--clay); border-radius: 6px; height: 50px; display: grid; place-items: center; }
.days h3 { margin: 0 0 .35em; }
.days p { color: var(--ink-2); margin-bottom: .5em; }

/* FAQ */
.faq { margin-top: 2.5em; }
.faq details { border-top: 1px solid var(--line); padding: 14px 0; }
.faq details:last-child { border-bottom: 1px solid var(--line); }
.faq summary { cursor: pointer; font-weight: 600; list-style: none; position: relative; padding-right: 30px; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; position: absolute; right: 4px; top: -2px; font-size: 1.4rem; color: var(--clay); transition: transform .2s; }
.faq details[open] summary::after { transform: rotate(45deg); }
.faq details div { color: var(--ink-2); padding-top: 10px; }

/* Destinations hub */
.region-block { margin-bottom: 40px; }
.region-side { padding: 10px 6px; }
.link-list { list-style: none; padding: 0; margin: 0; }
.link-list li { padding: 10px 0; border-bottom: 1px solid var(--line); display: flex; justify-content: space-between; gap: 12px; }
.link-list a { font-weight: 600; text-decoration: none; }

/* Footer */
.site-footer { background: #1b2430; color: #c5ccd6; padding: 64px 0 28px; font-size: .95rem; }
.footer-grid { display: grid; grid-template-columns: 1.6fr 1fr 1fr 1fr; gap: 40px; }
.site-footer a { display: block; color: #e8ebe6; text-decoration: none; padding: 4px 0; }
.site-footer a:hover { color: var(--sand); }
.site-footer .muted { color: #8f9a92; }
.brand-foot { font: 600 1.35rem var(--serif); color: #fff; }
.site-footer .foot-h { color: #8f9a92; }
.foot-base { border-top: 1px solid #34413a; margin-top: 44px; padding-top: 22px; font-size: .85rem; }

/* Responsive */
@media (max-width: 980px) {
    .grid-3 { grid-template-columns: repeat(2, 1fr); }
    .quick { grid-template-columns: repeat(2, 1fr); }
    .article-grid { grid-template-columns: 1fr; gap: 0; }
    .toc { display: none; }
    .footer-grid { grid-template-columns: 1fr 1fr; }
    .promise { grid-template-columns: 1fr; gap: 16px; }
}
@media (max-width: 760px) {
    .nav-toggle { display: block; }
    .nav { position: absolute; top: 66px; left: 0; right: 0; flex-direction: column; gap: 0; background: var(--paper); border-bottom: 1px solid var(--line); padding: 8px 24px 18px; display: none; }
    .nav.open { display: flex; }
    .nav a { padding: 12px 0; border-bottom: 1px solid var(--line); }
    .grid-2, .grid-3 { grid-template-columns: 1fr; }
    .hero-grid { grid-template-columns: 1fr; gap: 28px; }
    .section { padding: 56px 0; }
    .section-head.row { flex-direction: column; align-items: flex-start; }
    .quick .wide { grid-column: span 2; }
    .footer-grid { grid-template-columns: 1fr; }
}
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { transition: none !important; scroll-behavior: auto !important; }
}

/* Fill the unused cells at the end of the quick-facts grid */
.quick::after { content: ""; background: var(--card); grid-column-end: -1; }
.prose .facts { padding-left: 0; }
.hero-stats { display: inline-flex; background: rgba(245,246,247,.88); padding: 8px 16px; border-radius: 8px; }
.hero .btn.ghost { background: rgba(245,246,247,.88); }

/* Topographic contour backgrounds (home finder, /hikes/ header) */
.topo-section, .topo-hero { position: relative; overflow: hidden; }
.topo-lines { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.topo-section > .wrap, .topo-hero > .wrap { position: relative; z-index: 1; }
.topo-hero { min-height: 380px; display: flex; align-items: center; padding: 56px 0 64px; border-bottom: 1px solid var(--line); margin-bottom: 8px; }
.topo-hero h1, .topo-hero .lead { text-shadow: 0 0 18px var(--paper), 0 0 6px var(--paper); }

/* Photo hero: text pinned left, peak kept clear on the right */
.hero .hero-inner { max-width: none; margin: 0; width: min(680px, 50%); padding-left: max(24px, 6vw); padding-right: 0; }
.hero .lead, .hero h1 { text-shadow: 0 0 22px rgba(245,246,247,.9); }
@media (max-width: 760px) {
    .hero .hero-inner { width: 100%; padding-right: 24px; }
    .hero::before { background: rgba(245,246,247,.72); }
}
.photo-credit { position: absolute; right: 14px; bottom: 10px; z-index: 2; font-size: .72rem; color: var(--ink-2); background: rgba(245,246,247,.75); padding: 3px 8px; border-radius: 4px; text-decoration: none; }

/* Mobile hero: photo on top, compact text on the snow at the bottom */
.hero .lead-short { display: none; }
@media (max-width: 760px) {
    .hero { min-height: 88svh; align-items: flex-end; }
    .hero-photo { object-position: 50% 42%; }
    .hero::before { background: linear-gradient(180deg, rgba(245,246,247,0) 50%, rgba(245,246,247,.85) 63%, rgba(245,246,247,.97) 74%); }
    .hero .hero-inner { padding-top: 0; padding-bottom: 28px; }
    .hero .eyebrow { font-size: .7rem; margin-bottom: .6em; }
    .hero h1 { font-size: 2rem; max-width: 16ch; margin-bottom: .3em; }
    .hero .lead-long { display: none; }
    .hero .lead-short { display: block; font-size: 1rem; margin-bottom: 0; }
    .hero .actions { margin: 1.1em 0 0; gap: 10px; }
    .hero .btn { padding: 10px 18px; font-size: .92rem; }
    .hero-stats { display: none; }
    .photo-credit { top: 10px; bottom: auto; font-size: .66rem; }
}

/* Stacking: photo < washes < text */
.hero-photo { z-index: 0; }
.hero::before, .hero::after { z-index: 1; }
.hero .hero-inner { z-index: 2; }
.photo-credit { z-index: 3; }

/* Phone: filters as a 2x2 grid */
@media (max-width: 760px) {
    .filters { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; padding: 12px; }
    .filters label { flex: none; min-width: 0; }
    .filters select { width: 100%; min-width: 0; }
    .filters .check { grid-column: 1 / -1; padding-bottom: 2px; }
    .filters select { padding: 9px 10px; font-size: .9rem; }
}

/* Quick facts: draw dividers per cell so unfilled grid cells stay blank */
.quick { gap: 0; background: var(--card); }
.quick > div { box-shadow: 1px 0 0 var(--line), 0 1px 0 var(--line); }
.quick::after { display: none; }

.area-head { font-size: 1.15rem; margin: 32px 0 14px; color: var(--ink-2); }
.area-head:first-of-type { margin-top: 0; }

.card-route { font-size: .9rem; color: var(--ink-2); margin: .35em 0 0; }

/* ───── About & Contact layouts ───── */
img.cover { width: 100%; height: 100%; object-fit: cover; display: block; }

/* Full-bleed photo hero with an overlapping card */
.feature-hero { position: relative; }
.feature-hero-img { width: 100%; height: min(68vh, 620px); object-fit: cover; display: block; }
.feature-hero .wrap { position: relative; margin-top: -170px; }
.feature-hero-card { background: var(--card); border-radius: var(--radius); padding: 34px 40px 30px; max-width: 720px; box-shadow: 0 30px 60px -35px rgba(30, 39, 51, .45); }
.feature-hero-card h1 { margin-bottom: .35em; }
.feature-hero-card .lead { margin-bottom: 0; }

/* Text + photo split */
.wrap.split { display: grid; grid-template-columns: 1.05fr 1fr; gap: 64px; align-items: center; }
.wrap.split.reverse { grid-template-columns: 1fr 1.05fr; }
.split-text p { color: var(--ink-2); font-size: 1.05rem; }
.split-media { margin: 0; border-radius: var(--radius); overflow: hidden; aspect-ratio: 4 / 3; position: relative; box-shadow: 0 24px 50px -32px rgba(30, 39, 51, .5); }
.split-media.tall { aspect-ratio: 4 / 5; }
.split-media figcaption, .mosaic-item span { position: absolute; left: 12px; bottom: 12px; background: rgba(245, 246, 247, .9); color: var(--ink); font-size: .8rem; font-weight: 500; padding: 5px 10px; border-radius: 6px; }

/* Four answers */
.answer-grid { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; }
.answer-grid li { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 24px 22px; }
.answer-n { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 4px; background: var(--clay); color: #fff; font: 600 1rem/1 var(--serif); margin-bottom: 16px; }
.answer-grid h3 { margin-bottom: .4em; }
.answer-grid p { color: var(--ink-2); font-size: .95rem; margin: 0; }

/* Photo mosaic */
.photo-mosaic { display: grid; grid-template-columns: 2fr 1fr 1fr; grid-template-rows: 230px 230px; gap: 14px; }
.mosaic-item { position: relative; border-radius: var(--radius); overflow: hidden; display: block; }
.mosaic-item.big { grid-row: span 2; }
.mosaic-item img { transition: transform .6s; }
.mosaic-item:hover img { transform: scale(1.04); }

.check-list { list-style: none; padding: 0; margin: 0 0 1.2em; }
.check-list li { position: relative; padding: 0 0 16px 30px; color: var(--ink-2); }
.check-list li::before { content: ""; position: absolute; left: 0; top: 7px; width: 14px; height: 14px; border-radius: 3px; background: var(--pine); box-shadow: inset 0 0 0 4px var(--pine), inset 0 0 0 7px #fff; }
.check-list strong { color: var(--ink); }

/* Photo call-to-action band */
.cta-band { position: relative; overflow: hidden; padding: 110px 0; }
.cta-img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.cta-band::before { content: ""; position: absolute; inset: 0; background: linear-gradient(90deg, rgba(30, 39, 51, .78), rgba(30, 39, 51, .25)); z-index: 1; }
.cta-inner { position: relative; z-index: 2; }
.cta-inner h2 { color: #fff; max-width: 18ch; }
.cta-band .btn.ghost { color: #fff; border-color: #fff; }
.cta-band .btn.ghost:hover { background: #fff; color: var(--ink); }

/* Contact */
.contact-hero { display: grid; grid-template-columns: 1fr 1fr; min-height: min(78vh, 660px); }
.contact-hero-text { padding: 56px max(24px, calc((100vw - var(--wrap)) / 2 + 24px)) 56px; padding-right: 56px; display: flex; flex-direction: column; justify-content: center; }
.contact-hero-media { position: relative; }
.email-card { margin-top: 28px; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px 22px; display: grid; grid-template-columns: 1fr auto; gap: 4px 16px; align-items: center; max-width: 480px; }
.email-label { grid-column: 1 / -1; font-size: .74rem; font-weight: 600; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); }
.email-addr { font: 600 1.25rem/1.3 var(--serif); color: var(--pine); text-decoration: none; word-break: break-all; }
.copy-btn { font: 500 .85rem var(--sans); border: 1px solid var(--line); background: var(--paper); color: var(--ink); padding: 8px 12px; border-radius: 999px; cursor: pointer; }
.copy-btn:hover { border-color: var(--pine); }
.topic-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; }
.topic { border-top: 3px solid var(--clay); padding-top: 18px; }
.topic p { color: var(--ink-2); margin: 0; }

@media (max-width: 980px) {
    .answer-grid { grid-template-columns: repeat(2, 1fr); }
    .wrap.split, .wrap.split.reverse { grid-template-columns: 1fr; gap: 32px; }
    .split.reverse .split-media { order: 2; }
    .split-media.tall { aspect-ratio: 4 / 3; }
    .contact-hero { grid-template-columns: 1fr; }
    .contact-hero-text { padding: 40px 24px; }
    .contact-hero-media { height: 300px; order: -1; }
    .topic-grid { grid-template-columns: 1fr; }
}
@media (max-width: 760px) {
    .feature-hero-img { height: 46vh; }
    .feature-hero .wrap { margin-top: -80px; }
    .feature-hero-card { padding: 24px 22px; }
    .answer-grid { grid-template-columns: 1fr; }
    .photo-mosaic { grid-template-columns: 1fr 1fr; grid-template-rows: 220px 150px 150px; }
    .mosaic-item.big { grid-column: span 2; grid-row: auto; }
    .cta-band { padding: 70px 0; }
}

.story .split-text h2 { margin-bottom: .6em; }
.story-quote { font: 600 1.45rem/1.35 var(--serif); color: var(--ink) !important; border-left: 3px solid var(--clay); padding-left: 18px; margin: 0 0 1.2em; }
.split-text .eyebrow { color: var(--clay); font-size: .78rem; }

.prose .note.help { border-color: var(--pine); background: #eef2f7; }
@media (min-width: 981px) { .topic-grid { grid-template-columns: repeat(2, 1fr); } }

/* Mobile table of contents (dropdown) */
.toc-m { display: none; }
@media (max-width: 980px) {
    .article-grid { grid-template-columns: minmax(0, 1fr); }
    .toc-m { display: block; position: sticky; top: 66px; z-index: 20; margin: 0 0 28px; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: 0 10px 24px -18px rgba(30, 39, 51, .45); }
    .toc-m summary { list-style: none; cursor: pointer; padding: 13px 16px; font-weight: 600; font-size: .92rem; display: flex; justify-content: space-between; align-items: center; }
    .toc-m summary::-webkit-details-marker { display: none; }
    .toc-m summary::after { content: ""; width: 8px; height: 8px; border-right: 2px solid var(--ink-2); border-bottom: 2px solid var(--ink-2); transform: rotate(45deg); transition: transform .2s; margin-right: 4px; }
    .toc-m[open] summary::after { transform: rotate(-135deg); }
    .toc-m nav { padding: 0 16px 12px; max-height: 55vh; overflow-y: auto; }
    .toc-m nav a { display: block; padding: 9px 0 9px 12px; border-left: 2px solid var(--line); color: var(--ink-2); text-decoration: none; font-size: .92rem; }
    .toc-m nav a.on { border-color: var(--clay); color: var(--ink); }
    .prose h2 { scroll-margin-top: 140px; }
}
/* Phones: tables become stacked cards */
@media (max-width: 640px) {
    .prose table, .prose tbody, .prose tr, .prose td { display: block; width: 100%; }
    .prose thead { display: none; }
    .prose tr { background: var(--card); border: 1px solid var(--line); border-radius: 10px; padding: 6px 14px; margin-bottom: 12px; }
    .prose td { border: 0; padding: 7px 0; border-bottom: 1px solid var(--line); }
    .prose td:last-child { border-bottom: 0; }
    .prose td[data-label]::before { content: attr(data-label); display: block; font-size: .72rem; font-weight: 600; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin-bottom: 2px; }
    .prose td:first-child { font-family: var(--serif); font-size: 1.1rem; }
    .prose td:first-child::before { display: none; }
}
