/* ===========================================================================
   Iris: reset y elementos

   Los resets van con :where() para que tengan especificidad 0. Un reset que
   pesa más que el componente que lo usa es una tarde perdida averiguando por
   qué una regla «no se aplica».
   ======================================================================== */

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

:where(body, h1, h2, h3, h4, p, figure, blockquote, dl, dd, ol, ul) {
  margin: 0;
}

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

html {
  /* overflow-x: clip, no hidden. `hidden` en el elemento raíz crea un contexto
     de scroll y rompe position: sticky en toda la página. */
  overflow-x: clip;
  -webkit-text-size-adjust: 100%;
}

body {
  overflow-x: clip;
  margin: 0;
  background: var(--color-fondo);
  color: var(--color-texto);
  font-family: var(--iris-body);
  font-size: var(--t-body);
  line-height: var(--leading-body);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

:where(h1, h2, h3, h4) {
  color: var(--color-titular);
  font-family: var(--iris-display);
  font-weight: var(--peso-titular);
  line-height: var(--leading-titular);
  letter-spacing: var(--tracking-titular);
  text-transform: uppercase;
  text-wrap: balance;
}

/*
 * TODOS LOS TITULARES EN LA FUENTE DE TÍTULOS Y EN CAJA ALTA. Es lo que dice
 * el manual de Big Noodle —«robusta y en mayúsculas», «exclusivamente para
 * títulos»— y lo que hacen las cuatro vistas: hasta el título de una tarjeta
 * va en ella. Bebas Neue, la provisional, ya es de caja alta, pero el
 * text-transform se queda: Big Noodle trae minúsculas.
 */
h1 { font-size: var(--t-h1); }
h2 { font-size: var(--t-h2); }
h3 { font-size: var(--t-h3); }
h4 { font-size: var(--t-h4); }

:where(p) {
  text-wrap: pretty;
}

:where(a) {
  color: var(--color-enlace);
  text-underline-offset: 0.18em;
}

:where(img, picture, svg, video) {
  display: block;
  max-inline-size: 100%;
}

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

/* El foco NUNCA se apaga, y es un anillo doble: el color del fondo por dentro
   y el azul de la brocha por fuera. El de dentro es lo que lo hace visible
   también sobre el amarillo y el negro de las tarjetas.
   Ninguna vista puede reemplazarlo por outline: none sin poner otra cosa. */
:where(a, button, input, select, textarea, summary, [tabindex]):focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px var(--color-fondo), 0 0 0 5px var(--color-foco);
  border-radius: var(--radio-s);
}

/* Área táctil mínima de 44 × 44 px. */
:where(a, button, [role='button'], summary):where([class*='iris-']) {
  min-block-size: var(--tactil);
}

/* Apagado TOTAL, no reducción, como en los hermanos. Y las dos cosas,
   transición Y animación: apagar solo las transiciones es la mitad del
   problema. */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    transition: none !important;
    animation: none !important;
    scroll-behavior: auto !important;
  }
}

/* Solo para lectores de pantalla. */
.iris-oculto {
  position: absolute;
  inline-size: 1px;
  block-size: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

/* Salto al contenido: visible en cuanto recibe el foco. */
.iris-saltar:focus {
  position: fixed;
  inset-block-start: var(--space-2);
  inset-inline-start: var(--space-2);
  z-index: var(--z-flotante);
  padding: var(--space-3) var(--space-5);
  background: var(--color-fondo);
  border-radius: var(--radio-s);
  box-shadow: var(--sombra-alta);
}

.iris-contenedor {
  inline-size: 100%;
  max-inline-size: var(--contenedor);
  margin-inline: auto;
  padding-inline: var(--canaleta);
}
