/* www/static/css/agegating.css
 * agegating.org brand tokens + observatory styles.
 * UnGovr Oversight family chrome: warm-cream shared surfaces, plum member
 * hue, factual status palette (no red/alarm; grey carries the gap).
 * Parallels www/static/css/caoversight.css, sheriff.css, watchwatch.css,
 * and computecompute.css; cloned from the last and re-skinned.
 */

:root {
  --age-primary: #4a2e5a;
  --age-primary-dark: #341f40;
  --age-primary-light: #7c5a8c;
  --age-gold: #a98637;         /* enacted-not-in-force / partial */
  --age-grey: #8a8a8a;         /* the factual gap, never alarm */
  --age-pale: #cfc9bd;         /* none on record */
  --age-bg: #faf8f3;
  --age-bg-elevated: #ffffff;
  --age-bg-muted: #ede9df;
  --age-border: #d4cebe;
  --age-text: #1f2937;
  --age-text-muted: #5f6776;
  --age-text-inverse: #faf8f3;
  --age-font-display: 'Fraunces', 'Newsreader', Georgia, serif;
  --age-font-body: 'Newsreader', Georgia, serif;
  --age-font-mono: 'IBM Plex Mono', ui-monospace, monospace;
}

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

body {
  background: var(--age-bg);
  color: var(--age-text);
  font-family: var(--age-font-body);
  font-size: 1.05rem;
  line-height: 1.55;
  margin: 0;
  padding: 0;
}

h1, h2, h3, h4 {
  font-family: var(--age-font-display);
  font-weight: 600;
  line-height: 1.2;
  margin: 1.5rem 0 0.75rem;
}
h1 { font-size: 2.3rem; }
h2 { font-size: 1.5rem; }
h3 { font-size: 1.15rem; }

a {
  color: var(--age-primary);
  text-decoration: underline;
  text-decoration-color: rgba(74, 46, 90, 0.25);
  text-underline-offset: 2px;
}
a:hover { text-decoration-color: var(--age-primary); }

.age-container { max-width: 1080px; margin: 0 auto; padding: 0 1.5rem 3rem; }

.skip-link {
  position: absolute; left: -999px; top: 0;
  background: var(--age-primary); color: var(--age-text-inverse);
  padding: 0.5rem 1rem; z-index: 100;
}
.skip-link:focus { left: 0; }

/* ---- UnGovr Oversight network ribbon ----------------------------------- */

.age-ribbon {
  background: var(--age-primary-dark);
  color: rgba(250, 248, 243, 0.75);
  font-family: var(--age-font-mono);
  font-size: 0.68rem;
  letter-spacing: 0.02em;
  padding: 0.35rem 1.5rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 1.1rem;
  align-items: baseline;
}
.age-ribbon a {
  color: rgba(250, 248, 243, 0.85);
  text-decoration: none;
}
.age-ribbon a:hover { color: #ffffff; text-decoration: underline; }
.age-ribbon-brand {
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: rgba(250, 248, 243, 0.55);
}
.age-ribbon-here { color: #ffffff; font-weight: 600; }

/* ---- Header --------------------------------------------------------------
 * Solid member-hue bar, matching ComputeCompute's pattern rather than
 * WatchWatch's cream-with-border-bottom nav: the badge reads better
 * reversed out of its own primary. */

.age-nav {
  background: var(--age-primary);
  color: var(--age-text-inverse);
}
.age-nav-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.9rem;
  max-width: 1080px;
  margin: 0 auto;
  padding: 0.7rem 1.5rem;
  flex-wrap: wrap;
}
.age-nav-brand {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  text-decoration: none;
  color: inherit;
}
.age-nav-badge { display: block; width: 34px; height: 34px; flex: none; }
.age-nav-names { display: flex; flex-direction: column; line-height: 1.15; }
.age-nav-wordmark {
  font-family: var(--age-font-display);
  font-weight: 600;
  font-size: 1.2rem;
  color: var(--age-text-inverse);
}
.age-nav-kicker {
  font-family: var(--age-font-mono);
  font-size: 0.62rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(250, 248, 243, 0.75);
}
.age-pill {
  font-family: var(--age-font-mono);
  font-size: 0.62rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--age-text-inverse);
  background: var(--age-primary-light);
  border-radius: 999px;
  padding: 0.18rem 0.65rem;
  margin-left: 0.5rem;
}
.age-nav-actions {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 1.2rem;
  flex-wrap: wrap;
  font-family: var(--age-font-mono);
  font-size: 0.82rem;
}
.age-nav-action {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  text-decoration: none;
  color: var(--age-text-inverse);
  opacity: 0.9;
  background: none;
  border: none;
  font: inherit;
  cursor: pointer;
  padding: 0;
}
.age-nav-action:hover { opacity: 1; text-decoration: underline; }

/* ---- Header location breadcrumb (own line, under the top row) --------- */
.age-crumb {
  display: block;
  max-width: 1080px;
  margin: 0 auto;
  padding: 0 1.5rem 0.6rem;
  font-family: var(--age-font-mono);
  font-size: 0.82rem;
  color: rgba(250, 248, 243, 0.75);
}
.age-crumb:empty { display: none; }
.age-crumb a { color: rgba(250, 248, 243, 0.92); text-decoration: none; }
.age-crumb a:hover { text-decoration: underline; }

/* ---- On-this-page jump row ---------------------------------------------- */

.age-jump-nav {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.35rem 0.7rem;
  font-family: var(--age-font-mono);
  font-size: 0.95rem;
  letter-spacing: 0.02em;
  margin: 0.4rem 0 2.4rem;
}
.age-jump-nav a { text-decoration: none; color: var(--age-primary); }
.age-jump-nav a:hover { text-decoration: underline; }
.age-jump-sep { color: var(--age-text-muted); }

/* ---- Hero ---------------------------------------------------------------- */

.age-hero { padding: 3rem 0 2rem; border-bottom: 1px solid var(--age-border); }
.age-kicker {
  font-family: var(--age-font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--age-text-muted);
  margin: 0 0 0.6rem;
}
.age-hero h1 { margin: 0 0 0.4rem; font-size: 2.35rem; max-width: 30ch; }
.age-lede {
  font-size: 1.12rem;
  color: var(--age-text);
  max-width: 60ch;
  margin: 0 0 1.1rem;
}
.age-jur-meta {
  font-family: var(--age-font-mono);
  font-size: 0.82rem;
  color: var(--age-text-muted);
  margin: 0 0 0.6rem;
}
.age-hero-titled { display: flex; align-items: center; gap: 1.1rem; }
.age-hero-titled h1 { margin: 0; }
.age-page-mark { width: 72px; height: 72px; flex: none; }

/* Hero stat strip: one bordered box divided into per-stat cells, right-
   aligned mono numbers over an uppercase label. */
.age-statline {
  display: flex;
  gap: 0;
  margin-top: 1.8rem;
  border: 1px solid var(--age-border);
  border-radius: 10px;
  overflow: hidden;
  background: var(--age-bg-elevated);
  flex-wrap: wrap;
}
.age-stat {
  flex: 1 1 0;
  min-width: 150px;
  padding: 0.9rem 1.1rem;
  border-right: 1px solid var(--age-border);
}
.age-stat:last-child { border-right: none; }
.age-stat .n {
  display: block;
  font-family: var(--age-font-mono);
  font-size: 1.7rem;
  font-weight: 500;
  color: var(--age-primary-dark);
  text-align: right;
  font-variant-numeric: tabular-nums;
}
.age-stat .l {
  display: block;
  font-size: 0.78rem;
  color: var(--age-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.03em;
  text-align: right;
  margin-top: 0.15rem;
}

/* ---- Sections -------------------------------------------------------------
 * Numbered mono kicker ("01", "02", ...) above each h2. */

.age-section { padding: 2.6rem 0; border-bottom: 1px solid var(--age-border); }
.age-section:last-of-type { border-bottom: none; }
.age-section > .kicker {
  font-family: var(--age-font-mono);
  font-size: 0.74rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--age-primary-light);
  margin-bottom: 0.3rem;
}
.age-section h2 { font-size: 1.5rem; margin-top: 0; }
.age-section .section-lede {
  color: var(--age-text-muted);
  max-width: 62em;
  margin-bottom: 1.4rem;
}

/* ---- Observatory: four-lens choropleth, CSS-only tabs ------------------- */

.age-lens-tabs { position: relative; margin-top: 0.6rem; }
input[type="radio"].age-lens { display: none; }
.age-lens-labels {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-bottom: 1rem;
}
.age-lens-labels label {
  cursor: pointer;
  padding: 0.5rem 1rem;
  border: 1px solid var(--age-border);
  border-radius: 8px 8px 0 0;
  background: var(--age-bg-muted);
  color: var(--age-text-muted);
  font-family: var(--age-font-mono);
  font-size: 0.82rem;
}
.age-lens-panel { display: none; }
.age-lens-question {
  color: var(--age-text-muted);
  max-width: 60em;
  margin: 0 0 0.9rem;
}

/* Only four families exist (AGE_FAMILIES is a fixed vocabulary), so the
   :checked -> panel/label wiring is enumerated explicitly rather than with
   a generic sibling rule. */
#age-lens-adult_content_av:checked ~ .age-lens-labels label[for="age-lens-adult_content_av"],
#age-lens-social_media_minor:checked ~ .age-lens-labels label[for="age-lens-social_media_minor"],
#age-lens-app_store_av:checked ~ .age-lens-labels label[for="age-lens-app_store_av"],
#age-lens-design_code:checked ~ .age-lens-labels label[for="age-lens-design_code"] {
  background: var(--age-bg-elevated);
  color: var(--age-primary);
  font-weight: 600;
}
#age-lens-adult_content_av:checked ~ #age-panel-adult_content_av,
#age-lens-social_media_minor:checked ~ #age-panel-social_media_minor,
#age-lens-app_store_av:checked ~ #age-panel-app_store_av,
#age-lens-design_code:checked ~ #age-panel-design_code {
  display: block;
}

/* Map fill classes: the factual three-way status palette. Never red. */
.age-map-active { fill: #4a2e5a; }
.age-map-hold { fill: #a98637; }
.age-map-none { fill: #cfc9bd; }
.age-map svg { width: 100%; height: auto; display: block; }
.age-map path { stroke: #c9c2b2; stroke-width: 0.6; transition: filter 0.15s ease; }
.age-map a:hover path,
.age-map a:focus path { filter: brightness(1.15) saturate(1.1); }

.age-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 0.9rem;
  align-items: center;
  font-family: var(--age-font-mono);
  font-size: 0.72rem;
  color: var(--age-text-muted);
  margin: 0.8rem 0 1.4rem;
}
.age-legend .sw {
  display: inline-block;
  width: 0.85rem;
  height: 0.85rem;
  border: 1px solid var(--age-border);
  vertical-align: -0.12rem;
  margin-right: 0.3rem;
}
.age-sw-active { background: var(--age-primary); }
.age-sw-hold { background: var(--age-gold); }
.age-sw-none { background: var(--age-pale); }

.age-territories { font-size: 0.88rem; color: var(--age-text-muted); margin: 0.6rem 0 0.4rem; }

/* ---- Off-map national cards ---------------------------------------------- */

.age-national-cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 0.8rem;
  margin-top: 0.6rem;
}
.age-national-card {
  display: block;
  background: var(--age-bg-elevated);
  border: 1px solid var(--age-border);
  border-radius: 8px;
  padding: 0.8rem 0.9rem;
  text-decoration: none;
  color: inherit;
  transition: border-color 0.15s ease;
}
.age-national-card:hover {
  border-color: var(--age-primary-light);
  box-shadow: 0 2px 10px rgba(74, 46, 90, 0.12);
}
.age-national-card .name {
  font-family: var(--age-font-display);
  font-weight: 600;
  font-size: 1.05rem;
  color: var(--age-text);
}
.age-chip-row { display: flex; flex-wrap: wrap; gap: 0.3rem; margin-top: 0.5rem; }
.age-chip {
  font-family: var(--age-font-mono);
  font-size: 0.6rem;
  letter-spacing: 0.02em;
  border-radius: 999px;
  padding: 0.14rem 0.5rem;
  white-space: nowrap;
}
.age-chip--in-force { background: var(--age-primary); color: #fff; }
.age-chip--hold { background: var(--age-gold); color: #fff; }
.age-chip--none { background: var(--age-pale); color: var(--age-text-muted); }

/* ---- Status explainer + methodology teaser ------------------------------- */

.age-explainer { font-size: 0.98rem; color: var(--age-text-muted); max-width: 62em; margin-top: 1.6rem; }
.age-methodology-teaser { font-size: 0.98rem; color: var(--age-text-muted); max-width: 62em; }

/* ---- Findings ------------------------------------------------------------- */

.age-findings-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 1rem;
  margin: 0.6rem 0 1.6rem;
}
.age-finding {
  background: var(--age-bg-elevated);
  border: 1px solid var(--age-border);
  border-radius: 8px;
  padding: 0.9rem 1rem;
}
.age-finding h3 { margin: 0 0 0.35rem; font-size: 1.02rem; }
.age-finding p { margin: 0; color: var(--age-text-muted); }

/* ---- Data tables (timeline, status box score, instrument attributes) ----
 * Right-aligned, tabular-nums numeric cells (td.n) throughout. */
table.age-table {
  width: 100%;
  border-collapse: collapse;
  background: var(--age-bg-elevated);
  border: 1px solid var(--age-border);
  border-radius: 8px;
  overflow: hidden;
  margin: 0.6rem 0 1.4rem;
}
.age-table th {
  text-align: left;
  font-family: var(--age-font-mono);
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: var(--age-text-muted);
  padding: 0.5rem 0.9rem;
  border-bottom: 1px solid var(--age-border);
  background: var(--age-bg-muted);
}
.age-table td {
  padding: 0.5rem 0.9rem;
  border-bottom: 1px solid var(--age-bg-muted);
  font-size: 0.95rem;
}
.age-table tr:last-child td { border-bottom: none; }
.age-table th.n, .age-table td.n {
  text-align: right;
  font-variant-numeric: tabular-nums;
}
.age-attr-table { margin: 0.7rem 0; }
.age-attr-table td:first-child {
  color: var(--age-text-muted);
  width: 12rem;
  font-size: 0.86rem;
}

/* ---- Jurisdiction profile: instrument cards ------------------------------- */

.age-instruments { display: flex; flex-direction: column; gap: 1rem; margin-top: 0.6rem; }
.age-instrument {
  background: var(--age-bg-elevated);
  border: 1px solid var(--age-border);
  border-radius: 8px;
  padding: 1rem 1.2rem;
}
.age-instrument-head {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem 1.2rem;
  align-items: baseline;
  margin-bottom: 0.2rem;
}
.age-instrument-head h3 { margin: 0; }
.age-citation {
  font-family: var(--age-font-mono);
  font-size: 0.82rem;
  color: var(--age-text-muted);
  margin: 0 0 0.5rem;
}
.age-instrument-meta {
  font-family: var(--age-font-mono);
  font-size: 0.78rem;
  color: var(--age-text-muted);
  margin: 0 0 0.6rem;
}
.age-litigation { font-size: 0.94rem; color: var(--age-text-muted); }
.age-source { font-size: 0.86rem; }

/* Status tokens: the factual palette, never red. */
.age-token {
  font-family: var(--age-font-mono);
  font-size: 0.72rem;
  padding: 0.15rem 0.55rem;
  border-radius: 4px;
  white-space: nowrap;
}
.age-token--active { background: var(--age-primary); color: #fff; }
.age-token--hold { background: var(--age-gold); color: #fff; }
.age-token--none { background: var(--age-grey); color: #fff; }

/* ---- Prose (about, methodology) ------------------------------------------- */

.age-prose { max-width: 46em; }
.age-prose h2 { margin-top: 1.3rem; }
.age-prose dl { margin: 0.6rem 0 1.2rem; }
.age-prose dt { font-weight: 600; color: var(--age-text); margin-top: 0.6rem; }
.age-prose dd { margin: 0.1rem 0 0; color: var(--age-text-muted); }

/* ---- Footer ---------------------------------------------------------------
 * Full-bleed muted-cream band, with .age-container centering the row/note
 * inside it. */
.age-footer {
  background: var(--age-bg-muted);
  border-top: 1px solid var(--age-border);
  margin-top: 3rem;
  padding: 2rem 0;
  font-size: 0.92rem;
  color: var(--age-text-muted);
}
.age-footer-row {
  max-width: 1080px;
  margin: 0 auto;
  padding: 0 1.5rem;
  display: flex;
  flex-wrap: wrap;
  gap: 1rem 3rem;
  justify-content: space-between;
  margin-bottom: 0.9rem;
}
.age-footer-row a { color: var(--age-primary-dark); }
.age-footer-note {
  max-width: 1080px;
  margin: 1rem auto 0;
  padding: 0 1.5rem;
  font-size: 0.84rem;
}

/* ---- Responsive ------------------------------------------------------------ */

@media (max-width: 860px) {
  .age-nav-actions { margin-left: 0; flex-basis: 100%; }
  .age-national-cards { grid-template-columns: 1fr; }
  .age-findings-grid { grid-template-columns: 1fr; }
  .age-attr-table td:first-child { width: 9rem; }
}
