/* Actas Abiertas — Umbral modo laboratorio (light).
   Tokens are the source of truth: assets/tokens.css. No hard-coded hexes.
   Spacing follows the 8px scale (tokens.json scale.unit = 8).

   Signal budget (brand §3 "one element per view", §9 never decorative):
   every use below marks identity, a match, or an active state — never decoration.
     · hero accent      — the one hero accent sanctioned by brand §8
     · search matches   — the finding itself
     · open session row — highlighted-row spec (umbral-engineering §3)
     · hover / focus    — component spec (umbral-engineering §3)
*/

* { box-sizing: border-box; margin: 0; }

html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  background: var(--u-base);
  color: var(--u-ink);
  font-family: var(--u-font-body);
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--u-ink); text-decoration-color: var(--u-baseline); text-underline-offset: 3px; }
a:hover { color: var(--u-signal); text-decoration-color: var(--u-signal); }
:focus-visible { outline: 2px solid var(--u-signal); outline-offset: 2px; }

.mono { font-family: var(--u-font-mono); font-variant-numeric: tabular-nums; }

h1, h2, h3 {
  font-family: var(--u-font-display);
  font-weight: var(--u-weight-display);   /* 500 — never 700 for display */
  letter-spacing: var(--u-tracking-display);
}

/* ── header ── clear space around the isotype = one bar-height (brand §5) ── */
.site-header {
  display: flex; align-items: center; justify-content: space-between;
  flex-wrap: wrap; gap: 16px;
  padding: 24px 32px;
  border-bottom: var(--u-rule) solid var(--u-border);
}
.brand { display: flex; align-items: center; gap: 16px; text-decoration: none; }
.brand img { display: block; }
.wordmark {
  font-family: var(--u-font-display); font-weight: 500; font-size: 24px;
  letter-spacing: var(--u-tracking-display);
}
.wordmark .underscore { color: var(--u-signal); }   /* per logo spec */
.site-header nav { display: flex; gap: 24px; font-size: 14px; }
.site-header nav a { text-decoration: none; padding: 8px 0; }
.site-header nav a:hover { box-shadow: inset 0 -2px 0 var(--u-signal); }

main { max-width: 880px; margin: 0 auto; padding: 0 24px 80px; }

/* ── hero ── headline ≤ 2 lines, one signal accent, one supporting sentence ── */
.hero { padding: 72px 0 40px; }
.kicker {
  font-family: var(--u-font-mono); font-size: 12px; letter-spacing: 0.04em;
  text-transform: uppercase; color: var(--u-caption);
  margin-bottom: 16px;
}
.hero h1 { font-size: clamp(40px, 5.5vw, 56px); line-height: 1.1; }
.hero .accent { color: var(--u-signal); display: block; }  /* deliberate 2-line hero */
.lede { max-width: 65ch; margin-top: 24px; color: var(--u-muted); font-size: 17px; }

/* ── stats — numbers carry the argument (brand §2; KPI spec engineering §3) ── */
.statrow {
  display: flex; flex-wrap: wrap; gap: 40px;
  margin-top: 40px; padding-top: 24px;
  border-top: var(--u-rule) solid var(--u-border);
}
.stat .stat-label {
  display: block;
  font-family: var(--u-font-mono); font-size: 12px; letter-spacing: 0.04em;
  text-transform: uppercase; color: var(--u-caption);
  margin-bottom: 8px;
}
.stat .stat-value {
  display: block;
  font-family: var(--u-font-display); font-weight: var(--u-weight-display);
  font-size: 32px; letter-spacing: var(--u-tracking-display);
  font-variant-numeric: tabular-nums;
  line-height: 1.1;
}

/* ── controls ── flat bordered controls, no pills (engineering §3) ── */
.controls { margin: 48px 0; }
.searchrow input[type="search"] {
  width: 100%;
  padding: 16px;
  font: 16px var(--u-font-body);
  color: var(--u-ink);
  background: var(--u-panel);
  border: var(--u-rule) solid var(--u-baseline);
  border-radius: var(--u-radius);
  -webkit-appearance: none; appearance: none;
}
.searchrow input::placeholder { color: var(--u-caption); }
.searchrow input:focus { border-color: var(--u-signal); outline: none; }
.filterrow {
  display: flex; flex-wrap: wrap; gap: 16px 24px; align-items: end;
  margin-top: 24px; font-size: 13px; color: var(--u-muted);
}
.filterrow label { display: flex; flex-direction: column; gap: 8px; }
.filterrow .field-label {
  font-family: var(--u-font-mono); font-size: 12px; letter-spacing: 0.04em;
  text-transform: uppercase; color: var(--u-caption);
}
.filterrow select, .filterrow input[type="date"] {
  min-height: 44px;                        /* touch target (engineering §4) */
  padding: 8px 12px;
  font: 14px var(--u-font-body);
  color: var(--u-ink);
  background: var(--u-panel);
  border: var(--u-rule) solid var(--u-border);
  border-radius: var(--u-radius);
}
.filterrow select:hover, .filterrow input[type="date"]:hover { border-color: var(--u-baseline); }
.btn-secondary {
  min-height: 44px;
  padding: 13px 26px;                      /* button spec */
  font: 500 14px var(--u-font-display);
  letter-spacing: var(--u-tracking-display);
  color: var(--u-ink);
  background: transparent;
  border: var(--u-rule) solid var(--u-baseline);
  border-radius: var(--u-radius);
  cursor: pointer;
}
.btn-secondary:hover { color: var(--u-signal); border-color: var(--u-signal); }

/* ── results ── */
.result-count { font-size: 12px; color: var(--u-caption); margin-bottom: 24px; }
.result-list { list-style: none; padding: 0; display: flex; flex-direction: column; gap: 16px; }
.result {
  background: var(--u-panel);
  border: var(--u-rule) solid var(--u-border);
  padding: 24px;                           /* card spec: 24–32px */
}
.result .meta {
  display: flex; flex-wrap: wrap; gap: 8px 24px; align-items: baseline;
  font-size: 12px; color: var(--u-muted); margin-bottom: 16px;
}
.result .meta .fecha { color: var(--u-ink); }
.result .texto { max-width: 65ch; text-wrap: pretty; }
/* Matches carry weight + underline as well as color — never color alone
   (engineering §4: non-color encoding). */
.result mark {
  background: transparent;
  color: var(--u-signal);
  font-weight: 600;
  text-decoration: underline;
  text-decoration-color: var(--u-signal);
  text-underline-offset: 3px;
}
.result .acta-link { font-size: 13px; margin-top: 16px; display: inline-block; }
.sin-resultados .nota { margin-top: 16px; color: var(--u-muted); font-size: 14px; }

/* ── Phase 2: plain-language summary + outcome ──
   The resumen sits under the point it explains. `sentido` is a mono label,
   monochrome so it never competes with the search-match signal; alert only for
   a rejection; caption italic when the acta records no result. */
.resumen {
  display: block;
  margin-top: 8px;
  color: var(--u-muted);
  font-size: 14px;
  max-width: 68ch;
  text-wrap: pretty;
}
.result .resumen { margin-top: 12px; }
.sentido {
  font-family: var(--u-font-mono);
  font-size: 11px; letter-spacing: 0.04em; text-transform: uppercase;
  color: var(--u-caption);
  white-space: nowrap;
}
.sentido::before { content: "· "; }
.sentido.sd-alert { color: var(--u-alert); }
.sentido.sd-open { text-transform: none; letter-spacing: 0; font-style: italic; }
.resumen-nota {
  margin: 8px 0 20px 160px;
  font-size: 12px; color: var(--u-caption); font-style: italic;
  max-width: 68ch;
}

/* ── Phase 2: full-content search over OCR text ── */
.fulltext { margin-top: 40px; }
.ft-btn {
  width: 100%;
  padding: 14px 16px;
  font: 500 14px var(--u-font-display);
  letter-spacing: var(--u-tracking-display);
  text-align: left;
  color: var(--u-ink);
  background: transparent;
  border: var(--u-rule) solid var(--u-baseline);
  border-radius: var(--u-radius);
  cursor: pointer;
}
.ft-btn:hover { color: var(--u-signal); border-color: var(--u-signal); }
.ft-intro {
  font-size: 12px; color: var(--u-caption);
  padding-top: 16px; margin-bottom: 16px;
  border-top: 2px solid var(--u-ink);
  max-width: 72ch; line-height: 1.5;
}
.ft-result .meta { color: var(--u-caption); }
.ft-snip { margin-top: 10px; padding-left: 12px; border-left: var(--u-rule) solid var(--u-border); }
.ft-snip:first-of-type { margin-top: 0; }

/* ── on-site acta detail: session brief + full OCR text ── */
.acta-detalle { margin-top: 16px; }
.acta-detalle > summary {
  cursor: pointer; list-style: none;
  font-size: 13px; color: var(--u-ink);
  text-decoration: underline; text-decoration-color: var(--u-baseline);
  text-underline-offset: 3px;
}
.acta-detalle > summary::-webkit-details-marker { display: none; }
.acta-detalle > summary:hover { color: var(--u-signal); text-decoration-color: var(--u-signal); }
.acta-detalle-body { margin-top: 14px; }
.detalle-brief {
  font-size: 15px; color: var(--u-ink); max-width: 68ch;
  padding-left: 12px; border-left: 2px solid var(--u-baseline);
  margin-bottom: 16px; text-wrap: pretty;
}
.ocr-text {
  white-space: pre-wrap;
  font-family: var(--u-font-mono); font-size: 12px; line-height: 1.5;
  color: var(--u-muted);
  max-height: 380px; overflow-y: auto;
  background: var(--u-base);
  border: var(--u-rule) solid var(--u-border);
  padding: 16px;
}
.ocr-text mark {
  background: transparent; color: var(--u-signal); font-weight: 600;
}
.detalle-nota {
  margin-top: 12px; font-size: 12px; color: var(--u-caption);
  font-style: italic; max-width: 68ch;
}

/* ── timeline ── table spec: 2px ink top rule, 1px row rules ── */
.year-group { border-top: 2px solid var(--u-ink); margin-top: 40px; }
.year-group > summary {
  cursor: pointer; list-style: none;
  display: flex; justify-content: space-between; align-items: baseline;
  gap: 16px; padding: 16px 0;
}
.year-group > summary::-webkit-details-marker { display: none; }
.year-group > summary h2 {
  font-size: 28px; font-variant-numeric: tabular-nums;
}
.year-group > summary .count {
  font-family: var(--u-font-mono); font-size: 12px; color: var(--u-caption);
}

.session { border-top: var(--u-rule) solid var(--u-border); }
.session > summary {
  cursor: pointer; list-style: none;
  display: grid;
  grid-template-columns: 112px 1fr auto;
  gap: 24px; align-items: baseline;
  min-height: 44px;
  padding: 16px 8px 16px 0;
  font-size: 14px;
}
.session > summary::-webkit-details-marker { display: none; }
.session .s-fecha {
  font-family: var(--u-font-mono); font-size: 13px;
  font-variant-numeric: tabular-nums; color: var(--u-muted);
}
.session .s-acta { color: var(--u-ink); }
.session .s-titulo { color: var(--u-muted); text-wrap: pretty; }
.session > summary:hover .s-titulo { color: var(--u-ink); }
.session .s-pdf { font-size: 13px; white-space: nowrap; }
/* Highlighted (open) row: panel fill + 4px left signal border — table spec.
   The rule marks the summary row only; carrying it down the whole expanded
   agenda would turn an active-state marker into decoration. */
.session[open] { background: var(--u-panel); }
.session[open] > summary {
  box-shadow: inset 4px 0 0 var(--u-signal);
  padding-left: 24px;
}
.session[open] .s-fecha, .session[open] .s-titulo { color: var(--u-ink); }

/* ── agenda items — the substance of the product ── */
.agenda {
  list-style: none;
  margin: 0;
  padding: 0 24px 32px 160px;
}
.agenda li {
  display: grid;
  grid-template-columns: 48px 1fr;
  gap: 16px;
  padding: 8px 0;
  border-top: var(--u-rule) solid var(--u-border);
  font-size: 15px;
  max-width: 72ch;
}
.agenda li:first-child { border-top: 0; }
.agenda .num {
  font-family: var(--u-font-mono); font-size: 12px;
  color: var(--u-caption); padding-top: 3px;
}
.agenda .texto { text-wrap: pretty; }
/* Procedural points (asistencia, quórum, clausura) step back so the
   substantive decisions read first. Hierarchy only — nothing is encoded
   by this alone; the full text is always present. */
.agenda li.proc .texto { color: var(--u-muted); }
.agenda .empty { color: var(--u-caption); }
.agenda .empty .texto { font-style: italic; }

/* ── data / method / footer ── */
.section { margin-top: 80px; border-top: 2px solid var(--u-ink); padding-top: 32px; }
.section h2 { font-size: 24px; margin-bottom: 16px; }   /* 22–26px */
/* Section number in signal-mono — the brand book's chapter-header signature. */
.section-num {
  font-family: var(--u-font-mono);
  font-weight: 400;
  font-size: 0.6em;
  color: var(--u-signal);
  margin-right: 12px;
  vertical-align: 0.15em;
  letter-spacing: 0;
}
.section p { max-width: 65ch; color: var(--u-muted); font-size: 15px; }
.section p + p { margin-top: 16px; }
.datalinks {
  display: flex; flex-wrap: wrap; gap: 24px;
  margin-top: 24px; font-size: 14px;
}
.snapshot {
  font-family: var(--u-font-mono); font-size: 12px; color: var(--u-caption);
  margin-top: 16px;
}
.site-footer {
  border-top: var(--u-rule) solid var(--u-border);
  margin-top: 80px;
  padding: 32px;
}
.site-footer p {
  font-family: var(--u-font-mono); font-size: 12px; color: var(--u-caption);
  max-width: 880px; margin: 0 auto;
}

@media (max-width: 720px) {
  .site-header { padding: 16px; }
  main { padding: 0 16px 64px; }
  .hero { padding: 48px 0 32px; }
  .statrow { gap: 24px 32px; }
  .session > summary { grid-template-columns: 1fr auto; gap: 8px 16px; }
  .session .s-fecha { grid-column: 1 / -1; }
  .agenda { padding-left: 24px; padding-right: 0; }
  .agenda li { grid-template-columns: 40px 1fr; gap: 8px; }
  .resumen-nota { margin-left: 24px; }
}

@media (prefers-reduced-motion: no-preference) {
  details[open] > *:not(summary) { animation: fadein 0.15s ease-out; }
  @keyframes fadein { from { opacity: 0; } to { opacity: 1; } }
}

/* ════════════════════════════════════════════════════════════════════════════
   Panel por administración (Fase 3 · L4) — site/panel.html

   Chart marks deliberately carry NO colour encoding. Umbral's muted gray and
   signal fail CVD separation as a categorical pair (ΔE 1.8 deutan, 8.5 normal —
   measured with the dataviz validator), so every chart here is single-series:
   identity comes from the row label plus the mono value, never from hue. The
   whole page spends its signal budget on one element — the reading-depth meter
   in §01 — because that figure is the condition for reading everything else.
   ════════════════════════════════════════════════════════════════════════════ */

.fig { margin: 32px 0 0; }
.fig-title {
  font-size: 22px; line-height: 1.25; max-width: 60ch;   /* 22–26px per brand */
}
.fig-sub {
  margin-top: 8px; max-width: 65ch;
  color: var(--u-muted); font-size: 15px;
}
.fig-body { margin-top: 24px; }
.fig-src {
  margin-top: 16px; padding-top: 8px;
  border-top: var(--u-rule) solid var(--u-border);
  font-size: 12px; color: var(--u-caption);
}

/* ── horizontal bars ── rounded data-end only, anchored to the baseline ── */
.barras { display: flex; flex-direction: column; gap: 8px; }
.barra-row {
  display: grid; grid-template-columns: minmax(120px, 22ch) 1fr minmax(64px, auto);
  align-items: center; gap: 16px;
}
.barra-lab { font-size: 14px; text-wrap: pretty; }
.barra-track {
  height: 18px;
  border-left: 2px solid var(--u-baseline);   /* the baseline the bars sit on */
  background: linear-gradient(var(--u-gridline), var(--u-gridline)) no-repeat;
  background-size: 100% var(--u-rule); background-position: 0 50%;
}
.barra-fill {
  height: 100%;
  background: var(--u-ink);
  border-radius: 0 2px 2px 0;                /* max 2px anywhere (brand §7) */
  min-width: 2px;
}
.barra-val { font-size: 13px; text-align: right; font-variant-numeric: tabular-nums; }

/* ── columns over time ── horizontal gridlines only, no vertical rules ── */
.cols { margin-top: 8px; }
.cols-grid {
  position: relative; height: 180px;
  border-bottom: 2px solid var(--u-baseline);
}
.cols-gridline {
  position: absolute; left: 0; right: 0; height: var(--u-rule);
  background: var(--u-gridline);
}
.cols-ytick {
  position: absolute; right: 100%; top: -0.6em; padding-right: 8px;
  font-size: 12px; color: var(--u-caption);
}
.cols-plot {
  position: absolute; inset: 0;
  display: flex; align-items: flex-end; gap: 2px;      /* 2px surface gap */
}
.col { flex: 1 1 0; height: 100%; display: flex; align-items: flex-end; position: relative; }
.col-fill {
  width: 100%; background: var(--u-ink);
  border-radius: 2px 2px 0 0; min-height: 2px;
}
.col-tick {
  position: absolute; top: 100%; left: 0; right: 0; padding-top: 8px;
  text-align: center; font-size: 11px; color: var(--u-caption);
}
.cols + * { margin-top: 32px; }

/* ── the reading-depth meters — the page's one signal element ── */
.medidores { display: flex; flex-direction: column; gap: 24px; }
.medidor { display: grid; grid-template-columns: 1fr minmax(56px, auto); gap: 4px 16px; }
.medidor-lab { font-size: 15px; }
.medidor-track {
  grid-column: 1; height: 12px; background: var(--u-gridline);
  border-left: 2px solid var(--u-baseline);
}
.medidor-fill { height: 100%; min-width: 2px; border-radius: 0 2px 2px 0; }
.medidor-fill.signal { background: var(--u-signal); }
.medidor-val {
  grid-row: 1 / 3; grid-column: 2; align-self: center;
  font-family: var(--u-font-display); font-weight: var(--u-weight-display);
  font-size: 28px; text-align: right; font-variant-numeric: tabular-nums;
}
.medidor-det { grid-column: 1; font-size: 13px; color: var(--u-caption); }

/* ── inline caveats — the size of what they qualify, never a footnote ── */
.nota {
  margin-top: 16px; max-width: 65ch;
  font-size: 14px; line-height: 1.55; color: var(--u-muted);
  padding-left: 16px; border-left: var(--u-rule) solid var(--u-border);
}
.nota-alert { border-left-color: var(--u-alert); }
.hallazgos { margin-top: 16px; max-width: 65ch; padding-left: 20px; }
.hallazgos li { font-size: 15px; margin-top: 8px; color: var(--u-ink); }

/* ── declared total ── */
.total-declarado {
  display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between;
  gap: 8px 24px; margin-top: 24px; padding-top: 16px;
  border-top: 2px solid var(--u-ink);
}
.total-lab { font-size: 14px; color: var(--u-muted); }
.total-val {
  font-family: var(--u-font-display); font-weight: var(--u-weight-display);
  font-size: 28px; letter-spacing: var(--u-tracking-display);
  font-variant-numeric: tabular-nums;
}

/* ── the table twin of every chart ── */
.datos { margin-top: 24px; }
.datos > summary {
  cursor: pointer; font-size: 13px; color: var(--u-muted);
  padding: 8px 0; list-style: none;
}
.datos > summary::-webkit-details-marker { display: none; }
.datos > summary::before { content: "+ "; font-family: var(--u-font-mono); }
.datos[open] > summary::before { content: "− "; }
.datos > summary:hover { color: var(--u-signal); }
.tabla { width: 100%; border-collapse: collapse; font-size: 14px; }
.tabla th, .tabla td {
  text-align: left; padding: 8px 16px 8px 0;
  border-bottom: var(--u-rule) solid var(--u-border);
}
.tabla th {
  font-family: var(--u-font-mono); font-size: 11px; letter-spacing: 0.04em;
  text-transform: uppercase; color: var(--u-caption); font-weight: 500;
  border-bottom-color: var(--u-ink);
}
.tabla .num { text-align: right; font-variant-numeric: tabular-nums; }

/* ── colonia lookup ── */
.col-buscador { margin-bottom: 24px; }
.col-buscador input {
  width: 100%; padding: 12px 16px;
  font: 15px var(--u-font-body); color: var(--u-ink);
  background: var(--u-panel);
  border: var(--u-rule) solid var(--u-border); border-radius: 0;
}
.col-buscador input:focus-visible { border-color: var(--u-signal); }
.colonia-list { list-style: none; padding: 0; }
.col-mas { margin-top: 16px; }
.colonia-item {
  display: flex; align-items: baseline; justify-content: space-between; gap: 16px;
  padding: 10px 0; border-bottom: var(--u-rule) solid var(--u-border);
}
.colonia-nombre { font-size: 15px; }
.colonia-n { font-size: 13px; color: var(--u-caption); white-space: nowrap; }
.colonia-vacio { padding: 16px 0; font-size: 14px; color: var(--u-muted); }

@media (max-width: 720px) {
  .barra-row { grid-template-columns: 1fr auto; gap: 4px 12px; }
  .barra-lab { grid-column: 1 / -1; }
  .fig-title { font-size: 20px; }
  .cols-grid { height: 140px; }
  .cols-ytick { position: static; padding: 0; }
  .tabla { display: block; overflow-x: auto; }
}
