/* ==========================================================================
   HISTORIAS REY SANTANA — SISTEMA DE DISEÑO EDITORIAL PREMIUM
   Identidad visual extraida del emblema oficial (Azul Noche · Oro · Carmesi)
   Optimizado para accesibilidad senior, Core Web Vitals y Google AdSense
   ========================================================================== */

:root {
  /* 60% Lienzo de lectura calido y sereno */
  --bg: #f6f2ea;
  --surface: #ffffff;
  --surface-warm: #efe9dc;
  --surface-tint: #faf8f3;

  /* Tinta de altisimo contraste (WCAG AAA) */
  --ink: #151412;
  --ink-soft: #3d3832;
  --ink-muted: #6b6359;

  /* 30% Identidad de marca (del logo Rey Santana) */
  --navy: #0b1829;
  --navy-mid: #142842;
  --crimson: #6b1513;
  --crimson-mid: #861d1a;

  /* 10% Acento oro editorial */
  --gold: #7f530d;
  --gold-solid: #8a5a0c;
  --gold-hover: #704808;
  --gold-bright: #ecc26c;
  --gold-soft: rgba(143, 94, 15, 0.12);

  /* Bordes y elevaciones */
  --border: #dfd8c8;
  --border-strong: #c7bda8;
  --fb-blue: #1466d6;
  --fb-hover: #0f52ad;
  --wa-green: #137a3b;
  --wa-hover: #0e602e;

  --shadow-xs: 0 1px 3px rgba(11, 24, 41, 0.05);
  --shadow-sm: 0 4px 14px rgba(11, 24, 41, 0.06);
  --shadow-md: 0 14px 36px rgba(11, 24, 41, 0.09);
  --shadow-lg: 0 22px 54px rgba(11, 24, 41, 0.14);

  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --max-width: 1200px;

  --font-display: 'Playfair Display', Georgia, 'Times New Roman', serif;
  --font-reading: 'Merriweather', Georgia, serif;
  --font-ui: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

/* Tema Sepia (Lectura prolongada sin fatiga) */
body.theme-sepia {
  --bg: #ece2ce;
  --surface: #f7f0e2;
  --surface-warm: #e4d7bd;
  --surface-tint: #f2e8d5;
  --ink: #261d13;
  --ink-soft: #483826;
  --ink-muted: #6e5942;
  --border: #d2c2a3;
  --border-strong: #b9a480;
  --gold: #744707;
  --gold-solid: #825008;
  --gold-hover: #663e05;
}

/* Tema Noche Cinematografico */
body.theme-dark {
  --bg: #0c1017;
  --surface: #131922;
  --surface-warm: #1a2230;
  --surface-tint: #161d28;
  --ink: #f3f4f6;
  --ink-soft: #cdd3de;
  --ink-muted: #939cad;
  --border: #253042;
  --border-strong: #37465e;
  --gold: #e7bc62;
  --gold-solid: #d4a342;
  --gold-hover: #bc8d2f;
  --gold-soft: rgba(231, 188, 98, 0.14);
  --shadow-sm: 0 4px 16px rgba(0, 0, 0, 0.35);
  --shadow-md: 0 14px 36px rgba(0, 0, 0, 0.45);
}

/* Reset y control estricto de scroll (salto directo sin inercia) */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: auto !important;
  font-size: 16px;
}

body {
  font-family: var(--font-ui);
  background-color: var(--bg);
  color: var(--ink);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
  transition: background-color 0.2s ease, color 0.2s ease;
}

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

a {
  color: inherit;
}

/* Ocultar posibles insignias inyectadas externamente */
[class*="netlify-badge"], [id*="netlify-badge"], a[href*="netlify.com/sites"] {
  display: none !important;
  visibility: hidden !important;
}

/* Linea arquitectonica superior inspirada en el logo (Azul · Oro · Carmesi) */
.brand-split-bar {
  height: 4px;
  width: 100%;
  background: linear-gradient(90deg, var(--navy) 0%, #1c3d63 32%, var(--gold-bright) 50%, var(--crimson-mid) 68%, var(--crimson) 100%);
}

/* Barra de progreso de lectura */
#reading-progress {
  position: fixed;
  top: 0;
  left: 0;
  height: 4px;
  width: 0%;
  background: linear-gradient(90deg, var(--gold-solid), var(--gold-bright), var(--crimson-mid));
  z-index: 1200;
  display: none;
  pointer-events: none;
}

/* Cintillo de Edicion Diaria */
.edition-bar {
  background: var(--navy);
  color: #e2dcd0;
  font-size: 0.8rem;
  border-bottom: 1px solid rgba(236, 194, 108, 0.2);
}

.edition-bar-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0.48rem 1.25rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.edition-label {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 700;
  letter-spacing: 0.9px;
  text-transform: uppercase;
  color: var(--gold-bright);
}

.edition-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--gold-bright);
  box-shadow: 0 0 8px var(--gold-bright);
}

.edition-meta {
  color: #c5cedb;
  font-weight: 500;
}

/* Cabecera Principal Sticky */
.site-header {
  position: sticky;
  top: 0;
  z-index: 200;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  box-shadow: var(--shadow-xs);
}

.header-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0.75rem 1.25rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.brand-link {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  text-decoration: none;
  cursor: pointer;
}

.brand-logo-frame {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  overflow: hidden;
  border: 2px solid var(--gold-solid);
  box-shadow: 0 3px 10px rgba(11, 24, 41, 0.18);
  flex-shrink: 0;
  background: var(--navy);
}

.brand-logo-frame img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.brand-wordmark {
  display: flex;
  flex-direction: column;
}

.brand-title {
  font-family: var(--font-display);
  font-size: 1.4rem;
  font-weight: 800;
  letter-spacing: 0.02em;
  line-height: 1.05;
  color: var(--ink);
}

.brand-sub {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--gold);
  margin-top: 2px;
}

/* Navegacion Desktop */
.main-nav {
  display: flex;
  align-items: center;
  gap: 0.2rem;
}

.nav-item {
  text-decoration: none;
  font-size: 0.94rem;
  font-weight: 600;
  color: var(--ink-soft);
  padding: 0.55rem 0.9rem;
  border-radius: var(--radius-sm);
  transition: background 0.15s, color 0.15s;
  background: transparent;
  border: none;
  font-family: inherit;
  cursor: pointer;
}

.nav-item:hover,
.nav-item.active {
  background: var(--gold-soft);
  color: var(--gold);
}

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

.btn-saved-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.55rem 0.9rem;
  border-radius: 10px;
  border: 1.5px solid var(--border-strong);
  background: var(--surface-tint);
  color: var(--ink);
  font-family: inherit;
  font-size: 0.9rem;
  font-weight: 700;
  cursor: pointer;
  min-height: 42px;
  transition: border-color 0.15s, color 0.15s;
}

.btn-saved-pill:hover {
  border-color: var(--gold-solid);
  color: var(--gold);
}

.saved-count-badge {
  background: var(--crimson);
  color: #ffffff;
  font-size: 0.74rem;
  font-weight: 800;
  padding: 0.1rem 0.45rem;
  border-radius: 999px;
}

/* Botones Solidos de Alto Contraste (sin ghost buttons debiles en CTAs) */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.72rem 1.3rem;
  border-radius: 10px;
  font-family: inherit;
  font-size: 0.96rem;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
  border: 1.5px solid transparent;
  min-height: 46px;
  transition: transform 0.15s ease, background-color 0.15s ease, box-shadow 0.15s ease;
  white-space: nowrap;
}

.btn:active {
  transform: scale(0.98);
}

.btn-primary {
  background: linear-gradient(135deg, var(--gold-solid) 0%, var(--gold-hover) 100%);
  color: #ffffff;
  box-shadow: 0 4px 14px rgba(184, 126, 29, 0.28);
}

.btn-primary:hover {
  background: linear-gradient(135deg, var(--gold-hover) 0%, #5c3906 100%);
  transform: translateY(-1px);
  box-shadow: 0 7px 18px rgba(184, 126, 29, 0.34);
}

.btn-navy {
  background: var(--navy);
  color: #ffffff;
}

.btn-navy:hover {
  background: var(--navy-mid);
  transform: translateY(-1px);
}

.btn-crimson {
  background: var(--crimson);
  color: #ffffff;
}

.btn-crimson:hover {
  background: var(--crimson-mid);
  transform: translateY(-1px);
}

.btn-fb {
  background: var(--fb-blue);
  color: #ffffff;
}

.btn-fb:hover {
  background: var(--fb-hover);
  transform: translateY(-1px);
}

.btn-wa {
  background: var(--wa-green);
  color: #ffffff;
}

.btn-wa:hover {
  background: var(--wa-hover);
  transform: translateY(-1px);
}

.btn-outline {
  background: var(--surface);
  color: var(--ink);
  border-color: var(--border-strong);
}

.btn-outline:hover {
  border-color: var(--gold-solid);
  color: var(--gold);
}

.mobile-toggle {
  display: none;
  width: 44px;
  height: 44px;
  border-radius: 10px;
  border: 1.5px solid var(--border-strong);
  background: var(--surface);
  color: var(--ink);
  font-size: 1.35rem;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

/* Menu movil desplegable */
.mobile-drawer {
  display: none;
  background: var(--surface);
  border-bottom: 2px solid var(--gold-solid);
  padding: 1rem 1.25rem 1.35rem;
  box-shadow: var(--shadow-md);
}

.mobile-drawer.open {
  display: block;
}

.mobile-drawer-links {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  margin-bottom: 1rem;
}

.mobile-drawer-links a,
.mobile-drawer-links button {
  text-align: left;
  padding: 0.75rem 0.9rem;
  border-radius: 10px;
  font-size: 1rem;
  font-weight: 700;
  color: var(--ink);
  text-decoration: none;
  background: var(--surface-tint);
  border: 1px solid var(--border);
  font-family: inherit;
  cursor: pointer;
}

/* Contenedor Principal */
.page-shell {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 2rem 1.25rem 4.5rem;
}

/* ================= BENTO HERO EDITORIAL ================= */
.continue-banner {
  display: none;
  background: linear-gradient(90deg, var(--navy) 0%, #172b47 65%, #3d1619 100%);
  color: #ffffff;
  border-radius: var(--radius-md);
  padding: 1rem 1.35rem;
  margin-bottom: 1.5rem;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  border: 1px solid rgba(236, 194, 108, 0.35);
  box-shadow: var(--shadow-sm);
}

.continue-banner.visible {
  display: flex;
}

.continue-text small {
  display: block;
  color: var(--gold-bright);
  font-size: 0.75rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.9px;
}

.continue-text strong {
  font-family: var(--font-display);
  font-size: 1.12rem;
  line-height: 1.3;
}

.bento-hero {
  display: grid;
  grid-template-columns: 1.45fr 1fr;
  gap: 1.5rem;
  margin-bottom: 2.25rem;
}

.hero-lead-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-md);
  display: flex;
  flex-direction: column;
  position: relative;
}

.hero-lead-media {
  position: relative;
  height: 330px;
  background: var(--navy);
  overflow: hidden;
  cursor: pointer;
}

.hero-lead-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.45s ease;
}

.hero-lead-card:hover .hero-lead-media img {
  transform: scale(1.03);
}

.hero-media-scrim {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(11, 24, 41, 0.12) 0%, rgba(11, 24, 41, 0.72) 100%);
  pointer-events: none;
}

.hero-top-tags {
  position: absolute;
  top: 1rem;
  left: 1rem;
  right: 1rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.5rem;
  z-index: 2;
}

.badge-latest {
  background: var(--crimson);
  color: #ffffff;
  font-size: 0.75rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.9px;
  padding: 0.36rem 0.78rem;
  border-radius: 6px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
}

.badge-edition-num {
  background: rgba(11, 24, 41, 0.88);
  color: var(--gold-bright);
  border: 1px solid rgba(236, 194, 108, 0.4);
  font-size: 0.75rem;
  font-weight: 700;
  padding: 0.34rem 0.72rem;
  border-radius: 6px;
}

.hero-lead-body {
  padding: 1.75rem 1.85rem 1.9rem;
  display: flex;
  flex-direction: column;
  flex: 1;
}

.kicker-row {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--gold);
  text-transform: uppercase;
  letter-spacing: 0.8px;
  margin-bottom: 0.65rem;
  flex-wrap: wrap;
}

.hero-lead-title {
  font-family: var(--font-display);
  font-size: 1.95rem;
  line-height: 1.22;
  font-weight: 800;
  color: var(--ink);
  margin-bottom: 0.85rem;
  cursor: pointer;
}

.hero-lead-title:hover {
  color: var(--gold);
}

.hero-lead-excerpt {
  font-size: 1.04rem;
  color: var(--ink-soft);
  line-height: 1.65;
  margin-bottom: 1.5rem;
  flex: 1;
}

.hero-cta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  align-items: center;
}

/* Columna Derecha Bento (Destacadas) */
.hero-side-column {
  display: flex;
  flex-direction: column;
  gap: 1.15rem;
}

.side-header-strip {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-top: 2.5px solid var(--ink);
  border-bottom: 1px solid var(--border);
  padding: 0.55rem 0;
}

.side-header-strip span {
  font-family: var(--font-display);
  font-size: 1.12rem;
  font-weight: 800;
  letter-spacing: 0.01em;
}

.side-header-strip small {
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--gold);
  text-transform: uppercase;
  letter-spacing: 0.7px;
}

.side-story-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  overflow: hidden;
  display: grid;
  grid-template-columns: 126px 1fr;
  cursor: pointer;
  box-shadow: var(--shadow-xs);
  transition: transform 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease;
  flex: 1;
}

.side-story-card:hover {
  transform: translateY(-2px);
  border-color: var(--gold-solid);
  box-shadow: var(--shadow-sm);
}

.side-story-thumb {
  background: var(--navy);
  height: 100%;
  min-height: 130px;
}

.side-story-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.side-story-info {
  padding: 1rem 1.15rem;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.side-story-cat {
  font-size: 0.72rem;
  font-weight: 800;
  color: var(--crimson-mid);
  text-transform: uppercase;
  letter-spacing: 0.7px;
  margin-bottom: 0.35rem;
}

body.theme-dark .side-story-cat {
  color: var(--gold-bright);
}

.side-story-title {
  font-family: var(--font-display);
  font-size: 1.1rem;
  font-weight: 700;
  line-height: 1.3;
  color: var(--ink);
  margin-bottom: 0.45rem;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.side-story-meta {
  font-size: 0.8rem;
  color: var(--ink-muted);
  font-weight: 600;
}

/* Banda de Credenciales y Valor Editorial */
.trust-metrics-band {
  background: linear-gradient(125deg, var(--navy) 0%, #132842 52%, #4a1414 100%);
  color: #f4efe6;
  border-radius: var(--radius-md);
  padding: 1.35rem 1.75rem;
  margin-bottom: 2.5rem;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1.25rem;
  border: 1px solid rgba(236, 194, 108, 0.28);
  box-shadow: var(--shadow-sm);
}

.metric-item {
  display: flex;
  flex-direction: column;
  border-left: 2px solid rgba(236, 194, 108, 0.45);
  padding-left: 0.95rem;
}

.metric-item:first-child {
  border-left: none;
  padding-left: 0;
}

.metric-value {
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--gold-bright);
  line-height: 1.15;
}

.metric-label {
  font-size: 0.84rem;
  color: #d6dbe3;
  margin-top: 2px;
}

/* ================= EXPLORADOR Y ARCHIVO ================= */
.archive-section {
  scroll-margin-top: 84px;
}

.archive-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  border-top: 3px solid var(--ink);
  padding-top: 1rem;
  margin-bottom: 1.25rem;
}

.archive-title {
  font-family: var(--font-display);
  font-size: 1.85rem;
  font-weight: 800;
  line-height: 1.15;
}

.archive-subtitle {
  font-size: 0.95rem;
  color: var(--ink-muted);
  margin-top: 0.2rem;
}

.archive-counter {
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--gold);
  background: var(--gold-soft);
  padding: 0.4rem 0.85rem;
  border-radius: 999px;
}

.filter-console {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 1.15rem;
  margin-bottom: 1.85rem;
  box-shadow: var(--shadow-xs);
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.filter-top-row {
  display: flex;
  gap: 0.85rem;
  flex-wrap: wrap;
  align-items: center;
}

.search-wrap {
  flex: 1;
  min-width: 240px;
  position: relative;
}

.search-wrap input {
  width: 100%;
  padding: 0.82rem 2.75rem 0.82rem 1.05rem;
  font-size: 1rem;
  font-family: inherit;
  border: 1.5px solid var(--border-strong);
  border-radius: 10px;
  background: var(--bg);
  color: var(--ink);
  transition: border-color 0.15s;
}

.search-wrap input:focus {
  border-color: var(--gold-solid);
}

.search-clear-btn {
  position: absolute;
  right: 0.65rem;
  top: 50%;
  transform: translateY(-50%);
  background: var(--surface-warm);
  border: none;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  color: var(--ink-soft);
  cursor: pointer;
  display: none;
  font-weight: 700;
}

.search-clear-btn.visible {
  display: flex;
  align-items: center;
  justify-content: center;
}

.sort-select {
  padding: 0.82rem 1rem;
  font-size: 0.94rem;
  font-weight: 600;
  font-family: inherit;
  border: 1.5px solid var(--border-strong);
  border-radius: 10px;
  background: var(--bg);
  color: var(--ink);
  cursor: pointer;
  min-height: 46px;
}

.category-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.cat-chip {
  padding: 0.5rem 0.95rem;
  border-radius: 999px;
  border: 1.5px solid var(--border-strong);
  background: var(--surface-tint);
  color: var(--ink-soft);
  font-family: inherit;
  font-size: 0.88rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.15s;
  min-height: 38px;
}

.cat-chip:hover {
  border-color: var(--gold-solid);
  color: var(--gold);
}

.cat-chip.active {
  background: var(--navy);
  color: var(--gold-bright);
  border-color: var(--navy);
}

/* Cuadricula Editorial de Tarjetas */
.stories-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.6rem;
}

.story-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  cursor: pointer;
  box-shadow: var(--shadow-xs);
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.story-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-md);
  border-color: var(--gold-solid);
}

.card-media {
  position: relative;
  height: 205px;
  background: var(--navy);
  overflow: hidden;
}

.card-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.35s ease;
}

.story-card:hover .card-media img {
  transform: scale(1.04);
}

.card-cat-badge {
  position: absolute;
  bottom: 0.7rem;
  left: 0.7rem;
  background: rgba(11, 24, 41, 0.88);
  color: var(--gold-bright);
  font-size: 0.73rem;
  font-weight: 700;
  letter-spacing: 0.4px;
  padding: 0.26rem 0.65rem;
  border-radius: 6px;
  border: 1px solid rgba(236, 194, 108, 0.3);
}

.card-bookmark-dot {
  position: absolute;
  top: 0.7rem;
  right: 0.7rem;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: none;
  background: rgba(11, 24, 41, 0.8);
  color: #ffffff;
  font-size: 1rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2;
}

.card-bookmark-dot.saved {
  background: var(--gold-solid);
  color: #ffffff;
}

.card-content {
  padding: 1.25rem 1.35rem 1.35rem;
  display: flex;
  flex-direction: column;
  flex: 1;
}

.card-meta {
  font-size: 0.79rem;
  font-weight: 700;
  color: var(--ink-muted);
  margin-bottom: 0.45rem;
  display: flex;
  justify-content: space-between;
}

.card-title {
  font-family: var(--font-display);
  font-size: 1.22rem;
  font-weight: 800;
  line-height: 1.3;
  color: var(--ink);
  margin-bottom: 0.65rem;
}

.card-excerpt {
  font-size: 0.95rem;
  color: var(--ink-soft);
  line-height: 1.6;
  margin-bottom: 1.25rem;
  flex: 1;
}

.card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 0.85rem;
  border-top: 1px solid var(--border);
  font-size: 0.9rem;
  font-weight: 800;
  color: var(--gold);
}

/* Paginacion */
.pagination-bar {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 0.45rem;
  flex-wrap: wrap;
  margin-top: 2.5rem;
}

.page-btn {
  min-width: 44px;
  height: 44px;
  padding: 0 0.85rem;
  border-radius: 10px;
  border: 1.5px solid var(--border-strong);
  background: var(--surface);
  color: var(--ink);
  font-family: inherit;
  font-size: 0.94rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.15s;
}

.page-btn:hover:not(:disabled) {
  border-color: var(--gold-solid);
  color: var(--gold);
}

.page-btn.active {
  background: var(--navy);
  color: var(--gold-bright);
  border-color: var(--navy);
}

.page-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

/* Seccion Institucional en Portada (Aumenta valor editorial para AdSense) */
.editorial-pillars {
  margin-top: 3.75rem;
  padding-top: 2.25rem;
  border-top: 3px solid var(--ink);
}

.pillars-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
  margin-top: 1.35rem;
}

.pillar-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 1.65rem;
  box-shadow: var(--shadow-xs);
}

.pillar-num {
  font-family: var(--font-display);
  font-size: 1.6rem;
  font-weight: 800;
  color: var(--gold);
  margin-bottom: 0.5rem;
}

.pillar-card h3 {
  font-family: var(--font-display);
  font-size: 1.25rem;
  margin-bottom: 0.6rem;
}

.pillar-card p {
  font-size: 0.96rem;
  color: var(--ink-soft);
  line-height: 1.68;
}

/* ================= VISTA LECTOR INMERSIVO ================= */
#view-reader {
  display: none;
}

#view-reader.active {
  display: block;
}

#view-catalog.hidden {
  display: none;
}

.reader-container {
  max-width: 820px;
  margin: 0 auto;
}

.reader-dock {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 0.8rem 1rem;
  margin-bottom: 1.5rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  align-items: center;
  justify-content: space-between;
  box-shadow: var(--shadow-sm);
}

.dock-group {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  align-items: center;
}

.dock-btn {
  padding: 0.48rem 0.85rem;
  border-radius: 8px;
  border: 1.5px solid var(--border-strong);
  background: var(--surface-tint);
  color: var(--ink);
  font-family: inherit;
  font-size: 0.88rem;
  font-weight: 700;
  cursor: pointer;
  min-height: 40px;
  transition: all 0.15s;
}

.dock-btn:hover,
.dock-btn.active {
  border-color: var(--gold-solid);
  background: var(--gold-soft);
  color: var(--gold);
}

.dock-btn.speaking {
  background: var(--crimson);
  color: #ffffff;
  border-color: var(--crimson);
}

.article-sheet {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 2.75rem 2.65rem;
  box-shadow: var(--shadow-md);
}

.breadcrumb-nav {
  font-size: 0.84rem;
  color: var(--ink-muted);
  margin-bottom: 1rem;
  display: flex;
  gap: 0.45rem;
  flex-wrap: wrap;
  align-items: center;
}

.breadcrumb-nav button {
  background: none;
  border: none;
  color: var(--gold);
  font-family: inherit;
  font-size: inherit;
  font-weight: 700;
  cursor: pointer;
  text-decoration: underline;
}

.article-head {
  padding-bottom: 1.4rem;
  margin-bottom: 1.65rem;
  border-bottom: 2px solid var(--border);
}

.article-cat-pill {
  display: inline-block;
  background: var(--navy);
  color: var(--gold-bright);
  font-size: 0.76rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.9px;
  padding: 0.34rem 0.8rem;
  border-radius: 6px;
  margin-bottom: 0.9rem;
}

.article-h1 {
  font-family: var(--font-display);
  font-size: 2.25rem;
  font-weight: 800;
  line-height: 1.2;
  color: var(--ink);
  margin-bottom: 1rem;
}

.article-byline {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.85rem;
  font-size: 0.9rem;
  color: var(--ink-muted);
}

.byline-author {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--ink);
  font-weight: 700;
}

.byline-author img {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 1.5px solid var(--gold-solid);
}

.article-cover-wrap {
  margin-bottom: 1.75rem;
  border-radius: var(--radius-md);
  overflow: hidden;
  border: 1px solid var(--border);
  background: var(--navy);
}

.article-cover-wrap img {
  width: 100%;
  max-height: 450px;
  object-fit: cover;
}

/* Acordeon Parte 1 (Opcional, para ir directo a Parte 2 sin scroll) */
.part1-accordion {
  background: var(--surface-warm);
  border: 1px solid var(--border-strong);
  border-left: 4px solid var(--navy);
  border-radius: 0 var(--radius-md) var(--radius-md) 0;
  margin-bottom: 1.9rem;
  overflow: hidden;
}

.part1-toggle {
  width: 100%;
  background: transparent;
  border: none;
  padding: 1rem 1.25rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  cursor: pointer;
  font-family: inherit;
  font-size: 0.96rem;
  font-weight: 800;
  color: var(--ink);
  text-align: left;
}

.part1-toggle span {
  display: flex;
  align-items: center;
  gap: 0.55rem;
}

.part1-body {
  display: none;
  padding: 0 1.25rem 1.25rem;
  border-top: 1px solid var(--border);
  font-family: var(--font-reading);
  font-size: 1.04rem;
  line-height: 1.8;
  color: var(--ink-soft);
}

.part1-body.open {
  display: block;
}

.part1-body p {
  margin-top: 0.85rem;
}

.part2-label {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 1.35rem;
}

.part2-label span {
  font-size: 0.8rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--crimson-mid);
  white-space: nowrap;
}

body.theme-dark .part2-label span {
  color: var(--gold-bright);
}

.part2-label::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border-strong);
}

/* Cuerpo de Lectura Principal */
.story-prose {
  font-family: var(--font-reading);
  font-size: 1.22rem;
  line-height: 1.95;
  color: var(--ink);
}

.story-prose p {
  margin-bottom: 1.5rem;
}

.story-prose p:first-of-type::first-letter {
  font-family: var(--font-display);
  font-size: 3.6rem;
  font-weight: 800;
  float: left;
  line-height: 0.82;
  padding-right: 0.65rem;
  padding-top: 0.25rem;
  color: var(--gold);
}

.story-prose p.dialogue-line {
  padding-left: 1rem;
  border-left: 3px solid var(--gold-soft);
}

/* Tarjeta de Cierre y Comentarios en Facebook */
.closing-engagement {
  margin-top: 2.5rem;
  padding: 2rem 1.75rem;
  background: linear-gradient(135deg, var(--surface-warm) 0%, var(--surface-tint) 100%);
  border: 1.5px solid var(--border-strong);
  border-radius: var(--radius-md);
  text-align: center;
}

.closing-engagement h3 {
  font-family: var(--font-display);
  font-size: 1.5rem;
  margin-bottom: 0.55rem;
}

.closing-engagement p {
  font-size: 1.03rem;
  color: var(--ink-soft);
  max-width: 560px;
  margin: 0 auto 1.4rem;
}

.engagement-buttons {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.75rem;
}

/* Navegacion Anterior / Siguiente Historia */
.story-pager {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  margin-top: 2rem;
}

.pager-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 1.15rem 1.25rem;
  text-align: left;
  cursor: pointer;
  font-family: inherit;
  transition: border-color 0.15s, transform 0.15s;
}

.pager-card:hover {
  border-color: var(--gold-solid);
  transform: translateY(-2px);
}

.pager-card small {
  display: block;
  font-size: 0.76rem;
  font-weight: 800;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: 0.3rem;
}

.pager-card strong {
  font-family: var(--font-display);
  font-size: 1.05rem;
  color: var(--ink);
  line-height: 1.3;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* ================= PAGINAS INSTITUCIONALES Y LEGALES ================= */
.static-hero {
  background: linear-gradient(125deg, var(--navy) 0%, #152b47 55%, #551414 100%);
  color: #ffffff;
  border-radius: var(--radius-lg);
  padding: 2.75rem 2.5rem;
  margin-bottom: 2rem;
  border: 1px solid rgba(236, 194, 108, 0.3);
  box-shadow: var(--shadow-md);
}

.static-hero .kicker {
  display: inline-block;
  color: var(--gold-bright);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 1.2px;
  text-transform: uppercase;
  margin-bottom: 0.65rem;
}

.static-hero h1 {
  font-family: var(--font-display);
  font-size: 2.35rem;
  line-height: 1.18;
  margin-bottom: 0.8rem;
}

.static-hero p {
  font-size: 1.08rem;
  color: #d8dee8;
  max-width: 720px;
  line-height: 1.7;
}

.prose-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 2.5rem;
  box-shadow: var(--shadow-sm);
}

.prose-card h2 {
  font-family: var(--font-display);
  font-size: 1.55rem;
  color: var(--ink);
  margin: 2rem 0 0.75rem;
  padding-bottom: 0.4rem;
  border-bottom: 1px solid var(--border);
}

.prose-card h2:first-child {
  margin-top: 0;
}

.prose-card p,
.prose-card li {
  font-size: 1.04rem;
  color: var(--ink-soft);
  line-height: 1.82;
  margin-bottom: 0.95rem;
}

.prose-card ul, .prose-card ol {
  padding-left: 1.5rem;
  margin-bottom: 1.25rem;
}

.prose-card a {
  color: var(--gold);
  font-weight: 700;
  text-decoration: underline;
}

/* Formulario de Contacto */
.contact-grid {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: 1.75rem;
}

.form-field {
  margin-bottom: 1.15rem;
}

.form-field label {
  display: block;
  font-size: 0.92rem;
  font-weight: 700;
  margin-bottom: 0.4rem;
  color: var(--ink);
}

.form-field input,
.form-field select,
.form-field textarea {
  width: 100%;
  padding: 0.85rem 1rem;
  font-size: 1rem;
  font-family: inherit;
  border: 1.5px solid var(--border-strong);
  border-radius: 10px;
  background: var(--bg);
  color: var(--ink);
}

.form-field input:focus,
.form-field select:focus,
.form-field textarea:focus {
  border-color: var(--gold-solid);
}

.faq-item {
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  margin-bottom: 0.75rem;
  background: var(--surface-tint);
  overflow: hidden;
}

.faq-item summary {
  padding: 1rem 1.15rem;
  font-weight: 700;
  cursor: pointer;
  list-style: none;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.faq-item p {
  padding: 0 1.15rem 1rem;
  margin-bottom: 0;
  font-size: 0.96rem;
}

/* Pie de Pagina Corporativo */
.site-footer {
  background: var(--navy);
  color: #dce2eb;
  margin-top: 4rem;
  border-top: 4px solid var(--gold-solid);
}

.footer-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 3.25rem 1.25rem 2rem;
}

.footer-grid {
  display: grid;
  grid-template-columns: 1.5fr 1fr 1fr 1fr;
  gap: 2.25rem;
  padding-bottom: 2.25rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
}

.footer-brand-row {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  margin-bottom: 1rem;
}

.footer-brand-row img {
  width: 50px;
  height: 50px;
  border-radius: 12px;
  border: 2px solid var(--gold-bright);
}

.footer-brand-row strong {
  font-family: var(--font-display);
  font-size: 1.35rem;
  color: #ffffff;
  display: block;
  line-height: 1.1;
}

.footer-brand-row span {
  font-size: 0.72rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--gold-bright);
  font-weight: 700;
}

.footer-desc {
  font-size: 0.93rem;
  color: #b7c2d1;
  line-height: 1.68;
}

.footer-col h4 {
  font-family: var(--font-display);
  font-size: 1.1rem;
  color: var(--gold-bright);
  margin-bottom: 0.95rem;
}

.footer-col ul {
  list-style: none;
}

.footer-col li {
  margin-bottom: 0.6rem;
}

.footer-col a {
  text-decoration: none;
  font-size: 0.93rem;
  color: #d0d7e2;
  transition: color 0.15s;
}

.footer-col a:hover {
  color: var(--gold-bright);
  text-decoration: underline;
}

.footer-bottom {
  padding-top: 1.5rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
  font-size: 0.85rem;
  color: #9ba8ba;
}

/* Toast de notificaciones */
#rs-toast {
  position: fixed;
  bottom: 1.5rem;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: var(--navy);
  color: #ffffff;
  border: 1px solid var(--gold-bright);
  padding: 0.8rem 1.35rem;
  border-radius: 999px;
  font-size: 0.92rem;
  font-weight: 700;
  box-shadow: var(--shadow-lg);
  opacity: 0;
  pointer-events: none;
  z-index: 1500;
  transition: opacity 0.2s, transform 0.2s;
}

#rs-toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* Responsive */
@media (max-width: 1024px) {
  .bento-hero { grid-template-columns: 1fr; }
  .stories-grid { grid-template-columns: repeat(2, 1fr); }
  .trust-metrics-band { grid-template-columns: repeat(2, 1fr); }
  .pillars-grid { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: repeat(2, 1fr); }
  .contact-grid { grid-template-columns: 1fr; }
}

@media (max-width: 820px) {
  .main-nav { display: none; }
  .mobile-toggle { display: inline-flex; }
  .header-actions .btn-fb { display: none; }
}

@media (max-width: 640px) {
  .page-shell { padding: 1.25rem 1rem 3.5rem; }
  .stories-grid { grid-template-columns: 1fr; }
  .trust-metrics-band { grid-template-columns: 1fr; padding: 1.2rem; }
  .metric-item { border-left: none; padding-left: 0; border-top: 1px solid rgba(255,255,255,0.12); padding-top: 0.75rem; }
  .metric-item:first-child { border-top: none; padding-top: 0; }
  .hero-lead-media { height: 235px; }
  .hero-lead-body { padding: 1.35rem 1.25rem; }
  .hero-lead-title { font-size: 1.5rem; }
  .side-story-card { grid-template-columns: 104px 1fr; }
  .article-sheet, .prose-card { padding: 1.55rem 1.2rem; }
  .article-h1 { font-size: 1.65rem; }
  .static-hero { padding: 1.85rem 1.35rem; }
  .static-hero h1 { font-size: 1.75rem; }
  .story-pager { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr; gap: 1.75rem; }
}


/* ==========================================================================
   V5 ENHANCEMENTS — ENLACES SEMANTICOS <a href> Y PAGINAS ESTATICAS
   ========================================================================== */
a.story-card,
a.side-story-card,
a.pager-card,
a.hero-link-reset {
  text-decoration: none;
  color: inherit;
}

.story-card-wrap {
  position: relative;
  display: flex;
  flex-direction: column;
}

.story-card-wrap .story-card {
  flex: 1;
}

.story-card-wrap .card-bookmark-dot {
  position: absolute;
  top: 0.7rem;
  right: 0.7rem;
  z-index: 5;
}

.hero-lead-title a {
  text-decoration: none;
  color: inherit;
}

.hero-lead-title a:hover {
  color: var(--gold);
}

.breadcrumb-nav a {
  color: var(--gold);
  font-weight: 700;
  text-decoration: underline;
}

.not-found-card {
  max-width: 680px;
  margin: 2rem auto;
  text-align: center;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 3rem 2rem;
  box-shadow: var(--shadow-md);
}

.not-found-code {
  font-family: var(--font-display);
  font-size: 4rem;
  font-weight: 800;
  color: var(--gold);
  line-height: 1;
  margin-bottom: 0.75rem;
}

/* Ocultar insignia flotante de Netlify si el entorno la inyecta */
.netlify-badge,
[class*="netlify-badge"],
[id*="netlify-badge"],
a[href*="netlify.com/attribution"],
a[href*="netlify.com/?utm_campaign=badge"] {
  display: none !important;
  visibility: hidden !important;
  opacity: 0 !important;
  pointer-events: none !important;
}

/* ==========================================================================
   V6: ACCESIBILIDAD, ENLACE DE SALTO, FOCO VISIBLE Y PAGINAS DE CATEGORIAS
   ========================================================================== */

.skip-link {
  position: absolute;
  top: -120px;
  left: 1rem;
  z-index: 9999;
  background: var(--navy, #0b1829);
  color: #ffffff;
  padding: 0.7rem 1.15rem;
  border-radius: 999px;
  font-weight: 700;
  font-size: 0.92rem;
  text-decoration: none;
  border: 2px solid var(--gold, #c99738);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.25);
  transition: top 0.15s ease;
}

.skip-link:focus,
.skip-link:focus-visible {
  top: 0.85rem;
  outline: 3px solid var(--gold-bright);
  outline-offset: 2px;
}

a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
summary:focus-visible {
  outline: 3px solid var(--gold, #c99738);
  outline-offset: 2px;
  border-radius: 6px;
}

/* Colecciones Temáticas en Portada */
.category-hub-section {
  margin: 2.25rem 0 1.25rem;
}

.category-hub-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1rem;
}

.category-hub-card {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md, 14px);
  padding: 1.25rem 1.2rem;
  text-decoration: none;
  color: inherit;
  box-shadow: var(--shadow-sm);
  transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

.category-hub-card:hover {
  transform: translateY(-3px);
  border-color: var(--gold, #c99738);
  box-shadow: var(--shadow-md);
}

.category-hub-count {
  display: inline-block;
  align-self: flex-start;
  font-size: 0.75rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--gold);
  background: rgba(201, 151, 56, 0.14);
  padding: 0.22rem 0.6rem;
  border-radius: 999px;
}

.category-hub-card h3 {
  font-family: var(--font-display);
  font-size: 1.15rem;
  line-height: 1.28;
  margin: 0.15rem 0 0;
  color: var(--ink);
}

.category-hub-card p {
  font-size: 0.9rem;
  line-height: 1.5;
  color: var(--ink-muted);
  margin: 0;
  flex: 1;
}

.category-hub-link {
  margin-top: 0.5rem;
  font-size: 0.86rem;
  font-weight: 700;
  color: var(--crimson, #8c1d18);
}

/* Cabecera de páginas estáticas de categoría */
.category-hero {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg, 18px);
  padding: 2rem 2rem 1.75rem;
  margin-bottom: 2rem;
  box-shadow: var(--shadow-sm);
}

.category-hero-title {
  font-family: var(--font-display);
  font-size: clamp(1.85rem, 3.6vw, 2.65rem);
  line-height: 1.15;
  margin: 0.75rem 0 0.65rem;
  color: var(--ink);
}

.category-hero-desc {
  font-size: 1.05rem;
  line-height: 1.65;
  color: var(--ink-muted);
  max-width: 72ch;
  margin: 0 0 1.25rem;
}

.category-pills-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
}

.category-pills-row a.cat-chip {
  text-decoration: none;
  display: inline-flex;
  align-items: center;
}

body.theme-dark .category-hub-count {
  color: var(--gold, #ecc26c);
  background: rgba(236, 194, 108, 0.16);
}

body.theme-dark .category-hub-link {
  color: var(--gold, #ecc26c);
}

@media (max-width: 1024px) {
  .category-hub-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 640px) {
  .category-hub-grid {
    grid-template-columns: 1fr;
  }
  .category-hero {
    padding: 1.35rem 1.15rem 1.25rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* ==========================================================================
   V7: CONTRASTE WCAG 2.2 AA EN MODO NOCHE Y FOCO VISIBLE
   ========================================================================== */
body.theme-dark .btn-primary {
  background: linear-gradient(135deg, var(--gold) 0%, var(--gold-solid) 100%);
  color: #0b1829;
}

body.theme-dark .btn-primary:hover {
  background: linear-gradient(135deg, var(--gold-bright) 0%, var(--gold) 100%);
  color: #0b1829;
}

body.theme-dark .card-bookmark-dot.saved {
  background: var(--gold-solid);
  color: #0b1829;
}
/* ==========================================================================
   V11: RENDIMIENTO MOVIL (LCP/CLS), HISTORIAL RECIENTE Y ACCESIBILIDAD
   ========================================================================== */
.hero-lead-media,
.article-cover-wrap,
.card-media {
  width: 100%;
  height: auto !important;
  aspect-ratio: 16 / 9;
}

#category-bar {
  min-height: 44px;
}

.hero-lead-media img,
.article-cover-wrap img,
.card-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.story-card-wrap {
  content-visibility: auto;
  contain-intrinsic-size: 420px;
}

.history-strip {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 0.9rem 1.15rem;
  margin-bottom: 1.4rem;
  box-shadow: var(--shadow-sm);
}

.history-strip-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.65rem;
  font-size: 0.82rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--ink-muted);
}

.history-clear-btn {
  background: transparent;
  border: none;
  color: var(--ink-muted);
  font-size: 0.78rem;
  font-weight: 700;
  cursor: pointer;
  text-decoration: underline;
  padding: 0.2rem 0.35rem;
  border-radius: 6px;
}

.history-clear-btn:hover {
  color: var(--ink);
}

.history-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.history-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.42rem 0.78rem;
  border-radius: 999px;
  background: var(--bg-soft, rgba(15, 23, 42, 0.04));
  border: 1px solid var(--border);
  color: var(--ink);
  font-size: 0.84rem;
  font-weight: 600;
  text-decoration: none;
  max-width: 100%;
  transition: border-color 0.2s ease, transform 0.2s ease;
}

.history-chip:hover {
  border-color: var(--gold-solid, #b48224);
  transform: translateY(-1px);
}

.history-chip-title {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 28ch;
}

.history-progress-pill {
  font-size: 0.72rem;
  font-weight: 800;
  color: var(--gold-solid, #9a6d14);
  background: rgba(180, 130, 36, 0.14);
  padding: 0.12rem 0.45rem;
  border-radius: 999px;
  flex-shrink: 0;
}

body.theme-dark .history-chip {
  background: rgba(255, 255, 255, 0.05);
}

body.theme-dark .history-progress-pill {
  color: var(--gold, #ecc26c);
  background: rgba(236, 194, 108, 0.16);
}

a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 3px solid var(--gold-solid, #c9942a);
  outline-offset: 2px;
}

@media (max-width: 640px) {
  .history-chip-title {
    max-width: 22ch;
  }
}
