/* ==========================================================================
   Black Versions: design tokens (concepto Cartel)
   Todo color, tipo y espacio del sitio sale de aquí.
   ========================================================================== */

:root {
  color-scheme: light;

  /* Marca */
  --black: #000000;
  --white: #ffffff;
  --orange: #ff6a00;

  /* Categorías: siempre como relleno con texto negro, o como texto sobre negro */
  --cat-noticias: #ff6a00;
  --cat-politica: #ffe500;
  --cat-deportes: #00e08a;
  --cat-espectaculos: #ff2e88;
  --cat-horoscopo: #b18cff;
  --cat-peru: #ff4d4d;
  --cat-mundo: #2dd4e8;
  --cat-economia: #c6f135;
  --cat-tecnologia: #7aa7ff;

  /* Tema claro */
  --bg: #ffffff;
  --surface: #f2f2f2;
  --text: #000000;
  --muted: #55595e;
  --rule: #000000;
  --rule-soft: #d8d8d8;
  --band: #000000;
  --band-raised: #1c1c1c;
  --focus: #000000;
  --ad-line: #a9a9a9;

  /* Tipografía */
  --font-display: "Archivo", "Archivo Texto", Arial, sans-serif;
  --font-headline: "Archivo", "Archivo Titular", Arial, sans-serif;
  --font-read: "Literata", "Literata Respaldo", Georgia, serif;

  --fs-hero: clamp(2.5rem, 2rem + 2vw, 3.75rem);
  --fs-article: clamp(2.5rem, 1.85rem + 2.9vw, 4.5rem);
  --fs-section: clamp(1.875rem, 1.6rem + 1.2vw, 2.75rem);
  --fs-page: clamp(3rem, 2.3rem + 3.2vw, 5.5rem);
  --fs-lead: clamp(1.875rem, 1.6rem + 1.1vw, 2.5rem);
  --fs-card: clamp(1.25rem, 1.18rem + 0.3vw, 1.5rem);
  --fs-row: 1.1875rem;
  --fs-ui: 1rem;
  --fs-meta: 0.8125rem;
  --fs-body: clamp(1.125rem, 1.09rem + 0.15vw, 1.1875rem);

  /* Espaciado: base 4 px */
  --s-1: 0.25rem;
  --s-2: 0.5rem;
  --s-3: 0.75rem;
  --s-4: 1rem;
  --s-5: 1.5rem;
  --s-6: 2rem;
  --s-7: 3rem;
  --s-8: 4rem;
  --s-9: 6rem;

  /* Layout */
  --gutter: 1rem;
  --wrap: 85rem;
  --wrap-article: 64rem;
  --measure: 33em;

  /* Movimiento */
  --ease: cubic-bezier(0.2, 0.7, 0.2, 1);
  --dur: 160ms;
  --dur-slow: 260ms;
}

@media (min-width: 48rem) {
  :root { --gutter: 2rem; }
}

/* Tema oscuro: se repite a propósito para respetar sistema y selector manual */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --bg: #000000;
    --surface: #171717;
    --text: #f4f4f4;
    --muted: #b0b4b9;
    --rule: #ffffff;
    --rule-soft: #333333;
    --band: #1c1c1c;
    --band-raised: #2e2e2e;
    --focus: #ff6a00;
    --ad-line: #5a5a5a;
  }
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #000000;
  --surface: #171717;
  --text: #f4f4f4;
  --muted: #b0b4b9;
  --rule: #ffffff;
  --rule-soft: #333333;
  --band: #1c1c1c;
  --band-raised: #2e2e2e;
  --focus: #ff6a00;
  --ad-line: #5a5a5a;
}

/* Bloques negros: hero, Horóscopo, Lo más leído.
   En modo oscuro suben a gris muy oscuro para seguir separados de la página.
   Los componentes dentro heredan estos valores sin reglas especiales. */
.on-black {
  --bg: var(--band);
  --surface: var(--band-raised);
  --text: #ffffff;
  --muted: #b0b4b9;
  --rule: #ffffff;
  --rule-soft: #333333;
  --focus: #ff6a00;
  background-color: var(--bg);
  color: var(--text);
}

/* Cada componente toma su color con --cat */
.cat-noticias { --cat: var(--cat-noticias); }
.cat-politica { --cat: var(--cat-politica); }
.cat-deportes { --cat: var(--cat-deportes); }
.cat-espectaculos { --cat: var(--cat-espectaculos); }
.cat-horoscopo { --cat: var(--cat-horoscopo); }
.cat-peru { --cat: var(--cat-peru); }
.cat-mundo { --cat: var(--cat-mundo); }
.cat-economia { --cat: var(--cat-economia); }
.cat-tecnologia { --cat: var(--cat-tecnologia); }
