/**
 * RADIO UNaF — BASE
 * Reset moderno + tipografía institucional + accesibilidad de foco.
 */

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

* { margin: 0; }

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  /* El header fijo no debe tapar el destino de un ancla. */
  scroll-padding-top: 6rem;
}

body {
  font-family: var(--font-text);
  font-size: var(--step-0);
  font-weight: var(--weight-regular);
  line-height: var(--leading-relaxed);
  color: var(--text);
  background-color: var(--surface);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  /* Nunca desbordar en horizontal, en ningún ancho. */
  overflow-x: hidden;
}

img, picture, video, canvas, svg {
  display: block;
  max-width: 100%;
  height: auto;
}

/*
 * El atributo hidden tiene que ocultar. Siempre.
 *
 * Los navegadores lo aplican con la regla `[hidden] { display: none }` de su
 * hoja por defecto, que tiene la especificidad más baja posible. Basta con
 * que un componente declare `display: grid` o `display: flex` en su clase
 * para pisarla sin darse cuenta: el elemento sigue con hidden puesto, el
 * JavaScript cree que está oculto, y en pantalla se ve igual.
 *
 * Pasó exactamente eso con las celdas de la grilla y con la barra de
 * podcasts. Esta línea lo cierra de raíz para todo el tema.
 */
[hidden] { display: none !important; }

input, button, textarea, select { font: inherit; color: inherit; }

p, h1, h2, h3, h4, h5, h6 { overflow-wrap: break-word; }

ul[class], ol[class] { list-style: none; padding: 0; }

a { color: inherit; text-decoration: none; }

/* ==========================================================================
   TIPOGRAFÍA
   ========================================================================== */

.display,
h1, h2, h3 {
  font-family: var(--font-display);
  font-weight: var(--weight-black);
  font-stretch: 108%;
  font-variation-settings: 'wdth' var(--width-display);
  line-height: var(--leading-tight);
  letter-spacing: var(--tracking-display);
  text-transform: uppercase;
  /* «UNaF» lleva la a minúscula. Ver .brand-unaf. */
}

h4, h5, h6 {
  font-family: var(--font-display);
  font-weight: var(--weight-bold);
  line-height: var(--leading-snug);
  letter-spacing: -0.01em;
}

/* La grafía institucional es «UNaF», con la a minúscula. Cualquier título en
   caja alta que contenga la marca debe envolverla en este span para que el
   text-transform no la «corrija» a UNAF. */
.brand-unaf { text-transform: none; }

/* Metadato técnico: la voz de la consola. Frecuencia, señal, horario,
   duración, categoría. Siempre monoespaciada y espaciada. */
.meta {
  font-family: var(--font-mono);
  font-size: var(--step--2);
  font-weight: var(--weight-medium);
  line-height: 1.4;
  letter-spacing: var(--tracking-mono);
  text-transform: uppercase;
  font-variant-numeric: tabular-nums;
}

.lede {
  font-size: var(--step-1);
  line-height: var(--leading-normal);
  color: var(--text-muted);
  font-weight: var(--weight-regular);
}

/* ==========================================================================
   ACCESIBILIDAD
   ========================================================================== */

/* Un solo anillo de foco en todo el sitio, siempre visible sobre cualquier
   fondo gracias al doble trazo. */
:focus-visible {
  outline: 3px solid var(--focus-ring);
  outline-offset: 2px;
  border-radius: 1px;
}
:focus:not(:focus-visible) { outline: none; }

.screen-reader-text,
.visually-hidden {
  position: absolute !important;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

/* Salto al contenido: aparece solo al tabular. */
.skip-link {
  position: absolute;
  top: 0; left: 50%;
  transform: translate(-50%, -120%);
  z-index: var(--z-modal);
  padding: var(--space-3) var(--space-5);
  background: var(--action);
  color: var(--brand-on-red);
  font-family: var(--font-mono);
  font-size: var(--step--2);
  letter-spacing: var(--tracking-mono);
  text-transform: uppercase;
  transition: transform var(--duration) var(--ease-out);
}
.skip-link:focus { transform: translate(-50%, 0); }

/* Respetar la preferencia del sistema. Institucional antes que animado. */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* ==========================================================================
   SELECCIÓN
   ========================================================================== */
::selection { background: var(--action); color: var(--brand-on-red); }
