/* ==========================================================================
   WMH · base.css — componentes compartidos por todas las páginas del sitio
   Depende de tokens.css. No redefine variables de :root.
   Las páginas de línea de negocio importan tokens.css + base.css y añaden
   su propia hoja local.
   ========================================================================== */

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

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}

body {
  margin: 0; min-height: 100vh;
  display: flex; flex-direction: column;
  background: var(--superficie); color: var(--texto-principal);
  font-family: var(--fuente-texto); font-weight: var(--peso-texto);
  font-size: var(--ts-texto); line-height: var(--il-texto); text-align: left;
  -webkit-font-smoothing: antialiased;
}

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

:focus-visible {
  outline: var(--foco-grosor) solid var(--wmh-azul-industrial);
  outline-offset: var(--foco-desplazamiento);
}
.sobre-oscuro :focus-visible, .pie :focus-visible { outline-color: var(--wmh-blanco); }

.salto-contenido {
  position: absolute; left: -9999px; top: 0; z-index: 100;
  background: var(--wmh-azul-industrial); color: var(--wmh-blanco);
  padding: var(--esp-xs) var(--esp-sm); font-size: var(--ts-nota);
}
.salto-contenido:focus { left: var(--esp-sm); top: var(--esp-sm); }

.solo-lectores {
  position: absolute; width: 1px; height: 1px; overflow: hidden;
  clip-path: inset(50%); white-space: nowrap;
}

/* --- Retícula ------------------------------------------------------------ */
.contenedor {
  width: 100%; max-width: var(--ancho-contenido);
  margin-inline: auto; padding-inline: var(--margen-lateral);
}
.contenedor--ancho { max-width: 1400px; }

/* --- Tipografía ---------------------------------------------------------- */
h1, h2, h3 { font-family: var(--fuente-titular); margin: 0 0 var(--esp-sm); }
h1 {
  font-weight: var(--peso-titular-1); font-size: var(--ts-titular-1);
  line-height: var(--il-titular-1); text-transform: uppercase;
  letter-spacing: -0.015em; text-wrap: balance; hyphens: manual;
}
h2 {
  font-weight: var(--peso-titular-2); font-size: var(--ts-titular-2);
  line-height: var(--il-titular-2); text-transform: uppercase;
}
h3 { font-weight: var(--peso-subtitulo); font-size: var(--ts-subtitulo); line-height: var(--il-subtitulo); }

p { margin: 0 0 var(--esp-sm); max-width: var(--medida-lectura); }

.entradilla {
  font-weight: var(--peso-entradilla); font-size: var(--ts-entradilla);
  line-height: var(--il-entradilla); color: var(--texto-secundario);
}
.etiqueta {
  font-family: var(--fuente-mono); font-weight: 500;
  font-size: var(--ts-etiqueta); line-height: var(--il-etiqueta);
  letter-spacing: var(--tracking-etiqueta); text-transform: uppercase;
  color: var(--texto-secundario); margin: 0 0 var(--esp-xs);
}
.dato { font-family: var(--fuente-mono); font-size: var(--ts-cifra); line-height: 1.5; }
.nota { font-size: var(--ts-nota); line-height: var(--il-nota); color: var(--texto-secundario); }

strong { font-weight: 700; }
em { font-style: normal; font-weight: 700; }

a { color: inherit; text-decoration: underline; text-underline-offset: 0.18em; }
a:hover { text-decoration-thickness: 2px; }

/* --- Listas con marcador de vértice (Manual F.1) ------------------------- */
.lista { list-style: none; margin: 0 0 var(--esp-sm); padding: 0; max-width: var(--medida-lectura); }
.lista > li { position: relative; padding-left: 1.75rem; margin-bottom: var(--esp-2xs); }
.lista > li::before {
  content: ""; position: absolute; left: 0; top: 0.52em;
  width: 12px; height: 12px;
  background: var(--marcador-vineta) center / contain no-repeat;
}

.bloque-destacado {
  border-left: var(--filete-acento) solid var(--wmh-azul-industrial);
  padding: var(--esp-2xs) 0 var(--esp-2xs) var(--esp-sm);
  margin-block: var(--esp-md);
}

/* --- Tablas -------------------------------------------------------------- */
.tabla-envoltorio { overflow-x: auto; margin-block: var(--esp-md); }
table { width: 100%; border-collapse: collapse; font-size: var(--ts-nota); line-height: var(--il-nota); }
caption {
  text-align: left; font-family: var(--fuente-mono); font-size: var(--ts-etiqueta);
  letter-spacing: var(--tracking-etiqueta); text-transform: uppercase;
  color: var(--texto-secundario); padding-bottom: var(--esp-xs);
}
th, td { text-align: left; padding: var(--esp-xs) var(--esp-sm) var(--esp-xs) 0; vertical-align: top; }
thead th { border-bottom: 2px solid var(--wmh-azul-industrial); font-weight: 700; }
tbody tr { border-bottom: 1px solid var(--wmh-gris-tecnico); }
tbody th { font-weight: 700; }

/* --- Encabezado ---------------------------------------------------------- */
.cabecera { background: var(--wmh-blanco); border-bottom: 1px solid var(--wmh-gris-tecnico); }
.cabecera__fila { display: flex; align-items: center; gap: var(--esp-sm); min-height: 76px; }
/* Área de protección X/2 alrededor del lockup (Manual C.3) */
.cabecera__logo { display: block; padding: 0.5em; margin-left: -0.5em; flex: 0 0 auto; }
.cabecera__logo img { width: 172px; }
@media (max-width: 30rem) { .cabecera__logo img { width: 128px; } .nav-principal a { font-size: var(--ts-etiqueta); } }

.nav-principal { margin-left: auto; }
.nav-principal ul { display: flex; gap: var(--esp-md); list-style: none; margin: 0; padding: 0; }
.nav-principal a {
  font-size: var(--ts-nota); text-decoration: none; color: var(--texto-secundario);
  padding-block: var(--esp-2xs); border-bottom: 2px solid transparent;
}
.nav-principal a:hover, .nav-principal a:focus-visible,
.nav-principal a[aria-current="page"] {
  color: var(--wmh-azul-industrial); border-bottom-color: var(--wmh-azul-industrial);
}

/* --- Pie ----------------------------------------------------------------- */
.pie {
  margin-top: auto;
  background: var(--superficie-oscura); color: var(--texto-inverso);
  padding-block: var(--esp-xl) var(--esp-lg);
}
.pie__rejilla { display: grid; gap: var(--esp-lg); grid-template-columns: 1fr; }
@media (min-width: 48rem) { .pie__rejilla { grid-template-columns: 1.2fr 1fr 1fr; gap: var(--esp-xl); } }
.pie__logo { padding: 0.5em; margin-left: -0.5em; display: inline-block; }
.pie__logo img { width: 180px; }
.pie h2 {
  font-size: var(--ts-etiqueta); font-family: var(--fuente-mono); font-weight: 500;
  letter-spacing: var(--tracking-etiqueta); text-transform: uppercase;
  color: var(--texto-inverso-2); margin-bottom: var(--esp-sm);
}
.pie ul { list-style: none; margin: 0; padding: 0; }
.pie li { margin-bottom: var(--esp-2xs); font-size: var(--ts-nota); }
.pie p { color: var(--texto-inverso-2); font-size: var(--ts-nota); }
.pie a { color: var(--wmh-blanco); text-decoration: none; border-bottom: 1px solid transparent; }
.pie a:hover { border-bottom-color: var(--wmh-gris-tecnico); }
.pie .dato { color: var(--wmh-blanco); }
.pie__legal {
  margin-top: var(--esp-xl); padding-top: var(--esp-md);
  border-top: 1px solid rgba(160,172,186,.35);
  display: flex; flex-wrap: wrap; gap: var(--esp-sm) var(--esp-md);
  justify-content: space-between; align-items: baseline;
}
.pie__legal p { margin: 0; max-width: none; }
.pie__codigo { font-family: var(--fuente-mono); font-size: var(--ts-cifra); color: var(--texto-inverso-2); }

/* --- Pendientes de contenido, visibles a propósito ----------------------- */
.pendiente {
  font-family: var(--fuente-mono); font-size: var(--ts-cifra);
  background: var(--wmh-hielo); color: var(--wmh-rojo-alerta);
  padding: 0.1em 0.35em; border: 1px dashed var(--wmh-rojo-alerta);
}
.pie .pendiente { background: transparent; color: var(--wmh-gris-tecnico); border-color: var(--wmh-gris-tecnico); }

@media print {
  .cabecera, .salto-contenido { display: none; }
  .pie { background: #fff !important; color: #000 !important; }
}
