/* ==========================================================================
   NODO diario.es — sistema visual
   Concepto: papel de prensa reciclado bajo luz fluorescente. La estructura
   la marca el eje cronológico (la "guía"), y la firma visual es el peine de
   corroboración: un trazo vertical por cada medio independiente.
   ========================================================================== */

/* --- Tipografías propias, sin CDN ----------------------------------------- */
@font-face {
  font-family: 'Newsreader';
  src: url('../assets/fonts/newsreader-latin-standard-normal.woff2') format('woff2-variations');
  font-weight: 200 800;
  font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA,
    U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+2074, U+20AC, U+2122, U+2191,
    U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Newsreader';
  src: url('../assets/fonts/newsreader-latin-ext-standard-normal.woff2') format('woff2-variations');
  font-weight: 200 800;
  font-display: swap;
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF,
    U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020,
    U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: 'Archivo';
  src: url('../assets/fonts/archivo-latin-standard-normal.woff2') format('woff2-variations');
  font-weight: 100 900;
  font-stretch: 62% 125%;
  font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA,
    U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+2074, U+20AC, U+2122, U+2191,
    U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Archivo';
  src: url('../assets/fonts/archivo-latin-ext-standard-normal.woff2') format('woff2-variations');
  font-weight: 100 900;
  font-stretch: 62% 125%;
  font-display: swap;
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF,
    U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020,
    U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

/* --- Fichas de color -----------------------------------------------------
   Muestreadas de la maqueta de portada: fondo casi negro con temple azulado,
   menta para la acción, arena para la opinión y el análisis. Los grises
   apagados del original se quedaban en 2,75 de contraste, así que conservan
   el tono pero suben hasta ser legibles. */
:root {
  --noche: #0f1821;
  --noche-hondo: #0a1118;
  --noche-alto: #1b242d;
  --noche-borde: #24303b;
  --tinta: #fcfdff;
  --tinta-suave: #93a0ae;
  --filo: #24303b;
  --menta: #3ccbad;
  --menta-hondo: #154d40;
  --arena: #e0c39a;
  --acero: #3ccbad;
  --acero-hondo: #2aa88e;
  --acero-lavado: rgba(60, 203, 173, 0.11);

  --solido: #3ccbad;
  --contraste: #e0c39a;
  --fino: #ef7b83;

  --measure: 63ch;
  --gutter: clamp(1.25rem, 4vw, 3rem);
  --spine-w: 5.5rem;

  --t-fast: 140ms cubic-bezier(0.32, 0.72, 0, 1);
  --t-slow: 420ms cubic-bezier(0.32, 0.72, 0, 1);

  color-scheme: dark;
}

:root {
  --paper: var(--noche);
  --paper-deep: var(--noche-hondo);
  --paper-raised: var(--noche-alto);
  --ink: var(--tinta);
  --ink-soft: var(--tinta-suave);
  --rule: var(--filo);
  --guide: var(--menta);
  --guide-wash: var(--acero-lavado);
}

@media (prefers-color-scheme: light) {
  :root {
    --noche: #e8ecef;
    --noche-hondo: #d6dce1;
    --noche-alto: #f4f6f8;
    --noche-borde: #c2ccd4;
    --tinta: #0f1821;
    --tinta-suave: #4a5866;
    --filo: #c2ccd4;
    --menta: #0d6b58;
    --menta-hondo: #c9e8df;
    --arena: #7a5a2a;
    --acero: #0d6b58;
    --acero-hondo: #0a5446;
    --acero-lavado: rgba(13, 107, 88, 0.1);
    --solido: #0d6b58;
    --contraste: #7a5a2a;
    --fino: #9e3628;
    color-scheme: light;
  }
}

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

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

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: 'Newsreader', Georgia, 'Times New Roman', serif;
  font-size: clamp(1rem, 0.94rem + 0.28vw, 1.135rem);
  line-height: 1.62;
  font-variant-numeric: oldstyle-nums;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

/* Textura muy leve de papel: ruido generado en CSS, sin imagen externa */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  opacity: 0.5;
  background-image:
    radial-gradient(circle at 1px 1px, rgba(255, 255, 255, 0.035) 1px, transparent 0),
    radial-gradient(ellipse 90% 60% at 50% 0%, rgba(60, 203, 173, 0.06), transparent 68%);
  background-size: 5px 5px, 100% 100%;
}
@media (prefers-color-scheme: light) {
  body::before {
    opacity: 0.55;
    background-image:
      radial-gradient(circle at 1px 1px, rgba(15, 24, 33, 0.05) 1px, transparent 0),
      radial-gradient(ellipse 90% 60% at 50% 0%, rgba(13, 107, 88, 0.07), transparent 68%);
  }
}

/* --- Tipografía ----------------------------------------------------------- */
h1, h2, h3, h4 {
  font-family: 'Archivo', 'Helvetica Neue', Arial, sans-serif;
  font-weight: 700;
  font-stretch: 86%;
  line-height: 1.02;
  letter-spacing: -0.018em;
  margin: 0 0 0.55em;
  text-wrap: balance;
}

h1 { font-size: clamp(2.6rem, 1.4rem + 5.4vw, 5.6rem); font-weight: 800; font-stretch: 78%; }
h2 { font-size: clamp(1.7rem, 1.25rem + 1.9vw, 2.9rem); }
h3 { font-size: clamp(1.18rem, 1.04rem + 0.6vw, 1.5rem); font-stretch: 92%; }

p { margin: 0 0 1.05em; max-width: var(--measure); }

a {
  color: var(--guide);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.18em;
  text-decoration-color: color-mix(in srgb, var(--guide) 42%, transparent);
  transition: text-decoration-color var(--t-fast);
}
a:hover { text-decoration-color: currentColor; }

:focus-visible {
  outline: 2.5px solid var(--guide);
  outline-offset: 3px;
  border-radius: 1px;
}

.lede {
  font-size: clamp(1.15rem, 1.03rem + 0.6vw, 1.45rem);
  line-height: 1.5;
  color: var(--ink-soft);
  max-width: 48ch;
}

.dato {
  font-family: 'Archivo', sans-serif;
  font-stretch: 70%;
  font-weight: 600;
  font-variant-numeric: tabular-nums lining-nums;
  letter-spacing: 0.01em;
}

.sr-solo {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0);
  white-space: nowrap; border: 0;
}

.saltar {
  position: absolute;
  left: var(--gutter); top: 0;
  transform: translateY(-140%);
  background: var(--ink);
  color: var(--paper);
  padding: 0.6rem 1rem;
  z-index: 60;
  font-family: 'Archivo', sans-serif;
  font-stretch: 80%;
  text-decoration: none;
  transition: transform var(--t-fast);
}
.saltar:focus { transform: translateY(0.5rem); }

/* --- Cabecera ------------------------------------------------------------- */
.barra {
  position: sticky;
  top: 0;
  z-index: 40;
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 1.5rem;
  align-items: center;
  justify-content: space-between;
  padding: 0.7rem var(--gutter);
  background: color-mix(in srgb, var(--paper) 88%, transparent);
  backdrop-filter: blur(14px) saturate(1.3);
  -webkit-backdrop-filter: blur(14px) saturate(1.3);
  border-bottom: 1px solid var(--rule);
}

.marca {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  text-decoration: none;
  color: inherit;
  font-family: 'Archivo', sans-serif;
  font-weight: 800;
  font-stretch: 74%;
  font-size: 1.22rem;
  letter-spacing: -0.02em;
}
.marca svg { display: block; flex: none; }
.marca-texto {
  display: inline-flex;
  align-items: baseline;
  gap: 0.34rem;
  letter-spacing: 0.015em;
}
.marca-texto b {
  font-weight: 400;
  font-stretch: 88%;
  font-size: 0.66em;
  letter-spacing: 0.005em;
  color: var(--ink-soft);
}

.menu {
  display: flex;
  flex-wrap: wrap;
  gap: 0.15rem;
  font-family: 'Archivo', sans-serif;
  font-stretch: 82%;
  font-size: 0.93rem;
  font-weight: 500;
}
.menu {
  font-stretch: 76%;
  font-size: 0.8rem;
  letter-spacing: 0.06em;
  gap: 0.1rem;
}
.menu a {
  color: var(--ink-soft);
  text-decoration: none;
  padding: 0.4rem 0.6rem;
  text-transform: uppercase;
  transition: color var(--t-fast);
}
.menu a::before { content: '['; opacity: 0.45; margin-right: 0.12em; }
.menu a::after { content: ']'; opacity: 0.45; margin-left: 0.12em; }
.menu a:hover { color: var(--ink); }
.menu a:hover::before, .menu a:hover::after { opacity: 0.8; color: var(--menta); }
.menu a[aria-current='page'] { color: var(--menta); }
.menu a[aria-current='page']::before,
.menu a[aria-current='page']::after { opacity: 1; }

/* --- Contenedores --------------------------------------------------------- */
.envoltorio {
  position: relative;
  z-index: 1;
  padding-inline: var(--gutter);
  max-width: 78rem;
  margin-inline: auto;
}

.seccion { padding-block: clamp(3rem, 7vw, 6rem); }
.seccion + .seccion { border-top: 1px solid var(--rule); }

.cabecera-seccion {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 2.2rem;
}

/* --- Nodo de corroboración (firma visual) ---------------------------------
   Es el mismo símbolo del logotipo puesto a trabajar: cada segmento del
   anillo es una redacción independiente, y el cuadro central se rellena
   cuando hay documento original. */
.nodo {
  display: inline-block;
  width: 1.35rem;
  height: 1.35rem;
  vertical-align: -0.3rem;
  flex: none;
}
.nodo .base { stroke: var(--rule); }
.nodo .vivo { stroke: var(--guide); }
.nodo .malla { fill: var(--rule); opacity: 0.55; }
.nodo .centro { fill: none; stroke: var(--guide); stroke-width: 1.4; }
.nodo[data-primaria='si'] .centro { fill: var(--guide); }
.nodo[data-nivel='solido'] .vivo { stroke: var(--solido); }
.nodo[data-nivel='contraste'] .vivo { stroke: var(--contraste); }
.nodo[data-nivel='fino'] .vivo { stroke: var(--fino); }

/* --- Medidor de verificación ---------------------------------------------- */
.estado {
  display: inline-flex;
  align-items: center;
  gap: 0.42rem;
  font-family: 'Archivo', sans-serif;
  font-stretch: 74%;
  font-weight: 650;
  font-size: 0.76rem;
  letter-spacing: 0.02em;
  padding: 0.2rem 0.5rem 0.2rem 0.32rem;
  border: 1px solid currentColor;
  border-radius: 999px;
  white-space: nowrap;
}
.estado::before {
  content: '';
  width: 0.62rem; height: 0.62rem;
  border-radius: 50%;
  background: currentColor;
  flex: none;
}
.estado[data-nivel='solido'] { color: var(--solido); }
.estado[data-nivel='contraste'] { color: var(--contraste); }
.estado[data-nivel='fino'] { color: var(--fino); }
/* Forma además de color, para daltonismo */
.estado[data-nivel='contraste']::before { border-radius: 2px; transform: rotate(45deg); }
.estado[data-nivel='fino']::before {
  border-radius: 0;
  clip-path: polygon(50% 0, 100% 100%, 0 100%);
}

/* --- Botones -------------------------------------------------------------- */
.boton {
  font-family: 'Archivo', sans-serif;
  font-stretch: 80%;
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--paper);
  background: var(--ink);
  border: 1px solid var(--ink);
  padding: 0.6rem 1.15rem;
  border-radius: 2px;
  cursor: pointer;
  transition: background var(--t-fast), color var(--t-fast), transform var(--t-fast);
}
.boton:hover { background: var(--guide); border-color: var(--guide); }
.boton:active { transform: translateY(1px); }
.boton[disabled] { opacity: 0.45; cursor: not-allowed; }

.boton-sec {
  background: transparent;
  color: var(--ink);
  border-color: var(--rule);
}
.boton-sec:hover { background: var(--guide-wash); color: var(--ink); border-color: var(--guide); }

.boton-sec[aria-pressed='true'] {
  background: var(--ink);
  color: var(--paper);
  border-color: var(--ink);
}

input[type='text'], input[type='url'], input[type='password'], input[type='number'], select, textarea {
  font-family: 'Archivo', sans-serif;
  font-stretch: 88%;
  font-size: 0.95rem;
  color: var(--ink);
  background: var(--paper-raised);
  border: 1px solid var(--rule);
  border-radius: 2px;
  padding: 0.55rem 0.7rem;
  width: 100%;
}
textarea { font-family: 'Newsreader', serif; font-size: 1rem; line-height: 1.5; resize: vertical; }
label {
  display: block;
  font-family: 'Archivo', sans-serif;
  font-stretch: 78%;
  font-weight: 600;
  font-size: 0.8rem;
  color: var(--ink-soft);
  margin-bottom: 0.3rem;
}

/* --- Pie ------------------------------------------------------------------ */
.pie {
  border-top: 1px solid var(--rule);
  padding-block: 2.6rem 3.4rem;
  color: var(--ink-soft);
  font-size: 0.92rem;
}
.pie a { color: var(--ink-soft); }
.pie-rejilla {
  display: grid;
  gap: 2rem;
  grid-template-columns: repeat(auto-fit, minmax(13rem, 1fr));
}

/* --- Utilidades ----------------------------------------------------------- */
.aviso {
  border-left: 3px solid var(--contraste);
  background: color-mix(in srgb, var(--contraste) 8%, transparent);
  padding: 0.85rem 1.1rem;
  margin-block: 1.4rem;
  font-size: 0.96rem;
}
.aviso p:last-child { margin-bottom: 0; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
}
