/* =====================================================================
   site-pages.css — shared styles for the public information pages
   (about, how-we-score, agents, contact, terms).
   Colors are the app's own tokens (app.css :root and its dark theme):
   light = cream page, white cards, green accents; dark = the app's deep
   green surfaces. Pages follow the app's saved theme (localStorage
   hcDarkMode, applied as data-theme by each page's head script) and fall
   back to the device setting.
   ===================================================================== */
:root {
    --sp-bg:          #F4EFE6;   /* --gh-bg */
    --sp-surface:     #FFFFFF;   /* --gh-card */
    --sp-text:        #2D3B2F;   /* --gh-text */
    --sp-muted:       #555E55;   /* a step darker than --gh-muted so it holds AA on the cream page */
    --sp-accent:      #3B6A2B;   /* --fc-accent-text */
    --sp-border:      #E2D7C4;
    --sp-band:        #243020;   /* header band: --pro-surface (dark in both themes) */
    --sp-band-text:   #F4EFE6;
    --sp-band-sub:    #C8DACC;
    --sp-band-link:   #CFE5C2;
    --sp-focus:       #3B6A2B;
    --sp-btn-bg:      #4F763E;   /* --fc-btn-green, white text 5.3:1 */
    --sp-btn-text:    #FFFFFF;
    --sp-note-bg:     #EFEDE6;   /* --fc-note-bg */
    --sp-note-text:   #454B42;   /* --fc-note */
    --sp-encourage:    #3B6A2B; --sp-encourage-bg: #E4F0DC;
    --sp-moderate:     #7F5300; --sp-moderate-bg:  #FBEFD3;
    --sp-minimize:     #9C2A1E; --sp-minimize-bg:  #FBE4DF;
    color-scheme: light;
}
@media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) {
        --sp-bg:        #1A2B1D;
        --sp-surface:   #243020;
        --sp-text:      #F4EFE6;
        --sp-muted:     #C8DACC;
        --sp-accent:    #A8D394;
        --sp-border:    rgba(255,255,255,0.12);
        --sp-band:      #10200F;
        --sp-focus:     #A8D394;
        --sp-note-bg:   #2D3B2F;
        --sp-note-text: #E4EDE0;
        color-scheme: dark;
    }
}
:root[data-theme="dark"] {
    --sp-bg:        #1A2B1D;
    --sp-surface:   #243020;
    --sp-text:      #F4EFE6;
    --sp-muted:     #C8DACC;
    --sp-accent:    #A8D394;
    --sp-border:    rgba(255,255,255,0.12);
    --sp-band:      #10200F;
    --sp-focus:     #A8D394;
    --sp-note-bg:   #2D3B2F;
    --sp-note-text: #E4EDE0;
    color-scheme: dark;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
    margin: 0;
    background: var(--sp-bg);
    color: var(--sp-text);
    font-family: -apple-system, BlinkMacSystemFont, 'Inter', 'SF Pro Display', 'Segoe UI', Roboto, sans-serif;
    font-size: 1rem;
    line-height: 1.65;
}
a { color: var(--sp-accent); text-underline-offset: 2px; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 3px solid var(--sp-focus); outline-offset: 2px; border-radius: 4px; }

/* ── Header band ───────────────────────────────────────────────────── */
.sp-band { background: var(--sp-band); color: var(--sp-band-text); }
.sp-band-inner {
    max-width: 760px; margin: 0 auto; padding: 14px 16px 12px;
    display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px 20px;
}
.sp-brand {
    display: inline-flex; align-items: center; gap: 10px;
    color: var(--sp-band-text); text-decoration: none; font-weight: 800; font-size: 1.0625rem; letter-spacing: 0.01em;
}
.sp-brand img { width: 36px; height: 36px; border-radius: 50%; object-fit: cover; }
.sp-nav { display: flex; flex-wrap: wrap; gap: 4px 16px; }
.sp-nav a {
    color: var(--sp-band-link); text-decoration: none; font-size: 0.9375rem; font-weight: 600;
    padding: 4px 0; min-height: 28px; display: inline-flex; align-items: center;
}
.sp-nav a:hover { text-decoration: underline; }
.sp-nav a[aria-current="page"] { color: var(--sp-band-text); text-decoration: underline; text-decoration-thickness: 2px; }

/* ── Page body ─────────────────────────────────────────────────────── */
.sp-main { max-width: 760px; margin: 0 auto; padding: 32px 16px 48px; }
.sp-main > * { max-width: 68ch; }
.sp-eyebrow {
    margin: 0 0 6px; font-size: 0.8125rem; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--sp-muted);
}
h1 { margin: 0 0 14px; font-size: clamp(1.75rem, 4vw + 0.5rem, 2.375rem); line-height: 1.15; font-weight: 800; text-wrap: balance; }
h2 { margin: 40px 0 10px; font-size: 1.3125rem; line-height: 1.3; font-weight: 800; text-wrap: balance; }
h3 { margin: 24px 0 6px; font-size: 1.0625rem; line-height: 1.35; font-weight: 700; }
p { margin: 0 0 14px; }
ul, ol { margin: 0 0 16px; padding-left: 22px; }
li { margin-bottom: 6px; }
.sp-lead { font-size: 1.125rem; color: var(--sp-text); }
.sp-muted { color: var(--sp-muted); }
.sp-small { font-size: 0.875rem; color: var(--sp-muted); }

.sp-card {
    background: var(--sp-surface); border: 1px solid var(--sp-border); border-radius: 14px;
    padding: 18px 20px; margin: 0 0 16px;
}
.sp-card > :last-child { margin-bottom: 0; }
.sp-card h3 { margin-top: 0; }
.sp-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 14px; max-width: none; margin: 0 0 16px; }
.sp-grid .sp-card { margin: 0; }

.sp-note {
    background: var(--sp-note-bg); color: var(--sp-note-text); border-radius: 12px;
    padding: 14px 18px; margin: 24px 0; font-size: 0.9375rem;
}
.sp-note > :last-child { margin-bottom: 0; }

.sp-cta {
    display: inline-flex; align-items: center; justify-content: center; min-height: 44px;
    padding: 10px 20px; border-radius: 999px; background: var(--sp-btn-bg); color: var(--sp-btn-text);
    font-weight: 700; text-decoration: none;
}
.sp-cta:hover { filter: brightness(1.08); text-decoration: none; }

/* Food Compass label chips (same pairs as the app's --fc-* tokens) */
.sp-bands { display: grid; gap: 10px; margin: 0 0 16px; max-width: none; }
.sp-bandrow { display: flex; align-items: flex-start; gap: 14px; background: var(--sp-surface); border: 1px solid var(--sp-border); border-radius: 12px; padding: 12px 16px; }
.sp-chip { flex: 0 0 auto; min-width: 118px; text-align: center; border-radius: 999px; padding: 4px 12px; font-weight: 800; font-size: 0.875rem; font-variant-numeric: tabular-nums; }
.sp-chip.encourage { background: var(--sp-encourage-bg); color: var(--sp-encourage); }
.sp-chip.moderate  { background: var(--sp-moderate-bg);  color: var(--sp-moderate); }
.sp-chip.minimize  { background: var(--sp-minimize-bg);  color: var(--sp-minimize); }
.sp-bandrow p { margin: 0; }

/* Domain table */
.sp-table-wrap { overflow-x: auto; max-width: none; margin: 0 0 16px; border: 1px solid var(--sp-border); border-radius: 12px; background: var(--sp-surface); }
.sp-table { width: 100%; border-collapse: collapse; font-size: 0.9375rem; }
.sp-table th, .sp-table td { text-align: left; vertical-align: top; padding: 10px 14px; border-bottom: 1px solid var(--sp-border); }
.sp-table tr:last-child td { border-bottom: none; }
.sp-table th { font-size: 0.8125rem; letter-spacing: 0.06em; text-transform: uppercase; color: var(--sp-muted); }
.sp-table td:first-child { font-weight: 700; white-space: nowrap; }

/* Footer */
.sp-footer { border-top: 1px solid var(--sp-border); }
.sp-footer-inner { max-width: 760px; margin: 0 auto; padding: 22px 16px 36px; display: grid; gap: 10px; }
.sp-footer nav { display: flex; flex-wrap: wrap; gap: 4px 18px; }
.sp-footer nav a { font-size: 0.9375rem; font-weight: 600; min-height: 28px; display: inline-flex; align-items: center; }
.sp-footer p { margin: 0; font-size: 0.875rem; color: var(--sp-muted); }

@media (max-width: 520px) {
    .sp-bandrow { flex-direction: column; gap: 8px; }
    .sp-table td:first-child { white-space: normal; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }
