/* ==========================================================================
   Alcovar — base.css
   Reset, variables de diseño, tipografía y utilidades.
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. Variables
   -------------------------------------------------------------------------- */

:root {
  /* Marca */
  --azul:          #0b2a5b;
  --azul-oscuro:   #091b3a;
  --azul-claro:    #123a75;
  --rojo:          #e1121c;
  --rojo-claro:    #ff5a63;

  /* Texto */
  --tinta:         #14213d;
  --texto:         #4c596c;
  --texto-suave:   #5a6678;
  --texto-tenue:   #8d97a5;
  --sobre-azul:    #c6d1e1;
  --sobre-azul-2:  #9fb0c9;

  /* Superficies */
  --blanco:        #ffffff;
  --superficie:    #f6f8fa;
  --borde:         #e3e7ed;
  --borde-fuerte:  #dde3ea;
  --gris-footer:   #2b2e33;

  /* Tipografía */
  --fuente:        'Barlow', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --fuente-titulo: 'Barlow Condensed', 'Barlow', system-ui, sans-serif;

  /* Escala fluida */
  --t-h1:   clamp(2.375rem, 7.5vw,  5.125rem);
  --t-h2:   clamp(2rem,     4.6vw,  3.25rem);
  --t-h3:   clamp(1.5rem,   3.2vw,  2.125rem);
  --t-h4:   clamp(1.375rem, 2.4vw,  1.625rem);
  --t-lead: clamp(1rem,     1.7vw,  1.1875rem);
  --t-base: clamp(0.9375rem, 1.5vw, 1rem);
  --t-mini: 0.75rem;

  /* Ritmo */
  --gap:        clamp(1.5rem, 3vw, 2.5rem);
  --pad-seccion: clamp(3.5rem, 7vw, 6.5rem);
  --pad-lado:   clamp(1.25rem, 4vw, 2.5rem);
  --ancho-max:  90rem;   /* 1440px */
  --ancho-texto: 46rem;

  /* Otros */
  --alto-header: 4.75rem;
  --transicion: 0.18s ease;
  --sombra-menu: 0 18px 40px rgb(11 42 91 / 0.22);
}

/* --------------------------------------------------------------------------
   2. Reset
   -------------------------------------------------------------------------- */

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

* { margin: 0; }

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--alto-header) + 1rem);
}

body {
  font-family: var(--fuente);
  font-size: var(--t-base);
  line-height: 1.6;
  color: var(--tinta);
  background: var(--blanco);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

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

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

button { cursor: pointer; }

ul, ol { list-style: none; padding: 0; }

a { color: var(--azul); text-decoration: none; transition: color var(--transicion); }
a:hover { color: var(--rojo); }

/* --------------------------------------------------------------------------
   3. Tipografía
   -------------------------------------------------------------------------- */

h1, h2, h3, h4, h5, h6 {
  font-family: var(--fuente-titulo);
  font-weight: 700;
  line-height: 1.03;
  text-transform: uppercase;
  text-wrap: balance;
  color: var(--azul);
}

h1 { font-size: var(--t-h1); line-height: 0.96; }
h2 { font-size: var(--t-h2); }
h3 { font-size: var(--t-h3); }
h4 { font-size: var(--t-h4); }

p { text-wrap: pretty; }

.lead {
  font-size: var(--t-lead);
  line-height: 1.7;
  color: var(--texto);
  max-width: var(--ancho-texto);
}

/* --------------------------------------------------------------------------
   4. Accesibilidad
   -------------------------------------------------------------------------- */

/* Salto al contenido, visible solo con teclado */
.saltar {
  position: absolute;
  left: 0.5rem;
  top: -100%;
  z-index: 200;
  padding: 0.75rem 1.25rem;
  background: var(--rojo);
  color: var(--blanco);
  font-weight: 600;
  transition: top var(--transicion);
}
.saltar:focus { top: 0.5rem; color: var(--blanco); }

/* Anillo de foco consistente en todo el sitio */
:where(a, button, input, textarea, select, summary):focus-visible {
  outline: 3px solid var(--rojo);
  outline-offset: 2px;
  border-radius: 2px;
}

/* Texto solo para lectores de pantalla */
.visualmente-oculto {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

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

/* --------------------------------------------------------------------------
   5. Utilidades
   -------------------------------------------------------------------------- */

.contenedor {
  width: 100%;
  max-width: var(--ancho-max);
  margin-inline: auto;
  padding-inline: var(--pad-lado);
}

.seccion { padding-block: var(--pad-seccion); }

.seccion--superficie {
  background: var(--superficie);
  border-block: 1px solid var(--borde);
}

.seccion--azul { background: var(--azul); color: var(--blanco); }
.seccion--azul h2,
.seccion--azul h3 { color: var(--blanco); }

/* Antetítulo: línea roja + texto en versalitas */
.antetitulo {
  display: flex;
  align-items: center;
  gap: 0.625rem;
  margin-bottom: 1rem;
  font-size: var(--t-mini);
  font-weight: 600;
  letter-spacing: 0.24em;
  color: var(--rojo);
  text-transform: uppercase;
}
.antetitulo::before {
  content: "";
  width: 1.75rem;
  height: 3px;
  background: var(--rojo);
  flex: 0 0 auto;
}

/* Franja bicolor de 4px que abre la página */
.franja {
  height: 4px;
  display: grid;
  grid-template-columns: 1fr 1fr;
}
.franja span:first-child { background: var(--azul); }
.franja span:last-child  { background: var(--rojo); }
