/* ==========================================================================
   ARCHIVO:   css/1-base.css
   PARTE:     Base del diseño
   CONTIENE:  fuentes, variables de color y tamaño, estilos base, utilidades,
              huecos para imágenes, botones y notas
   LO USAN:   todas las páginas
   ORDEN:     se enlaza primero
   ========================================================================== */

/* ---------- Fuentes (alojadas en el sitio; licencia SIL Open Font, ver assets/fuentes) ---------- */
@font-face {
  font-family: "Plus Jakarta Sans";
  src: url("../assets/fuentes/jakarta-latin-wght.woff") format("woff");
  font-weight: 200 800;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Inter";
  src: url("../assets/fuentes/inter-latin-wght.woff") format("woff");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

/* ---------- Variables ----------
   La paleta sale del logotipo de la Cámara: blanco, azul marino del anillo,
   azul de la bandera de Honduras y rojo de la bandera de California.

   Hay dos zonas:
   · ZONA CLARA (toda la página): fondo blanco, tinta marino.
   · ZONA NOCHE (aviso de beta, cabecera con su menú desplegable, pie y aviso
     de cookies): el azul marino original, con texto claro.

   Para cambiar un color del sitio se cambia aquí, en un solo lugar. */
:root {
  /* --- Colores del logotipo (no cambian entre zonas) --- */
  --blanco: #ffffff;
  --marino-900: #040b1f;
  --marino-800: #08142f;
  --marino-700: #0e2047;
  --marino-600: #17306a;
  --marino-tinta: #0a1a3d;
  --hn-azul: #2a9bc4;
  --hn-azul-profundo: #0a6788;
  --hn-turquesa: #3dd6f5;
  --ca-rojo: #c8102e;
  --ca-rojo-profundo: #a50d26;
  --oso: #7d5016;

  /* --- ZONA CLARA: papel de cada color --- */
  --fondo: #f3f6fb;
  --panel: var(--blanco);
  --panel-alto: #e6ecf5;
  --panel-realce: #d6dfee;
  --tinta: var(--marino-tinta);
  --tinta-suave: #44547a;
  /* Azul de Honduras: uno para adornos y otro, más oscuro, para texto y enlaces */
  --azul: var(--hn-azul);
  --azul-tinta: var(--hn-azul-profundo);
  /* Rojo de California: la acción principal y los marcadores del mapa */
  --rojo: var(--ca-rojo);
  --rojo-realce: var(--ca-rojo-profundo);
  --sobre-rojo: var(--blanco);
  /* Lo que está elegido o activado: chips, casillas, idioma */
  --seleccion: var(--marino-tinta);
  --sobre-seleccion: var(--blanco);
  /* Avisos: datos pendientes y fichas de ejemplo (el café del oso del logotipo) */
  --aviso: var(--oso);
  --aviso-tinte: rgba(125, 80, 22, 0.1);
  --error: #b3122a;
  --error-tinte: rgba(179, 18, 42, 0.06);
  --exito: #0f6b45;
  --exito-tinte: rgba(15, 107, 69, 0.07);
  /* Líneas */
  --linea: rgba(10, 26, 61, 0.14);
  --linea-fuerte: rgba(10, 26, 61, 0.34);
  --borde-campo: #66769a;
  --rejilla: rgba(10, 26, 61, 0.035);
  --rayas: rgba(10, 26, 61, 0.05);
  --sombra: rgba(10, 26, 61, 0.18);
  /* Mapa */
  --mapa-fondo: var(--blanco);
  --mapa-estado: #e3eaf4;
  --mapa-estado-linea: #6f81a6;
  --mapa-estado-activo: #a9d3e6;
  --mapa-estado-realce: #8cc6de;
  --mapa-estado-elegido: #6fbbd9;

  --fuente-titulo: "Plus Jakarta Sans", "Segoe UI", system-ui, -apple-system, sans-serif;
  --fuente-texto: "Inter", "Segoe UI", system-ui, -apple-system, sans-serif;

  /* Escala tipográfica (más contenida desde v0.23) */
  --paso--1: 0.8125rem;
  --paso-0: 0.96875rem;
  --paso-1: 1.125rem;
  --paso-2: clamp(1.2rem, 1.05rem + 0.6vw, 1.45rem);
  --paso-3: clamp(1.45rem, 1.15rem + 1.2vw, 2rem);
  --paso-4: clamp(1.8rem, 1.2rem + 2.4vw, 2.85rem);

  --espacio-seccion: clamp(3.5rem, 2rem + 6vw, 7rem);
  --bisel: 18px;
  --radio: 6px;
  --cabecera-alto: 4.5rem;

  /* Curvas de movimiento: salida rápida para la interfaz */
  --salida: cubic-bezier(0.23, 1, 0.32, 1);
  --entrada-salida: cubic-bezier(0.77, 0, 0.175, 1);
}

/* ---------- ZONA NOCHE ----------
   Estas partes conservan el azul marino: dentro de ellas, las mismas variables
   toman sus valores oscuros. Para oscurecer otra parte basta con ponerle la
   clase "zona-noche" en el HTML. */
.zona-noche,
.aviso-beta,
.cabecera,
.pie,
.aviso-cookies {
  --fondo: var(--marino-900);
  --panel: var(--marino-800);
  --panel-alto: var(--marino-700);
  --panel-realce: var(--marino-600);
  --tinta: #ecf3ff;
  --tinta-suave: #a8b9d9;
  --azul: var(--hn-turquesa);
  --azul-tinta: var(--hn-turquesa);
  --rojo: #d81e3a;
  --rojo-realce: #b8152f;
  --seleccion: var(--hn-turquesa);
  --sobre-seleccion: var(--marino-900);
  --aviso: #ffc83d;
  --aviso-tinte: rgba(255, 200, 61, 0.14);
  --error: #ff9c9c;
  --exito: #7be0b0;
  --linea: rgba(150, 190, 255, 0.18);
  --linea-fuerte: rgba(150, 190, 255, 0.4);
  --borde-campo: #6f86b5;
  --rayas: rgba(150, 190, 255, 0.07);
  --sombra: rgba(0, 0, 0, 0.45);
  color: var(--tinta);
  color-scheme: dark;
}

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

html {
  color-scheme: light;
  -webkit-text-size-adjust: 100%;
  -webkit-tap-highlight-color: transparent;
  scroll-padding-top: calc(var(--cabecera-alto) + 1rem);
}

body {
  margin: 0;
  min-height: 100svh;
  font-family: var(--fuente-texto);
  font-size: var(--paso-0);
  font-weight: 400;
  line-height: 1.6;
  color: var(--tinta);
  background-color: var(--fondo);
  background-image:
    linear-gradient(var(--rejilla) 1px, transparent 1px),
    linear-gradient(90deg, var(--rejilla) 1px, transparent 1px);
  background-size: 72px 72px;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

h1,
h2,
h3,
h4 {
  margin: 0;
  font-family: var(--fuente-titulo);
  font-weight: 650;
  line-height: 1.18;
  letter-spacing: -0.012em;
  word-spacing: 0.06em;
  text-wrap: balance;
}

h1 {
  font-size: var(--paso-4);
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: -0.02em;
}
h2 {
  font-size: var(--paso-3);
}
h3 {
  font-size: var(--paso-1);
  letter-spacing: -0.01em;
}

p,
ul,
ol,
dl,
figure {
  margin: 0;
}
p {
  text-wrap: pretty;
}

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

a {
  color: var(--azul-tinta);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.2em;
}
@media (hover: hover) and (pointer: fine) {
  a:hover {
    color: var(--tinta);
  }
}

button,
input,
select,
textarea {
  font: inherit;
  color: inherit;
}
button,
a,
[role="button"] {
  touch-action: manipulation;
}

:focus {
  outline: none;
}
:focus-visible {
  outline: 3px solid var(--azul-tinta);
  outline-offset: 3px;
  border-radius: 2px;
}

::selection {
  background: var(--seleccion);
  color: var(--sobre-seleccion);
}

[hidden] {
  display: none !important;
}

/* ---------- Utilidades ---------- */
.contenedor {
  width: 100%;
  max-width: 76rem;
  margin-inline: auto;
  padding-inline: clamp(1rem, 0.4rem + 3vw, 2.5rem);
}

.oculto {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

.saltar {
  position: absolute;
  left: 1rem;
  top: -5rem;
  z-index: 100;
  padding: 0.75rem 1rem;
  background: var(--rojo);
  color: var(--sobre-rojo);
  font-weight: 600;
  text-decoration: none;
}
.saltar:focus {
  top: 1rem;
}

.pendiente {
  padding: 0 0.3em;
  background: var(--aviso-tinte);
  color: var(--aviso);
  border-bottom: 1px dashed var(--aviso);
}

/* Panel con una esquina biselada: una capa dibuja la línea y otra el fondo */
.bisel {
  position: relative;
  isolation: isolate;
}
.bisel::before,
.bisel::after {
  content: "";
  position: absolute;
  z-index: -1;
  pointer-events: none;
}
.bisel::before {
  inset: 0;
  background: var(--linea-fuerte);
  clip-path: polygon(0 0, calc(100% - var(--bisel)) 0, 100% var(--bisel), 100% 100%, 0 100%);
  transition: background-color 180ms var(--salida);
}
.bisel::after {
  inset: 1px;
  background: var(--panel);
  clip-path: polygon(0 0, calc(100% - var(--bisel) + 0.4px) 0, 100% calc(var(--bisel) - 0.4px), 100% 100%, 0 100%);
}

/* ---------- Huecos para imágenes ----------
   Espacio reservado para un logo o una foto que todavía no se ha colocado.
   Desaparece solo cuando se escribe la ruta de la imagen
   (ver documentacion/03-imagenes-y-logos.md). */
.hueco {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.3rem;
  width: 100%;
  height: 100%;
  padding: 0.75rem;
  text-align: center;
  color: var(--tinta-suave);
  background:
    repeating-linear-gradient(135deg, var(--rayas) 0 10px, transparent 10px 20px),
    var(--panel-alto);
  border: 1px dashed var(--linea-fuerte);
}
.hueco svg {
  width: 1.75rem;
  height: 1.75rem;
  color: var(--azul-tinta);
}
.hueco__titulo {
  font-size: 0.92rem;
  font-weight: 500;
  color: var(--tinta);
}
.hueco__medida {
  font-size: 0.82rem;
}
.hueco--logo {
  flex: none;
  width: 3.25rem;
  height: 3.25rem;
  padding: 0;
  border-radius: var(--radio);
  font-size: 0.75rem;
  font-weight: 500;
}

/* ---------- Botones ---------- */
.boton {
  position: relative;
  isolation: isolate;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.55rem;
  min-height: 3rem;
  padding: 0.7rem 1.5rem;
  border: 0;
  background: none;
  font-family: var(--fuente-texto);
  font-size: 1rem;
  font-weight: 600;
  line-height: 1.2;
  color: var(--sobre-rojo);
  text-decoration: none;
  text-align: center;
  cursor: pointer;
  user-select: none;
  -webkit-user-select: none;
  transition: transform 140ms var(--salida);
}
.boton::before,
.boton::after {
  content: "";
  position: absolute;
  z-index: -1;
  clip-path: polygon(11px 0, 100% 0, 100% calc(100% - 11px), calc(100% - 11px) 100%, 0 100%, 0 11px);
  transition: background-color 160ms var(--salida);
}
.boton::before {
  inset: 0;
  background: var(--rojo);
}
.boton::after {
  display: none;
}
.boton:active {
  transform: scale(0.97);
}
.boton svg {
  flex: none;
  width: 1.15em;
  height: 1.15em;
}

.boton--secundario {
  color: var(--tinta);
}
.boton--secundario::before {
  background: var(--seleccion);
}
.boton--secundario::after {
  display: block;
  inset: 1.5px;
  background: var(--panel);
}

.boton--chico {
  min-height: 2.75rem;
  padding: 0.5rem 1rem;
  font-size: 0.95rem;
}

.boton[disabled] {
  cursor: not-allowed;
  opacity: 0.55;
}

@media (hover: hover) and (pointer: fine) {
  .boton:hover {
    color: var(--sobre-rojo);
  }
  .boton:hover::before {
    background: var(--rojo-realce);
  }
  .boton--secundario:hover {
    color: var(--tinta);
  }
  .boton--secundario:hover::before {
    background: var(--azul-tinta);
  }
  .boton--secundario:hover::after {
    background: var(--panel-alto);
  }
}

.enlace-flecha {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  min-height: 2.75rem;
  font-weight: 500;
}
.enlace-flecha svg {
  width: 1.1em;
  height: 1.1em;
  transition: transform 180ms var(--salida);
}
@media (hover: hover) and (pointer: fine) {
  .enlace-flecha:hover svg {
    transform: translateX(4px);
  }
}

/* ---------- Notas ---------- */
.nota {
  padding: 1rem 1.25rem;
  border-left: 0;
  border: 1px solid var(--linea-fuerte);
  border-radius: var(--radio);
  background: var(--panel);
  color: var(--tinta-suave);
}
.nota strong {
  color: var(--tinta);
  font-weight: 600;
}
