/* ==========================================================================
   MyTravelHomie — minimal travel guide theme
   ========================================================================== */

:root {
    --bg: #f7f5f0;
    --surface: #ffffff;
    --text: #1b1b1a;
    --muted: #6b6a66;
    --line: #e4e1d9;
    --accent: #c2562f;
    --accent-ink: #ffffff;
    --success: #2f7a4f;
    --danger: #b3261e;

    --font-sans: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
    --font-serif: "Fraunces", Georgia, "Times New Roman", serif;

    --radius: 18px;
    --radius-sm: 10px;
    --max: 1180px;
    --gutter: clamp(16px, 4vw, 40px);
    --shadow: 0 1px 2px rgb(0 0 0 / .04), 0 8px 30px rgb(0 0 0 / .06);
    --ease: cubic-bezier(.2, .7, .2, 1);
    color-scheme: light;
}

@media (prefers-color-scheme: dark) {
    :root {
        --bg: #121212;
        --surface: #1b1b1b;
        --text: #eceae4;
        --muted: #9c9a93;
        --line: #2c2b29;
        --accent: #e07a52;
        --accent-ink: #121212;
        --shadow: 0 1px 2px rgb(0 0 0 / .3), 0 8px 30px rgb(0 0 0 / .3);
        color-scheme: dark;
    }
}

/* Base ------------------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
    margin: 0;
    background: var(--bg);
    color: var(--text);
    font: 400 1rem/1.65 var(--font-sans);
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
}
img { max-width: 100%; display: block; }
a { color: inherit; text-decoration-color: color-mix(in srgb, currentColor 35%, transparent); text-underline-offset: 3px; }
a:hover { color: var(--accent); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 4px; }
h1, h2, h3 { margin: 0; font-weight: 500; line-height: 1.15; letter-spacing: -.01em; }
p { margin: 0; }

.container { width: 100%; max-width: var(--max); margin-inline: auto; padding-inline: var(--gutter); }
.container.narrow { max-width: 760px; }
.container.wide { max-width: 1320px; }
.center { text-align: center; justify-content: center; }
.muted { color: var(--muted); }
.small { font-size: .875rem; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip-link { position: absolute; left: 1rem; top: -3rem; background: var(--text); color: var(--bg); padding: .5rem 1rem; border-radius: 8px; z-index: 100; }
.skip-link:focus { top: 1rem; }

/* Type ------------------------------------------------------------------- */
.display, .display-sm, .h2, .card-title, .brand, .value h3, .prose h2 { font-family: var(--font-serif); }
.display { font-size: clamp(2.75rem, 7vw, 5.25rem); line-height: 1.02; letter-spacing: -.03em; }
.display em { font-style: italic; color: var(--accent); }
.display-sm { font-size: clamp(2.1rem, 5vw, 3.5rem); line-height: 1.08; letter-spacing: -.025em; }
.h2 { font-size: clamp(1.6rem, 3vw, 2.1rem); }
.lead { font-size: clamp(1.05rem, 1.6vw, 1.2rem); color: var(--muted); max-width: 46ch; margin-top: 1.25rem; }
.eyebrow { font-size: .78rem; font-weight: 600; text-transform: uppercase; letter-spacing: .12em; color: var(--accent); margin-bottom: 1rem; }
.meta { font-size: .82rem; color: var(--muted); letter-spacing: .01em; }

/* Header ----------------------------------------------------------------- */
.site-header {
    position: sticky; top: 0; z-index: 50;
    background: color-mix(in srgb, var(--bg) 82%, transparent);
    backdrop-filter: saturate(160%) blur(14px);
    -webkit-backdrop-filter: saturate(160%) blur(14px);
    border-bottom: 1px solid transparent;
    transition: border-color .3s var(--ease);
}
.site-header.is-scrolled { border-bottom-color: var(--line); }
.header-inner { display: flex; align-items: center; justify-content: space-between; height: 72px; }
.brand { display: inline-flex; align-items: center; gap: .45rem; font-size: 1.4rem; font-weight: 600; text-decoration: none; letter-spacing: -.025em; color: var(--text); }
.brand:hover { color: var(--text); }
.logo-mark { width: 1.6em; height: 1.6em; flex: none; overflow: visible; transition: transform .35s var(--ease); }
.logo-pin { fill: var(--accent); }
.logo-home { fill: var(--bg); }
.brand:hover .logo-mark { transform: translateY(-2px) rotate(-6deg); }
.logo-word { line-height: 1; }
.logo-word em { font-style: italic; font-weight: 500; color: var(--accent); margin-left: .07em; }
.site-nav { display: flex; gap: .25rem; }
.site-nav a {
    text-decoration: none; font-size: .94rem; font-weight: 500;
    padding: .5rem .9rem; border-radius: 999px; color: var(--muted);
    transition: color .2s, background .2s;
}
.site-nav a:hover { color: var(--text); background: color-mix(in srgb, var(--text) 6%, transparent); }
.site-nav a[aria-current="page"] { color: var(--text); background: color-mix(in srgb, var(--text) 8%, transparent); }
.nav-toggle { display: none; }

@media (max-width: 760px) {
    .nav-toggle {
        display: grid; place-content: center; gap: 6px;
        width: 44px; height: 44px; border: 0; background: none; cursor: pointer; color: var(--text);
    }
    .nav-toggle span { display: block; width: 22px; height: 2px; background: currentColor; border-radius: 2px; transition: transform .3s var(--ease); }
    .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); }
    .site-nav {
        position: fixed; inset: 72px 0 auto 0; flex-direction: column; gap: 0;
        padding: .5rem var(--gutter) 1.5rem; background: var(--bg); border-bottom: 1px solid var(--line);
        opacity: 0; pointer-events: none; transform: translateY(-8px);
        transition: opacity .25s var(--ease), transform .25s var(--ease);
    }
    .site-nav.is-open { opacity: 1; pointer-events: auto; transform: none; }
    .site-nav a { font-size: 1.15rem; padding: .85rem 0; border-radius: 0; border-bottom: 1px solid var(--line); background: none !important; }
}

/* Buttons ---------------------------------------------------------------- */
.actions { display: flex; flex-wrap: wrap; gap: .75rem; margin-top: 2rem; }
.btn {
    display: inline-flex; align-items: center; gap: .5rem;
    padding: .85rem 1.4rem; border-radius: 999px; border: 1px solid transparent;
    font: 500 .95rem/1 var(--font-sans); text-decoration: none; cursor: pointer;
    transition: transform .2s var(--ease), background .2s, color .2s, border-color .2s;
}
.btn:active { transform: scale(.98); }
.btn-primary { background: var(--text); color: var(--bg); }
.btn-primary:hover { background: var(--accent); color: var(--accent-ink); }
.btn-ghost { border-color: var(--line); }
.btn-ghost:hover { border-color: var(--text); color: var(--text); }
.link-arrow { font-size: .92rem; font-weight: 500; text-decoration: none; white-space: nowrap; }
.link-arrow span { display: inline-block; transition: transform .2s var(--ease); }
.link-arrow:hover span, .feature-link:hover .link-arrow span { transform: translateX(4px); }

/* Hero ------------------------------------------------------------------- */
.hero {
    display: grid; grid-template-columns: 1.05fr 1fr; gap: clamp(2rem, 5vw, 4.5rem);
    align-items: center; padding-block: clamp(2.5rem, 7vw, 6rem);
}
.hero-media { position: relative; display: block; border-radius: var(--radius); overflow: hidden; aspect-ratio: 4 / 5; box-shadow: var(--shadow); }
.hero-media .cover { width: 100%; height: 100%; object-fit: cover; transition: transform 1.2s var(--ease); }
.hero-media:hover .cover { transform: scale(1.03); }
.hero-caption {
    position: absolute; left: 1rem; bottom: 1rem; right: 1rem;
    display: flex; flex-direction: column; gap: .1rem;
    padding: .9rem 1.1rem; border-radius: 14px; color: #fff;
    background: rgb(20 20 20 / .35); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
    font-size: .95rem;
}
.hero-caption strong { font-family: var(--font-serif); font-weight: 500; font-size: 1.15rem; }
.muted-light { font-size: .75rem; text-transform: uppercase; letter-spacing: .12em; opacity: .8; }
@media (max-width: 860px) {
    .hero { grid-template-columns: 1fr; }
    .hero-media { aspect-ratio: 4 / 3; }
}

/* Sections & grid -------------------------------------------------------- */
.section { padding-block: clamp(2.5rem, 6vw, 5rem); }
.section-head { display: flex; align-items: end; justify-content: space-between; gap: 1rem; margin-bottom: 2rem; }
.page-head { padding-block: clamp(2.5rem, 7vw, 5.5rem) clamp(1.5rem, 4vw, 3rem); }
.page-head .lead { max-width: 56ch; }
.page-head.center .lead { margin-inline: auto; }
.grid { display: grid; gap: clamp(1.25rem, 2.5vw, 2rem); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
@media (max-width: 960px) { .grid-3 { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 600px) { .grid-3 { grid-template-columns: 1fr; } }

/* Cards ------------------------------------------------------------------ */
.card-link { display: flex; flex-direction: column; height: 100%; text-decoration: none; color: inherit; }
.card-link:hover { color: inherit; }
.card-media { border-radius: var(--radius); overflow: hidden; aspect-ratio: 3 / 2; background: var(--line); }
.card-media .cover { width: 100%; height: 100%; object-fit: cover; transition: transform .8s var(--ease); }
.card-link:hover .cover { transform: scale(1.04); }
.card-body { padding-top: 1.1rem; display: grid; gap: .45rem; }
.card-title { font-size: 1.4rem; transition: color .2s; }
.card-link:hover .card-title { color: var(--accent); }
.card-body .muted { font-size: .95rem; }
.card[hidden] { display: none; }

/* Cover placeholder (shown until AI images are generated) ---------------- */
.cover--placeholder {
    --h: 20;
    width: 100%; height: 100%; min-height: 100%;
    display: grid; place-items: end start; padding: 1.25rem;
    background:
        radial-gradient(120% 90% at 15% 10%, hsl(var(--h) 70% 82% / .9), transparent 60%),
        radial-gradient(90% 80% at 90% 90%, hsl(calc(var(--h) + 40) 55% 60% / .85), transparent 65%),
        linear-gradient(160deg, hsl(var(--h) 45% 72%), hsl(calc(var(--h) + 60) 35% 45%));
}
.cover--placeholder span { font-family: var(--font-serif); font-size: 1.1rem; color: rgb(255 255 255 / .92); letter-spacing: .02em; }

/* Values / stats --------------------------------------------------------- */
.values { display: grid; grid-template-columns: repeat(3, 1fr); border-top: 1px solid var(--line); }
.value { padding: 2rem 2rem 0 0; }
.value + .value { padding-left: 2rem; border-left: 1px solid var(--line); }
.value-num { font-size: .8rem; color: var(--accent); font-weight: 600; letter-spacing: .1em; }
.value h3 { font-size: 1.45rem; margin: .75rem 0 .5rem; }
@media (max-width: 760px) {
    .values { grid-template-columns: 1fr; }
    .value, .value + .value { padding: 1.75rem 0; border-left: 0; border-bottom: 1px solid var(--line); }
}

.split { display: grid; grid-template-columns: 1.4fr 1fr; gap: clamp(2rem, 6vw, 5rem); align-items: start; }
@media (max-width: 860px) { .split { grid-template-columns: 1fr; } }
.stats { margin: 0; display: grid; gap: 1rem; }
.stats div { padding: 1.5rem; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--line); }
.stats dt { font-size: .85rem; color: var(--muted); }
.stats dd { margin: .25rem 0 0; font-family: var(--font-serif); font-size: 2.4rem; line-height: 1.1; }

/* CTA -------------------------------------------------------------------- */
.cta {
    text-align: center; padding: clamp(2.5rem, 6vw, 4.5rem) var(--gutter);
    border-radius: calc(var(--radius) + 6px); background: var(--surface); border: 1px solid var(--line);
    display: grid; justify-items: center; gap: 1rem;
}
.cta .muted { max-width: 48ch; }
.cta .btn { margin-top: .5rem; }

/* Filters ---------------------------------------------------------------- */
.filters { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 1rem; margin-bottom: 2rem; }
.chips { display: flex; flex-wrap: wrap; gap: .5rem; }
.chip {
    font: 500 .88rem/1 var(--font-sans); color: var(--muted); cursor: pointer;
    padding: .6rem 1rem; border-radius: 999px; border: 1px solid var(--line); background: transparent;
    transition: all .2s var(--ease);
}
.chip:hover { color: var(--text); border-color: var(--text); }
.chip.is-active { background: var(--text); color: var(--bg); border-color: var(--text); }
.search {
    display: flex; align-items: center; gap: .5rem; padding: 0 1rem;
    border: 1px solid var(--line); border-radius: 999px; color: var(--muted); background: var(--surface);
    min-width: min(280px, 100%);
}
.search:focus-within { border-color: var(--text); }
.search input { border: 0; outline: 0; background: none; color: var(--text); font: inherit; font-size: .95rem; padding: .65rem 0; width: 100%; }
.empty { padding: 3rem 0; text-align: center; }

/* Feature (blog lead) ---------------------------------------------------- */
.feature-link { display: grid; grid-template-columns: 1.3fr 1fr; gap: clamp(1.5rem, 4vw, 3.5rem); align-items: center; text-decoration: none; color: inherit; }
.feature-link:hover { color: inherit; }
.feature-media { border-radius: var(--radius); overflow: hidden; aspect-ratio: 3 / 2; }
.feature-media .cover { width: 100%; height: 100%; object-fit: cover; transition: transform .8s var(--ease); }
.feature-link:hover .cover { transform: scale(1.03); }
.feature-body { display: grid; gap: 1rem; }
.feature-link:hover .h2 { color: var(--accent); }
@media (max-width: 760px) { .feature-link { grid-template-columns: 1fr; } }

/* Article ---------------------------------------------------------------- */
.article-head { padding-block: clamp(2rem, 5vw, 4rem) 2rem; }
.article-head .meta { margin-top: 1.25rem; }
.back { display: inline-flex; gap: .4rem; font-size: .9rem; color: var(--muted); text-decoration: none; margin-bottom: 2rem; }
.article-cover { margin: 0; border-radius: var(--radius); overflow: hidden; aspect-ratio: 21 / 9; }
.article-cover .cover { width: 100%; height: 100%; object-fit: cover; }
@media (max-width: 600px) { .article-cover { aspect-ratio: 4 / 3; } }

.article-layout { display: grid; grid-template-columns: 240px minmax(0, 680px); gap: clamp(2rem, 6vw, 5rem); justify-content: center; padding-block: clamp(2.5rem, 5vw, 4rem); }
@media (max-width: 860px) { .article-layout { grid-template-columns: 1fr; } }
.facts { position: sticky; top: 96px; align-self: start; }
.facts dl { margin: 0; display: grid; gap: 1.25rem; padding: 1.5rem; border-radius: var(--radius); border: 1px solid var(--line); background: var(--surface); }
.facts dt { font-size: .75rem; text-transform: uppercase; letter-spacing: .1em; color: var(--muted); }
.facts dd { margin: .2rem 0 0; font-weight: 500; }
@media (max-width: 860px) {
    .facts { position: static; }
    .facts dl { grid-template-columns: repeat(2, 1fr); }
}

/* Prose ------------------------------------------------------------------ */
.prose { font-size: 1.075rem; line-height: 1.75; }
.container.narrow > .prose { padding-block: clamp(2.5rem, 5vw, 4rem); }
.prose > * + * { margin-top: 1.2em; }
.prose h2 { font-size: 1.75rem; margin-top: 2.2em; }
.prose h2:first-child { margin-top: 0; }
.prose h3 { font-size: 1.15rem; font-weight: 600; }
.prose ul, .prose ol { padding-left: 1.25rem; }
.prose li + li { margin-top: .45em; }
.prose li::marker { color: var(--accent); }
.prose .intro { font-size: 1.25rem; line-height: 1.6; font-family: var(--font-serif); }
.prose blockquote {
    margin-inline: 0; padding-left: 1.5rem; border-left: 2px solid var(--accent);
    font-family: var(--font-serif); font-size: 1.35rem; font-style: italic; line-height: 1.5;
}
.prose table { width: 100%; border-collapse: collapse; font-size: .95rem; display: block; overflow-x: auto; }
.prose th, .prose td { text-align: left; padding: .75rem; border-bottom: 1px solid var(--line); vertical-align: top; }
.prose th { font-weight: 600; }
.prose code { font-size: .88em; background: color-mix(in srgb, var(--text) 7%, transparent); padding: .15em .4em; border-radius: 6px; }
.checklist { list-style: none; padding: 0 !important; }
.checklist li { position: relative; padding-left: 1.9rem; }
.checklist li::before {
    content: ""; position: absolute; left: 0; top: .45em; width: 1.1rem; height: 1.1rem; border-radius: 50%;
    background: color-mix(in srgb, var(--accent) 15%, transparent);
}
.checklist li::after {
    content: ""; position: absolute; left: .38rem; top: .68em; width: .35rem; height: .55rem;
    border: solid var(--accent); border-width: 0 2px 2px 0; transform: rotate(45deg);
}
.callout { padding: 1.5rem 1.75rem; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--line); margin-top: 2.5rem !important; }
.callout h3 { margin-bottom: .75rem; }
.callout ul { margin: 0; }

/* Legal ------------------------------------------------------------------ */
.legal-layout { display: grid; grid-template-columns: 200px minmax(0, 720px); gap: clamp(2rem, 6vw, 5rem); justify-content: center; padding-bottom: clamp(3rem, 6vw, 5rem); }
.legal-nav { position: sticky; top: 96px; align-self: start; display: grid; gap: .25rem; }
.legal-nav a { text-decoration: none; color: var(--muted); font-size: .92rem; padding: .4rem 0 .4rem .9rem; border-left: 2px solid var(--line); }
.legal-nav a:hover { color: var(--text); }
.legal-nav a[aria-current="page"] { color: var(--text); border-left-color: var(--accent); font-weight: 500; }
.legal-layout .prose h2 { font-size: 1.35rem; margin-top: 2em; }
@media (max-width: 860px) {
    .legal-layout { grid-template-columns: 1fr; }
    .legal-nav { position: static; display: flex; flex-wrap: wrap; gap: .5rem; }
    .legal-nav a { border: 1px solid var(--line); border-radius: 999px; padding: .45rem .9rem; }
    .legal-nav a[aria-current="page"] { border-color: var(--text); }
}

/* Forms ------------------------------------------------------------------ */
.form { display: grid; gap: 1.25rem; }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 1.25rem; }
@media (max-width: 600px) { .field-row { grid-template-columns: 1fr; } }
.field { display: grid; gap: .45rem; }
.field label { font-size: .88rem; font-weight: 500; }
.field input, .field select, .field textarea {
    width: 100%; font: inherit; color: var(--text);
    padding: .85rem 1rem; border-radius: var(--radius-sm); border: 1px solid var(--line); background: var(--surface);
    transition: border-color .2s, box-shadow .2s;
}
.field textarea { resize: vertical; min-height: 150px; }
.field input:focus, .field select:focus, .field textarea:focus {
    outline: 0; border-color: var(--text); box-shadow: 0 0 0 4px color-mix(in srgb, var(--text) 8%, transparent);
}
.field.has-error input, .field.has-error textarea { border-color: var(--danger); }
.field .error { color: var(--danger); font-size: .85rem; }
.check { display: flex !important; gap: .65rem; align-items: flex-start; font-weight: 400 !important; font-size: .92rem !important; }
.check input { width: 18px; height: 18px; margin-top: .2rem; accent-color: var(--accent); }
.form .btn { justify-self: start; }
.hp { position: absolute; left: -9999px; }
.notice { padding: 1.25rem 1.5rem; border-radius: var(--radius-sm); margin-bottom: 1.5rem; border: 1px solid; }
.notice-success { color: var(--success); border-color: color-mix(in srgb, var(--success) 35%, transparent); background: color-mix(in srgb, var(--success) 7%, transparent); }
.notice-error { color: var(--danger); border-color: color-mix(in srgb, var(--danger) 35%, transparent); background: color-mix(in srgb, var(--danger) 7%, transparent); }
.notice p { color: var(--text); margin-top: .25rem; }
.contact-aside { display: grid; gap: 1.75rem; padding: 2rem; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--line); }

/* Footer ----------------------------------------------------------------- */
.site-footer { margin-top: clamp(3rem, 6vw, 5rem); border-top: 1px solid var(--line); padding-top: clamp(3rem, 6vw, 4.5rem); }
.footer-grid { display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 2.5rem; }
.footer-brand p { margin-top: 1rem; max-width: 36ch; font-size: .95rem; }
.footer-title { font-family: var(--font-sans); font-size: .75rem; font-weight: 600; text-transform: uppercase; letter-spacing: .12em; color: var(--muted); margin-bottom: .9rem; }
.footer-links { list-style: none; padding: 0; margin: 0; display: grid; gap: .55rem; }
.footer-links a { text-decoration: none; font-size: .95rem; }
.footer-bottom { display: flex; flex-wrap: wrap; justify-content: space-between; gap: .5rem; margin-top: 3rem; padding-block: 1.5rem 2rem; border-top: 1px solid var(--line); font-size: .85rem; }
@media (max-width: 760px) { .footer-grid { grid-template-columns: 1fr 1fr; } .footer-brand { grid-column: 1 / -1; } }

/* Motion ----------------------------------------------------------------- */
.reveal { opacity: 0; transform: translateY(16px); transition: opacity .8s var(--ease), transform .8s var(--ease); }
.reveal.is-visible { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { transition-duration: .01ms !important; animation-duration: .01ms !important; scroll-behavior: auto !important; }
    .reveal { opacity: 1; transform: none; }
}
