/* Tu-Via.org
   Light-first palette with a full dark override. Sizes are generous on purpose:
   the people reading this are often tired, often on a phone, often mid-crisis. */

:root {
    --sand:        #faf6f0;
    --sand-deep:   #f2ebe1;
    --card:        #ffffff;
    --ink:         #1c2b31;
    --ink-soft:    #4d5c64;
    --ink-faint:   #6e7c83;
    --line:        #e2dacf;
    --line-strong: #cfc4b5;

    --teal:        #0d5c58;
    --teal-deep:   #084440;
    --teal-wash:   #e6f1ef;
    --clay:        #a94a26;
    --clay-wash:   #fbeee7;
    --gold-wash:   #fdf4dd;
    --gold-line:   #e2c574;

    --radius:      14px;
    --radius-lg:   22px;
    --shadow:      0 1px 2px rgba(28, 43, 49, .06), 0 8px 24px -12px rgba(28, 43, 49, .18);
    --wrap:        1120px;
    --measure:     47rem;
}

@media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) {
        --sand:        #101819;
        --sand-deep:   #162023;
        --card:        #182226;
        --ink:         #e7eef0;
        --ink-soft:    #adbcc2;
        --ink-faint:   #8b9ba2;
        --line:        #27353a;
        --line-strong: #35474e;

        --teal:        #6fc9c0;
        --teal-deep:   #9adcd4;
        --teal-wash:   #14292b;
        --clay:        #e79a76;
        --clay-wash:   #2a1f1a;
        --gold-wash:   #241f14;
        --gold-line:   #6b5a2e;
        --shadow:      0 1px 2px rgba(0, 0, 0, .4), 0 10px 30px -14px rgba(0, 0, 0, .6);
    }
}

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
    margin: 0;
    background: var(--sand);
    color: var(--ink);
    font: 17px/1.65 ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4 { line-height: 1.2; margin: 0 0 .5em; letter-spacing: -.011em; font-weight: 700; }
h1 { font-size: clamp(2rem, 1.4rem + 2.4vw, 2.9rem); letter-spacing: -.021em; }
h2 { font-size: clamp(1.35rem, 1.15rem + .8vw, 1.7rem); }
h3 { font-size: 1.12rem; }
p, ul, ol, dl, table { margin: 0 0 1.1em; }
ul, ol { padding-left: 1.35em; }
li { margin-bottom: .45em; }
li > ul, li > ol { margin-top: .45em; }
strong { font-weight: 650; }

a { color: var(--teal); text-underline-offset: .18em; text-decoration-thickness: from-font; }
a:hover { color: var(--teal-deep); }

:focus-visible {
    outline: 3px solid var(--clay);
    outline-offset: 2px;
    border-radius: 3px;
}

.vh {
    position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
    overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

.ext::after { content: "\2197"; font-size: .78em; margin-left: .18em; vertical-align: .12em; opacity: .7; }

.skip {
    position: absolute; left: -9999px; top: 0; z-index: 50;
    background: var(--teal); color: #fff; padding: .8rem 1.2rem;
    border-bottom-right-radius: var(--radius); font-weight: 600;
}
.skip:focus { left: 0; }

.wrap { width: 100%; max-width: var(--wrap); margin: 0 auto; padding: 0 1.25rem; }
.wrap.narrow { max-width: calc(var(--measure) + 2.5rem); }
.wrap.wide { max-width: var(--wrap); }

/* ------------------------------------------------------------------ header */

.site-head {
    background: var(--card);
    border-bottom: 1px solid var(--line);
    position: sticky; top: 0; z-index: 20;
}

.head-inner {
    display: flex; align-items: center; gap: 1rem;
    min-height: 74px; flex-wrap: wrap;
}

.brand { display: flex; align-items: center; gap: .7rem; text-decoration: none; color: inherit; margin-right: auto; }
.brand:hover .brand-name { color: var(--teal); }

.mark { width: 40px; height: 40px; flex: none; }
.mark-field { fill: var(--teal-wash); stroke: var(--teal); stroke-width: 1.6; }
.mark-path  { stroke: var(--teal); stroke-width: 3.2; }
.mark-dot   { fill: var(--clay); }
.mark-goal  { fill: var(--teal); }

.brand-text { display: flex; flex-direction: column; line-height: 1.2; }
.brand-name { font-size: 1.3rem; font-weight: 750; letter-spacing: -.02em; }
.brand-sub  { font-size: .76rem; color: var(--ink-faint); letter-spacing: .01em; }

.nav-toggle {
    display: none; align-items: center; gap: .5rem;
    background: var(--sand-deep); color: var(--ink);
    border: 1px solid var(--line-strong); border-radius: var(--radius);
    padding: .55rem .85rem; font: inherit; font-weight: 600; cursor: pointer;
}
.bars { display: grid; gap: 4px; }
.bars span { display: block; width: 18px; height: 2px; background: currentColor; border-radius: 2px; }

.site-nav ul { display: flex; gap: .2rem; list-style: none; margin: 0; padding: 0; flex-wrap: wrap; }
.site-nav a {
    display: block; padding: .5rem .7rem; border-radius: 10px;
    text-decoration: none; color: var(--ink-soft); font-weight: 600; font-size: .95rem;
}
.site-nav a:hover { background: var(--sand-deep); color: var(--ink); }
.site-nav a[aria-current="page"] { background: var(--teal-wash); color: var(--teal-deep); }

@media (max-width: 900px) {
    .nav-toggle { display: inline-flex; }
    .site-nav { display: none; flex-basis: 100%; padding-bottom: .8rem; }
    .site-nav.open { display: block; }
    .site-nav ul { flex-direction: column; gap: 0; }
    .site-nav a { padding: .7rem .8rem; border-radius: 10px; font-size: 1rem; }
}

/* ------------------------------------------------------------------ hero */

.hero { background: linear-gradient(180deg, var(--card), var(--sand)); border-bottom: 1px solid var(--line); }

.hero-inner {
    display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, .95fr);
    gap: clamp(1.5rem, 4vw, 3.5rem); align-items: center;
    padding-top: clamp(2.2rem, 5vw, 4rem); padding-bottom: clamp(2.2rem, 5vw, 4rem);
}
@media (max-width: 860px) {
    .hero-inner { grid-template-columns: 1fr; }
    .hero-art { order: -1; }
}

.kicker {
    text-transform: uppercase; letter-spacing: .1em; font-size: .76rem; font-weight: 700;
    color: var(--clay); margin: 0 0 .6rem;
}

.lede { font-size: 1.16rem; color: var(--ink-soft); max-width: 40rem; }
.hero .lede { font-size: clamp(1.1rem, 1rem + .5vw, 1.3rem); }

.hero-actions { display: flex; flex-wrap: wrap; gap: .7rem; margin: 1.6rem 0 .9rem; }
.hero-note { font-size: .92rem; color: var(--ink-faint); margin: 0; }

.btn {
    display: inline-block; padding: .78rem 1.35rem; border-radius: var(--radius);
    font-weight: 650; text-decoration: none; border: 1.5px solid transparent; cursor: pointer;
    font-size: 1rem; line-height: 1.3; text-align: center;
}
.btn-primary { background: var(--teal); color: #fff; }
.btn-primary:hover { background: var(--teal-deep); color: #fff; }
.btn-ghost { background: var(--card); color: var(--teal); border-color: var(--line-strong); }
.btn-ghost:hover { border-color: var(--teal); background: var(--teal-wash); }

@media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) .btn-primary { color: #06201f; }
    :root:not([data-theme="light"]) .btn-primary:hover { color: #06201f; }
}

.hero-art svg { display: block; width: 100%; height: auto; border-radius: var(--radius-lg); }
.sky-a { stop-color: #dbeeec; }
.sky-b { stop-color: #f6ece0; }
.art-sun { fill: #f1c96b; }
.art-mesa-far  { fill: #9dc3bd; }
.art-mesa-near { fill: #6ea49d; }
.art-ground    { fill: #d8b593; }
.art-trail        { stroke: #fdf8f1; stroke-width: 9; }
.art-trail-dashes { stroke: #a94a26; stroke-width: 2.6; stroke-dasharray: 1 11; }
.art-flag circle { fill: #a94a26; }
.art-flag-ring   { stroke: #a94a26; stroke-width: 2; opacity: .5; }
.art-plants path { stroke: #3f6b60; stroke-width: 2.4; }

@media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) .sky-a { stop-color: #14282c; }
    :root:not([data-theme="light"]) .sky-b { stop-color: #22232a; }
    :root:not([data-theme="light"]) .art-sun { fill: #b9903c; }
    :root:not([data-theme="light"]) .art-mesa-far  { fill: #2c4b4c; }
    :root:not([data-theme="light"]) .art-mesa-near { fill: #3a635f; }
    :root:not([data-theme="light"]) .art-ground    { fill: #5a4738; }
    :root:not([data-theme="light"]) .art-trail     { stroke: #1a2427; }
    :root:not([data-theme="light"]) .art-trail-dashes { stroke: #e79a76; }
    :root:not([data-theme="light"]) .art-flag circle { fill: #e79a76; }
    :root:not([data-theme="light"]) .art-flag-ring   { stroke: #e79a76; }
    :root:not([data-theme="light"]) .art-plants path { stroke: #7fb0a3; }
}

/* ------------------------------------------------------------------ page head */

.page-head {
    background: var(--card); border-bottom: 1px solid var(--line);
    padding: clamp(2rem, 4vw, 3.2rem) 0 clamp(1.6rem, 3vw, 2.4rem);
}
.page-head h1 { margin-bottom: .6rem; }

/* ------------------------------------------------------------------ blocks */

.prose { padding: clamp(2rem, 4vw, 3.2rem) 0 4rem; }
.prose > .block + .block { margin-top: clamp(2rem, 3.5vw, 3rem); }
.block > :last-child { margin-bottom: 0; }
.block h2 { padding-top: .2rem; }

.flash {
    max-width: var(--measure); margin: 1.4rem auto 0; padding: .9rem 1.1rem;
    border-radius: var(--radius); border: 1px solid var(--line-strong); font-weight: 550;
}
.flash-ok   { background: var(--teal-wash); border-color: var(--teal); }
.flash-warn { background: var(--gold-wash); border-color: var(--gold-line); }

.callout {
    background: var(--gold-wash); border: 1px solid var(--gold-line);
    border-radius: var(--radius); padding: 1.15rem 1.3rem;
}
.callout > :last-child { margin-bottom: 0; }

.tone-clay .callout { background: var(--clay-wash); border-color: var(--clay); }
.tone-teal .callout { background: var(--teal-wash); border-color: var(--teal); }

/* steps */
.steps { list-style: none; padding: 0; margin: 1.5rem 0 0; counter-reset: step; }
.steps > li {
    display: grid; grid-template-columns: 2.6rem 1fr; gap: 1rem;
    padding-bottom: 1.6rem; margin-bottom: 0; position: relative;
}
.steps > li::before {
    content: ""; position: absolute; left: 1.29rem; top: 2.6rem; bottom: 0;
    width: 2px; background: var(--line-strong);
}
.steps > li:last-child { padding-bottom: 0; }
.steps > li:last-child::before { display: none; }
.step-n {
    display: grid; place-items: center; width: 2.6rem; height: 2.6rem; border-radius: 50%;
    background: var(--teal); color: #fff; font-weight: 700; font-size: 1.02rem;
}
.step-body h3 { margin-bottom: .35rem; padding-top: .35rem; }
.step-body > :last-child { margin-bottom: 0; }
.step-note {
    font-size: .93rem; color: var(--ink-faint); border-left: 3px solid var(--line-strong);
    padding-left: .8rem; margin-top: .7rem;
}
@media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) .step-n { color: #06201f; }
}

/* cards */
.cards {
    list-style: none; padding: 0; margin: 1.4rem 0 0;
    display: grid; gap: 1rem; grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr));
}
.card {
    background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
    padding: 1.15rem 1.25rem; box-shadow: var(--shadow); margin: 0;
}
.card h3 { margin-bottom: .4rem; }
.card h3 a { text-decoration: none; }
.card h3 a:hover { text-decoration: underline; }
.card-kicker {
    text-transform: uppercase; letter-spacing: .09em; font-size: .7rem; font-weight: 700;
    color: var(--clay); margin: 0 0 .4rem;
}
.card > :last-child { margin-bottom: 0; }
.card p { font-size: .96rem; color: var(--ink-soft); }

/* tables */
.table-scroll { overflow-x: auto; margin: 1.3rem 0 0; border: 1px solid var(--line); border-radius: var(--radius); background: var(--card); }
table { border-collapse: collapse; width: 100%; margin: 0; font-size: .96rem; min-width: 34rem; }
th, td { text-align: left; vertical-align: top; padding: .8rem 1rem; border-bottom: 1px solid var(--line); }
thead th { background: var(--sand-deep); font-size: .84rem; text-transform: uppercase; letter-spacing: .06em; color: var(--ink-soft); white-space: nowrap; }
tbody th { font-weight: 650; width: 30%; }
tbody tr:last-child th, tbody tr:last-child td { border-bottom: 0; }

/* link lists */
.link-list { list-style: none; padding: 0; margin: 1.2rem 0 0; }
.link-list li { padding: .6rem 0; border-bottom: 1px solid var(--line); margin: 0; }
.link-list li:last-child { border-bottom: 0; }
.link-note { display: block; font-size: .92rem; color: var(--ink-faint); }

/* cta */
.cta {
    background: var(--teal-wash); border: 1px solid var(--teal);
    border-radius: var(--radius-lg); padding: clamp(1.3rem, 3vw, 2rem);
}
.cta > :last-child { margin-bottom: 0; }
.cta-actions { display: flex; flex-wrap: wrap; gap: .7rem; margin-top: 1.2rem; }

/* ------------------------------------------------------------------ glossary */

.filter { margin: 1.6rem 0 1rem; }
.filter-field { display: block; }
.filter-field > span { display: block; font-weight: 650; margin-bottom: .35rem; font-size: .95rem; }
.filter input {
    width: 100%; padding: .7rem .9rem; font: inherit; color: var(--ink);
    background: var(--card); border: 1.5px solid var(--line-strong); border-radius: var(--radius);
}
.filter-count { font-size: .9rem; color: var(--ink-faint); margin: .5rem 0 0; min-height: 1.4em; }

.glossary { margin: 0; }
.glossary-item {
    padding: 1rem 0; border-bottom: 1px solid var(--line);
}
.glossary-item[hidden] { display: none; }
.glossary dt { font-weight: 700; display: flex; flex-wrap: wrap; align-items: baseline; gap: .5rem; }
.glossary dd { margin: .4rem 0 0; color: var(--ink-soft); }
.glossary dd > :last-child { margin-bottom: 0; }
.acronym {
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: .82rem; font-weight: 600; background: var(--sand-deep);
    border: 1px solid var(--line); border-radius: 6px; padding: .1rem .4rem; color: var(--ink-soft);
}

.pill {
    font-size: .72rem; font-weight: 700; text-transform: uppercase; letter-spacing: .06em;
    background: var(--sand-deep); border: 1px solid var(--line); border-radius: 999px;
    padding: .12rem .55rem; color: var(--ink-faint); white-space: nowrap;
}
.pill-mi_via    { background: var(--teal-wash); border-color: var(--teal); color: var(--teal-deep); }
.pill-dd_waiver { background: var(--clay-wash); border-color: var(--clay); color: var(--clay); }

/* ------------------------------------------------------------------ resources */

.resource-list { list-style: none; padding: 0; margin: 1.2rem 0 0; }
.resource-list > li { padding: .9rem 0; border-bottom: 1px solid var(--line); margin: 0; }
.resource-list > li:last-child { border-bottom: 0; }
.resource-name { margin: 0; font-weight: 600; display: flex; flex-wrap: wrap; align-items: center; gap: .5rem; }
.resource-desc { margin: .3rem 0 0; color: var(--ink-soft); font-size: .96rem; }
.resource-phone { margin: .3rem 0 0; font-size: .94rem; }

/* ------------------------------------------------------------------ faq */

.qa {
    background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
    margin-bottom: .7rem; overflow: hidden;
}
.qa summary {
    cursor: pointer; padding: 1rem 1.15rem; font-weight: 650; list-style: none;
    display: flex; justify-content: space-between; gap: 1rem; align-items: center;
}
.qa summary::-webkit-details-marker { display: none; }
.qa summary::after {
    content: "+"; font-size: 1.4rem; font-weight: 400; color: var(--teal); flex: none; line-height: 1;
}
.qa[open] summary::after { content: "\2212"; }
.qa summary:hover { background: var(--sand-deep); }
.qa-body { padding: 0 1.15rem 1.15rem; color: var(--ink-soft); }
.qa-body > :last-child { margin-bottom: 0; }

/* ------------------------------------------------------------------ forms */

.form { margin-top: 1.8rem; }
.hp { position: absolute; left: -9999px; }
.field { margin-bottom: 1.1rem; }
.field label { display: block; font-weight: 650; margin-bottom: .35rem; }
.req { font-weight: 500; font-size: .82rem; color: var(--clay); text-transform: uppercase; letter-spacing: .05em; margin-left: .3rem; }
.field input, .field select, .field textarea {
    width: 100%; padding: .7rem .9rem; font: inherit; color: var(--ink);
    background: var(--card); border: 1.5px solid var(--line-strong); border-radius: var(--radius);
}
.field textarea { resize: vertical; min-height: 8rem; }
.field-bad input, .field-bad textarea, .field-bad select { border-color: var(--clay); background: var(--clay-wash); }
.field-error { color: var(--clay); font-size: .92rem; font-weight: 600; margin: .35rem 0 0; }
.field-hint { font-size: .92rem; color: var(--ink-faint); margin: -.5rem 0 1.1rem; }
.field-row { display: grid; gap: 1rem; grid-template-columns: 1fr 1fr; }
@media (max-width: 620px) { .field-row { grid-template-columns: 1fr; } }
.form-actions { margin-top: 1.5rem; }

.empty { color: var(--ink-faint); font-style: italic; }

/* ------------------------------------------------------------------ footer */

.site-foot { background: var(--card); border-top: 1px solid var(--line); margin-top: auto; }

.foot-grid {
    display: grid; gap: clamp(1.5rem, 3vw, 2.5rem);
    grid-template-columns: minmax(0, 1.5fr) repeat(2, minmax(0, .8fr)) minmax(0, 1.1fr);
    padding-top: 2.8rem; padding-bottom: 2rem;
}
@media (max-width: 940px) { .foot-grid { grid-template-columns: 1fr 1fr; } }
@media (max-width: 560px) { .foot-grid { grid-template-columns: 1fr; } }

.foot-name { font-weight: 750; font-size: 1.15rem; margin: 0 0 .4rem; }
.foot-about p { font-size: .95rem; color: var(--ink-soft); }
.foot-disclaimer { font-size: .88rem !important; color: var(--ink-faint) !important; }

.foot-head {
    font-size: .78rem; text-transform: uppercase; letter-spacing: .09em; font-weight: 700;
    color: var(--ink-faint); margin: 0 0 .7rem;
}
.foot-nav ul { list-style: none; padding: 0; margin: 0; }
.foot-nav li { margin-bottom: .45rem; }
.foot-nav a { font-size: .95rem; text-decoration: none; }
.foot-nav a:hover { text-decoration: underline; }
.foot-urgent p { font-size: .92rem; color: var(--ink-soft); margin: 0; }

.foot-bottom { border-top: 1px solid var(--line); padding-top: 1.2rem; padding-bottom: 2rem; }
.foot-bottom p { font-size: .88rem; color: var(--ink-faint); margin: 0; }

html, body { min-height: 100%; }
body { display: flex; flex-direction: column; }
main { flex: 1 0 auto; }

@media print {
    .site-head, .site-nav, .nav-toggle, .hero-art, .skip { display: none !important; }
    body { background: #fff; color: #000; font-size: 12pt; }
    a::after { content: " (" attr(href) ")"; font-size: .85em; word-break: break-all; }
    .qa[open] .qa-body, .qa-body { display: block !important; }
}

/* Resource link freshness, written by bin/check-links.php */
.resource-checked { margin: .3rem 0 0; font-size: .84rem; color: var(--ink-faint); }
.resource-stale {
    color: var(--clay); font-weight: 600;
    background: var(--clay-wash); border: 1px solid var(--clay);
    border-radius: 8px; padding: .4rem .6rem; display: inline-block;
}

/* Footer attribution */
.foot-powered { margin: .4rem 0 0; font-size: .88rem; color: var(--ink-faint); }
.foot-bottom p:first-child a { color: var(--ink-faint); }

/* Inline literal names (cookie names, config keys) in editorial copy */
code {
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: .88em; background: var(--sand-deep);
    border: 1px solid var(--line); border-radius: 6px; padding: .08em .35em;
    overflow-wrap: break-word;
}

/* Data-handling note beside the contact form */
.form-legal { font-size: .92rem; margin-bottom: 0; }

/* ------------------------------------------------------------------ language */

/* Always visible, never inside the mobile menu: a parent looking for Spanish
   should see the word "Espanol" the moment the page loads. */
.lang-switch { margin-left: auto; }
.lang-switch ul {
    display: flex; align-items: center; gap: .25rem;
    list-style: none; margin: 0; padding: 0;
    border: 1px solid var(--line-strong); border-radius: 999px;
    background: var(--sand-deep); padding: .18rem;
}
.lang-switch li { margin: 0; }
.lang-switch a, .lang-switch .lang-current {
    display: block; padding: .3rem .75rem; border-radius: 999px;
    font-size: .88rem; font-weight: 650; text-decoration: none; white-space: nowrap;
}
.lang-switch a { color: var(--ink-soft); }
.lang-switch a:hover { background: var(--card); color: var(--teal-deep); }
.lang-switch .lang-current { background: var(--teal); color: #fff; }
@media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) .lang-switch .lang-current { color: #06201f; }
}

@media (max-width: 900px) {
    .lang-switch { margin-left: auto; margin-right: .5rem; }
    .lang-switch a, .lang-switch .lang-current { padding: .35rem .7rem; font-size: .9rem; }
}
@media (max-width: 420px) {
    .brand-sub { display: none; }
}

/* Offered to a browser that asks for Spanish. Not a redirect, not remembered. */
.lang-offer {
    background: var(--teal-wash);
    border-bottom: 1px solid var(--teal);
}
.lang-offer p {
    margin: 0; padding: .7rem 0; font-size: .95rem; font-weight: 550;
    color: var(--teal-deep);
}
.lang-offer a { font-weight: 700; }
