/* Letra Chica PY · css/style.css · prototipo local
 *
 * (a) La decisión que ningún template produce por defecto:
 *     el salto de 96px entre la nota y el Expediente (.expediente → margin-top: var(--e-96))
 *     es el espacio vertical más grande del sitio, y el Expediente numera sus apartados en
 *     el margen, colgados a la izquierda del filete (.expediente > h3 .num), como un anexo legal.
 *     La portada numera igual los pilares y los pasos del método (.numerada .num, dentro de la media query).
 * (b) El elemento editorial que se usa como gramática visual: la bifurcación.
 *     La nota se compone en Source Serif 4 (.nota > p) y el Expediente en IBM Plex Mono
 *     (.expediente > :not(summary)). Una cita legal dentro de la nota también va en mono
 *     (.cita): la ley se reconoce por su letra antes de leerla. El ámbar es un solo párrafo
 *     (.ambar) y el signo es el único gráfico (.signo).
 * (c) Los defaults de framework eliminados: radios, sombras, cards con fondo propio, hero
 *     centrado, botones de llamada a la acción, iconos de librería, modo oscuro, animaciones
 *     decorativas (quedan tres reglas con transición de border-color de 150 ms:
 *     .entrada__titular a; .lista__titular a, .filtros a; y .expediente > summary), el triángulo del <details> (list-style: none y
 *     summary::-webkit-details-marker) y los bullets por defecto (.nota > ul li::before, .ficha).
 *     herramientas/barrido.js cuenta lo que se puede contar: border-radius, box-shadow,
 *     transform, prefers-color-scheme, <img> y <script>.
 */

/* ── Tipografías: archivos en /fuentes/, provistos por el Director desde Google Fonts ── */
@font-face { font-family: "Source Serif 4"; src: url("/fuentes/SourceSerif4-VariableFont_opsz,wght.ttf") format("truetype"); font-weight: 200 900; font-style: normal; font-display: swap; }
@font-face { font-family: "Source Serif 4"; src: url("/fuentes/SourceSerif4-Italic-VariableFont_opsz,wght.ttf") format("truetype"); font-weight: 200 900; font-style: italic; font-display: swap; }
@font-face { font-family: "Archivo"; src: url("/fuentes/Archivo-VariableFont_wdth,wght.ttf") format("truetype"); font-weight: 100 900; font-style: normal; font-display: swap; }
@font-face { font-family: "IBM Plex Mono"; src: url("/fuentes/IBMPlexMono-Regular.ttf") format("truetype"); font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: "IBM Plex Mono"; src: url("/fuentes/IBMPlexMono-Italic.ttf") format("truetype"); font-weight: 400; font-style: italic; font-display: swap; }
@font-face { font-family: "IBM Plex Mono"; src: url("/fuentes/IBMPlexMono-SemiBold.ttf") format("truetype"); font-weight: 600; font-style: normal; font-display: swap; }
@font-face { font-family: "IBM Plex Mono"; src: url("/fuentes/IBMPlexMono-SemiBoldItalic.ttf") format("truetype"); font-weight: 600; font-style: italic; font-display: swap; }

/* ── Tokens: los únicos colores y medidas del archivo ── */
:root {
  --azul: #0B3B5E;
  --tostado: #B87F14;
  --ambar-texto: #8A5A0E;
  --papel: #F3F1EA;
  --gris: #7E8890;
  --gris-texto: #5A636B;

  /* escala de espaciado: 4 8 12 16 24 32 48 64 96 128 (px con raíz de 16px) */
  --e-4: 0.25rem; --e-8: 0.5rem; --e-12: 0.75rem; --e-16: 1rem; --e-24: 1.5rem;
  --e-32: 2rem; --e-48: 3rem; --e-64: 4rem; --e-96: 6rem; --e-128: 8rem;

  /* filetes */
  --f-1: 1px; --f-2: 2px; --f-3: 3px;

  --col: 40rem;
  --serif: "Source Serif 4", Georgia, serif;
  --sans: "Archivo", "Helvetica Neue", Arial, sans-serif;
  --mono: "IBM Plex Mono", Menlo, Consolas, monospace;

  /* tamaños, móvil: 13 · 17 · 23 · 30 · 30 · mono 14 */
  --t-chico: 0.8125rem;
  --t-cuerpo: 1.0625rem;
  --t-medio: 1.4375rem;
  --t-titular: 1.875rem;
  --t-display: 1.875rem;
  --t-mono: 0.875rem;
  --interlineado: 1.65;
}

/* ── Base: Archivo por defecto (regla 1: lo que no tiene rol se resuelve en Archivo) ── */
*, *::before, *::after { box-sizing: border-box; }
html { background: var(--papel); color: var(--azul); -webkit-text-size-adjust: 100%; }
body { margin: 0; font-family: var(--sans); font-size: var(--t-cuerpo); line-height: var(--interlineado); }
a { color: var(--azul); text-decoration-thickness: var(--f-1); text-underline-offset: 0.18em; }
:focus-visible { outline: var(--f-2) solid var(--azul); outline-offset: var(--e-4); }
::selection { background: var(--azul); color: var(--papel); }
.vh { position: absolute; width: var(--f-1); height: var(--f-1); overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.sep, .flecha, .fecha, .cifra, .num, code { font-family: var(--mono); }

/* ── Columna ── */
.cabecera, .contenido, .pie {
  max-width: calc(var(--col) + 2 * var(--e-16));
  margin-inline: auto;
  padding-inline: var(--e-16);
}

/* ── Cabecera: una línea de texto ── */
.nav { border-bottom: var(--f-1) solid var(--gris); display: flex; flex-wrap: wrap; align-items: center; gap: var(--e-8) var(--e-16); padding-block: var(--e-16); font-size: var(--t-chico); }
.firma + .sep { display: none; }
.firma { flex-basis: 100%; display: inline-flex; align-items: center; gap: var(--e-12); color: var(--azul); text-decoration: none; text-transform: uppercase; letter-spacing: 0.18em; font-weight: 650; }
.firma__py { color: var(--ambar-texto); font-size: 0.8em; font-weight: 500; letter-spacing: 0.24em; }
.contenido { padding-top: var(--e-64); }

/* ── El signo (manual, planchas II-IV): acento en el brazo superior ── */
.signo { display: block; flex: none; }
.signo__acento { stroke: var(--tostado); }
.signo__brazos { stroke: var(--azul); }
.signo--firma { width: 1.25rem; height: 1.25rem; }
.signo--sumario { width: 1rem; height: 1rem; margin-top: var(--e-4); }
.signo--sumario .signo__acento { stroke: var(--azul); } /* versión 02, monocromo */

/* ── Metadatos y etiquetas ── */
.meta { margin: 0; font-size: var(--t-chico); }
.pilar, .etiqueta { text-transform: uppercase; letter-spacing: 0.12em; font-weight: 600; }
.etiqueta { margin: 0 0 var(--e-12); font-size: var(--t-chico); }

/* ── Portada ── */
.tesis { margin: 0; }
.tesis p { margin: 0; max-width: var(--col); font-family: var(--serif); font-style: italic; font-size: var(--t-display); line-height: 1.2; font-weight: 400; }
.declaracion { margin: var(--e-24) 0 0; font-size: var(--t-chico); letter-spacing: 0.02em; }
.edicion { margin: 0 0 var(--e-16); font-size: var(--t-chico); letter-spacing: 0.02em; }
.portada__bloque { margin-top: var(--e-64); }
.portada__bloque--lista { margin-top: var(--e-48); }
.portada__archivo { margin: var(--e-16) 0 0; font-size: var(--t-chico); }

/* ── Lista de notas anteriores: solo texto, un filete por renglón ── */
.lista { margin: 0; padding: 0; list-style: none; border-top: var(--f-1) solid var(--azul); }
.lista li { padding-block: var(--e-12); border-bottom: var(--f-1) solid var(--gris); }
.lista__titular { margin: var(--e-4) 0 0; font-weight: 600; line-height: 1.3; }
.lista__titular a, .filtros a { text-decoration: none; border-bottom: var(--f-1) solid var(--papel); transition: border-color 150ms; }
.lista__titular a:hover, .lista__titular a:focus-visible, .filtros a:hover, .filtros a[aria-current] { border-bottom-color: var(--azul); }

/* ── Listas numeradas de la portada (pilares y pasos): número en mono, colgado en el margen en escritorio ── */
.numerada { margin: 0; padding: 0; list-style: none; border-top: var(--f-1) solid var(--azul); }
.numerada li { position: relative; padding-block: var(--e-12); border-bottom: var(--f-1) solid var(--gris); }
.numerada p { margin: 0; }
.numerada .num { margin-right: var(--e-8); }
.numerada__nombre { font-weight: 650; }
.numerada__desc { margin-top: var(--e-4); font-family: var(--serif); }
.numerada__pie { margin-top: var(--e-4); font-size: var(--t-chico); }
.numerada--pasos .numerada__cab { line-height: 1.5; }

/* ── Archivo: conteo, filtros por pilar (una página por filtro) y entradas ── */
.conteo { margin: 0; font-size: var(--t-chico); }
.filtros { display: flex; flex-wrap: wrap; gap: var(--e-8) var(--e-24); margin: var(--e-16) 0 var(--e-32); padding: 0; list-style: none; font-size: var(--t-chico); }
.filtros a[aria-current] { font-weight: 650; }
.archivo .entrada + .entrada { margin-top: var(--e-32); }

/* ── Entrada de gaceta: filete, titular, bajada, metadatos. Sin contenedor. ── */
.entrada { border-top: var(--f-1) solid var(--azul); padding-top: var(--e-12); }
.entrada__titular { margin: var(--e-8) 0 0; font-size: var(--t-medio); line-height: 1.2; font-weight: 650; }
.entrada__titular a { text-decoration: none; border-bottom: var(--f-1) solid var(--papel); transition: border-color 150ms; }
.entrada:hover .entrada__titular a, .entrada__titular a:focus-visible { border-bottom-color: var(--azul); }
.entrada__bajada { margin: var(--e-8) 0 0; font-family: var(--serif); }
.entrada__accion { margin: var(--e-12) 0 0; font-size: var(--t-chico); }

/* ── Cabecera de la nota y de las páginas ── */
.nota__cabecera, .pagina__cabecera { margin-bottom: var(--e-48); }
.alcance { margin: var(--e-24) 0 0; padding-top: var(--e-12); border-top: var(--f-1) solid var(--gris); font-size: var(--t-chico); line-height: 1.5; }
.nota__salida { margin: var(--e-48) 0 0; font-size: var(--t-chico); }
.titular { margin: var(--e-8) 0 0; font-size: var(--t-titular); line-height: 1.15; font-weight: 650; }
.bajada { margin: var(--e-12) 0 0; font-family: var(--serif); font-size: var(--t-medio); line-height: 1.35; }

/* ── La nota (bloques 1-5): Source Serif 4 ── */
.nota > p, .nota > ul { margin: 0; font-family: var(--serif); }
.nota > p + p, .nota > p + ul, .nota > ul + p { margin-top: var(--e-16); }
.nota > h2 { margin: var(--e-32) 0 var(--e-8); font-size: var(--t-chico); text-transform: uppercase; letter-spacing: 0.12em; font-weight: 600; line-height: 1.5; }
.nota > ul { padding: 0; list-style: none; }
.nota > ul li { position: relative; padding-left: var(--e-24); }
.nota > ul li + li { margin-top: var(--e-12); }
.nota > ul li::before { content: "·"; position: absolute; left: var(--e-4); font-family: var(--mono); }
.nota code, .cita { font-size: 0.875em; }
.cita { font-family: var(--mono); font-style: normal; }

/* ── El ámbar: uno solo, en el bloque 3 ── */
.nota > p.ambar { margin-block: var(--e-24); padding-left: var(--e-16); border-left: var(--f-3) solid var(--tostado); background: var(--papel); color: var(--ambar-texto); font-weight: 600; }

/* ── El Expediente: forma visual, no acordeón ── */
.expediente { margin-top: var(--e-96); }
.expediente > * { margin: 0 0 0 var(--e-32); }               /* móvil: canal para los números */
.expediente > summary {
  display: flex; gap: var(--e-8);
  padding: var(--e-16) 0 var(--e-16) var(--e-24);
  border-left: var(--f-2) solid var(--papel);
  list-style: none; cursor: pointer;
  font-size: var(--t-chico); line-height: var(--e-24); text-transform: uppercase; letter-spacing: 0.08em; font-weight: 600;
  transition: border-color 150ms;
}
.expediente > summary::-webkit-details-marker { display: none; }
.expediente[open] > summary { border-left-color: var(--azul); }
.expediente > :not(summary) {
  padding-left: var(--e-24);
  border-left: var(--f-2) solid var(--azul);
  font-family: var(--mono); font-size: var(--t-mono); line-height: 1.6;
}
.expediente > :not(summary) + :not(summary) { padding-top: var(--e-16); }
.expediente > :not(summary) + h3 { padding-top: var(--e-48); }   /* entre apartados 6.x: 48 */
.expediente > summary + h3 { padding-top: var(--e-24); }
.expediente > h3 { position: relative; font-size: var(--t-mono); font-weight: 600; letter-spacing: 0.04em; }
.expediente > h3 .num { position: absolute; right: calc(100% + var(--f-2) + var(--e-8)); text-decoration: none; }
.expediente > h3 .num:hover, .expediente > h3 .num:focus-visible { text-decoration: underline; }
.expediente > .indice { list-style: none; padding-top: var(--e-8); }
.indice li + li { margin-top: var(--e-4); }
.indice a { text-decoration: none; }
.indice a:hover, .indice a:focus-visible { text-decoration: underline; }
.expediente > :last-child { padding-bottom: var(--e-24); }
.expediente p.descargo { color: var(--gris-texto); background: var(--papel); }
.expediente blockquote > p { margin: 0; padding-left: var(--e-16); border-left: var(--f-1) solid var(--gris); }
.expediente blockquote > p + p { padding-top: var(--e-8); }
.expediente pre { white-space: pre-wrap; overflow-wrap: anywhere; }
.expediente code { font-size: inherit; }
.expediente strong { font-weight: 600; }

/* ── Cómo verificamos: ficha en Archivo, numeración en mono ── */
.pagina > h2 { margin: var(--e-48) 0 var(--e-12); font-size: var(--t-chico); text-transform: uppercase; letter-spacing: 0.12em; font-weight: 600; line-height: 1.5; }
.ficha__intro { margin: var(--e-12) 0 0; }
.ficha { margin: var(--e-16) 0 0; padding: 0; list-style: none; counter-reset: ficha; }
.ficha > li { position: relative; padding-left: var(--e-48); }
.ficha > li + li { margin-top: var(--e-12); }
ol.ficha > li { counter-increment: ficha; }
ol.ficha > li::before { content: counter(ficha); position: absolute; left: 0; font-family: var(--mono); }
.ficha--lista > li::before { content: "·"; position: absolute; left: 0; font-family: var(--mono); }
.ficha--catalogo .num { position: absolute; left: 0; }
.ficha__titulo { font-weight: 600; }

/* ── Pie ── */
.pie { margin-top: var(--e-64); padding-bottom: var(--e-32); }
.pie p { margin: 0; font-size: var(--t-chico); }
.pie__nav { padding-top: var(--e-16); border-top: var(--f-1) solid var(--gris); }
.pie__descargo { margin-top: var(--e-12); color: var(--gris-texto); }
.pie__nota { margin-top: var(--e-4); }

/* ── Escritorio: la única media query ── */
@media (min-width: 48em) {
  :root {
    --t-chico: 0.9375rem;   /* 15 */
    --t-cuerpo: 1.25rem;    /* 20 */
    --t-medio: 1.6875rem;   /* 27 */
    --t-titular: 2.25rem;   /* 36 */
    --t-display: 2.9375rem; /* 47 */
    --t-mono: 1rem;         /* 16 */
    --interlineado: 1.7;
  }
  .signo--firma { width: 1.5rem; height: 1.5rem; }
  .firma { flex-basis: auto; }
  .firma + .sep { display: inline; }
  .numerada .num { position: absolute; right: calc(100% + var(--e-16)); margin-right: 0; }
  .expediente > * { margin-left: 0; }   /* los números cuelgan en el margen de la página */
}
