/* ==========================================================================
   BASE — Reset, elementos base y utilidades globales
   ========================================================================== */

/* ── Reset moderno ── */
*,
*::before,
*::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    -webkit-text-size-adjust: 100%;
}

body {
    font-family: var(--font-family);
    font-size: var(--font-size-base);
    color: var(--color-dark);
    background-color: var(--color-bg);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

a {
    text-decoration: none;
    color: inherit;
    transition: color var(--transition-fast);
}

ul, ol {
    list-style: none;
}

button {
    font-family: inherit;
    cursor: pointer;
    border: none;
    background: none;
}

input, textarea, select {
    font-family: inherit;
    font-size: inherit;
}

/* ── Focus visible accesible ── */
:focus-visible {
    outline: 2px solid var(--color-primary);
    outline-offset: 2px;
}

/* ── Selección de texto ── */
::selection {
    background-color: var(--color-primary);
    color: var(--color-bg);
}

/* ── Skip-link de accesibilidad ── */
.skip-link {
    position: absolute;
    top: -100%;
    left: var(--space-lg);
    background: var(--color-dark);
    color: var(--color-bg);
    padding: var(--space-md) var(--space-lg);
    border-radius: var(--radius-sm);
    font-weight: var(--fw-semibold);
    z-index: calc(var(--z-overlay) + 1);
    transition: top var(--transition-fast);
}

.skip-link:focus {
    top: var(--space-lg);
}

/* ── Contenedor ── */
.container {
    max-width: var(--container-max-width);
    margin: 0 auto;
    padding: 0 var(--container-padding);
}

/* ── Visualmente oculto pero accesible para screen readers ── */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border-width: 0;
}
