/* ============================================================
   site.css — design tokens, reset, base
   Orden de carga (en Master.cshtml):
   1) site.css   ← este archivo (tokens + reset)
   2) layout.css
   3) components.css
   4) sections.css
   5) animations.css
   6) responsive.css
   ============================================================ */

/* Inter variable font self-hosted (subset latin, todos los pesos en 47KB).
   Elimina el render-blocking de fonts.googleapis.com. */
@font-face {
    font-family: 'Inter';
    font-style: normal;
    font-weight: 100 900;
    font-display: swap;
    src: url('/fonts/inter-var-latin.woff2') format('woff2-variations'),
         url('/fonts/inter-var-latin.woff2') format('woff2');
}

:root {
    /* ---- Colores (paleta del logo) ---- */
    --color-primary: #BD1924;
    --color-primary-dark: #9A151E;
    --color-secondary: #071F43;
    --color-secondary-light: #0E2E5C;
    --color-white: #FFFFFF;
    --color-gray-50: #F9FAFB;
    --color-gray-100: #F5F5F5;
    --color-gray-200: #E5E7EB;
    --color-gray-400: #9CA3AF;
    --color-gray-600: #6B7280;
    --color-gray-800: #1F2937;
    --color-gray-900: #111827;

    /* ---- Tipografía ---- */
    --font-heading: 'Inter', system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
    --font-body: 'Inter', system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
    --fs-h1: clamp(2.5rem, 5vw + 1rem, 4rem);
    --fs-h2: clamp(2rem, 3vw + 1rem, 3rem);
    --fs-h3: clamp(1.5rem, 2vw + 0.75rem, 2rem);
    --fs-body: 1rem;
    --fs-small: 0.875rem;
    --lh-tight: 1.2;
    --lh-base: 1.6;

    /* ---- Espaciado ---- */
    --section-padding: 80px;
    --section-padding-lg: 120px;
    --container-max: 1280px;
    --container-padding: 24px;

    /* ---- Bordes ---- */
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;

    /* ---- Sombras (tintadas con secondary) ---- */
    --shadow-sm: 0 1px 2px rgba(7, 31, 67, 0.05);
    --shadow-md: 0 4px 6px rgba(7, 31, 67, 0.1);
    --shadow-lg: 0 10px 15px rgba(7, 31, 67, 0.15);

    /* ---- Transiciones ---- */
    --transition-fast: 150ms ease;
    --transition-base: 300ms ease-in-out;
}

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

* {
    margin: 0;
}

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

body {
    font-family: var(--font-body);
    font-size: var(--fs-body);
    line-height: var(--lh-base);
    color: var(--color-secondary);
    background: var(--color-white);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

main {
    flex: 1 0 auto;
}

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

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

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

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

h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-heading);
    line-height: var(--lh-tight);
    color: var(--color-secondary);
    font-weight: 700;
}

h1 { font-size: var(--fs-h1); }
h2 { font-size: var(--fs-h2); }
h3 { font-size: var(--fs-h3); }

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

a:hover {
    color: var(--color-primary-dark);
}

/* ---- Accesibilidad: focus visible ---- */
:focus-visible {
    outline: 2px solid var(--color-primary);
    outline-offset: 2px;
    border-radius: 2px;
}

/* Outline blanco sobre fondos oscuros — el rojo no llega a 3:1 contra el azul. */
.site-footer :focus-visible,
.hero :focus-visible,
.section--dark :focus-visible,
.skip-link:focus-visible,
.skip-link:focus {
    outline-color: var(--color-white);
}

/* ---- Skip link (se usa en Master.cshtml) ---- */
.skip-link {
    position: absolute;
    top: -100px;
    left: 0;
    background: var(--color-secondary);
    color: var(--color-white);
    padding: 12px 16px;
    z-index: 1000;
    transition: top var(--transition-base);
}

.skip-link:focus {
    top: 0;
    color: var(--color-white);
}
