/* ============================================================
   Histarmar - Contenido histórico del archivo (FrontPage)
   Estilos para que las páginas antiguas convivan con el tema
   claro moderno del sitio. Normaliza fuentes, colores y tablas
   heredadas de FrontPage sin reescribir el HTML.
   ============================================================ */

.legacy-page {
  background: var(--white, #ffffff);
  color: var(--text-body, #1c2733);
  padding-block: 2rem;
  overflow-x: auto;
  font-family: var(--font, "Inter", system-ui, sans-serif);
  font-size: 1rem;
  line-height: 1.7;
}

/* Tipografía heredada: font, face, color, size, center */
.legacy-page font,
.legacy-page [face] {
  font-family: var(--font) !important;
}
.legacy-page font[color],
.legacy-page [color] {
  color: var(--text-body) !important;
}
.legacy-page font[size] {
  font-size: 1em !important;
}
.legacy-page center {
  text-align: left;
}
.legacy-page center p,
.legacy-page center div {
  text-align: center;
}
.legacy-page [align="justify"] {
  text-align: left !important;
}
.legacy-page [align="center"] {
  text-align: center !important;
}
.legacy-page marquee {
  display: block;
  white-space: normal;
  animation: none !important;
}

/* Encabezados dentro del contenido histórico */
.legacy-page h1,
.legacy-page h2,
.legacy-page h3,
.legacy-page h4 {
  font-family: var(--serif, Georgia, serif);
  color: var(--text-primary, #0a1628);
  line-height: 1.25;
  margin: 1.6rem 0 0.8rem;
  font-weight: 700;
}
.legacy-page h1 { font-size: clamp(1.5rem, 3vw, 2rem); }
.legacy-page h2 { font-size: clamp(1.25rem, 2.5vw, 1.6rem); }
.legacy-page h3 { font-size: 1.15rem; }

/* Párrafos y listas */
.legacy-page p {
  margin: 0.7rem 0;
  line-height: 1.7;
}
.legacy-page ul,
.legacy-page ol {
  margin: 0.8rem 0 0.8rem 1.3rem;
}
.legacy-page li { margin-bottom: 0.4rem; }
.legacy-page blockquote {
  border-left: 4px solid var(--celeste, #4a90c4);
  margin: 1rem 0;
  padding: 0.6rem 1rem;
  background: var(--gray-light, #f0f3f6);
  color: var(--text-body);
  font-style: italic;
}
.legacy-page hr {
  border: 0;
  border-top: 1px solid var(--border-subtle, #e2e6ea);
  margin: 1.5rem 0;
}

/* Imágenes: responsive + alineación antigua */
.legacy-page img {
  max-width: 100%;
  height: auto;
  border-radius: 8px;
}
.legacy-page img[align="left"],
.legacy-page img[align="right"] {
  float: none !important;
  display: block;
  margin: 1rem auto;
}
.legacy-page img[border] { border: 0 !important; }

/* Tablas: 98% tenían width fijo — las hacemos fluidas */
.legacy-page table {
  width: 100% !important;
  max-width: 100% !important;
  border-collapse: collapse;
  margin: 1rem 0;
  display: table;
  overflow-x: auto;
}
.legacy-page td,
.legacy-page th {
  padding: 10px 12px;
  border: 1px solid var(--border-subtle, #e2e6ea);
  vertical-align: top;
  overflow-wrap: anywhere;
}
.legacy-page th {
  background: var(--navy-800, #0a2150);
  color: var(--white);
  font-weight: 700;
  text-align: left;
}
.legacy-page tr:nth-child(even) td {
  background: var(--gray-light, #f0f3f6);
}
/* Anula bgcolor heredados que rompen contraste */
.legacy-page td[bgcolor],
.legacy-page th[bgcolor],
.legacy-page tr[bgcolor],
.legacy-page table[bgcolor] {
  background-color: var(--white) !important;
}
.legacy-page [bgcolor="#ffffff"],
.legacy-page [bgcolor="#FFFFFF"],
.legacy-page [bgcolor="white"] {
  background: var(--white) !important;
}

/* Enlaces */
.legacy-page a {
  color: var(--navy-700, #0e2b64);
  text-decoration: underline;
  text-underline-offset: 2px;
}
.legacy-page a:hover {
  color: var(--celeste-dark, #0f3a6e);
  text-decoration-thickness: 2px;
}

/* Spans con background-color inline (ej. traducción) */
.legacy-page span[style*="background"] {
  background: transparent !important;
  padding: 0 !important;
}

/* Limpia br excesivos heredados */
.legacy-page br + br { display: none; }

/* FrontPage webbots inertes */
.legacy-page MSTHEMELIST,
.legacy-page MSTHEMESEPARATOR {
  display: none !important;
}

/* ---- Correcciones de auditoría ---- */
/* <th bgcolor="..."> heredado: sin esto quedaba texto blanco sobre fondo blanco */
.legacy-page th[bgcolor] {
  background-color: var(--navy-800, #0a2150) !important;
  color: var(--white) !important;
}
.legacy-page th font[color],
.legacy-page th [color] { color: var(--white) !important; }

/* Rescatado de legacy_min.css (estaba solo en la versión minificada) */
.legacy-page table img { max-width: 100% !important; height: auto !important; width: auto !important; display: block; margin: 0 auto; }
.legacy-page font b,
.legacy-page font strong { color: var(--text-primary) !important; font-weight: 700 !important; }
.legacy-page .container .container { padding: 0 !important; max-width: none !important; width: 100% !important; }

/* Móvil: las tablas anchas se desplazan en lugar de aplastar las columnas */
@media (max-width: 640px) {
  .legacy-page table { display: block; overflow-x: auto; -webkit-overflow-scrolling: touch; }
}

/* ---- Legibilidad (2026-10) ---- */
/* Columna de lectura algo más angosta: líneas más cortas, más cómodas */
.legacy-page > .container { width: min(1040px, 92%); }
.legacy-page { color: var(--text-body); }
.legacy-page p, .legacy-page li { line-height: 1.75; }
/* Tablas: bordes más suaves y esquinas redondeadas */
.legacy-page td, .legacy-page th { border-color: #e6eaef; }
.legacy-page h2, .legacy-page h3 { color: var(--navy-800, #0a2150); }
.legacy-page blockquote { border-radius: 0 8px 8px 0; font-style: normal; }
/* Celdas: no partir palabras al medio ("Patago-nia"); si no entra, la tabla se desplaza */
.legacy-page td, .legacy-page th { overflow-wrap: break-word; word-break: normal; hyphens: manual; }
@media (max-width: 640px) {
  .legacy-page td, .legacy-page th { padding: 8px 9px; }
}

/* Enlaces desactivados (su destino no existe): se leen como texto normal.
   Los <a name="…"> (anclas internas) tampoco tienen href y quedan igual de discretos. */
.legacy-page a:not([href]) { color: inherit; text-decoration: none; cursor: text; }
