/*
Theme Name: Semana Santa en la Memoria
Theme URI: https://semanasantaenlamemoria.es
Author: Equipo Editorial Semana Santa en la Memoria
Description: Tema editorial híbrido para la publicación de «Semana Santa en la Memoria (1870–1935)». Automatiza capítulos mediante Categorías, artículos desde Entradas y el Archivo fotográfico directamente desde la Biblioteca de Medios.
Version: 1.0.0
Requires at least: 6.0
Tested up to: 6.7
Requires PHP: 7.4
Text Domain: ssm
*/

:root {
  --ink: #171717;
  --paper: #f8f7f4;
  --accent: #963d42;
  --accent-soft: #c58d8d;
  --muted: #666666;
  --dark-header: #141414;
  --dark-hero: #121212;
  --dark-band: #1b1b1b;
  --rule: #d5d3cf;
  --rule-light: #cccccc;
  --rule-dark: #ffffff25;
  --plate-bg: #e8e6e2;
  --serif: Georgia, 'Times New Roman', serif;
  --sans: Arial, Helvetica, sans-serif;
  --header-h: 72px;
  --max-w: 1320px;
}

*, *::before, *::after {
  box-sizing: border-box;
  border-radius: 0 !important;
  box-shadow: none !important;
}

html {
  scroll-behavior: smooth;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--serif);
  -webkit-font-smoothing: antialiased;
}

body {
  margin: 0;
  padding: 0;
  background: var(--paper);
  color: var(--ink);
  line-height: 1.65;
  overflow-x: clip;
}

body.admin-bar .site-header {
  top: 32px;
}

body.admin-bar .reading-progress {
  top: calc(var(--header-h) + 32px);
}

@media (max-width: 782px) {
  body.admin-bar .site-header {
    top: 46px;
  }
  body.admin-bar .reading-progress {
    top: calc(var(--header-h) + 46px);
  }
}

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

a {
  color: inherit;
  text-decoration: none;
}

button, input, select, textarea {
  font-family: var(--sans);
  color: inherit;
}

button {
  cursor: pointer;
  background: none;
  border: none;
  padding: 0;
}

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

.sr-only,
.screen-reader-text {
  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(--max-w);
  margin: 0 auto;
  padding: 0 clamp(20px, 4vw, 56px);
}

.eyebrow {
  font-family: var(--sans);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--accent);
  margin: 0 0 12px;
  display: block;
}

/* ==========================================================================
   CABECERA STICKY Y BARRA DE PROGRESO
   ========================================================================== */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  min-height: var(--header-h);
  background: var(--dark-header);
  color: #ffffff;
  border-bottom: 1px solid var(--rule-dark);
  display: flex;
  align-items: center;
}

.header-inner {
  width: 100%;
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 clamp(20px, 4vw, 56px);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  min-height: var(--header-h);
}

.brand {
  font-family: var(--serif);
  font-style: italic;
  font-size: 22px;
  font-weight: 400;
  letter-spacing: -0.01em;
  color: #ffffff;
  white-space: nowrap;
  padding: 8px 0;
}

.brand:hover {
  color: var(--accent-soft);
}

.main-nav ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  align-items: center;
  gap: clamp(18px, 2.4vw, 34px);
}

.main-nav a {
  font-family: var(--sans);
  font-size: 12px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: #d7d5d0;
  padding: 10px 0;
  border-bottom: 2px solid transparent;
  transition: color 0.18s ease, border-color 0.18s ease;
  white-space: nowrap;
  display: inline-block;
}

.main-nav a:hover {
  color: #ffffff;
}

.main-nav .current-menu-item > a,
.main-nav .current-menu-ancestor > a,
.main-nav a.is-active {
  color: #ffffff;
  border-bottom-color: var(--accent);
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.icon-btn {
  width: 42px;
  height: 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #ffffff;
  border: 1px solid var(--rule-dark);
  font-size: 20px;
  line-height: 1;
  transition: background 0.18s ease, border-color 0.18s ease;
}

.icon-btn:hover {
  background: #242424;
  border-color: var(--accent-soft);
}

.mobile-toggle {
  display: none;
}

.mobile-drawer {
  display: none;
  background: var(--dark-header);
  color: #ffffff;
  border-bottom: 1px solid var(--rule-dark);
  position: sticky;
  top: var(--header-h);
  z-index: 99;
}

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

.mobile-drawer ul {
  list-style: none;
  margin: 0;
  padding: 8px clamp(20px, 4vw, 56px) 20px;
  display: flex;
  flex-direction: column;
}

.mobile-drawer a {
  display: block;
  font-family: var(--sans);
  font-size: 13px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  padding: 14px 0;
  border-bottom: 1px solid var(--rule-dark);
  color: #e4e2dd;
}

.reading-progress {
  position: fixed;
  top: var(--header-h);
  left: 0;
  width: 0%;
  height: 3px;
  background: var(--accent);
  z-index: 95;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.2s ease;
}

.reading-progress.is-visible {
  opacity: 1;
}

/* ==========================================================================
   PORTADA EDITORIAL (front-page.php)
   ========================================================================== */
.hero {
  background: var(--dark-hero);
  color: #ffffff;
  display: grid;
  grid-template-columns: 47% 53%;
  min-height: min(720px, 85vh);
  border-bottom: 1px solid var(--rule-dark);
}

.hero-copy {
  padding: clamp(44px, 6vw, 88px) clamp(24px, 5vw, 68px);
  display: flex;
  flex-direction: column;
  justify-content: center;
  position: relative;
  z-index: 2;
}

.hero .date {
  font-family: var(--sans);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--accent-soft);
  margin-bottom: 20px;
}

.hero h1 {
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(48px, 6vw, 96px);
  line-height: 1.03;
  letter-spacing: -0.05em;
  margin: 0 0 26px;
  color: #ffffff;
}

.hero-subtitle {
  font-family: var(--serif);
  font-size: clamp(17px, 1.45vw, 20px);
  line-height: 1.65;
  color: #d6d3cd;
  max-width: 48ch;
  margin: 0 0 36px;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 20px 28px;
}

.cta {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  background: var(--accent);
  color: #ffffff;
  font-family: var(--sans);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  padding: 15px 24px;
  border: 1px solid var(--accent);
  transition: background 0.18s ease, border-color 0.18s ease;
}

.cta:hover {
  background: #7c3035;
  border-color: #7c3035;
}

.link-secondary {
  font-family: var(--sans);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: #ffffff;
  padding: 10px 0;
  border-bottom: 1px solid #ffffff70;
  transition: color 0.18s ease, border-color 0.18s ease;
}

.link-secondary:hover {
  color: var(--accent-soft);
  border-bottom-color: var(--accent-soft);
}

.hero-image {
  position: relative;
  min-height: 380px;
  overflow: hidden;
  background: #0d0d0d;
}

.hero-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 22%;
  filter: grayscale(1);
}

.hero-image::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, #121212 0%, transparent 35%);
  pointer-events: none;
}

.hero-image .credit {
  position: absolute;
  right: 20px;
  bottom: 16px;
  z-index: 2;
  font-family: var(--sans);
  font-size: 11px;
  letter-spacing: 0.04em;
  color: #ffffffcc;
  background: #121212c8;
  padding: 6px 10px;
  border-left: 2px solid var(--accent);
}

.intro {
  background: var(--paper);
  border-bottom: 1px solid var(--rule);
}

.intro-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.intro-stat {
  padding: 32px 24px 32px 0;
  border-right: 1px solid var(--rule);
}

.intro-stat:not(:first-child) {
  padding-left: 28px;
}

.intro-stat:last-child {
  border-right: none;
  padding-right: 0;
}

.intro-stat .num {
  font-family: var(--serif);
  font-size: 28px;
  font-weight: 400;
  line-height: 1.15;
  color: var(--ink);
  display: block;
  margin-bottom: 6px;
}

.intro-stat .label {
  font-family: var(--sans);
  font-size: 12px;
  letter-spacing: 0.06em;
  color: var(--muted);
  line-height: 1.45;
}

.band {
  padding: clamp(54px, 7vw, 92px) 0;
  border-bottom: 1px solid var(--rule);
}

.band.dark {
  background: var(--dark-band);
  color: #ffffff;
  border-bottom: 1px solid var(--rule-dark);
}

.band.dark .eyebrow {
  color: var(--accent-soft);
}

.section-head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 38px;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--rule);
}

.band.dark .section-head {
  border-bottom-color: var(--rule-dark);
}

.section-head h2 {
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(28px, 3.2vw, 42px);
  line-height: 1.13;
  letter-spacing: -0.03em;
  margin: 0;
}

.section-link {
  font-family: var(--sans);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent);
  border-bottom: 1px solid var(--accent);
  padding-bottom: 4px;
  white-space: nowrap;
}

.band.dark .section-link {
  color: var(--accent-soft);
  border-bottom-color: var(--accent-soft);
}

.chapters {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  border-top: 1px solid var(--rule);
}

.chapter-card {
  display: grid;
  grid-template-columns: 54px 1fr 24px;
  gap: 16px;
  align-items: start;
  padding: 24px 24px 24px 0;
  border-bottom: 1px solid var(--rule);
  transition: background 0.15s ease;
}

.chapter-card:nth-child(odd) {
  border-right: 1px solid var(--rule);
  padding-right: 32px;
}

.chapter-card:nth-child(even) {
  padding-left: 32px;
  padding-right: 0;
}

.chapter-card:hover {
  background: #efede8;
}

.chapter-card .roman {
  font-family: var(--serif);
  font-size: 20px;
  color: var(--accent);
  line-height: 1.25;
  padding-top: 2px;
}

.chapter-card h3 {
  font-family: var(--serif);
  font-weight: 400;
  font-size: 22px;
  line-height: 1.22;
  margin: 0 0 8px;
  color: var(--ink);
}

.chapter-card p {
  font-family: var(--sans);
  font-size: 13px;
  line-height: 1.55;
  color: var(--muted);
  margin: 0;
}

.chapter-card .arrow {
  font-family: var(--sans);
  font-size: 18px;
  color: var(--accent);
  text-align: right;
  padding-top: 2px;
}

.features {
  display: grid;
  grid-template-columns: 1.25fr 1fr;
  gap: 32px;
}

.feature-main {
  border: 1px solid var(--rule-dark);
  background: #141414;
  display: flex;
  flex-direction: column;
}

.feature-img {
  aspect-ratio: 16 / 10;
  overflow: hidden;
  background: #0d0d0d;
  border-bottom: 1px solid var(--rule-dark);
}

.feature-img img,
.feature-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: grayscale(1);
  transition: transform 0.35s ease;
}

.feature-main:hover .feature-img img,
.feature-side-item:hover .feature-thumb img {
  transform: scale(1.02);
}

.feature-body {
  padding: 28px;
  display: flex;
  flex-direction: column;
  flex: 1;
}

.feature-body h3 {
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(24px, 2.4vw, 31px);
  line-height: 1.18;
  margin: 0 0 14px;
  color: #ffffff;
}

.feature-body p {
  font-family: var(--serif);
  font-size: 16px;
  line-height: 1.65;
  color: #ccc8c1;
  margin: 0 0 20px;
}

.feature-meta {
  margin-top: auto;
  font-family: var(--sans);
  font-size: 12px;
  color: #a9a59e;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 16px;
  border-top: 1px solid var(--rule-dark);
}

.feature-stack {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.feature-side-item {
  border: 1px solid var(--rule-dark);
  background: #141414;
  display: grid;
  grid-template-columns: 160px 1fr;
  flex: 1;
}

.feature-thumb {
  overflow: hidden;
  background: #0d0d0d;
  border-right: 1px solid var(--rule-dark);
}

.feature-side-item .feature-body {
  padding: 22px;
}

.feature-side-item h3 {
  font-size: 21px;
  margin-bottom: 10px;
}

.gallery {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 24px;
}

.gallery-card {
  border: 1px solid var(--rule);
  background: #ffffff;
  display: flex;
  flex-direction: column;
}

.gallery-frame {
  aspect-ratio: 3 / 4;
  background: var(--plate-bg);
  overflow: hidden;
  cursor: zoom-in;
  border-bottom: 1px solid var(--rule);
  position: relative;
}

.gallery-frame img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: grayscale(1);
  transition: transform 0.3s ease;
}

.gallery-frame:hover img {
  transform: scale(1.03);
}

.plate-badge {
  position: absolute;
  top: 10px;
  left: 10px;
  background: #141414d9;
  color: #ffffff;
  font-family: var(--sans);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  padding: 5px 8px;
}

.gallery-info {
  padding: 16px;
  display: flex;
  flex-direction: column;
  flex: 1;
  gap: 6px;
}

.gallery-info h3 {
  font-family: var(--serif);
  font-weight: 400;
  font-size: 16px;
  line-height: 1.3;
  margin: 0;
}

.gallery-info .meta {
  font-family: var(--sans);
  font-size: 12px;
  color: var(--muted);
  line-height: 1.45;
}

.about {
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: clamp(32px, 5vw, 72px);
  align-items: start;
}

.about h2 {
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(28px, 3vw, 40px);
  line-height: 1.15;
  margin: 0 0 20px;
}

.about p {
  font-family: var(--serif);
  font-size: 18px;
  line-height: 1.75;
  margin: 0 0 18px;
  color: #2c2b29;
}

.about-aside {
  border-top: 1px solid var(--ink);
  padding-top: 22px;
}

.credit-block {
  padding: 18px 0;
  border-bottom: 1px solid var(--rule);
}

.credit-block:first-child {
  padding-top: 0;
}

.credit-block h3 {
  font-family: var(--sans);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--accent);
  margin: 0 0 10px;
}

.credit-block ul {
  list-style: none;
  margin: 0;
  padding: 0;
}

.credit-block li {
  font-family: var(--sans);
  font-size: 14px;
  line-height: 1.65;
  color: var(--ink);
  padding: 3px 0;
}

/* ==========================================================================
   CABECERAS DE SECCIÓN Y SUMARIO DE CAPÍTULOS
   ========================================================================== */
.section-hero {
  background: var(--dark-header);
  color: #ffffff;
  border-bottom: 1px solid var(--rule-dark);
  padding: clamp(44px, 6vw, 74px) 0;
}

.section-hero .eyebrow {
  color: var(--accent-soft);
}

.section-hero h1 {
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(34px, 4.4vw, 58px);
  line-height: 1.13;
  letter-spacing: -0.035em;
  margin: 0 0 16px;
}

.section-hero p {
  font-family: var(--serif);
  font-size: 18px;
  line-height: 1.65;
  color: #cfccc6;
  max-width: 68ch;
  margin: 0;
}

.sumario-nav-strip {
  background: #efede8;
  border-bottom: 1px solid var(--rule);
  padding: 14px 0;
}

.sumario-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.sumario-pills span {
  font-family: var(--sans);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--muted);
  margin-right: 8px;
}

.sumario-pill {
  font-family: var(--serif);
  font-size: 14px;
  padding: 6px 12px;
  border: 1px solid var(--rule-light);
  background: var(--paper);
  color: var(--ink);
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.sumario-pill:hover,
.sumario-pill.is-featured {
  background: var(--accent);
  border-color: var(--accent);
  color: #ffffff;
}

.sumario-list {
  padding: 48px 0 80px;
}

.sumario-chapter {
  display: grid;
  grid-template-columns: 110px 1fr;
  gap: 32px;
  padding: 40px 0;
  border-bottom: 1px solid var(--rule);
  scroll-margin-top: 96px;
}

.sumario-roman-col {
  border-right: 1px solid var(--rule);
  padding-right: 20px;
}

.sumario-roman {
  font-family: var(--serif);
  font-size: 38px;
  line-height: 1;
  color: var(--accent);
  display: block;
  margin-bottom: 10px;
}

.sumario-pages {
  font-family: var(--sans);
  font-size: 12px;
  color: var(--muted);
  display: block;
}

.sumario-status {
  display: inline-block;
  margin-top: 12px;
  font-family: var(--sans);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  padding: 4px 7px;
  border: 1px solid var(--rule-light);
  color: var(--muted);
}

.sumario-status.is-live {
  border-color: var(--accent);
  color: var(--accent);
  background: #963d4210;
}

.sumario-content h2 {
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(24px, 2.5vw, 32px);
  line-height: 1.16;
  margin: 0 0 12px;
}

.sumario-synopsis {
  font-family: var(--serif);
  font-size: 17px;
  line-height: 1.7;
  color: #3a3936;
  max-width: 72ch;
  margin: 0 0 24px;
}

.chapter-articles {
  border-top: 1px solid var(--rule);
}

.chapter-article-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 20px;
  align-items: center;
  padding: 16px 0;
  border-bottom: 1px solid var(--rule);
}

.chapter-article-row h3 {
  font-family: var(--serif);
  font-weight: 400;
  font-size: 19px;
  line-height: 1.3;
  margin: 0 0 4px;
}

.chapter-article-row .row-meta {
  font-family: var(--sans);
  font-size: 12px;
  color: var(--muted);
}

.btn-outline {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--sans);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  padding: 10px 16px;
  border: 1px solid var(--ink);
  color: var(--ink);
  white-space: nowrap;
  transition: background 0.16s ease, color 0.16s ease, border-color 0.16s ease;
}

.btn-outline:hover {
  background: var(--accent);
  border-color: var(--accent);
  color: #ffffff;
}

.row-planned {
  font-family: var(--sans);
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
  border: 1px solid var(--rule);
  padding: 6px 10px;
  white-space: nowrap;
}

/* ==========================================================================
   LECTOR DE ARTÍCULOS (single.php) - CABECERA .article-hero EXACTA
   ========================================================================== */
.article-hero {
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  background: #141414;
  color: #ffffff;
  min-height: 510px;
  border-bottom: 1px solid var(--rule-dark);
}

.article-hero .copy {
  padding: 60px 9%;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.article-hero .eyebrow {
  color: #c58d8d;
  margin-bottom: 18px;
}

.article-hero .eyebrow a {
  text-decoration: underline;
  text-underline-offset: 4px;
  text-decoration-color: #c58d8d88;
}

.article-hero h1 {
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(38px, 4.7vw, 72px);
  letter-spacing: -0.04em;
  line-height: 1.13;
  margin: 0 0 24px;
  color: #ffffff;
}

.article-author {
  font-family: var(--serif);
  font-size: 17px;
  margin: 0 0 8px;
}

.article-author button {
  font-family: var(--serif);
  font-size: 17px;
  color: #ffffff;
  text-decoration: underline;
  text-decoration-color: #ffffff60;
  text-underline-offset: 4px;
}

.article-meta {
  font-family: var(--sans);
  font-size: 13px;
  color: #bbbbbb;
  margin: 0;
}

.article-hero .tools {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 18px;
  margin-top: 25px;
}

.article-hero .tools a,
.article-hero .tools button {
  font-family: var(--sans);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: #ffffff;
  padding: 11px 16px;
  border: 1px solid #ffffff35;
}

.article-hero .tools a {
  background: var(--accent);
  border-color: var(--accent);
}

.article-hero .visual {
  position: relative;
  overflow: hidden;
  background: #0d0d0d;
  min-height: 360px;
}

.article-hero .visual img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 25%;
  filter: grayscale(1);
}

.article-hero .visual::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, #141414, transparent 28%);
  pointer-events: none;
}

.article-layout {
  display: grid;
  grid-template-columns: 220px minmax(0, 760px);
  gap: clamp(30px, 6vw, 95px);
  justify-content: center;
  padding: 64px clamp(20px, 4vw, 48px) 70px;
}

.toc {
  position: sticky;
  top: 105px;
  align-self: start;
  border-top: 1px solid var(--ink);
  padding-top: 16px;
}

.toc-list {
  list-style: none;
  margin: 0 0 28px;
  padding: 0;
}

.toc-list li {
  border-bottom: 1px solid var(--rule);
}

.toc-list a {
  display: block;
  font-family: var(--sans);
  font-size: 13px;
  line-height: 1.42;
  color: var(--muted);
  padding: 10px 0 10px 10px;
  border-left: 2px solid transparent;
}

.toc-list a.is-active {
  color: var(--ink);
  font-weight: 700;
  border-left-color: var(--accent);
}

.toc-plates {
  border-top: 1px solid var(--rule);
  padding-top: 16px;
}

.toc-plates ul {
  list-style: none;
  margin: 0;
  padding: 0;
}

.toc-plates button {
  text-align: left;
  font-family: var(--sans);
  font-size: 12px;
  line-height: 1.4;
  color: var(--muted);
  padding: 4px 0;
}

.toc-plates button:hover {
  color: var(--accent);
  text-decoration: underline;
}

/* PROSA EDITORIAL + BLOQUES GUTENBERG */
.prose {
  font: 19px / 1.82 var(--serif);
  color: var(--ink);
  min-width: 0;
}

.prose p {
  margin: 0 0 1.45em;
  hyphens: auto;
}

.prose > p:first-of-type::first-letter {
  float: left;
  font-family: var(--serif);
  font-size: 76px;
  line-height: 0.84;
  padding: 6px 12px 2px 0;
  color: var(--accent);
  font-weight: 400;
}

.prose h2 {
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(25px, 2.6vw, 33px);
  line-height: 1.18;
  letter-spacing: -0.02em;
  color: var(--ink);
  margin: 2.3em 0 0.85em;
  padding-top: 0.9em;
  border-top: 1px solid var(--rule);
  scroll-margin-top: 100px;
}

.prose h2:first-child {
  margin-top: 0;
  padding-top: 0;
  border-top: none;
}

.prose blockquote,
.prose .wp-block-quote {
  margin: 1.9em 0;
  padding: 4px 0 4px 24px;
  border-left: 2px solid var(--accent);
  font-style: italic;
  color: #2f2e2b;
}

.prose figure,
.prose .wp-block-image {
  margin: 2.3em 0;
  padding: 0;
  scroll-margin-top: 100px;
}

.prose figure .plate-wrap,
.prose .wp-block-image > img {
  background: var(--plate-bg);
  border: 1px solid var(--rule);
  cursor: zoom-in;
  filter: grayscale(1);
}

.prose figure .plate-wrap img {
  width: 100%;
  display: block;
  filter: grayscale(1);
}

.prose .pair,
.prose .wp-block-gallery.columns-2 {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 20px;
  margin: 2.3em 0;
}

.prose .pair figure,
.prose .wp-block-gallery.columns-2 figure {
  margin: 0 !important;
}

.prose .pair img,
.prose .wp-block-gallery.columns-2 img {
  aspect-ratio: 3 / 4;
  object-fit: cover;
  width: 100%;
  filter: grayscale(1);
  cursor: zoom-in;
}

.prose figcaption,
.prose .wp-element-caption {
  margin-top: 12px;
  padding-left: 14px;
  border-left: 2px solid var(--accent);
  font-family: var(--sans);
  font-size: 13px;
  line-height: 1.55;
  color: var(--ink);
  text-align: left;
}

.prose figcaption small {
  display: block;
  margin-top: 4px;
  font-size: 12px;
  color: var(--muted);
}

.article-end {
  margin-top: 52px;
  padding-top: 28px;
  border-top: 1px solid var(--ink);
  font-family: var(--sans);
}

.citation-box {
  background: #efede8;
  border: 1px solid var(--rule);
  padding: 20px 22px;
}

.citation-text {
  font-family: var(--serif);
  font-size: 15px;
  line-height: 1.6;
  margin: 0 0 14px;
}

.article-end-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.related {
  background: var(--dark-band);
  color: #ffffff;
  border-top: 1px solid var(--rule-dark);
  padding: clamp(48px, 6vw, 76px) 0;
}

.related .eyebrow {
  color: var(--accent-soft);
}

.related h2 {
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(26px, 2.8vw, 36px);
  margin: 0 0 28px;
}

.related-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 28px;
}

.related-card {
  border: 1px solid var(--rule-dark);
  background: #141414;
  display: grid;
  grid-template-columns: 150px 1fr;
}

.related-thumb {
  overflow: hidden;
  border-right: 1px solid var(--rule-dark);
  background: #0d0d0d;
}

.related-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: grayscale(1);
}

.related-body {
  padding: 22px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.related-body h3 {
  font-family: var(--serif);
  font-weight: 400;
  font-size: 21px;
  line-height: 1.24;
  margin: 0 0 12px;
  color: #ffffff;
}

.related-body .meta {
  font-family: var(--sans);
  font-size: 12px;
  color: #b5b1aa;
}

/* ==========================================================================
   ARCHIVO FOTOGRÁFICO (page-archivo-fotografico.php)
   ========================================================================== */
.filter-bar {
  background: var(--paper);
  border-bottom: 1px solid var(--rule);
  padding: 24px 0;
}

.filter-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr)) 1.3fr;
  gap: 14px;
  margin-bottom: 16px;
}

.filter-field label {
  display: block;
  font-family: var(--sans);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 6px;
}

.filter-field select,
.filter-field input {
  width: 100%;
  height: 40px;
  padding: 0 12px;
  background: #ffffff;
  border: 1px solid var(--rule-light);
  font-size: 13px;
}

.filter-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding-top: 14px;
  border-top: 1px solid var(--rule);
}

.view-switcher {
  display: inline-flex;
  border: 1px solid var(--rule-light);
}

.view-switcher button {
  font-family: var(--sans);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  padding: 9px 14px;
  background: #ffffff;
  color: var(--muted);
  border-right: 1px solid var(--rule-light);
}

.view-switcher button:last-child {
  border-right: none;
}

.view-switcher button.is-active {
  background: var(--ink);
  color: #ffffff;
}

.archive-content {
  padding: 40px 0 80px;
}

.archive-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 28px;
}

.archive-card {
  border: 1px solid var(--rule);
  background: #ffffff;
  display: flex;
  flex-direction: column;
}

.archive-card-media {
  aspect-ratio: 4 / 3;
  background: var(--plate-bg);
  overflow: hidden;
  cursor: zoom-in;
  border-bottom: 1px solid var(--rule);
  position: relative;
}

.archive-card-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: grayscale(1);
}

.archive-card-body {
  padding: 18px 20px 20px;
  display: flex;
  flex-direction: column;
  flex: 1;
}

.archive-card-num {
  font-family: var(--sans);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 6px;
}

.archive-card-body h3 {
  font-family: var(--serif);
  font-weight: 400;
  font-size: 19px;
  line-height: 1.28;
  margin: 0 0 10px;
}

.archive-card-meta {
  font-family: var(--sans);
  font-size: 12px;
  line-height: 1.6;
  color: var(--muted);
  margin: 0 0 16px;
}

.archive-card-actions {
  margin-top: auto;
  padding-top: 14px;
  border-top: 1px solid var(--rule);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.text-action {
  font-family: var(--sans);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent);
}

.text-action:hover {
  text-decoration: underline;
}

.catalog-table-wrap {
  overflow-x: auto;
  border: 1px solid var(--rule);
  background: #ffffff;
}

.catalog-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 780px;
}

.catalog-table th {
  font-family: var(--sans);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  text-align: left;
  padding: 14px 16px;
  background: #efede8;
  border-bottom: 1px solid var(--ink);
}

.catalog-table td {
  padding: 14px 16px;
  border-bottom: 1px solid var(--rule);
  vertical-align: middle;
  font-family: var(--sans);
  font-size: 13px;
}

.table-thumb {
  width: 58px;
  height: 58px;
  object-fit: cover;
  border: 1px solid var(--rule);
  cursor: zoom-in;
  filter: grayscale(1);
}

/* ==========================================================================
   LA OBRA (page-la-obra.php)
   ========================================================================== */
.formats-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  border: 1px solid var(--rule);
  background: #ffffff;
}

.format-col {
  padding: 32px 28px;
  border-right: 1px solid var(--rule);
}

.format-col:last-child {
  border-right: none;
}

.format-num {
  font-family: var(--serif);
  font-size: 28px;
  color: var(--accent);
  display: block;
  margin-bottom: 12px;
}

.format-col h3 {
  font-family: var(--serif);
  font-weight: 400;
  font-size: 24px;
  margin: 0 0 14px;
}

.obra-split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: clamp(32px, 5vw, 68px);
  align-items: start;
}

.specs-table {
  width: 100%;
  border-collapse: collapse;
  border-top: 1px solid var(--ink);
}

.specs-table th,
.specs-table td {
  padding: 13px 10px 13px 0;
  border-bottom: 1px solid var(--rule);
  text-align: left;
  vertical-align: top;
}

.specs-table th {
  width: 36%;
  font-family: var(--sans);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
}

.reserve-form {
  border: 1px solid var(--rule);
  background: #ffffff;
  padding: 32px;
}

.form-group {
  margin-bottom: 16px;
}

.form-group label {
  display: block;
  font-family: var(--sans);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  margin-bottom: 6px;
}

.form-group input,
.form-group select,
.form-group textarea {
  width: 100%;
  padding: 11px 12px;
  border: 1px solid var(--rule-light);
  background: var(--paper);
  font-size: 14px;
}

.form-check {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  margin: 18px 0 22px;
  font-family: var(--sans);
  font-size: 12px;
  color: var(--muted);
}

.form-message {
  margin-top: 16px;
  padding: 14px 16px;
  font-family: var(--sans);
  font-size: 13px;
  display: none;
}

.form-message.is-success {
  display: block;
  border: 1px solid var(--accent);
  background: #963d4212;
}

.form-message.is-error {
  display: block;
  border: 1px solid #8a1f1f;
  background: #8a1f1f14;
  color: #6d1515;
}

/* ==========================================================================
   DIÁLOGOS (BUSCADOR, VISOR ZOOM, AUTOR) Y PIE DE PÁGINA
   ========================================================================== */
dialog {
  border: 1px solid var(--rule-dark);
  padding: 0;
  margin: auto;
  max-width: 100%;
  max-height: 100%;
}

dialog::backdrop {
  background: rgba(12, 12, 12, 0.82);
}

#findbox,
#authorbox {
  width: min(760px, 94vw);
  background: var(--paper);
  color: var(--ink);
  border: 1px solid var(--ink);
}

#authorbox {
  width: min(580px, 92vw);
}

.dialog-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 24px;
  background: var(--dark-header);
  color: #ffffff;
}

.dialog-head h2 {
  font-family: var(--serif);
  font-weight: 400;
  font-size: 20px;
  margin: 0;
}

.dialog-close {
  width: 36px;
  height: 36px;
  border: 1px solid var(--rule-dark);
  color: #ffffff;
  font-size: 20px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.find-input-wrap {
  padding: 20px 24px;
  border-bottom: 1px solid var(--rule);
  background: #ffffff;
}

.find-input-wrap input {
  width: 100%;
  padding: 13px 16px;
  font-family: var(--serif);
  font-size: 18px;
  border: 1px solid var(--ink);
  background: var(--paper);
}

.find-results {
  max-height: 58vh;
  overflow-y: auto;
  padding: 8px 24px 24px;
}

.find-group-title {
  font-family: var(--sans);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--accent);
  margin: 20px 0 8px;
}

.find-item {
  display: block;
  padding: 13px 14px;
  border: 1px solid var(--rule);
  background: #ffffff;
  margin-bottom: 8px;
}

.find-item:hover {
  border-color: var(--accent);
  background: #f3f1ec;
}

.find-item strong {
  display: block;
  font-family: var(--serif);
  font-weight: 400;
  font-size: 17px;
  margin-bottom: 4px;
}

.find-item span {
  display: block;
  font-family: var(--sans);
  font-size: 12px;
  color: var(--muted);
}

dialog.zoom {
  width: min(1120px, 96vw);
  height: min(88vh, 840px);
  background: #141414;
  color: #ffffff;
}

dialog.zoom[open] {
  display: grid;
  grid-template-rows: auto 1fr auto;
}

.zoom-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 22px;
  border-bottom: 1px solid var(--rule-dark);
  font-family: var(--sans);
  font-size: 12px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.zoom-stage {
  display: grid;
  grid-template-columns: 56px 1fr 56px;
  align-items: center;
  gap: 12px;
  padding: 18px 14px;
  overflow: hidden;
  min-height: 0;
}

.zoom-nav {
  height: 56px;
  width: 48px;
  margin: 0 auto;
  border: 1px solid var(--rule-dark);
  color: #ffffff;
  font-size: 22px;
}

.zoom-img-wrap {
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.zoom-img-wrap img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  filter: grayscale(1);
}

.zoom-caption {
  padding: 18px 24px 20px;
  border-top: 1px solid var(--rule-dark);
  background: #1b1b1b;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.zoom-caption-copy {
  max-width: 760px;
  border-left: 2px solid var(--accent);
  padding-left: 14px;
}

.zoom-caption-copy p {
  font-family: var(--serif);
  font-size: 16px;
  margin: 0 0 4px;
}

.zoom-caption-copy small {
  font-family: var(--sans);
  font-size: 12px;
  color: #b7b3ac;
}

.site-footer {
  background: var(--dark-header);
  color: #cfccc6;
  border-top: 1px solid var(--rule-dark);
  padding: 44px 0 36px;
}

.footer-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr;
  gap: 32px;
  padding-bottom: 28px;
  border-bottom: 1px solid var(--rule-dark);
}

.footer-brand {
  font-family: var(--serif);
  font-style: italic;
  font-size: 22px;
  color: #ffffff;
  display: block;
  margin-bottom: 10px;
}

.footer-col h4 {
  font-family: var(--sans);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--accent-soft);
  margin: 0 0 12px;
}

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

.footer-col li {
  margin-bottom: 8px;
  font-family: var(--sans);
  font-size: 13px;
}

.footer-bottom {
  padding-top: 20px;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 12px;
  font-family: var(--sans);
  font-size: 12px;
  color: #8f8b84;
}

.back-to-top {
  position: fixed;
  right: 22px;
  bottom: 22px;
  z-index: 80;
  width: 44px;
  height: 44px;
  background: var(--dark-header);
  color: #ffffff;
  border: 1px solid var(--rule-dark);
  font-size: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
}

.back-to-top.is-visible {
  opacity: 1;
  pointer-events: auto;
}

@media (max-width: 1080px) {
  .hero,
  .article-hero,
  .article-layout,
  .features,
  .formats-grid,
  .obra-split,
  .about,
  .related-grid {
    grid-template-columns: 1fr;
  }
  .toc {
    position: static;
  }
  .gallery,
  .archive-grid,
  .filter-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 820px) {
  .main-nav { display: none; }
  .mobile-toggle { display: inline-flex; }
  .intro-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .chapters,
  .sumario-chapter,
  .footer-grid { grid-template-columns: 1fr; }
  .chapter-card:nth-child(odd),
  .chapter-card:nth-child(even) { border-right: none; padding: 20px 0; }
}

@media (max-width: 600px) {
  .gallery,
  .archive-grid,
  .filter-grid,
  .prose .pair,
  .prose .wp-block-gallery.columns-2,
  .feature-side-item,
  .related-card {
    grid-template-columns: 1fr;
  }
}

@media print {
  .site-header, .mobile-drawer, .reading-progress, .toc, .article-hero .tools,
  .article-end-actions, .related, .site-footer, .back-to-top, dialog {
    display: none !important;
  }
  .article-hero {
    display: block !important;
    background: #fff !important;
    color: #000 !important;
    min-height: auto !important;
    border-bottom: 1px solid #000 !important;
  }
  .article-hero .visual { display: none !important; }
  .article-hero .copy { padding: 0 0 14pt !important; }
  .article-hero h1, .article-author button, .article-meta { color: #000 !important; }
  .article-layout { display: block !important; padding: 18pt 0 0 !important; }
  .prose { font-size: 11.5pt !important; line-height: 1.62 !important; color: #000 !important; }
}
