/* Fuentes auto-alojadas: Sora (titulares) + Newsreader (cuerpo) */
@font-face {
  font-family: 'Newsreader';
  font-style: italic;
  font-weight: 400;
  font-display: swap;
  src: url('/assets/fonts/newsreader-italic-400-latin-ext.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: 'Newsreader';
  font-style: italic;
  font-weight: 400;
  font-display: swap;
  src: url('/assets/fonts/newsreader-italic-400-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Newsreader';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('/assets/fonts/newsreader-normal-400-latin-ext.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: 'Newsreader';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('/assets/fonts/newsreader-normal-400-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Newsreader';
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url('/assets/fonts/newsreader-normal-500-latin-ext.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: 'Newsreader';
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url('/assets/fonts/newsreader-normal-500-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Sora';
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url('/assets/fonts/sora-normal-700-latin-ext.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: 'Sora';
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url('/assets/fonts/sora-normal-700-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Sora';
  font-style: normal;
  font-weight: 800;
  font-display: swap;
  src: url('/assets/fonts/sora-normal-800-latin-ext.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: 'Sora';
  font-style: normal;
  font-weight: 800;
  font-display: swap;
  src: url('/assets/fonts/sora-normal-800-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
/* ============================================================
   AquaPez — identidad "Profundidad" (v6)
   Diseño propio: oscuro marino + coral + burbujas + olas.
   HTML/CSS/JS puros, sin frameworks. Mobile-first.
   Tipografías: Sora (titulares/UI) + Newsreader (cuerpo).
   ============================================================ */

:root {
  --bg: #E9F4F7;
  --surface: #FFFFFF;
  --ink: #0B2A3A;
  --ink-soft: #4E6E80;
  --deep: #0A2C3D;
  --deep-2: #0E3D52;
  --deep-3: #125A74;
  --primary: #0077B6;
  --primary-dark: #005A8C;
  --coral: #C7431F;
  --coral-dark: #A83718;
  --coral-bright: #E4572E;
  --aqua-light: #BFE3EC;
  --aqua-mist: #D9EFF5;
  --border: #CFE3EA;
  --sea-green: #1E9E8A;
  --radius: 20px;
  --pill: 999px;
  --shadow: 0 4px 18px rgba(11, 42, 58, 0.10);
  --shadow-hover: 0 10px 30px rgba(11, 42, 58, 0.18);
  --font-head: "Sora", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-body: "Newsreader", Georgia, "Times New Roman", serif;
  --container: 1120px;
  --wave: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 1200 60' preserveAspectRatio='none'%3E%3Cpath d='M0,32 C200,60 400,0 600,28 C800,56 1000,8 1200,32 L1200,60 L0,60 Z' fill='%23E9F4F7'/%3E%3C/svg%3E");
}

/* ---------- Reset y base ---------- */
*,
*::before,
*::after { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 1.075rem;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}

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

h1, h2, h3, h4 {
  font-family: var(--font-head);
  font-weight: 800;
  line-height: 1.22;
  margin: 0 0 0.6em;
  color: var(--ink);
  letter-spacing: -0.01em;
}

p { margin: 0 0 1em; }

a {
  color: var(--primary-dark);
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-thickness: 1.5px;
}
a:hover { color: var(--primary); }

:focus-visible {
  outline: 3px solid var(--primary);
  outline-offset: 2px;
  border-radius: 6px;
}

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

.container {
  width: 100%;
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 1.25rem;
}

/* ---------- Header (marino oscuro) ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--deep);
  border-bottom: 1px solid rgba(191, 227, 236, 0.18);
  box-shadow: 0 2px 14px rgba(4, 20, 28, 0.35);
}

.site-header .container {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem 1rem;
  min-height: 66px;
  padding-top: 0.6rem;
  padding-bottom: 0.6rem;
}

.logo { display: inline-flex; align-items: center; gap: 0.6rem; text-decoration: none; }
.logo:hover { text-decoration: none; }
.logo-mark { flex: 0 0 auto; display: block; }
.logo-word {
  font-family: var(--font-head);
  font-weight: 800;
  font-size: 1.35rem;
  letter-spacing: 0.01em;
  color: #FFFFFF;
  line-height: 1;
  white-space: nowrap;
}
.logo-word em { font-style: normal; color: var(--coral-bright); }
@media (max-width: 480px) {
  .logo-word { font-size: 1.15rem; }
  .logo-mark { width: 32px; height: 32px; }
}

.header-actions { display: flex; align-items: center; gap: 0.75rem; }

.search-link {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  color: var(--aqua-light);
  text-decoration: none;
  font-family: var(--font-head);
  font-weight: 600;
  font-size: 0.92rem;
  padding: 0.55rem 1rem;
  border-radius: var(--pill);
  border: 1px solid rgba(191, 227, 236, 0.35);
}
.search-link:hover { background: rgba(191, 227, 236, 0.14); color: #FFFFFF; }

#nav-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  background: transparent;
  border: 1px solid rgba(191, 227, 236, 0.35);
  border-radius: 50%;
  cursor: pointer;
  color: #FFFFFF;
}
#nav-toggle:hover { background: rgba(191, 227, 236, 0.14); }
#nav-toggle .bar {
  display: block;
  width: 20px;
  height: 2px;
  background: currentColor;
  position: relative;
  border-radius: 2px;
}
#nav-toggle .bar::before,
#nav-toggle .bar::after {
  content: "";
  position: absolute;
  left: 0;
  width: 20px;
  height: 2px;
  background: currentColor;
  border-radius: 2px;
}
#nav-toggle .bar::before { top: -6px; }
#nav-toggle .bar::after { top: 6px; }

#main-nav {
  display: none;
  flex-basis: 100%;
  border-top: 1px solid rgba(191, 227, 236, 0.18);
  background: var(--deep);
}
#main-nav.open { display: block; }
#main-nav ul {
  list-style: none;
  margin: 0;
  padding: 0.6rem 0;
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}
#main-nav a {
  display: block;
  padding: 0.65rem 0.9rem;
  color: var(--aqua-light);
  text-decoration: none;
  font-family: var(--font-head);
  font-weight: 600;
  font-size: 0.95rem;
  border-radius: var(--pill);
}
#main-nav a:hover { background: rgba(191, 227, 236, 0.14); color: #FFFFFF; }
#main-nav a[aria-current="page"] {
  color: #FFFFFF;
  background: var(--primary);
}

/* ---------- Breadcrumb ---------- */
.breadcrumb {
  display: inline-flex;
  font-family: var(--font-head);
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--ink-soft);
  margin: 1.25rem 0 0;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--pill);
  padding: 0.45rem 1.1rem;
}
.breadcrumb ol {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  align-items: center;
}
.breadcrumb li + li::before { content: "›"; margin-right: 0.4rem; color: var(--primary); font-weight: 800; }
.breadcrumb a { color: var(--ink-soft); text-decoration: none; }
.breadcrumb a:hover { color: var(--primary-dark); }
.breadcrumb [aria-current="page"] { color: var(--ink); }

/* ---------- Hero (océano con burbujas y ola) ---------- */
.hero {
  position: relative;
  background: linear-gradient(165deg, var(--deep) 0%, var(--deep-2) 62%, var(--deep-3) 100%);
  color: #FFFFFF;
  overflow: hidden;
}
/* Burbujas decorativas */
.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background-image:
    radial-gradient(circle at 8% 78%, rgba(191,227,236,0.20) 0 9px, transparent 10px),
    radial-gradient(circle at 14% 30%, rgba(191,227,236,0.14) 0 6px, transparent 7px),
    radial-gradient(circle at 88% 22%, rgba(191,227,236,0.16) 0 11px, transparent 12px),
    radial-gradient(circle at 93% 68%, rgba(191,227,236,0.12) 0 7px, transparent 8px),
    radial-gradient(circle at 70% 85%, rgba(191,227,236,0.10) 0 5px, transparent 6px),
    radial-gradient(circle at 45% 12%, rgba(191,227,236,0.10) 0 8px, transparent 9px);
}
/* Ola inferior */
.hero::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -1px;
  height: 54px;
  background: var(--wave) no-repeat center bottom / 100% 100%;
  pointer-events: none;
}
.hero .container {
  position: relative;
  z-index: 1;
  display: grid;
  gap: 1.75rem;
  padding-top: 2.75rem;
  padding-bottom: 4.5rem;
  align-items: center;
}
.hero-badge {
  display: inline-block;
  font-family: var(--font-head);
  font-size: 0.75rem;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: #FFFFFF;
  background: var(--coral);
  border-radius: var(--pill);
  padding: 0.45rem 1.1rem;
  margin: 0 0 1rem;
}
.hero h1 {
  color: #FFFFFF;
  font-size: 2.15rem;
  margin-bottom: 0.6rem;
}
.hero .tagline {
  color: var(--aqua-light);
  font-size: 1.15rem;
  margin-bottom: 1.5rem;
  max-width: 34rem;
}
.hero-cta {
  display: inline-block;
  background: var(--coral);
  color: #FFFFFF;
  font-family: var(--font-head);
  font-weight: 700;
  font-size: 1rem;
  text-decoration: none;
  padding: 0.85rem 1.9rem;
  border-radius: var(--pill);
  box-shadow: 0 6px 20px rgba(199, 67, 31, 0.45);
}
.hero-cta:hover { background: var(--coral-dark); color: #FFFFFF; transform: translateY(-1px); }
.hero-media img {
  border-radius: 24px;
  width: 100%;
  height: auto;
  border: 5px solid rgba(191, 227, 236, 0.22);
  box-shadow: 0 18px 44px rgba(0, 0, 0, 0.35);
}

/* ---------- Secciones ---------- */
.section { padding: 2.75rem 0; }
.section-title {
  font-size: 1.75rem;
  margin-bottom: 0.35rem;
}
.section-title::after {
  content: "";
  display: block;
  width: 58px;
  height: 5px;
  border-radius: var(--pill);
  background: linear-gradient(90deg, var(--primary), var(--coral-bright));
  margin-top: 0.55rem;
}
.section-lead {
  color: var(--ink-soft);
  margin-bottom: 1.75rem;
  max-width: 46rem;
  font-size: 1.1rem;
}

/* ---------- Tarjetas de artículos ---------- */
.card-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.6rem;
}

.card {
  background: var(--surface);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  transition: transform 0.18s ease, box-shadow 0.18s ease;
  border: 1px solid rgba(207, 227, 234, 0.7);
}
.card:hover { transform: translateY(-5px); box-shadow: var(--shadow-hover); }
.card-link { text-decoration: none; color: inherit; display: flex; flex-direction: column; height: 100%; }
.card-link:hover { color: inherit; }
.card-media { position: relative; }
.card-media img { width: 100%; aspect-ratio: 16 / 10; object-fit: cover; }
.card-category {
  position: absolute;
  left: 1rem;
  bottom: -0.85rem;
  font-family: var(--font-head);
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: #FFFFFF;
  background: var(--coral);
  border-radius: var(--pill);
  padding: 0.4rem 0.95rem;
  box-shadow: 0 4px 12px rgba(199, 67, 31, 0.4);
}
.card-body { padding: 1.5rem 1.3rem 1.4rem; display: flex; flex-direction: column; gap: 0.45rem; flex: 1; }
.card-title { font-size: 1.18rem; margin: 0; color: var(--ink); font-weight: 700; }
.card-link:hover .card-title { color: var(--primary-dark); }
.card-excerpt { font-size: 1rem; color: var(--ink-soft); margin: 0; flex: 1; }
.card-meta { font-size: 0.85rem; color: var(--ink-soft); font-family: var(--font-head); font-weight: 600; }

/* Tarjetas de categoría (home) */
.category-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.4rem;
}
.category-card {
  position: relative;
  background: var(--surface);
  border-radius: var(--radius);
  padding: 1.6rem 1.5rem 1.4rem;
  box-shadow: var(--shadow);
  overflow: hidden;
  border: 1px solid rgba(207, 227, 234, 0.7);
}
.category-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 6px;
  background: var(--primary);
}
.category-card:nth-child(2)::before { background: var(--coral); }
.category-card:nth-child(3)::before { background: var(--sea-green); }
.category-card:nth-child(4)::before { background: var(--deep-3); }
.category-card h3 { font-size: 1.3rem; margin-bottom: 0.4rem; }
.category-card h3 a { color: var(--ink); text-decoration: none; }
.category-card h3 a:hover { color: var(--primary-dark); }
.category-card p { color: var(--ink-soft); font-size: 1rem; margin: 0 0 1rem; }
.category-card .more-link {
  font-family: var(--font-head);
  font-weight: 700;
  font-size: 0.92rem;
  text-decoration: none;
  color: var(--primary-dark);
}
.category-card .more-link:hover { color: var(--coral); }

/* ---------- Artículo ---------- */
main.container > article { max-width: 46rem; }
main.container > article h1 { font-size: 2rem; margin-top: 1rem; }
.article-meta {
  font-family: var(--font-head);
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--ink-soft);
  margin-bottom: 1.25rem;
}
main.container > article > img {
  border-radius: var(--radius);
  margin: 0 0 1.5rem;
  box-shadow: var(--shadow);
}
.lead {
  font-size: 1.22rem;
  line-height: 1.65;
  color: var(--ink);
  font-weight: 500;
}
.lead::first-letter {
  font-family: var(--font-head);
  font-weight: 800;
  font-size: 3.1em;
  float: left;
  line-height: 0.85;
  padding: 0.08em 0.12em 0 0;
  color: var(--primary);
}
main.container > article h2 { font-size: 1.6rem; margin: 2.2rem 0 0.8rem; }
main.container > article h3 { font-size: 1.3rem; margin: 1.8rem 0 0.6rem; }
main.container > article ul, main.container > article ol { margin: 0 0 1.25em; padding-left: 1.4rem; }
main.container > article li { margin-bottom: 0.45em; }
main.container > article li::marker { color: var(--coral); font-weight: 700; }
main.container > article blockquote {
  margin: 1.6em 0;
  padding: 1.1em 1.35em;
  border-left: 5px solid var(--coral);
  background: var(--surface);
  border-radius: 0 var(--radius) var(--radius) 0;
  color: var(--ink-soft);
  font-style: italic;
  box-shadow: var(--shadow);
}
main.container > article blockquote p { margin: 0; }

/* Tablas */
main.container > article table, .table-wrap table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  margin: 1.5rem 0;
  font-size: 0.98rem;
  background: var(--surface);
  border-radius: 14px;
  overflow: hidden;
  box-shadow: var(--shadow);
}
main.container > article th, .table-wrap th {
  background: var(--deep);
  color: #FFFFFF;
  font-family: var(--font-head);
  font-weight: 700;
  font-size: 0.88rem;
  text-align: left;
  padding: 0.75rem 1rem;
}
main.container > article td, .table-wrap td {
  padding: 0.7rem 1rem;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
}
main.container > article tr:last-child td, .table-wrap tr:last-child td { border-bottom: none; }
main.container > article tbody tr:nth-child(even), .table-wrap tbody tr:nth-child(even) { background: #F4FAFC; }
.table-wrap { overflow-x: auto; margin: 1.5rem 0; border-radius: 14px; }

/* Contenido de páginas de sección */
.article-content { max-width: 46rem; font-size: 1.08rem; }

/* Índice del artículo */
.toc {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.2rem 1.4rem;
  margin: 1.75rem 0;
  box-shadow: var(--shadow);
}
.toc-title { font-family: var(--font-head); font-weight: 800; color: var(--ink); margin: 0 0 0.6rem; font-size: 1.05rem; }
.toc ol { margin: 0; padding: 0; list-style: none; display: flex; flex-wrap: wrap; gap: 0.5rem; }
.toc li { margin: 0; }
.toc a {
  display: inline-block;
  color: var(--primary-dark);
  text-decoration: none;
  font-family: var(--font-head);
  font-size: 0.86rem;
  font-weight: 600;
  background: var(--aqua-mist);
  border-radius: var(--pill);
  padding: 0.4rem 0.95rem;
}
.toc a:hover { background: var(--primary); color: #FFFFFF; }

/* Compartir */
.share { border-top: 2px solid var(--border); margin-top: 2.25rem; padding-top: 1.4rem; }
.share-title { font-family: var(--font-head); font-weight: 800; color: var(--ink); margin: 0 0 0.8rem; font-size: 1.05rem; }
.share-buttons { display: flex; flex-wrap: wrap; gap: 0.6rem; }
.share-btn {
  display: inline-block;
  padding: 0.55rem 1.15rem;
  border-radius: var(--pill);
  border: 1.5px solid var(--border);
  background: var(--surface);
  color: var(--ink);
  font-family: var(--font-head);
  font-size: 0.88rem;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
}
.share-btn:hover { background: var(--deep); color: #FFFFFF; border-color: var(--deep); text-decoration: none; }

/* Caja de autor */
.author-box {
  position: relative;
  background: linear-gradient(135deg, var(--aqua-mist), #FFFFFF);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.4rem 1.4rem 1.4rem 4.6rem;
  margin: 2rem 0;
  box-shadow: var(--shadow);
}
.author-box::before {
  content: "AP";
  position: absolute;
  left: 1.2rem;
  top: 1.3rem;
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: var(--deep);
  color: #FFFFFF;
  font-family: var(--font-head);
  font-weight: 800;
  font-size: 1.05rem;
  display: flex;
  align-items: center;
  justify-content: center;
}
.author-box p { margin: 0 0 0.4rem; font-size: 0.98rem; }
.author-box p:first-child { font-family: var(--font-head); font-weight: 700; color: var(--ink); }

/* Relacionados */
.related { margin-top: 2.25rem; }
.related h2 { font-size: 1.45rem; }
.related h2::after {
  content: "";
  display: block;
  width: 46px;
  height: 4px;
  border-radius: var(--pill);
  background: linear-gradient(90deg, var(--primary), var(--coral-bright));
  margin-top: 0.45rem;
}
.related ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 0.55rem; }
.related li a {
  display: block;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 0.8rem 1.1rem;
  text-decoration: none;
  font-family: var(--font-head);
  font-weight: 600;
  font-size: 0.98rem;
  color: var(--ink);
}
.related li a:hover { border-color: var(--primary); color: var(--primary-dark); transform: translateX(3px); }

/* ---------- Newsletter (panel marino) ---------- */
.newsletter {
  position: relative;
  background: linear-gradient(150deg, var(--deep) 0%, var(--deep-2) 100%);
  border-radius: 26px;
  padding: 2.25rem 1.75rem;
  box-shadow: 0 14px 36px rgba(6, 28, 38, 0.35);
  max-width: 46rem;
  margin: 0 auto;
  text-align: center;
  overflow: hidden;
}
.newsletter::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background-image:
    radial-gradient(circle at 92% 12%, rgba(191,227,236,0.16) 0 10px, transparent 11px),
    radial-gradient(circle at 6% 88%, rgba(191,227,236,0.12) 0 8px, transparent 9px),
    radial-gradient(circle at 80% 90%, rgba(191,227,236,0.10) 0 6px, transparent 7px);
}
.newsletter > * { position: relative; z-index: 1; }
.newsletter h2 { font-size: 1.6rem; color: #FFFFFF; }
.newsletter p { color: var(--aqua-light); }
.newsletter-form { display: flex; flex-direction: column; gap: 0.65rem; margin: 1.25rem auto 0; max-width: 26rem; }
.newsletter .form-note { color: rgba(191, 227, 236, 0.75); font-size: 0.85rem; }
.newsletter .form-note a { color: #FFFFFF; }

/* ---------- Footer (marino con ola superior) ---------- */
.site-footer {
  position: relative;
  background: var(--deep);
  color: var(--aqua-light);
  margin-top: 4rem;
  padding-top: 3.5rem;
}
.site-footer::before {
  content: "";
  position: absolute;
  top: -53px;
  left: 0;
  right: 0;
  height: 54px;
  background: var(--wave) no-repeat center bottom / 100% 100%;
  transform: scaleY(-1);
  pointer-events: none;
}
.site-footer .container {
  display: grid;
  grid-template-columns: 1fr;
  gap: 2rem;
  padding-bottom: 1.5rem;
}
.site-footer h2 {
  color: #FFFFFF;
  font-size: 1rem;
  font-family: var(--font-head);
  font-weight: 700;
  margin-bottom: 0.9rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.site-footer .footer-brand { font-family: var(--font-head); font-weight: 800; font-size: 1.4rem; color: #FFFFFF; }
.site-footer .footer-brand::after {
  content: "";
  display: block;
  width: 40px;
  height: 4px;
  border-radius: var(--pill);
  background: var(--coral-bright);
  margin-top: 0.5rem;
}
.site-footer p { font-size: 0.95rem; margin-bottom: 0.8rem; }
.site-footer ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 0.45rem; }
.site-footer a { color: var(--aqua-light); text-decoration: none; font-size: 0.93rem; }
.site-footer a:hover { color: #FFFFFF; text-decoration: underline; text-underline-offset: 3px; }
#open-cookie-settings {
  background: transparent;
  border: 1.5px solid rgba(191, 227, 236, 0.4);
  color: var(--aqua-light);
  border-radius: var(--pill);
  padding: 0.55rem 1.15rem;
  font-family: var(--font-head);
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  margin-top: 0.6rem;
}
#open-cookie-settings:hover { border-color: #FFFFFF; color: #FFFFFF; }
.footer-legal {
  border-top: 1px solid rgba(191, 227, 236, 0.18);
  padding-top: 1.25rem;
  font-size: 0.85rem;
  color: rgba(191, 227, 236, 0.65);
}

/* ---------- Formularios ---------- */
form { max-width: 34rem; }
.field { margin-bottom: 1.1rem; }
label { display: block; font-family: var(--font-head); font-weight: 600; font-size: 0.92rem; margin-bottom: 0.35rem; }
input[type="text"],
input[type="email"],
input[type="search"],
textarea {
  width: 100%;
  padding: 0.75rem 1.1rem;
  border: 1.5px solid var(--border);
  border-radius: var(--pill);
  font-family: var(--font-body);
  font-size: 1rem;
  background: var(--surface);
  color: var(--ink);
}
textarea { border-radius: 18px; }
input:focus, textarea:focus { border-color: var(--primary); outline: none; box-shadow: 0 0 0 3px rgba(0, 119, 182, 0.22); }
textarea { min-height: 140px; resize: vertical; }
button.btn, .btn {
  display: inline-block;
  background: var(--coral);
  color: #FFFFFF;
  border: none;
  border-radius: var(--pill);
  padding: 0.8rem 1.8rem;
  font-size: 1rem;
  font-weight: 700;
  font-family: var(--font-head);
  cursor: pointer;
  text-decoration: none;
}
button.btn:hover, .btn:hover { background: var(--coral-dark); color: #FFFFFF; }
.form-error { color: var(--coral-dark); font-size: 0.88rem; margin-top: 0.3rem; font-weight: 600; }
.form-success {
  background: #E9F7EF;
  border: 1.5px solid #9ADBB5;
  color: #1E6B3A;
  border-radius: 16px;
  padding: 0.9rem 1.1rem;
  margin-bottom: 1rem;
}
.form-note { font-size: 0.85rem; color: var(--ink-soft); margin-top: 0.75rem; }

/* ---------- Buscador ---------- */
.search-page { max-width: 44rem; }
.search-page h1 { font-size: 1.9rem; }
#search-results { margin-top: 1.5rem; display: flex; flex-direction: column; gap: 1rem; }
.search-result {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.15rem 1.3rem;
  box-shadow: var(--shadow);
}
.search-result h3 { font-size: 1.15rem; margin-bottom: 0.3rem; }
.search-result h3 a { color: var(--ink); text-decoration: none; }
.search-result h3 a:hover { color: var(--primary-dark); }
.search-result .card-category { position: static; display: inline-block; margin-bottom: 0.4rem; box-shadow: none; }
.search-result p { color: var(--ink-soft); font-size: 0.98rem; margin: 0; }
.search-status { color: var(--ink-soft); font-style: italic; }

/* ---------- Placeholders de anuncios (INACTIVOS) ---------- */
.ad-slot { display: none; }
body.ads-preview .ad-slot {
  display: block;
  border: 2px dashed var(--primary);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--ink-soft);
  text-align: center;
  padding: 1.5rem 1rem;
  margin: 1.5rem auto;
  max-width: 728px;
  font-size: 0.85rem;
}
body.ads-preview .ad-slot::before {
  content: "Espacio publicitario (vista previa) — slot: " attr(data-ad-slot);
  display: block;
  font-family: var(--font-head);
  font-weight: 700;
  margin-bottom: 0.25rem;
  color: var(--primary-dark);
}

/* ---------- Banner y modal de cookies ---------- */
#cookie-banner {
  position: fixed;
  left: 1rem;
  right: 1rem;
  bottom: 1rem;
  z-index: 200;
  background: var(--deep);
  color: var(--aqua-light);
  padding: 1.2rem 1.4rem;
  border-radius: var(--radius);
  box-shadow: 0 12px 36px rgba(4, 20, 28, 0.5);
  border: 1px solid rgba(191, 227, 236, 0.2);
}
#cookie-banner[hidden] { display: none; }
#cookie-banner .container {
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
  padding: 0;
}
#cookie-banner p { margin: 0; font-size: 0.95rem; }
#cookie-banner a { color: #FFFFFF; }
.cookie-buttons { display: flex; flex-wrap: wrap; gap: 0.6rem; }
.cookie-buttons button {
  border-radius: var(--pill);
  padding: 0.6rem 1.25rem;
  font-size: 0.9rem;
  font-weight: 700;
  font-family: var(--font-head);
  cursor: pointer;
}
.cookie-accept { background: var(--coral); color: #FFFFFF; border: none; }
.cookie-accept:hover { background: var(--coral-dark); }
.cookie-reject { background: transparent; color: var(--aqua-light); border: 1.5px solid rgba(191,227,236,0.4); }
.cookie-reject:hover { border-color: #FFFFFF; color: #FFFFFF; }
.cookie-config { background: transparent; color: var(--aqua-light); border: 1.5px solid rgba(191,227,236,0.4); }
.cookie-config:hover { border-color: #FFFFFF; color: #FFFFFF; }

#cookie-modal { border: none; border-radius: var(--radius); padding: 0; max-width: 34rem; width: calc(100% - 2.5rem); }
#cookie-modal::backdrop { background: rgba(6, 28, 38, 0.65); }
.cookie-modal-inner { padding: 1.75rem; }
.cookie-modal-inner h2 { font-size: 1.4rem; }
.cookie-category {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  padding: 0.9rem 0;
  border-bottom: 1px solid var(--border);
}
.cookie-category .cookie-desc { font-size: 0.9rem; color: var(--ink-soft); margin: 0.15rem 0 0; }
.cookie-category strong { display: block; font-family: var(--font-head); }

/* ---------- Página de error ---------- */
.error-page { text-align: center; padding: 4rem 0; }
.error-page h1 { font-size: 3rem; margin-bottom: 0.5rem; }
.error-page .error-links { margin-top: 1.5rem; display: flex; flex-wrap: wrap; gap: 0.6rem; justify-content: center; }

/* ---------- Tabla de créditos ---------- */
.credits-table { width: 100%; border-collapse: collapse; font-size: 0.95rem; }
.credits-table th, .credits-table td { text-align: left; padding: 0.65rem 0.8rem; border-bottom: 1px solid var(--border); vertical-align: middle; }
.credits-table thead th { background: var(--deep); color: #FFFFFF; font-family: var(--font-head); font-size: 0.85rem; }
.credits-table tbody tr:nth-child(even) { background: #F4FAFC; }
.credits-table img { border-radius: 8px; display: block; }
.credits-table a { color: var(--primary-dark); }

/* ---------- Responsive ---------- */
@media (min-width: 720px) {
  .hero .container { grid-template-columns: 1fr 1fr; padding-top: 3.25rem; padding-bottom: 5rem; }
  .hero h1 { font-size: 2.7rem; }
  .card-grid { grid-template-columns: repeat(2, 1fr); }
  .category-grid { grid-template-columns: repeat(2, 1fr); }
  .site-footer .container { grid-template-columns: 1.4fr 1fr 1fr; }
  .newsletter { padding: 2.5rem 2.5rem; }
  .newsletter-form { flex-direction: row; }
  .newsletter-form input { flex: 1; }
  #cookie-banner { left: auto; right: 1.5rem; bottom: 1.5rem; max-width: 26rem; }
  #cookie-banner .container { flex-direction: column; align-items: stretch; }
}

@media (min-width: 1024px) {
  #nav-toggle { display: none; }
  .site-header .container { flex-wrap: nowrap; min-height: 74px; padding-top: 0; padding-bottom: 0; }
  #main-nav { display: block; flex-basis: auto; border-top: none; background: transparent; }
  #main-nav ul { flex-direction: row; gap: 0.3rem; padding: 0; align-items: center; }
  .card-grid { grid-template-columns: repeat(3, 1fr); }
  .category-grid { grid-template-columns: repeat(4, 1fr); }
  .hero h1 { font-size: 3.1rem; }
  main.container > article h1 { font-size: 2.4rem; }
}
