/* Shannon County EM — base theme. Kept in one external file so the Content
   Security Policy can stay strict (no inline styles). */

@font-face { font-family: 'Inter'; font-style: normal; font-weight: 400; font-display: swap; src: url('/assets/fonts/inter-400.woff2') format('woff2'); }
@font-face { font-family: 'Inter'; font-style: normal; font-weight: 500; font-display: swap; src: url('/assets/fonts/inter-500.woff2') format('woff2'); }
@font-face { font-family: 'Inter'; font-style: normal; font-weight: 600; font-display: swap; src: url('/assets/fonts/inter-600.woff2') format('woff2'); }
@font-face { font-family: 'Inter'; font-style: normal; font-weight: 700; font-display: swap; src: url('/assets/fonts/inter-700.woff2') format('woff2'); }
@font-face { font-family: 'Fraunces'; font-style: normal; font-weight: 100 900; font-display: swap; src: url('/assets/fonts/fraunces-var.woff2') format('woff2'); }

:root {
    --font-sans: 'Inter', system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, sans-serif;
    --font-display: 'Fraunces', Georgia, 'Times New Roman', serif;
    --bg: #faf9f5;          /* warm limestone */
    --ink: #1b211d;         /* deep forest charcoal */
    --muted: #5c655e;
    --brand: #14532d;       /* deep pine */
    --brand-ink: #ffffff;
    --water: #0e7490;       /* spring-water teal accent */
    --emergency: #b91c1c;   /* safety red — never change */
    --line: #e6e2d8;        /* warm limestone line */
    --card: #ffffff;        /* crisp surface on the warm page */
    --ok: #15803d;
    --shadow: 0 1px 2px rgba(20, 40, 25, .06), 0 6px 18px rgba(20, 40, 25, .05);
    --radius: .6rem;
    --max: 70rem;
}

* { box-sizing: border-box; }

/* Accessibility */
:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; border-radius: 2px; }
.visually-hidden { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.site-nav a[aria-current="page"] { background: rgba(20, 83, 45, .12); color: var(--brand); font-weight: 600; }
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: .01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: .01ms !important;
        scroll-behavior: auto !important;
    }
}

html { -webkit-text-size-adjust: 100%; }

body {
    margin: 0;
    font-family: var(--font-sans);
    color: var(--ink);
    background: var(--bg);
    line-height: 1.65;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

h1, h2, h3 { font-family: var(--font-display); font-weight: 600; letter-spacing: -.015em; line-height: 1.12; }

a { color: var(--brand); }

.container { width: 100%; max-width: var(--max); margin: 0 auto; padding: 0 1rem; }

.skip-link {
    position: absolute; left: -999px;
    background: var(--ink); color: #fff; padding: .5rem .75rem; z-index: 100;
}
.skip-link:focus { left: .5rem; top: .5rem; }

/* Header */
.emergency-bar {
    background: var(--emergency); color: #fff; text-align: center;
    padding: .4rem 1rem; font-size: .95rem;
}
.emergency-bar a { color: #fff; text-decoration: underline; }

.site-header { position: sticky; top: 0; z-index: 50; background: rgba(250, 249, 245, .92); backdrop-filter: saturate(1.4) blur(10px); -webkit-backdrop-filter: saturate(1.4) blur(10px); border-bottom: 1px solid var(--line); box-shadow: 0 6px 22px -18px rgba(20, 40, 25, .55); }
.site-header__inner {
    display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between;
    gap: .5rem 1rem; padding-top: .75rem; padding-bottom: .75rem;
}
.brand { text-decoration: none; color: var(--ink); display: flex; flex-direction: row; align-items: center; gap: .6rem; }
.brand__mark { display: inline-flex; flex: none; filter: drop-shadow(0 1px 2px rgba(0, 0, 0, .18)); }
.brand__logo { display: block; flex: none; width: 46px; height: 46px; border-radius: 50%; box-shadow: 0 1px 3px rgba(0, 0, 0, .22); }
.brand__text { display: flex; flex-direction: column; line-height: 1.05; }
.brand__title { font-family: var(--font-display); font-weight: 600; font-size: 1.35rem; color: var(--brand); letter-spacing: -.01em; }
.brand__sub { color: var(--muted); font-size: .76rem; letter-spacing: .09em; text-transform: uppercase; }

.site-nav { display: flex; flex-wrap: wrap; align-items: center; gap: .15rem .3rem; }
.site-nav a { text-decoration: none; padding: .45rem .75rem; border-radius: 999px; color: var(--ink); font-weight: 500; font-size: .95rem; transition: background .12s ease, color .12s ease; }
.site-nav a:hover, .site-nav a:focus { background: rgba(20, 83, 45, .08); color: var(--brand); }
.site-nav a.nav-cta { background: var(--brand); color: #fff; font-weight: 600; }
.site-nav a.nav-cta:hover, .site-nav a.nav-cta:focus { background: #0f3d22; color: #fff; }
.nav-logout { margin: 0; }
.nav-logout button { background: transparent; border: 0; color: var(--ink); font: inherit; font-weight: 500; font-size: .95rem; padding: .45rem .75rem; border-radius: 999px; cursor: pointer; transition: background .12s ease, color .12s ease; }
.nav-logout button:hover, .nav-logout button:focus { background: rgba(20, 83, 45, .08); color: var(--brand); }

/* Main */
main { padding: 1.5rem 1rem 3rem; flex: 1 0 auto; }

.alert-banner {
    display: flex; flex-wrap: wrap; gap: .5rem; align-items: baseline;
    border-radius: .5rem; padding: .75rem 1rem; margin-bottom: 1.5rem;
    border: 1px solid var(--line); background: var(--card);
}
.alert-banner--clear { border-color: #cce3d3; background: #f0faf3; }
.alert-banner__label { font-weight: 700; text-transform: uppercase; font-size: .75rem; letter-spacing: .04em; color: var(--ok); }

.hero h1 { font-size: 1.9rem; margin: 0 0 .5rem; }
.lede { font-size: 1.1rem; color: var(--muted); max-width: 48rem; }
.hero--banner { position: relative; overflow: hidden; border-radius: var(--radius); background: radial-gradient(120% 80% at 85% 6%, rgba(255, 244, 206, .6), rgba(255, 244, 206, 0) 55%), linear-gradient(180deg, #d7ebf0 0%, #e6f0e8 45%, var(--card) 100%); padding: 3.25rem 1.75rem 6.5rem; margin-bottom: 1.5rem; box-shadow: var(--shadow); }
.hero--banner .hero__content { position: relative; z-index: 1; max-width: 46rem; }
.hero--banner h1 { font-size: clamp(1.9rem, 5vw, 2.9rem); line-height: 1.1; letter-spacing: -.015em; margin: 0 0 .7rem; color: #123524; }
.hero--banner .lede { font-size: clamp(1.05rem, 2.2vw, 1.25rem); color: #3c4a40; }
.hero__ridge { position: absolute; left: 0; right: 0; bottom: -1px; width: 100%; height: 165px; display: block; pointer-events: none; }
.hero__cta { display: flex; flex-wrap: wrap; gap: .75rem; margin: 1.5rem 0 0; }

.feature { display: flex; gap: 1.5rem; align-items: flex-start; background: linear-gradient(135deg, #0f3d2a, #14532d 70%); color: #eaf3ec; border-radius: 1rem; padding: 2rem; margin: 2.5rem 0; box-shadow: 0 12px 32px rgba(15, 61, 42, .22); }
.feature h2 { color: #fff; margin: 0 0 .5rem; }
.feature p { color: #cfe0d5; margin: 0 0 1.1rem; }
.feature strong { color: #fff; }
.feature a:not(.btn) { color: #9fe3f1; }
.feature .btn { background: #ffffff; color: var(--brand); box-shadow: 0 2px 10px rgba(0, 0, 0, .18); }
.feature .btn:hover, .feature .btn:focus { background: #eafaf0; }
.feature__icon { flex: none; width: 52px; height: 52px; color: #86d9ec; }
.feature__icon svg { width: 100%; height: 100%; }
@media (max-width: 34rem) { .feature { flex-direction: column; gap: 1rem; padding: 1.5rem; } }

.conditions {
    display: grid; gap: 1rem; margin: 2rem 0;
    grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr));
}
.card { border: 1px solid var(--line); background: var(--card); border-radius: var(--radius); padding: 1.25rem 1.4rem; box-shadow: var(--shadow); transition: transform .14s ease, box-shadow .14s ease, border-color .14s ease; }
.card:hover { transform: translateY(-3px); box-shadow: 0 2px 4px rgba(20, 40, 25, .06), 0 14px 30px rgba(20, 40, 25, .10); border-color: #d3ddd1; }
.card__icon { width: 30px; height: 30px; color: var(--brand); display: block; margin-bottom: .5rem; }
.card__value { color: var(--brand); }
.card__title { font-size: 1rem; margin: 0 0 .25rem; }
.card__value { font-size: 1.8rem; font-weight: 700; margin: 0; }
.card__note { color: var(--muted); font-size: .85rem; margin: .25rem 0 0; }

.prepare { margin-top: 2rem; padding-top: 1.5rem; border-top: 1px solid var(--line); }
.prepare h2 { margin-top: 0; }

/* Footer */
.site-footer { background: #0f3d2a; color: #cfe0d5; padding: 2.75rem 1rem 1.75rem; margin-top: 3rem; flex-shrink: 0; }
.site-footer a { color: #eaf3ec; }
.site-footer .footer-links { display: flex; flex-wrap: wrap; gap: .6rem 1.5rem; padding-bottom: 1.25rem; margin-bottom: 1.25rem; border-bottom: 1px solid rgba(255, 255, 255, .14); }
.site-footer .footer-links a { text-decoration: none; font-weight: 500; color: #eaf3ec; }
.site-footer .footer-links a:hover, .site-footer .footer-links a:focus { text-decoration: underline; }
.site-footer__org { margin: 0 0 .5rem; color: #ffffff; }
.site-footer__muted { color: #93ad9f; font-size: .85rem; margin: .25rem 0; }

@media (max-width: 30rem) {
    .site-header__inner { flex-direction: column; align-items: flex-start; }
    .hero h1 { font-size: 1.5rem; }
}

/* Print: drop chrome/interactive bits, keep the readable content */
@media print {
    .site-header, .site-footer, .footer-links, .alert-banner, .burnban,
    .hydro, .conditions-map, .stage-meter, form.form, .skip-link { display: none !important; }
    body { color: #000; background: #fff; }
    a { color: #000; text-decoration: underline; }
    .container { max-width: 100%; padding: 0; }
    .card, .gauge, .news-item { border-color: #999; break-inside: avoid; }
}

/* River gauges */
.gauges { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fit, minmax(16rem, 1fr)); margin: 1.5rem 0; }
.gauge { border: 1px solid var(--line); border-left-width: 6px; border-radius: var(--radius); padding: 1rem 1.25rem; background: var(--card); box-shadow: var(--shadow); }
.gauge--primary { box-shadow: 0 0 0 2px rgba(20, 83, 45, .12); }
.gauge__head { display: flex; justify-content: space-between; align-items: baseline; gap: .5rem; }
.gauge__name { font-size: 1.05rem; margin: 0; }
.gauge__stage { font-size: 1.8rem; font-weight: 700; margin: .35rem 0 0; }
.gauge__trend { font-size: .85rem; font-weight: 600; margin-left: .4rem; }
.gauge__flow, .gauge__fcst, .gauge__meta, .gauge__note { margin: .2rem 0 0; font-size: .85rem; color: var(--muted); }
.gauge__fcst { color: var(--ink); font-weight: 600; }
.gauge__stale { color: var(--emergency); font-weight: 600; }
.badge { font-size: .72rem; font-weight: 700; text-transform: uppercase; letter-spacing: .03em; padding: .2rem .55rem; border-radius: 1rem; white-space: nowrap; }
.gauge--normal   { border-left-color: #15803d; } .badge--normal   { background: #dcfce7; color: #14532d; }
.gauge--action   { border-left-color: #ca8a04; } .badge--action   { background: #fef9c3; color: #713f12; }
.gauge--minor    { border-left-color: #ea580c; } .badge--minor    { background: #ffedd5; color: #7c2d12; }
.gauge--moderate { border-left-color: #dc2626; } .badge--moderate { background: #fee2e2; color: #7f1d1d; }
.gauge--major    { border-left-color: #7f1d1d; } .badge--major    { background: #7f1d1d; color: #fff; }
.gauge--unknown  { border-left-color: #94a3b8; } .badge--unknown  { background: #e2e8f0; color: #334155; }

/* Content pages (interim — elevated in Phase 16 beautification) */
.page-hero { position: relative; padding: 1.6rem 1.6rem; margin-bottom: 1.6rem; background: linear-gradient(120deg, #e8f1ec 0%, #f3f1e9 58%, var(--card) 100%); border: 1px solid var(--line); border-left: 5px solid var(--brand); border-radius: var(--radius); box-shadow: var(--shadow); }
.page-hero h1 { font-size: clamp(1.7rem, 4vw, 2.3rem); margin: 0 0 .35rem; color: #123524; }
.page-hero .lede { margin: 0; }
.prose { max-width: 65ch; }
.prose h2 { margin: 1.8rem 0 .5rem; font-size: 1.3rem; }
.prose h3 { margin: 1.1rem 0 .3rem; font-size: 1.05rem; }
.prose ul { padding-left: 1.2rem; }
.prose li { margin: .3rem 0; }
.callout { border-left: 4px solid var(--brand); background: var(--card); padding: .8rem 1rem; border-radius: 0 .4rem .4rem 0; margin: 1.2rem 0; }
.callout--warn { border-left-color: var(--emergency); }
.callout strong { display: block; margin-bottom: .2rem; }
.hazard-grid { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr)); margin: 1.4rem 0; }
.hazard-card { display: block; border: 1px solid var(--line); border-radius: var(--radius); padding: 1.1rem 1.35rem; background: var(--card); text-decoration: none; color: var(--ink); box-shadow: var(--shadow); transition: transform .12s ease, border-color .12s ease; }
.hazard-card:hover, .hazard-card:focus { border-color: var(--brand); transform: translateY(-2px); }
.hazard-card h2 { margin: 0 0 .3rem; font-size: 1.1rem; color: var(--brand); }
.hazard-card p { margin: 0; font-size: .9rem; color: var(--muted); }
.hazard-card__icon { width: 30px; height: 30px; color: var(--brand); display: block; margin-bottom: .55rem; }
.contact-table { width: 100%; border-collapse: collapse; margin: 1rem 0; }
.contact-table th, .contact-table td { text-align: left; padding: .5rem .6rem; border-bottom: 1px solid var(--line); font-size: .95rem; vertical-align: top; }
.contact-table th { color: var(--muted); font-weight: 600; white-space: nowrap; }
.footer-links { display: flex; flex-wrap: wrap; gap: .5rem 1.25rem; margin: 0 0 .8rem; padding: 0; list-style: none; }
.footer-links a { color: var(--brand); text-decoration: none; font-size: .9rem; }

/* Alerts */
a.alert-banner { text-decoration: none; color: inherit; }
.alert-banner--extreme, .alert-banner--severe { background: #fee2e2; border-color: #fecaca; }
.alert-banner--extreme .alert-banner__label, .alert-banner--severe .alert-banner__label { color: #7f1d1d; }
.alert-banner--moderate { background: #ffedd5; border-color: #fed7aa; }
.alert-banner--moderate .alert-banner__label { color: #7c2d12; }
.alert-banner--minor { background: #fef9c3; border-color: #fde68a; }
.alert-banner--minor .alert-banner__label { color: #713f12; }
.card__lead { margin: .3rem 0 0; font-size: 1rem; }
.alert-list { display: grid; gap: .75rem; margin: 1.25rem 0; }
.alert { border: 1px solid var(--line); border-left-width: 6px; border-radius: .5rem; background: var(--card); }
.alert__summary { cursor: pointer; list-style: none; display: flex; flex-wrap: wrap; align-items: center; gap: .5rem; padding: .8rem 1rem; font-weight: 600; }
.alert__summary::-webkit-details-marker { display: none; }
.alert__event { font-size: 1.05rem; }
.alert__meta { color: var(--muted); font-weight: 400; font-size: .85rem; }
.alert__body { padding: 0 1rem 1rem; }
.alert__headline { font-weight: 600; }
.alert__instruction { background: #fff7ed; border: 1px solid #fed7aa; border-radius: .4rem; padding: .5rem .7rem; }
.alert__src { font-size: .8rem; }
.alert--extreme { border-left-color: #7f1d1d; } .alert--severe { border-left-color: #dc2626; }
.alert--moderate { border-left-color: #ea580c; } .alert--minor { border-left-color: #ca8a04; }
.alert--unknown { border-left-color: #94a3b8; }
.badge--extreme  { background: #7f1d1d; color: #fff; }
.badge--severe   { background: #fee2e2; color: #7f1d1d; }
.badge--moderate { background: #ffedd5; color: #7c2d12; }
.badge--minor    { background: #fef9c3; color: #713f12; }

/* Map */
.conditions-map { height: 480px; max-height: 70vh; border: 1px solid var(--line); border-radius: .5rem; margin: 1.25rem 0; }
.leaflet-container { font: inherit; }

/* Forms & auth */
.form { max-width: 28rem; }
.field { display: flex; flex-direction: column; gap: .25rem; margin: 0 0 1rem; }
.field label { font-weight: 600; font-size: .9rem; }
.field input { padding: .55rem .65rem; border: 1px solid var(--line); border-radius: .4rem; font: inherit; }
.field input:focus { outline: 2px solid var(--brand); outline-offset: 1px; }
.field__error { color: var(--emergency); font-size: .85rem; }
.field__hint { color: var(--muted); font-size: .8rem; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: .5rem; background: var(--brand); color: #fff; border: 0; border-radius: 999px; padding: .72rem 1.45rem; font: inherit; font-weight: 600; cursor: pointer; text-decoration: none; box-shadow: 0 2px 10px rgba(20, 83, 45, .28); transition: transform .12s ease, background .12s ease, box-shadow .12s ease; }
.btn:hover, .btn:focus { background: #0f3d22; transform: translateY(-1px); box-shadow: 0 4px 16px rgba(20, 83, 45, .32); }
.btn--ghost { background: transparent; color: var(--brand); border: 1.5px solid var(--brand); box-shadow: none; }
.btn--ghost:hover, .btn--ghost:focus { background: rgba(20, 83, 45, .08); color: var(--brand); }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.site-nav__user { color: var(--muted); font-size: .9rem; align-self: center; }
.nav-logout { display: inline; margin: 0; }
.nav-logout button { background: none; border: 0; color: var(--brand); font: inherit; padding: .35rem .25rem; cursor: pointer; text-decoration: underline; }
.btn--muted { background: var(--muted); }
.btn--muted:hover, .btn--muted:focus { background: #475569; }
.totp-secret code { font-size: 1.15rem; letter-spacing: .12em; background: var(--card); padding: .4rem .6rem; border-radius: .3rem; display: inline-block; }
.role-form { display: flex; gap: .4rem; align-items: center; margin: 0; }
.role-form select { padding: .3rem .4rem; border: 1px solid var(--line); border-radius: .3rem; font: inherit; }
.btn--sm { padding: .3rem .6rem; font-size: .85rem; }
fieldset.field { border: 1px solid var(--line); border-radius: .5rem; padding: .8rem 1rem; }
fieldset.field legend { font-weight: 600; padding: 0 .3rem; }
.checkboxes { display: flex; flex-wrap: wrap; gap: .5rem 1.25rem; }
.checkboxes--stack { flex-direction: column; gap: .5rem; }
.checkbox { display: flex; gap: .45rem; align-items: center; font-weight: 400; }
.form select { padding: .5rem .6rem; border: 1px solid var(--line); border-radius: .4rem; font: inherit; }
.form textarea { width: 100%; padding: .55rem .65rem; border: 1px solid var(--line); border-radius: .4rem; font: inherit; }
.burnban { background: #7f1d1d; color: #fff; border-radius: .5rem; padding: .75rem 1rem; margin-bottom: 1.25rem; }
.burnban strong { letter-spacing: .02em; }
.stage-meter { display: flex; gap: 3px; margin: .5rem 0 .35rem; }
.stage-seg { flex: 1 1 0; height: 8px; border-radius: 2px; background: #e2e8f0; }
.stage-seg--normal { background: #15803d; }
.stage-seg--action { background: #ca8a04; }
.stage-seg--minor { background: #ea580c; }
.stage-seg--moderate { background: #dc2626; }
.stage-seg--major { background: #7f1d1d; }
.hydro { margin: 1.5rem 0; }
.hydro__title { font-size: 1.15rem; margin: 0 0 .5rem; }
.hydro__wrap { position: relative; height: 300px; }
.news-item { border-bottom: 1px solid var(--line); padding-bottom: 1rem; margin-bottom: 1.25rem; }
.news-item h2 { margin-bottom: .15rem; }
.news-item__date { margin-top: 0; font-size: .85rem; }
.inline-form { display: inline; margin: 0; }
.linkbtn { background: none; border: 0; color: var(--emergency); cursor: pointer; text-decoration: underline; font: inherit; padding: 0 .25rem; }
