/*
 * Base de todas las páginas: caja, tipografía y fondo, con los tokens de tokens.css.
 * Tomada de avena.io-ingredient (styles/site.css). Se carga después de tokens.css y antes de los
 * componentes.
 */

/*
 * Figtree autohospedada (skill rule-frontend, regla 5): la fuente variable de avena.io-ingredient, convertida
 * a WOFF2 (28 KB). Un solo archivo da todos los pesos de 300 a 900. Licencia SIL Open Font License 1.1, que
 * va dentro del archivo. layoutHtml() la precarga.
 */
@font-face {
    font-family: Figtree;
    font-style: normal;
    font-weight: 300 900;
    font-display: swap;
    src: url('../fonts/figtree-variable.woff2') format('woff2');
}

/*
 * Figtree de Google Fonts (v9), la que cargan en producción plantillas, recetas y especialistas: sus letras
 * miden un poco distinto que las de la fuente de arriba y los textos se parten en otras líneas. Autohospedada
 * (regla 5 de rule-frontend) en sus dos subconjuntos, con los mismos unicode-range de Google; solo la usan las
 * páginas con "typography" => "landing". De 400 a 800, los pesos que pide producción: un 900 se dibuja con el 800,
 * como allá. Licencia: fonts/OFL-figtree.txt.
 */
@font-face {
    font-family: 'Figtree Landing';
    font-style: normal;
    font-weight: 400 800;
    font-display: swap;
    src: url('../fonts/figtree-landing-latin-ext.woff2') format('woff2');
    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-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

@font-face {
    font-family: 'Figtree Landing';
    font-style: normal;
    font-weight: 400 800;
    font-display: swap;
    src: url('../fonts/figtree-landing-latin.woff2') format('woff2');
    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+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

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

html,
body {
    font-family: var(--font-family);
    font-size: var(--font-size);
    line-height: var(--line-height);
    letter-spacing: var(--letter-spacing);
    color: var(--fg);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;

    /* Sin rebote elástico al llegar arriba o abajo: el nav fijo no se jala con la página. También quita el
       "jalar para recargar" del teléfono; recargar sigue disponible en el navegador. */
    overscroll-behavior-y: none;
}

body {
    margin: 0;
    background: var(--bg);
    overflow-x: hidden;
}

/* layoutHtml() con "typography" => "landing": la fuente y la base de la landing, como en producción. El tracking
   (-2 %) se vuelve a calcular sobre 16 px porque se declara en em */
.type-landing,
.type-landing body {
    font-family: var(--font-family-landing);
    font-size: var(--font-size-landing);
    line-height: var(--line-height-landing);
}

img,
svg,
video {
    max-width: 100%;
    height: auto;
}

/* Foco visible en todo lo interactivo (skill rule-frontend, accesibilidad) */
:focus-visible {
    outline: 2px solid var(--primary-ring);
    outline-offset: 2px;
}

/* Oculta visualmente pero deja el texto para lectores de pantalla */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip-path: inset(50%);
    white-space: nowrap;
    border: 0;
}

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