/* ============================================================
   HISTARMAR - Historia y Arqueología Marítima
   Hoja de estilos principal
   ============================================================ */
 
/* Fuentes locales VARIABLES: un solo archivo por familia cubre todos los pesos.
   (inter-600.woff2 y merriweather-700.woff2 contienen el eje wght completo;
   el nombre del archivo no limita el peso.) Rutas relativas a /css/. */
@font-face {
  font-family: "Inter"; font-style: normal; font-weight: 100 900; font-display: swap;
  src: url("fonts/inter-600.woff2") format("woff2");
}
@font-face {
  font-family: "Merriweather"; font-style: normal; font-weight: 300 900; font-display: swap;
  src: url("fonts/merriweather-700.woff2") format("woff2");
}

:root {
  color-scheme: light;
  /* Azules — marca principal */
  --navy: #0a2150;
  --navy-deep: #071a3d;
  --navy-900: #071a3d;
  --navy-800: #0a2150;
  --navy-700: #0e2b64;
  --navy-600: #1a5fa7;
  --celeste-dark: #0f3a6e;
  --celeste: #4a90c4;
  --celeste-light: #d6e8f5;
  --celeste-soft: #e4f2fb;
  /* Acento cálido */
  --oxido: #b06029;
  --oxido-dark: #8c4a1f;
  --oxido-light: #f3e2d3;
  /* Neutros con tinte de marca */
  --text-primary: #0a1628;
  --text-body: #3a3f47;
  --text-secondary: #64707d;
  --white: #ffffff;
  --page-bg: #fafbfc;
  --gray-light: #f0f3f6;
  --border-subtle: #e2e6ea;
  --cream: #f4f9fd;
  --soft: var(--page-bg);
  --text: var(--text-body);
  --muted: var(--text-secondary);
  --line: var(--border-subtle);
  /* Semánticos de categoría */
  --tag-naufragios: #a85838;
  --tag-arqueologia: #3d5a4a;
  --tag-neutro: var(--celeste-dark);
  /* Extras */
  --radius: 12px;
  --radius-sm: 8px;
  --shadow-xs: 0 1px 3px rgba(6, 23, 53, 0.08);
  --shadow: 0 10px 30px rgba(6, 23, 53, 0.14);
  --shadow-sm: 0 4px 14px rgba(6, 23, 53, 0.10);
  /* Variables tipográficas con fallback del sistema */
  --font: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --serif: "Merriweather", Georgia, "Times New Roman", serif;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html { scroll-behavior: smooth; scroll-padding-top: 5.5rem; }

body {
  font-family: var(--font);
  color: var(--text);
  background: var(--soft);
  line-height: 1.6;
  font-size: 16px;
}

img { max-width: 100%; height: auto; display: block; }
address { font-style: normal; }
a { color: var(--navy-700); text-decoration: none; }
a:hover { color: var(--celeste-dark); }

h1, h2, h3, h4 { font-family: var(--serif); color: var(--text-primary); line-height: 1.25; font-weight: 700; }

.muted { color: var(--muted); }
.small { font-size: 0.85rem; }

.skip-link {
  position: absolute; left: -9999px; top: 0; z-index: 300;
  background: var(--celeste); color: var(--navy-900); font-weight: 700;
  padding: 0.7rem 1.4rem; border-radius: 0 0 8px 0;
}
.skip-link:focus { left: 0; }

:focus-visible { outline: 3px solid var(--celeste); outline-offset: 2px; }

.container { width: min(1180px, 92%); margin-inline: auto; }

/* ============ Utilidades ============ */
.btn {
  display: inline-flex; align-items: center; gap: 0.5rem;
  padding: 0.7rem 1.4rem; min-height: 44px; border-radius: 50px;
  font-weight: 600; font-size: 0.95rem; cursor: pointer;
  border: 2px solid transparent; transition: all 0.25s ease;
}
.btn-celeste { background: var(--oxido); color: var(--white); border-color: var(--oxido); }
.btn-celeste:hover { background: var(--oxido-dark); color: var(--white); transform: translateY(-2px); box-shadow: var(--shadow-sm); }
.btn-outline { background: transparent; color: var(--white); border-color: rgba(255,255,255,0.7); }
.btn-outline:hover { background: rgba(255,255,255,0.12); color: var(--celeste-light); border-color: var(--celeste-light); }
.btn-navy { background: var(--navy); color: var(--white); border-color: var(--navy); }
.btn-navy:hover { background: var(--navy-deep); color: var(--celeste-light); transform: translateY(-2px); }

.badge {
  display: inline-block; padding: 0.25rem 0.8rem; border-radius: 50px;
  background: var(--celeste-light); color: var(--celeste-dark); font-size: 0.72rem;
  font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em;
}

.section { padding: 4.5rem 0; }
.section-head { max-width: 760px; margin-bottom: 2.5rem; }
.section-head .badge { margin-bottom: 0.8rem; }
.section-head h2 { font-size: clamp(1.6rem, 3.5vw, 2.4rem); margin-bottom: 0.6rem; }
.section-head p { color: var(--muted); }
.center { text-align: center; }
.center .section-head { margin-inline: auto; }

.lead { font-size: 1.05rem; color: var(--muted); }

/* ============ Barra superior ============ */
.topbar {
  background: var(--celeste);
  color: var(--navy-900);
  font-size: 0.85rem; font-weight: 600;
}
.topbar .container { display: flex; flex-wrap: wrap; gap: 0.5rem 1.5rem; align-items: center; justify-content: space-between; padding: 0.35rem 1rem; }
.topbar a { color: var(--navy-900); }
.topbar a:hover { text-decoration: underline; }
.topbar .social { display: flex; gap: 0.8rem; align-items: center; }
.topbar .social img { width: auto; height: 22px; }

/* ============ Header ============ */
.site-header {
  background: linear-gradient(135deg, var(--navy-900) 0%, var(--navy-700) 60%, var(--navy-800) 100%);
  position: sticky; top: 0; z-index: 100;
  box-shadow: 0 4px 18px rgba(0,0,0,0.25);
}
.nav-wrap { display: flex; align-items: center; justify-content: space-between; padding: 0.6rem 1rem; gap: 1rem; }
.brand { display: flex; align-items: center; gap: 0.7rem; }
.brand img { height: 48px; width: auto; background: var(--white); border-radius: 14px; padding: 3px; box-shadow: 0 2px 8px rgba(0,0,0,0.25); }
.brand-text { color: var(--white); line-height: 1.15; }
.brand-text b { font-size: 1.05rem; letter-spacing: 0.03em; display: block; color: var(--white); }
.brand-text span { font-size: 0.72rem; color: var(--celeste-light); text-transform: uppercase; letter-spacing: 0.08em; }

nav.main-nav ul { list-style: none; display: flex; align-items: center; gap: 0.15rem; flex-wrap: nowrap; }
nav.main-nav a {
  color: rgba(255,255,255,0.88); font-weight: 600; font-size: 0.88rem;
  padding: 0.5rem 0.62rem; border-radius: 8px; transition: all 0.2s; white-space: nowrap;
}
nav.main-nav a:hover, nav.main-nav a.active { background: rgba(255,255,255,0.12); color: var(--celeste-light); }
.nav-cta { background: var(--celeste) !important; color: var(--navy-900) !important; margin-left: 0.4rem; }
.nav-cta:hover { background: var(--celeste-light) !important; color: var(--navy-900) !important; }

.hamburger { display: none; background: none; border: 0; cursor: pointer; padding: 0.6rem; min-width: 44px; min-height: 44px; }
.hamburger span { display: block; width: 26px; height: 3px; background: var(--white); margin: 5px 0; border-radius: 3px; transition: 0.3s; }
.hamburger[aria-expanded="true"] span:nth-child(1) { transform: translateY(8px) rotate(45deg); }
.hamburger[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.hamburger[aria-expanded="true"] span:nth-child(3) { transform: translateY(-8px) rotate(-45deg); }

/* ============ Hero ============ */
.hero {
  position: relative; min-height: 72vh;
  display: flex; align-items: center;
  background-size: cover; background-position: center;
  color: var(--white); overflow: hidden;
}
.hero::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(6,20,53,0.65) 0%, rgba(6,20,53,0.82) 100%); }
.hero .container { position: relative; z-index: 2; padding-block: 4rem; }
.hero h1 { color: var(--white); font-size: clamp(2rem, 5vw, 3.4rem); margin: 1rem 0 1rem; text-shadow: 0 3px 12px rgba(0,0,0,0.5); }
.hero h1 .hl { color: var(--oxido-light); }
.hero p { max-width: 700px; font-size: 1.08rem; color: rgba(255,255,255,0.92); margin-top: 0.5rem; }
.hero .actions { display: flex; flex-wrap: wrap; gap: 0.9rem; margin-top: 2rem; }
.hero .badge { font-size: 0.78rem; }

/* ============ Tarjetas / grids ============ */
.grid { display: grid; gap: 1.4rem; }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }
.grid-5 { grid-template-columns: repeat(5, 1fr); }

.card {
  background: var(--white); border-radius: var(--radius);
  box-shadow: var(--shadow-xs), var(--shadow-sm); overflow: hidden;
  border: 1px solid var(--border-subtle);
  transition: transform 0.3s cubic-bezier(0.22, 1, 0.36, 1), box-shadow 0.3s ease, border-color 0.3s ease;
}
.card:hover { transform: translateY(-6px); box-shadow: var(--shadow); border-color: var(--celeste); }
.card a.card-link { display: block; color: inherit; }
.card .thumb { aspect-ratio: 16/10; overflow: hidden; background: var(--navy-700); }
.card .thumb img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.4s ease; }
.card:hover .thumb img { transform: scale(1.06); }
.card .body { padding: 1.25rem 1.35rem 1.45rem; }
.card .body h3 { font-size: 1.05rem; margin-bottom: 0.4rem; letter-spacing: 0.01em; }
.card .body p { font-size: 0.9rem; color: var(--muted); line-height: 1.55; margin-bottom: 0.75rem; }
.card .tag {
  display: inline-block; font-size: 0.7rem; color: var(--celeste-dark);
  font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em;
  background: var(--celeste-soft); padding: 0.18rem 0.55rem; border-radius: 50px;
}

/* Tarjetas de categorías (indice) */
.cat-list { list-style: none; display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 1rem; }
.cat-list li a {
  display: flex; align-items: center; gap: 0.6rem;
  background: var(--white); border: 1px solid var(--line); border-radius: var(--radius-sm);
  padding: 0.8rem 1rem; font-weight: 600; color: var(--navy-800);
  box-shadow: var(--shadow-sm); transition: 0.2s;
}
.cat-list li a:hover { background: var(--navy-800); color: var(--celeste-light); transform: translateY(-2px); border-color: var(--navy-800); }
.cat-list li a::before { content: "⚓"; color: var(--celeste); }

/* ============ Novedades ============ */
.news-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1.4rem; }
.news-card { position: relative; }
.news-card a.card-link { display: flex; flex-direction: column; height: 100%; }
.news-card .body { display: flex; flex-direction: column; align-items: flex-start; flex: 1; }
.news-card .body .btn { margin-top: auto; }
.card .thumb.thumb-illustration { background: #e9f6fb; }
.card .thumb.thumb-illustration img { object-fit: contain; padding: 0.6rem; }
.btn-sm { padding: 0.4rem 0.9rem; min-height: 0; font-size: 0.8rem; }
.news-card .date { position: absolute; top: 0.8rem; left: 0.8rem; background: var(--celeste); color: var(--navy-900); font-weight: 700; font-size: 0.72rem; padding: 0.2rem 0.6rem; border-radius: 50px; z-index: 2; }

/* ============ PECIOS / publicaciones ============ */
.pub-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 1.6rem; }
.pub-card .thumb { aspect-ratio: 3/4; }
.pub-card .body { text-align: center; padding: 0.9rem 0.5rem 1rem; }
.pub-card .body h3 { font-size: 0.95rem; }

/* ============ Sección oscura (CTAs) ============ */
.dark-band { background: linear-gradient(135deg, var(--navy-900), var(--navy-700)); color: var(--white); }
.dark-band h2, .dark-band h3 { color: var(--white); }
.dark-band p { color: rgba(255,255,255,0.85); }

/* ============ Página interior hero ============ */
.page-hero {
  background: linear-gradient(135deg, var(--navy-900), var(--navy-700));
  color: var(--white); padding: 3rem 0 3.2rem; position: relative; overflow: hidden;
}
.page-hero::before { content: "⚓"; position: absolute; right: -1.5rem; top: -2rem; font-size: 12rem; opacity: 0.07; }
.page-hero h1 { color: var(--white); font-size: clamp(1.8rem, 4vw, 2.8rem); }
.page-hero .crumb { color: var(--celeste-light); font-size: 0.82rem; text-transform: uppercase; letter-spacing: 0.08em; font-weight: 600; }
.page-hero p { color: rgba(255,255,255,0.82); max-width: 760px; margin-top: 0.6rem; }

/* ============ Panel de contenido ============ */
.panel {
  background: var(--white); border: 1px solid var(--line);
  border-radius: var(--radius); box-shadow: var(--shadow-xs), var(--shadow-sm);
  padding: 2rem; margin-bottom: 2rem;
}
.panel h2 { font-size: 1.4rem; margin: 1.4rem 0 0.6rem; letter-spacing: 0.01em; }
.panel h2:first-child { margin-top: 0; padding-bottom: 0.6rem; border-bottom: 2px solid var(--celeste-light); }
.panel p { margin-bottom: 1rem; }
.panel ul, .panel ol { margin: 0 0 1.2rem 1.3rem; }
.panel li { margin-bottom: 0.45rem; }

/* ============ Tablas ============ */
.tbl-wrap { overflow-x: auto; }
table.data { width: 100%; border-collapse: collapse; font-size: 0.92rem; }
table.data th { background: var(--navy-800); color: var(--white); text-align: left; padding: 0.6rem 0.9rem; }
table.data td { border: 1px solid var(--line); padding: 0.55rem 0.9rem; vertical-align: top; }
table.data tr:nth-child(even) td { background: var(--soft); }

.name-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 0.6rem; }
.name-grid .chip {
  background: var(--soft); border: 1px solid var(--line); border-radius: var(--radius-sm);
  padding: 0.45rem 0.6rem; font-size: 0.82rem; font-weight: 600; color: var(--navy-800);
}

/* ============ Formulario contacto ============ */
form.contact { display: grid; gap: 1rem; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
label { font-weight: 600; font-size: 0.88rem; color: var(--navy-800); }
input, textarea, select {
  width: 100%; padding: 0.75rem 0.9rem; border: 1px solid var(--line);
  border-radius: var(--radius-sm); font-family: inherit; font-size: 0.95rem;
  background: var(--white); color: var(--text);
}
input:focus, textarea:focus, select:focus { outline: 2px solid var(--celeste); border-color: var(--celeste); }
textarea { resize: vertical; min-height: 130px; }

form.contact-form { display: grid; gap: 1.1rem; }
form.contact-form label { display: grid; gap: 0.35rem; }
form.contact-form .btn { justify-self: start; }
.req { color: var(--celeste-dark); }
.hp-field { position: absolute !important; left: -9999px !important; width: 1px; height: 1px; overflow: hidden; }
#formStatus.ok { color: var(--celeste-dark); font-weight: 600; }
#formStatus.err { color: #b3261e; font-weight: 600; }

/* ============ Banner de aviso ============ */
.notice { background: var(--celeste-soft); border: 1px solid #bcdcf0; border-left: 5px solid var(--celeste); border-radius: var(--radius-sm); padding: 0.9rem 1.1rem; margin-bottom: 1.4rem; font-size: 0.92rem; }
.notice b { color: var(--navy-800); }

/* ============ CTA bandas ============ */
.cta-band { text-align: center; padding: 4.5rem 0; }
.cta-band h2 { margin-bottom: 0.6rem; }
.cta-band .actions { justify-content: center; margin-top: 1.6rem; display: flex; flex-wrap: wrap; gap: 1rem; }

/* ============ CTA banner (páginas interiores) ============ */
.cta-banner {
  background: linear-gradient(135deg, var(--navy-900), var(--navy-700));
  color: var(--white); border-radius: var(--radius); box-shadow: var(--shadow);
  padding: 2.6rem 2.4rem; margin: 2.5rem 0; text-align: center;
  border: 1px solid rgba(74, 179, 232, 0.35);
}
.cta-banner h2 { color: var(--celeste-light); margin-bottom: 0.6rem; font-size: 1.5rem; }
.cta-banner p { color: rgba(255,255,255,0.85); max-width: 640px; margin: 0 auto 1.4rem; }

/* ============ Footer ============ */
footer.site-footer { background: var(--navy-900); color: rgba(255,255,255,0.85); padding-top: 3.5rem; margin-top: 0; border-top: 4px solid var(--celeste); }
.footer-grid { display: grid; grid-template-columns: 2fr 1fr 1fr 1.4fr; gap: 2.2rem; padding-bottom: 2.5rem; }
.site-footer h2 { color: var(--celeste-light); font-size: 1rem; margin-bottom: 1rem; letter-spacing: 0.04em; }
.site-footer ul { list-style: none; }
.site-footer ul li { margin-bottom: 0.5rem; font-size: 0.9rem; }
.site-footer a { color: rgba(255,255,255,0.85); }
.site-footer a:hover { color: var(--celeste-light); }
.footer-bottom { border-top: 1px solid rgba(255,255,255,0.14); padding: 1.2rem 0; font-size: 0.82rem; text-align: center; color: rgba(255,255,255,0.6); }

/* ============ Accesibilidad: título solo para lectores de pantalla ============ */
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

/* ============ Animaciones scroll ============ */
.reveal { opacity: 0; transform: translateY(26px); transition: opacity 0.6s cubic-bezier(0.22, 1, 0.36, 1), transform 0.6s cubic-bezier(0.22, 1, 0.36, 1); }
.reveal.visible { opacity: 1; transform: none; }
.reveal-delay-1 { transition-delay: 0.1s; }
.reveal-delay-2 { transition-delay: 0.2s; }

/* ============ Busqueda ============ */
.search-box {
  display: flex; gap: 0.6rem; margin-bottom: 2rem; flex-wrap: wrap;
}
.search-box input[type="search"] {
  flex: 1 1 320px; padding: 0.85rem 1.1rem; border: 2px solid var(--line);
  border-radius: 50px; font-size: 1rem; background: var(--white); color: var(--text);
}
.search-box input[type="search"]:focus { outline: none; border-color: var(--celeste-dark); box-shadow: 0 0 0 3px var(--celeste-light); }
#searchCount { color: var(--muted); font-size: 0.9rem; margin-bottom: 1rem; }
.search-results { display: grid; gap: 1rem; }
.search-results .result {
  background: var(--white); border: 1px solid var(--line); border-left: 4px solid var(--celeste);
  border-radius: var(--radius-sm); padding: 1.1rem 1.3rem; box-shadow: var(--shadow-sm);
}
.search-results .result a.result-title { font-family: var(--serif); font-weight: 700; font-size: 1.1rem; color: var(--navy-800); }
.search-results .result a.result-title:hover { color: var(--celeste-dark); }
.search-results .result p { color: var(--muted); font-size: 0.9rem; margin-top: 0.3rem; }
.search-results mark { background: var(--celeste-light); color: var(--navy-900); border-radius: 3px; padding: 0 2px; }
.result-empty { text-align: center; color: var(--muted); padding: 3rem 0; }

/* ============ Mapa del sitio ============ */
.sitemap-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 1.4rem; }
.sitemap-col h3 { font-size: 1rem; margin-bottom: 0.8rem; }
.sitemap-col ul { list-style: none; }
.sitemap-col ul li { margin-bottom: 0.5rem; font-size: 0.92rem; }
.sitemap-col ul li::before { content: "⚓"; margin-right: 0.5rem; color: var(--celeste); }

/* ============ Legales ============ */
.legal-list { list-style: decimal; margin-left: 1.3rem; margin-bottom: 1.2rem; }
.legal-list li { margin-bottom: 0.5rem; }

/* Cookies */
#cookieBar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 150;
  background: var(--navy-900); color: rgba(255,255,255,0.9);
  padding: 0.9rem 1.2rem; font-size: 0.88rem;
  display: none; align-items: center; justify-content: center; gap: 1rem; flex-wrap: wrap;
  border-top: 3px solid var(--celeste);
}
#cookieBar.show { display: flex; }
#cookieBar a { color: var(--celeste-light); text-decoration: underline; }
#cookieBar .btn { padding: 0.4rem 1rem; font-size: 0.85rem; }

/* ============ Optimizaciones rendimiento ============ */
/* (se quitó content-visibility de .hero: retrasa el LCP en pantallas grandes) */
@media (min-width: 769px) {
  .hero::before { content: ""; position: absolute; inset: 0; background: radial-gradient(circle at 80% 20%, rgba(74,179,232,0.18), transparent 55%); pointer-events: none; }
}

/* ============ Back to top ============ */
#toTop {
  position: fixed; right: 1.2rem; bottom: 1.2rem; z-index: 90;
  width: 46px; height: 46px; border-radius: 50%; border: 0; cursor: pointer;
  background: var(--celeste); color: var(--navy-900); font-size: 1.3rem; box-shadow: var(--shadow);
  opacity: 0; visibility: hidden; transform: translateY(12px); transition: all 0.3s;
}
#toTop.show { opacity: 1; visibility: visible; transform: none; }
#toTop:hover { background: var(--celeste-light); }

/* ============ Galería === fuente ============ */
.gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 1rem; }
.gallery figure { position: relative; border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow-sm); }
.gallery img { width: 100%; height: 200px; object-fit: cover; transition: transform 0.4s; cursor: pointer; }
.gallery figure:hover img { transform: scale(1.05); }
.gallery figcaption { position: absolute; left: 0; right: 0; bottom: 0; padding: 1.2rem 0.8rem 0.5rem; background: linear-gradient(transparent, rgba(6,20,53,0.85)); color: var(--white); font-size: 0.8rem; }

/* Lightbox */
.lightbox { position: fixed; inset: 0; background: rgba(4, 12, 28, 0.92); z-index: 200; display: none; align-items: center; justify-content: center; padding: 2rem; }
.lightbox.open { display: flex; }
.lightbox img { max-width: 100%; max-height: 82vh; border-radius: var(--radius); box-shadow: var(--shadow); }
.lightbox p { color: var(--white); text-align: center; margin-top: 0.8rem; }
.lightbox .close { position: absolute; top: 1rem; right: 1.6rem; background: none; border: 0; color: var(--white); font-size: 2.4rem; cursor: pointer; }

/* ============ Responsive ============ */
@media (max-width: 1279px) and (min-width: 1201px) {
  .brand-text span { display: none; }
}
@media (max-width: 1200px) {
  nav.main-nav {
    display: none; position: absolute; top: 100%; left: 0; right: 0;
    background: var(--navy-800); padding: 0.6rem 1rem 1rem; flex-direction: column;
    border-top: 2px solid var(--celeste); box-shadow: 0 14px 28px rgba(0,0,0,0.3);
    max-height: calc(100vh - 100%); max-height: calc(100dvh - 100%); overflow-y: auto;
  }
  nav.main-nav.open { display: flex; }
  nav.main-nav ul { flex-direction: column; align-items: stretch; width: 100%; max-width: 1180px; margin-inline: auto; }
  nav.main-nav a { display: block; text-align: left; padding: 0.8rem 0.6rem; min-height: 44px; font-size: 0.95rem; }
  nav.main-nav a.nav-cta { margin-left: 0; margin-top: 0.4rem; text-align: center; }
  .hamburger { display: block; }
  .news-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 992px) {
  .grid-4 { grid-template-columns: repeat(2, 1fr); }
  .grid-5 { grid-template-columns: repeat(3, 1fr); }
  .grid-3 { grid-template-columns: repeat(2, 1fr); }
  .footer-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 768px) {
  .section { padding: 3rem 0; }
  .grid-2, .grid-3, .grid-4, .grid-5 { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr; gap: 1.6rem; }
  .form-row { grid-template-columns: 1fr; }
  .hero { min-height: 62vh; }
  .panel { padding: 1.2rem; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
  .reveal { opacity: 1; transform: none; }
}

/* ============ Línea de tiempo ============ */
.timeline {
  position: relative;
  max-width: 760px;
  margin: 2.5rem auto 0;
  padding-left: 2.2rem;
}
.timeline-track {
  position: absolute;
  left: 9px; top: 6px; bottom: 6px;
  width: 2px;
  background: var(--celeste-dark);
  opacity: 0.25;
}
.timeline-item { position: relative; padding-bottom: 2.4rem; }
.timeline-item:last-child { padding-bottom: 0; }
.timeline-dot {
  position: absolute; left: -2.2rem; top: 4px;
  width: 20px; height: 20px; border-radius: 50%;
  background: var(--white); border: 3px solid var(--celeste-dark);
}
.timeline-year {
  display: inline-block; font-weight: 700;
  color: var(--celeste-dark); font-size: 0.95rem;
  letter-spacing: 0.02em; margin-bottom: 0.2rem;
}
.timeline-content h3 { margin: 0.1rem 0 0.4rem; font-size: 1.15rem; }
.timeline-content p { margin: 0; color: var(--text-body); }
@media (max-width: 640px) {
  .timeline { padding-left: 1.8rem; }
  .timeline-track { left: 8px; }
  .timeline-dot { left: -1.8rem; width: 16px; height: 16px; }
}

/* ============ Efeméride del día ============ */
.efemeride-card {
  display: flex; align-items: flex-start; gap: 1rem;
  padding: 1.2rem 1.4rem;
  background: var(--gray-light);
  border-left: 4px solid var(--celeste-dark);
}
.efemeride-icon { width: 28px; height: 28px; flex-shrink: 0; color: var(--celeste-dark); margin-top: 2px; }
.efemeride-icon svg { width: 100%; height: 100%; }
.efemeride-body .tag {
  display: block; margin-bottom: 0.3rem;
  text-transform: uppercase; font-size: 0.75rem; letter-spacing: 0.04em;
  color: var(--celeste-dark);
}
.efemeride-body p { margin: 0; font-size: 0.98rem; }

/* ============ Mapa Leaflet ============ */
#histarmarMapa { height: 440px; border-radius: 12px; overflow: hidden; border: 1px solid var(--border-subtle); }

/* ============ Carrusel de fotos históricas ============ */
.carousel {
  position: relative; max-width: 900px; margin: 2rem auto 0;
  border-radius: 12px; overflow: hidden; background: #000;
}
.carousel-track { position: relative; width: 100%; aspect-ratio: 16/9; }
.carousel-slide {
  position: absolute; inset: 0; margin: 0;
  opacity: 0; transition: opacity 0.6s ease; pointer-events: none;
}
.carousel-slide.active { opacity: 1; pointer-events: auto; }
.carousel-slide img { width: 100%; height: 100%; object-fit: cover; display: block; }
.carousel-slide figcaption {
  position: absolute; left: 0; right: 0; bottom: 0;
  padding: 1rem 1.2rem;
  background: linear-gradient(transparent, rgba(0,0,0,0.65));
  color: #fff; font-size: 0.95rem;
}
.carousel-btn {
  position: absolute; top: 50%; transform: translateY(-50%);
  width: 40px; height: 40px; border-radius: 50%; border: none;
  background: rgba(255,255,255,0.85); color: var(--celeste-dark);
  font-size: 1.5rem; line-height: 1; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: background 0.2s ease;
}
.carousel-btn:hover { background: #fff; }
.carousel-btn.prev { left: 12px; }
.carousel-btn.next { right: 12px; }
.carousel-dots {
  position: absolute; bottom: 6px; left: 50%; transform: translateX(-50%);
  display: flex; gap: 0;
}
.carousel-dots button {
  width: 24px; height: 24px; border: none; background: transparent;
  cursor: pointer; padding: 0; display: grid; place-items: center;
}
.carousel-dots button::before {
  content: ""; width: 9px; height: 9px; border-radius: 50%;
  background: rgba(255,255,255,0.55);
}
.carousel-dots button.active::before { background: #fff; }
@media (max-width: 640px) {
  .carousel-btn { width: 44px; height: 44px; font-size: 1.2rem; }
}

/* ============ Buscador con autocompletado ============ */
.hist-search { position: relative; max-width: 480px; margin: 0 auto; }
.hist-search input {
  width: 100%; padding: 0.7rem 1rem;
  border-radius: 8px; border: 1px solid var(--border-subtle);
  font-size: 1rem;
}
.hist-search input:focus {
  outline: 2px solid var(--celeste-dark); outline-offset: 1px;
}
.hist-search-results {
  position: absolute; top: calc(100% + 6px); left: 0; right: 0;
  background: var(--white);
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  max-height: 320px; overflow-y: auto;
  list-style: none; margin: 0; padding: 0.4rem 0;
  z-index: 20; box-shadow: 0 8px 20px rgba(0,0,0,0.08);
}
.hist-search-results li a {
  display: block; padding: 0.55rem 1rem;
  color: var(--text-primary); text-decoration: none; font-size: 0.92rem;
}
.hist-search-results li a:hover,
.hist-search-results li a.active-option { background: var(--gray-light); }
.hist-search-results .his-search-empty {
  padding: 0.6rem 1rem; font-size: 0.85rem; color: var(--text-secondary);
}

/* ============ Tags semánticos por categoría ============ */
.tag-naufragios { color: var(--tag-naufragios); }
.tag-arqueologia { color: var(--tag-arqueologia); }

/* ============ Correcciones de auditoría ============ */
.site-footer .btn { color:var(--white)!important }
.site-footer .btn:hover { color:var(--white)!important }

/* Clases usadas en ayudar.html / contacto.html que no tenían estilos */
.cards-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 1.4rem; margin-bottom: 1rem; }
.card-body { padding: 1.35rem 1.4rem 1.5rem; }
.card-body h3 { font-size: 1.08rem; margin-bottom: 0.5rem; }
.card-body p { font-size: 0.92rem; color: var(--muted); margin-bottom: 0.6rem; }
.card-body p:last-child { margin-bottom: 0; }

/* Sin JavaScript el contenido con .reveal debe seguir visible */
@media (scripting: none) {
  .reveal { opacity: 1; transform: none; }
}

/* unirse.html: columna de paneles (antes sin estilos) */
.panels-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 1.4rem; margin-bottom: 1.6rem; }
.panels-grid .panel { margin-bottom: 0; }

/* Formulario de contacto: mensaje de estado */
#formStatus { min-height: 1.4em; margin: 0; }

/* Carrusel: botón de pausa (arriba a la derecha) */
.carousel-btn.carousel-pause { top: 12px; right: 12px; left: auto; transform: none; width: 44px; height: 44px; font-size: 0.85rem; }

/* ============ Pulido visual (2026-10) ============ */
::selection { background: var(--celeste-light); color: var(--navy-900); }
h1, h2, h3 { text-wrap: balance; }
.section-head p, .hero p, .page-hero p { text-wrap: pretty; }

/* Línea de acento bajo los títulos de sección */
.section-head h2::after {
  content: ""; display: block; width: 56px; height: 3px; margin-top: 0.7rem;
  border-radius: 3px; background: linear-gradient(90deg, var(--oxido), var(--celeste));
}
.section-head.center h2::after, .center .section-head h2::after { margin-inline: auto; }
.dark-band .section-head h2::after { background: linear-gradient(90deg, var(--oxido-light), var(--celeste)); }

/* Hero: badge legible sobre la foto */
.hero .badge { background: rgba(255,255,255,0.14); color: var(--white); border: 1px solid rgba(255,255,255,0.35); backdrop-filter: blur(4px); }

/* Tarjetas de publicaciones: sombra suave sobre la tapa */
.pub-card .thumb { background: var(--gray-light); }

/* Buscador de la portada: más presencia */
.hist-search input { padding: 0.85rem 1.2rem; border-radius: 50px; border-width: 2px; box-shadow: var(--shadow-xs); }
.hist-search input:focus { outline: none; border-color: var(--celeste-dark); box-shadow: 0 0 0 3px var(--celeste-light); }
.hist-search-results { border-radius: 14px; }

/* Mapa: borde y sombra coherentes con las tarjetas */
#histarmarMapa { box-shadow: var(--shadow-xs), var(--shadow-sm); }

/* Vuelta arriba sin tapar el aviso de cookies */
#toTop:has(~ #cookieBar.show) { bottom: 5.5rem; }

@media (max-width: 768px) {
  /* Barra superior: solo redes y contacto */
  .topbar .container > div:first-child { display: none; }
  .topbar .container { justify-content: center; }
  /* Encabezado más bajo para dejar lugar al contenido */
  .brand img { height: 42px; }
  .brand-text b { font-size: 1rem; }
  .brand-text span { font-size: 0.64rem; }
  /* Índice de secciones más compacto */
  .cat-list { gap: 0.6rem; }
  .cat-list li a { padding: 0.65rem 0.9rem; font-size: 0.93rem; }
  /* Mapa más bajo en el teléfono */
  #histarmarMapa { height: 340px; }
  /* Aviso de cookies compacto y flotante */
  #cookieBar {
    left: 0.75rem; right: 0.75rem; bottom: 0.75rem; border-radius: 14px;
    border: 1px solid rgba(255,255,255,0.15); border-top: 3px solid var(--celeste);
    padding: 0.75rem 0.9rem; font-size: 0.8rem; line-height: 1.45; gap: 0.6rem;
    box-shadow: var(--shadow); flex-wrap: nowrap;
  }
  #cookieBar .btn { flex-shrink: 0; padding: 0.4rem 0.85rem; min-height: 38px; font-size: 0.8rem; }
  .hero .container { padding-block: 3rem; }
  .hero .actions .btn { flex: 1 1 auto; justify-content: center; }
}
@media (max-width: 600px) {
  .news-grid { grid-template-columns: 1fr; }
}

/* ============ Legibilidad de cuadros y secciones (2026-10) ============ */

/* --- Paneles de contenido --- */
.panel { padding: 2rem 2.25rem; line-height: 1.7; border-color: #dfe5ec; }
.panel p, .panel li { color: var(--text-body); max-width: 75ch; }
.panel h2:first-child {
  padding-bottom: 0.7rem; border-bottom: 1px solid var(--border-subtle);
  background: linear-gradient(90deg, var(--oxido), var(--celeste)) left bottom / 56px 3px no-repeat;
}
.panel h3 {
  font-size: 1.15rem; color: var(--navy-800); margin: 1.2rem 0 0.55rem;
  padding-left: 0.85rem; border-left: 3px solid var(--oxido);
}
.panel h3:first-child { margin-top: 0; }
.panel:not(.sitemap-col) ul:not(.cat-list) { list-style: none; margin-left: 0; }
.panel:not(.sitemap-col) ul:not(.cat-list) > li { position: relative; padding-left: 1.4rem; }
.panel:not(.sitemap-col) ul:not(.cat-list) > li::before {
  content: ""; position: absolute; left: 0.2rem; top: 0.68em;
  width: 7px; height: 7px; border-radius: 50%; background: var(--celeste);
}
.panel ol > li::marker { color: var(--celeste-dark); font-weight: 700; }
.panel strong { color: var(--text-primary); }
.panel .cat-list { margin-top: 1.1rem; }
.panel + .panel { margin-top: 0; }

/* Enlaces dentro del texto: subrayados para que se distingan */
.panel p a:not(.btn), .panel:not(.sitemap-col) ul:not(.cat-list) li a, .panel ol li a, .notice a, .card-body p a {
  color: var(--navy-600); text-decoration: underline; text-decoration-thickness: 1px;
  text-underline-offset: 3px; text-decoration-color: rgba(26, 95, 167, 0.45);
}
.panel p a:not(.btn):hover, .panel:not(.sitemap-col) ul:not(.cat-list) li a:hover, .panel ol li a:hover, .notice a:hover, .card-body p a:hover {
  color: var(--oxido-dark); text-decoration-color: currentColor;
}

/* --- Tarjetas informativas (ayudar, contacto) --- */
.cards-grid .card { border-top: 3px solid var(--celeste); }
.card-body h3 { color: var(--navy-800); }
.card-body p { line-height: 1.65; color: var(--text-body); }
/* Solo las tarjetas que son enlace se elevan al pasar el mouse */
.card:not(:has(a.card-link)):hover { transform: none; box-shadow: var(--shadow-xs), var(--shadow-sm); border-color: var(--border-subtle); }
.cards-grid .card:not(:has(a.card-link)):hover { border-top-color: var(--celeste); }
.card .body h3 { line-height: 1.3; }
.card .body p { color: var(--text-body); }

/* --- Índice de categorías --- */
.cat-list li a { height: 100%; line-height: 1.35; border-color: #dfe5ec; box-shadow: var(--shadow-xs); }
.cat-list li a:hover { box-shadow: var(--shadow-sm); }
.cat-list li a::before { flex-shrink: 0; }

/* --- Avisos --- */
.notice { line-height: 1.65; color: var(--text-body); padding: 1rem 1.25rem; border-radius: var(--radius-sm); }

/* --- Banners de llamada a la acción --- */
.cta-banner { position: relative; overflow: hidden; }
.cta-banner::before {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: radial-gradient(circle at 85% 15%, rgba(74, 144, 196, 0.22), transparent 55%);
}
.cta-banner > * { position: relative; }
.cta-banner p { line-height: 1.7; }
.cta-banner a:not(.btn), .dark-band a:not(.btn), .page-hero p a {
  color: var(--celeste-light); text-decoration: underline; text-underline-offset: 3px;
}
.cta-banner a:not(.btn):hover, .dark-band a:not(.btn):hover { color: var(--white); }

/* --- Cabecera de páginas interiores --- */
.page-hero { padding: 3.2rem 0 3.4rem; border-bottom: 3px solid var(--oxido); }
.page-hero .crumb { display: inline-block; margin-bottom: 0.35rem; }
.page-hero p { font-size: 1.05rem; line-height: 1.65; }

/* --- Encabezados de sección --- */
.section-head p { font-size: 1.04rem; line-height: 1.65; }

/* --- Portada: alternar fondos para separar bloques --- */
#catalogo { background: var(--gray-light); }

/* --- Tablas de datos --- */
.tbl-wrap { border: 1px solid var(--line); border-radius: var(--radius-sm); }
table.data th { font-family: var(--font); font-size: 0.85rem; letter-spacing: 0.02em; }
table.data td { border-width: 0 0 1px; }
table.data tbody tr:hover td { background: var(--celeste-soft); }

/* --- Mapa del sitio --- */
.sitemap-col h3 { padding-bottom: 0.5rem; border-bottom: 1px solid var(--border-subtle); }

/* --- Resultados de búsqueda --- */
.search-results .result p { line-height: 1.6; }

/* --- Pie --- */
.site-footer p { line-height: 1.65; font-size: 0.92rem; }
.site-footer p + p { margin-top: 0.4rem; }

@media (max-width: 768px) {
  .panel { padding: 1.4rem 1.25rem; }
  .cta-banner { padding: 2rem 1.3rem; }
  .page-hero { padding: 2.4rem 0 2.6rem; }
}

/* ==========================================================================
   TEMA MODERNO (2026-10-11)
   Capa visual sobre los estilos anteriores. Para volver al aspecto previo,
   basta con borrar desde este comentario hasta el final del archivo.
   ========================================================================== */
:root {
  --radius: 16px;
  --radius-sm: 10px;
  --shadow-xs: 0 1px 2px rgba(10, 33, 80, 0.06);
  --shadow-sm: 0 2px 6px rgba(10, 33, 80, 0.06), 0 8px 24px rgba(10, 33, 80, 0.07);
  --shadow: 0 4px 10px rgba(10, 33, 80, 0.08), 0 18px 40px rgba(10, 33, 80, 0.14);
  --page-bg: #f5f7fa;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}
body { -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; text-rendering: optimizeLegibility; }
h1, h2 { letter-spacing: -0.012em; }

/* --- Botones --- */
.btn { border-radius: 999px; font-weight: 600; letter-spacing: 0.005em; transition: transform 0.25s var(--ease), box-shadow 0.25s var(--ease), background-color 0.2s, color 0.2s, border-color 0.2s; }
.btn-celeste { background: linear-gradient(180deg, #bd6a2f, var(--oxido)); border-color: transparent; box-shadow: 0 6px 16px rgba(176, 96, 41, 0.28); }
.btn-celeste:hover { background: linear-gradient(180deg, var(--oxido), var(--oxido-dark)); box-shadow: 0 10px 24px rgba(176, 96, 41, 0.34); }
.btn-navy { box-shadow: 0 6px 16px rgba(10, 33, 80, 0.2); }
.btn-outline { border-color: rgba(255,255,255,0.45); background: rgba(255,255,255,0.06); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); }
.btn:active { transform: translateY(0) scale(0.98); }

/* --- Barra superior: discreta --- */
.topbar { background: var(--navy-900); color: rgba(255,255,255,0.72); font-weight: 500; font-size: 0.8rem; border-bottom: 1px solid rgba(255,255,255,0.08); }
.topbar a { color: rgba(255,255,255,0.82); }
.topbar a:hover { color: var(--white); }
.topbar .social span { opacity: 0.35; }
.topbar .social img { height: 18px; border-radius: 4px; filter: grayscale(1) brightness(1.6); opacity: 0.8; transition: filter 0.2s, opacity 0.2s; }
.topbar .social a:hover img { filter: none; opacity: 1; }

/* --- Encabezado translúcido que se compacta al bajar --- */
.site-header {
  background: rgba(7, 26, 61, 0.92);
  backdrop-filter: saturate(160%) blur(14px); -webkit-backdrop-filter: saturate(160%) blur(14px);
  box-shadow: 0 1px 0 rgba(255,255,255,0.06), 0 10px 30px rgba(3, 12, 30, 0.25);
}
.nav-wrap { transition: padding 0.3s var(--ease); }
.site-header.is-scrolled .nav-wrap { padding-block: 0.35rem; }
.brand img { border-radius: 12px; transition: height 0.3s var(--ease); }
.site-header.is-scrolled .brand img { height: 40px; }
.brand-text b { letter-spacing: 0.08em; }
@media (min-width: 1201px) {
  nav.main-nav a { position: relative; border-radius: 999px; }
  nav.main-nav a:not(.nav-cta)::after {
    content: ""; position: absolute; left: 0.62rem; right: 0.62rem; bottom: 0.22rem; height: 2px; border-radius: 2px;
    background: var(--celeste); transform: scaleX(0); transform-origin: left; transition: transform 0.3s var(--ease);
  }
  nav.main-nav a:not(.nav-cta):hover::after, nav.main-nav a.active::after { transform: scaleX(1); }
  nav.main-nav a:hover, nav.main-nav a.active { background: rgba(255,255,255,0.07); color: var(--white); }
}
.nav-cta { background: linear-gradient(180deg, #bd6a2f, var(--oxido)) !important; color: var(--white) !important; box-shadow: 0 4px 14px rgba(176, 96, 41, 0.35); }
.nav-cta:hover { background: linear-gradient(180deg, var(--oxido), var(--oxido-dark)) !important; color: var(--white) !important; }
@media (max-width: 1200px) {
  nav.main-nav { background: rgba(7, 26, 61, 0.98); border-top: 1px solid rgba(255,255,255,0.08); }
  nav.main-nav a { border-radius: 10px; }
  nav.main-nav a.active { background: rgba(255,255,255,0.08); box-shadow: inset 3px 0 0 var(--celeste); }
}

/* --- Portada: imagen protagonista, texto a la izquierda --- */
.hero { min-height: min(82vh, 760px); }
.hero::after { background: linear-gradient(100deg, rgba(5, 16, 40, 0.92) 0%, rgba(7, 26, 61, 0.78) 42%, rgba(7, 26, 61, 0.28) 100%), linear-gradient(0deg, rgba(5,16,40,0.55) 0%, transparent 35%); }
.hero h1 { font-size: clamp(2.3rem, 5.6vw, 4.1rem); line-height: 1.08; max-width: 16ch; text-shadow: 0 2px 24px rgba(0,0,0,0.35); }
.hero p { font-size: clamp(1.02rem, 1.4vw, 1.15rem); line-height: 1.7; max-width: 58ch; }
.hero .badge { padding: 0.35rem 0.9rem; letter-spacing: 0.1em; }
/* Título de la portada en dorado */
.hero h1, .hero h1 .hl { color: #e6bf55; }
.hero-facts { list-style: none; display: flex; flex-wrap: wrap; gap: 0.6rem 1.8rem; margin-top: 2.2rem; padding-top: 1.4rem; border-top: 1px solid rgba(255,255,255,0.16); max-width: 640px; }
.hero-facts li { display: grid; line-height: 1.25; }
.hero-facts b { font-family: var(--serif); font-size: 1.35rem; color: var(--white); }
.hero-facts span { font-size: 0.78rem; letter-spacing: 0.06em; text-transform: uppercase; color: rgba(255,255,255,0.7); }

/* --- Encabezados de sección --- */
.section-head .badge { background: transparent; padding: 0; border-radius: 0; color: var(--oxido); letter-spacing: 0.14em; font-size: 0.74rem; display: inline-flex; align-items: center; gap: 0.6rem; }
.section-head .badge::before { content: ""; width: 26px; height: 2px; border-radius: 2px; background: currentColor; }
.section-head.center .badge::after, .center .section-head .badge::after { content: ""; width: 26px; height: 2px; border-radius: 2px; background: currentColor; }
.dark-band .section-head .badge, .cta-band .badge { color: var(--oxido-light); }
.section-head h2::after { display: none; }
.section-head h2 { font-size: clamp(1.8rem, 3.6vw, 2.6rem); }

/* --- Tarjetas --- */
.card { border: 1px solid rgba(10, 33, 80, 0.07); border-radius: var(--radius); box-shadow: var(--shadow-sm); }
.card:hover { transform: translateY(-4px); box-shadow: var(--shadow); border-color: rgba(10, 33, 80, 0.1); }
.card:not(:has(a.card-link)):hover { transform: none; border-color: rgba(10, 33, 80, 0.07); box-shadow: var(--shadow-sm); }
.card .thumb { position: relative; }
.news-card .thumb::after { content: ""; position: absolute; inset: auto 0 0 0; height: 40%; background: linear-gradient(transparent, rgba(5, 16, 40, 0.28)); pointer-events: none; }
.card .thumb img { transition: transform 0.6s var(--ease); }
.card .body h3 { font-size: 1.12rem; }
.news-card .body .btn { background: transparent; color: var(--navy-700); border: 0; box-shadow: none; padding: 0.3rem 0; font-size: 0.86rem; }
.news-card .body .btn::after { content: "\2192"; transition: transform 0.25s var(--ease); }
.news-card:hover .body .btn { color: var(--oxido); background: transparent; transform: none; }
.news-card:hover .body .btn::after { transform: translateX(4px); }
.cards-grid .card { border-top: 0; }
.cards-grid .card .card-body { border-top: 3px solid transparent; border-image: linear-gradient(90deg, var(--oxido), var(--celeste)) 1; }

/* --- Índice de secciones: fichas con flecha --- */
.cat-list { gap: 0.75rem; }
.cat-list li a {
  border-radius: 12px; border: 1px solid rgba(10, 33, 80, 0.08); box-shadow: var(--shadow-xs);
  padding: 0.85rem 2.4rem 0.85rem 0.85rem; position: relative;
  transition: transform 0.25s var(--ease), box-shadow 0.25s, background-color 0.2s, color 0.2s;
}
.cat-list li a::before { content: "\2693"; display: grid; place-items: center; flex-shrink: 0; width: 34px; height: 34px; border-radius: 10px; background: var(--celeste-soft); color: var(--celeste-dark); font-size: 0.95rem; transition: background-color 0.2s, color 0.2s; }
.cat-list li a::after { content: "\2192"; position: absolute; right: 0.95rem; top: 50%; transform: translate(-4px, -50%); opacity: 0; transition: opacity 0.2s, transform 0.25s var(--ease); }
.cat-list li a:hover { background: var(--navy-800); color: var(--white); box-shadow: var(--shadow-sm); }
.cat-list li a:hover::before { background: rgba(255,255,255,0.12); color: var(--celeste-light); }
.cat-list li a:hover::after { opacity: 1; transform: translate(0, -50%); }

/* --- Bandas oscuras con brillo sutil --- */
.dark-band { position: relative; isolation: isolate; background:
  radial-gradient(60% 80% at 85% 0%, rgba(74, 144, 196, 0.22), transparent 60%),
  radial-gradient(50% 70% at 0% 100%, rgba(176, 96, 41, 0.16), transparent 60%),
  linear-gradient(135deg, var(--navy-900), var(--navy-700)); }

/* --- Buscador de la portada --- */
.hist-search { max-width: 560px; }
.hist-search input {
  padding: 1rem 1.3rem 1rem 3.1rem; font-size: 1.02rem; border: 1px solid rgba(10, 33, 80, 0.12); box-shadow: var(--shadow-sm);
  background: var(--white) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='20' fill='none' stroke='%2364707d' stroke-width='2' stroke-linecap='round'%3E%3Ccircle cx='9' cy='9' r='6.5'/%3E%3Cpath d='m14 14 4.5 4.5'/%3E%3C/svg%3E") no-repeat 1.15rem 50%;
}
.hist-search input:focus { border-color: var(--celeste); box-shadow: 0 0 0 4px var(--celeste-soft), var(--shadow-sm); }
.hist-search-results { border-radius: 16px; box-shadow: var(--shadow); border-color: rgba(10, 33, 80, 0.08); }

/* --- Mapa y galería --- */
#histarmarMapa { border-radius: var(--radius); border-color: rgba(10, 33, 80, 0.08); box-shadow: var(--shadow-sm); }
.carousel { border-radius: 20px; box-shadow: var(--shadow); }
.carousel-btn { background: rgba(255,255,255,0.9); box-shadow: 0 4px 14px rgba(0,0,0,0.2); }
.carousel-slide figcaption { padding: 2.2rem 1.4rem 1.1rem; font-weight: 500; background: linear-gradient(transparent, rgba(5, 16, 40, 0.75)); }

/* --- Publicaciones: tapas como libros --- */
.pub-card .thumb { aspect-ratio: 3/4; padding: 1rem 1rem 0; background: linear-gradient(180deg, var(--gray-light), #e6ebf1); }
.pub-card .thumb img { border-radius: 4px 4px 0 0; box-shadow: 0 8px 20px rgba(10, 33, 80, 0.25); }

@media (min-width: 769px) {
  .pub-grid { grid-template-columns: repeat(4, minmax(0, 220px)); justify-content: center; }
}

/* --- Cabecera de páginas interiores --- */
.page-hero { background:
  radial-gradient(60% 90% at 90% 0%, rgba(74, 144, 196, 0.28), transparent 60%),
  radial-gradient(40% 70% at 10% 120%, rgba(176, 96, 41, 0.2), transparent 60%),
  linear-gradient(135deg, var(--navy-900), var(--navy-700));
  padding: 3.6rem 0 3.8rem; border-bottom: 0; }
.page-hero .crumb { padding: 0.28rem 0.8rem; border-radius: 999px; background: rgba(255,255,255,0.1); border: 1px solid rgba(255,255,255,0.16); font-size: 0.72rem; margin-bottom: 0.8rem; }
.page-hero h1 { font-size: clamp(2rem, 4.6vw, 3.1rem); }
.page-hero::before { opacity: 0.05; }

/* --- Paneles y banners --- */
.panel { border-radius: var(--radius); border-color: rgba(10, 33, 80, 0.07); box-shadow: var(--shadow-sm); }
.cta-banner { border-radius: 20px; border: 0; background:
  radial-gradient(60% 90% at 90% 0%, rgba(74, 144, 196, 0.26), transparent 60%),
  linear-gradient(135deg, var(--navy-900), var(--navy-700)); }
.cta-banner::before { display: none; }
.notice { border-radius: 12px; border: 1px solid rgba(74, 144, 196, 0.25); border-left: 4px solid var(--celeste); }

/* --- Pie de página --- */
footer.site-footer { background:
  radial-gradient(50% 60% at 100% 0%, rgba(74, 144, 196, 0.12), transparent 60%),
  var(--navy-900); border-top: 0; position: relative; }
footer.site-footer::before { content: ""; position: absolute; top: 0; left: 0; right: 0; height: 3px; background: linear-gradient(90deg, var(--oxido), var(--celeste)); }
.site-footer h2 { font-family: var(--font); font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.14em; color: rgba(255,255,255,0.55); }
.footer-grid > div:first-child h2 { font-family: var(--serif); font-size: 1.35rem; text-transform: none; letter-spacing: 0.04em; color: var(--white); }
.site-footer ul li a { transition: color 0.2s, padding-left 0.25s var(--ease); }
.site-footer ul li a:hover { padding-left: 4px; }
.footer-bottom { color: rgba(255,255,255,0.5); }

/* --- Elementos flotantes --- */
#toTop { background: var(--navy-800); color: var(--white); border: 1px solid rgba(255,255,255,0.15); box-shadow: var(--shadow); }
#toTop:hover { background: var(--oxido); color: var(--white); }
#cookieBar { background: rgba(7, 26, 61, 0.96); }
@media (min-width: 769px) {
  #cookieBar { left: 1.25rem; right: auto; bottom: 1.25rem; max-width: 520px; border-radius: 16px; border: 1px solid rgba(255,255,255,0.12); box-shadow: var(--shadow); justify-content: flex-start; flex-wrap: nowrap; padding: 1rem 1.2rem; }
}

/* --- Móvil --- */
@media (max-width: 768px) {
  .hero { min-height: auto; }
  .hero::after { background: linear-gradient(180deg, rgba(5, 16, 40, 0.72) 0%, rgba(7, 26, 61, 0.9) 100%); }
  .hero-facts { gap: 0.8rem 1.4rem; margin-top: 1.8rem; }
  .hero-facts b { font-size: 1.15rem; }
  .pub-grid { grid-template-columns: repeat(2, 1fr); gap: 1rem; }
  .pub-card .thumb { padding: 0.7rem 0.7rem 0; }
  .pub-card .body .tag { white-space: nowrap; font-size: 0.64rem; letter-spacing: 0.03em; }
  .section-head h2 { font-size: clamp(1.6rem, 7vw, 2rem); }
  .topbar .container { padding-block: 0.25rem; }
}

@media (prefers-reduced-motion: reduce) {
  .card:hover, .cat-list li a:hover { transform: none; }
}

/* Imágenes inexistentes (las marca main.js) */
.img-rota { display: none !important; }

/* Buscador: resultados del archivo histórico (Pagefind) */
.archivo-bloque { margin-top: 2.6rem; padding-top: 1.8rem; border-top: 1px solid var(--line); display: grid; gap: 1rem; }
.archivo-bloque h2 { font-size: 1.35rem; }
.archivo-bloque #archivoCount { color: var(--muted); font-size: 0.92rem; margin: 0; }
.archivo-bloque .btn { justify-self: center; }
.search-results .result-path { display: block; font-size: 0.78rem; color: var(--muted); margin-top: 0.15rem; overflow-wrap: anywhere; }

/* Mapa de la portada: botones de zoom más grandes en pantallas táctiles (mínimo recomendado 44 px) */
@media (max-width: 768px), (pointer: coarse) {
  #histarmarMapa .leaflet-control-zoom a { width: 44px; height: 44px; line-height: 44px; font-size: 24px; }
  #histarmarMapa .leaflet-control-zoom a:first-child { border-top-left-radius: 8px; border-top-right-radius: 8px; }
  #histarmarMapa .leaflet-control-zoom a:last-child { border-bottom-left-radius: 8px; border-bottom-right-radius: 8px; }
}
