/* =========================================================
   CEV · Construcciones Valdivielso — base.css
   1 fuentes · 2 variables · 3 reset · 4 base · 5 utilidades
   Los componentes y las secciones están en estilos.css.
   Decisiones: diseno.md (paleta §2, tipografía §3, espaciado §4).
   ========================================================= */

/* ---------- 1. Fuentes alojadas aquí (no Google Fonts: no se cede la IP) ---------- */
@font-face { font-family: "Oswald"; font-style: normal; font-weight: 500; font-display: swap; src: url("../fonts/oswald-500.woff2") format("woff2"); }
@font-face { font-family: "Oswald"; font-style: normal; font-weight: 600; font-display: swap; src: url("../fonts/oswald-600.woff2") format("woff2"); }
@font-face { font-family: "Oswald"; font-style: normal; font-weight: 700; font-display: swap; src: url("../fonts/oswald-700.woff2") format("woff2"); }
@font-face { font-family: "Barlow"; font-style: normal; font-weight: 400; font-display: swap; src: url("../fonts/barlow-400.woff2") format("woff2"); }
@font-face { font-family: "Barlow"; font-style: normal; font-weight: 500; font-display: swap; src: url("../fonts/barlow-500.woff2") format("woff2"); }
@font-face { font-family: "Barlow"; font-style: normal; font-weight: 600; font-display: swap; src: url("../fonts/barlow-600.woff2") format("woff2"); }

/* ---------- 2. Variables ---------- */
:root {
  /* Color. El amarillo NUNCA va como texto sobre blanco (1,9:1). */
  --c-marca: #F7B512;          /* fondos de botón y detalles sobre oscuro */
  --c-marca-hover: #E0A20A;
  --c-marca-activo: #C98F05;
  --c-oscuro: #1A181D;         /* casi negro CEV */
  --c-oscuro-2: #242229;       /* tarjeta sobre oscuro */
  --c-oscuro-3: #34313A;       /* líneas sobre oscuro */
  --c-pie: #121114;
  --c-fondo: #FFFFFF;          /* nunca crema */
  --c-fondo-alt: #F2F2F3;      /* gris frío */
  --c-texto: #1A181D;          /* 17,6:1 sobre blanco */
  --c-texto-suave: #55525A;    /* 7,7:1 sobre blanco */
  --c-texto-medio: #3F3C44;    /* 9,7:1 sobre #F2F2F3 */
  --c-texto-inv: #FFFFFF;
  --c-texto-inv-suave: #B8B5BE;/* 8,7:1 sobre oscuro, 9,3:1 sobre pie */
  --c-borde: #DEDDE1;
  --c-whatsapp: #25D366;       /* solo el icono */
  --foto-filtro: saturate(.9) contrast(1.04); /* mismo tratamiento a todas las fotos viejas */

  /* Tipografía */
  --f-titulos: "Oswald", "Arial Narrow", sans-serif;
  --f-texto: "Barlow", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  --t-h1: clamp(2.5rem, 1.6rem + 4.2vw, 4.75rem);       /* 40 → 76 px */
  --t-h2: clamp(1.875rem, 1.45rem + 1.5vw, 2.75rem);    /* 30 → 44 px: no compite con el h1 */
  --t-h3: clamp(1.25rem, 1.1rem + 0.6vw, 1.5rem);       /* 20 → 24 px */
  --t-entrada: clamp(1.125rem, 1.05rem + 0.35vw, 1.3125rem); /* 18 → 21 px */
  --t-base: 1.0625rem;                                  /* 17 px */
  --t-boton: 1rem;                                      /* 16 px */
  --t-peq: 0.875rem;                                    /* 14 px, nunca menos */

  /* Espacio (de 4 en 4) */
  --e-1: 4px;  --e-2: 8px;  --e-3: 12px; --e-4: 16px; --e-5: 24px;
  --e-6: 32px; --e-7: 48px; --e-8: 64px; --e-9: 96px; --e-10: 128px;
  --seccion-y: clamp(64px, 5vw + 40px, 112px);
  --margen-x: 16px;
  --ancho-max: 1200px;

  /* Forma: NADA de píldoras */
  --radio: 4px;
  --radio-foto: 2px;
  --alto-boton: 52px;
  --alto-cabecera: 64px;

  /* Movimiento */
  --curva: cubic-bezier(.2, .7, .2, 1);
}
@media (min-width: 600px)  { :root { --margen-x: 32px; } }
@media (min-width: 1024px) { :root { --margen-x: 48px; --alto-cabecera: 76px; } }

/* ---------- 3. Reset ---------- */
*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; }
html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--alto-cabecera) + 16px);
}
body { min-height: 100vh; min-height: 100dvh; -webkit-font-smoothing: antialiased; }
img, picture, svg, video { display: block; max-width: 100%; }
img { height: auto; }
input, button, textarea, select { font: inherit; color: inherit; }
button { cursor: pointer; background: none; border: 0; padding: 0; }
p, h1, h2, h3, h4 { overflow-wrap: break-word; }
ul[role="list"], ol[role="list"] { list-style: none; padding: 0; }
address { font-style: normal; }

/* ---------- 4. Base ---------- */
body {
  background: var(--c-fondo);
  color: var(--c-texto);
  font-family: var(--f-texto);
  font-size: var(--t-base);
  line-height: 1.6;
  overflow-x: hidden;
}
h1, h2 {
  font-family: var(--f-titulos);
  font-weight: 600;
  text-transform: uppercase;
  text-wrap: balance;
}
h1 { font-size: var(--t-h1); line-height: 1.02; letter-spacing: 0.005em; max-width: 18ch; }
h2 { font-size: var(--t-h2); line-height: 1.05; letter-spacing: 0.01em; max-width: 22ch; }
h3 { font-family: var(--f-titulos); font-weight: 500; font-size: var(--t-h3); line-height: 1.2; text-wrap: balance; }
p { text-wrap: pretty; }
a { color: inherit; text-underline-offset: 0.2em; }

/* Foco: oscuro en secciones claras, amarillo en las oscuras */
:focus:not(:focus-visible) { outline: none; }
:focus-visible { outline: 3px solid var(--c-oscuro); outline-offset: 3px; }
.sobre-oscuro :focus-visible, .portada :focus-visible, .cabecera :focus-visible, .pie :focus-visible,
.visor :focus-visible, .barra-contacto :focus-visible { outline-color: var(--c-marca); }

/* ---------- 5. Utilidades ---------- */
.contenedor {
  width: 100%;
  max-width: calc(var(--ancho-max) + 2 * var(--margen-x));
  margin-inline: auto;
  padding-inline: var(--margen-x);
}
.visualmente-oculto {
  position: absolute !important;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0);
  white-space: nowrap; border: 0;
}
.saltar {
  position: absolute;
  left: var(--margen-x);
  top: -100px;
  z-index: 100;
  padding: var(--e-3) var(--e-4);
  background: var(--c-marca);
  color: var(--c-oscuro);
  font-weight: 600;
  border-radius: var(--radio);
}
.saltar:focus-visible { top: var(--e-2); }
.icono { width: 20px; height: 20px; flex: none; }

@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;
    scroll-behavior: auto !important;
  }
}
