/* =========================================================
   GMI — Reset, tipografía base, contenedor y utilidades
   ========================================================= */

/* --- Reset ------------------------------------------------ */
*, *::before, *::after { box-sizing: border-box; }

html {
    scroll-behavior: smooth;
    /* Evita que el header fijo tape el destino de los enlaces ancla. */
    scroll-padding-top: calc(var(--header-h) + var(--sp-4));
    -webkit-text-size-adjust: 100%;
}

body {
    margin: 0;
    font-family: var(--font-sans);
    font-size: var(--fs-base);
    line-height: var(--lh-normal);
    color: var(--text);
    background: var(--bg);
    overflow-x: hidden;
}

h1, h2, h3, h4 {
    margin: 0 0 var(--sp-3);
    color: var(--gmi-navy);
    font-weight: var(--fw-bold);
    line-height: var(--lh-tight);
    text-wrap: balance;
}

h1 { font-size: var(--fs-3xl); }
h2 { font-size: var(--fs-2xl); }
h3 { font-size: var(--fs-lg); }
h4 { font-size: var(--fs-md); }

p { margin: 0 0 var(--sp-4); }
p:last-child { margin-bottom: 0; }

a { color: var(--gmi-blue); text-decoration: none; transition: color var(--dur-fast) var(--ease); }
a:hover { color: var(--gmi-navy); text-decoration: underline; }

img, svg, video { max-width: 100%; height: auto; display: block; }

ul, ol { margin: 0 0 var(--sp-4); padding-left: var(--sp-5); }
li { margin-bottom: var(--sp-2); }

hr { border: 0; border-top: 1px solid var(--border); margin: var(--sp-6) 0; }

/* --- Foco visible ----------------------------------------- */
:focus-visible {
    outline: 3px solid var(--gmi-blue);
    outline-offset: 2px;
    border-radius: var(--radius-sm);
}

/* --- Accesibilidad ---------------------------------------- */
.skip-link {
    position: absolute;
    left: var(--sp-4);
    top: -100px;
    z-index: var(--z-modal);
    padding: var(--sp-3) var(--sp-5);
    background: var(--gmi-navy);
    color: var(--text-invert);
    border-radius: 0 0 var(--radius) var(--radius);
    font-weight: var(--fw-semibold);
    transition: top var(--dur) var(--ease);
}
.skip-link:focus { top: 0; color: var(--text-invert); text-decoration: none; }

.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;
}

/* --- Contenedor ------------------------------------------- */
.container {
    width: 100%;
    max-width: var(--container);
    margin-inline: auto;
    padding-inline: var(--container-pad);
}
.container--narrow { max-width: 860px; }

/* --- Secciones -------------------------------------------- */
.section { padding-block: var(--sp-8); }
.section--tight { padding-block: var(--sp-7); }
.section--alt   { background: var(--bg-alt); }
.section--navy  { background: var(--gmi-navy); color: var(--text-invert); }
/* Los encabezados son navy por defecto: sobre fondo navy hay que invertirlos
   todos, o quedan invisibles. */
.section--navy :is(h1, h2, h3, h4) { color: var(--text-invert); }

.section-head {
    max-width: 720px;
    margin: 0 auto var(--sp-7);
    text-align: center;
}
.section-head p {
    color: var(--text-muted);
    font-size: var(--fs-md);
    margin-bottom: 0;
}
.section--navy .section-head p { color: rgba(255, 255, 255, .82); }

.section-eyebrow {
    display: inline-block;
    margin-bottom: var(--sp-3);
    color: var(--gmi-red);
    font-size: var(--fs-sm);
    font-weight: var(--fw-bold);
    letter-spacing: .09em;
    text-transform: uppercase;
}
.section--navy .section-eyebrow { color: #FF8FA0; }

/* --- Grid ------------------------------------------------- */
.grid { display: grid; gap: var(--sp-5); }
.grid--2 { grid-template-columns: repeat(2, 1fr); }
.grid--3 { grid-template-columns: repeat(3, 1fr); }
.grid--4 { grid-template-columns: repeat(4, 1fr); }

@media (max-width: 992px) {
    .grid--3, .grid--4 { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 640px) {
    .grid--2, .grid--3, .grid--4 { grid-template-columns: 1fr; }
}

/* --- Utilidades ------------------------------------------- */
.text-center { text-align: center; }
.text-muted  { color: var(--text-muted); }
.text-sm     { font-size: var(--fs-sm); }
.text-lg     { font-size: var(--fs-md); }
.fw-semibold { font-weight: var(--fw-semibold); }
.fw-bold     { font-weight: var(--fw-bold); }

.stack       { display: flex; flex-direction: column; gap: var(--sp-4); }
.cluster     { display: flex; flex-wrap: wrap; gap: var(--sp-3); align-items: center; }
.cluster--center { justify-content: center; }

.mt-0 { margin-top: 0; }
.mb-0 { margin-bottom: 0; }
.mb-4 { margin-bottom: var(--sp-4); }
.mb-5 { margin-bottom: var(--sp-5); }
.mb-6 { margin-bottom: var(--sp-6); }

/* No fijan display en escritorio: así respetan el del componente al que
   se aplican (inline-flex, grid, etc.) en lugar de aplastarlo. */
.only-mobile { display: none !important; }

@media (max-width: 768px) {
    .hide-mobile { display: none !important; }
    .only-mobile { display: revert !important; }
}

/* --- Animación de entrada --------------------------------- */
/* Se activa con JS añadiendo .is-visible; sin JS el contenido
   permanece visible porque .reveal solo aplica si <html> tiene .js */
.js .reveal {
    opacity: 0;
    transform: translateY(18px);
    transition: opacity var(--dur-slow) var(--ease), transform var(--dur-slow) var(--ease);
}
.js .reveal.is-visible { opacity: 1; transform: none; }
.js .reveal--delay-1 { transition-delay: .08s; }
.js .reveal--delay-2 { transition-delay: .16s; }
.js .reveal--delay-3 { transition-delay: .24s; }
