/* ============================================================
   Onnix — Reset moderno / normalización base
   ============================================================ */

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

html {
    -webkit-text-size-adjust: 100%;
    scroll-behavior: smooth;
    /* Compensa el header fijo al saltar a un #ancla */
    scroll-padding-top: calc(var(--header-height) + 12px);
}

body {
    min-height: 100vh;
    font-family: var(--font-base);
    font-size: var(--fs-body);
    line-height: var(--lh-body);
    color: var(--color-text);
    background-color: var(--color-background);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
    overflow-x: hidden; /* §19.2 — sin scroll horizontal */
}

/* Bloqueo de scroll del body cuando el menú móvil está abierto (§10.6) */
body.is-menu-open {
    overflow: hidden;
}

h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-heading);
    font-weight: 700;
    line-height: var(--lh-heading);
    letter-spacing: -0.02em;
}

p {
    text-wrap: pretty;
}

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

ul, ol {
    list-style: none;
}

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

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

button {
    background: none;
    border: none;
    cursor: pointer;
}

/* Accesibilidad: foco visible por teclado (§21) */
:focus-visible {
    outline: 3px solid var(--color-accent);
    outline-offset: 3px;
    border-radius: 4px;
}

/* Sólo lectores de pantalla */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* Enlace de salto al contenido */
.skip-link {
    position: fixed;
    left: 50%;
    top: 0;
    transform: translate(-50%, -140%);
    z-index: calc(var(--z-menu) + 1);
    background: var(--color-primary);
    color: #fff;
    padding: 0.7rem 1.3rem;
    border-radius: var(--radius-pill);
    transition: transform var(--transition-base);
}

.skip-link:focus-visible {
    transform: translate(-50%, 12px);
}

/* Respeto a la reducción de movimiento (§20) */
@media (prefers-reduced-motion: reduce) {
    html {
        scroll-behavior: auto;
    }

    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        scroll-behavior: auto !important;
        transition-duration: 0.01ms !important;
    }
}
