/* ==========================================================================
   José Roger Balet — Tema Editorial Histórico v3.1.7
   Paleta: Azul Marino Profundo (#0f1c2e), Crema Pergamino (#faf6ef), Bronce Dorado (#8c651d / #c89d3c)
   Fotografías contenidas y proporcionadas + Indicador de ampliación + Visor Lightbox con Zoom
   ========================================================================== */

:root {
  --navy: #0f1c2e;
  --navy-soft: #172a45;
  --navy-elevated: #1e3554;
  --bg: #faf6ef;
  --bg-elevated: #ffffff;
  --bg-parchment: #f3ece0;
  --bg-tint: #ebe1d0;
  --text: #1c2430;
  --text-muted: #4a5568;
  --text-on-navy: #f7f3eb;
  --text-on-navy-muted: #cbd5e1;
  --gold: #8c651d;
  --gold-bright: #c89d3c;
  --gold-soft: #dfc075;
  --border: #dcd1be;
  --border-navy: rgba(223, 192, 117, 0.24);
  --shadow-sm: 0 2px 8px rgba(15, 28, 46, 0.06);
  --shadow-md: 0 8px 24px rgba(15, 28, 46, 0.12);
  --max: 960px;
  --side-w: 265px;
  --header-h: 4.3rem;
  --font-display: "Playfair Display", "Cormorant Garamond", Georgia, serif;
  --font-body: "Source Serif 4", Georgia, "Times New Roman", serif;
  --font-sans: "Inter", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

*, *::before, *::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  font-size: 16px;
}

body {
  margin: 0;
  font-family: var(--font-body);
  font-size: 1.06rem;
  line-height: 1.76;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

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

a {
  color: var(--gold);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
  transition: color 0.2s ease;
}

a:hover {
  color: var(--navy);
}

h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 700;
  line-height: 1.25;
  color: var(--navy);
  scroll-margin-top: calc(var(--header-h) + 1.5rem);
}

h1 {
  font-size: clamp(1.9rem, 4vw, 2.7rem);
  margin: 0 0 0.6rem;
}

h2 {
  font-size: clamp(1.38rem, 2.6vw, 1.85rem);
  margin: 0 0 0.8rem;
}

h3 {
  font-size: clamp(1.16rem, 2vw, 1.38rem);
  margin: 1.4rem 0 0.6rem;
  color: var(--navy-soft);
}

p {
  margin: 0 0 1rem;
}

ul, ol {
  margin: 0 0 1.15rem;
  padding-left: 1.4rem;
}

li {
  margin-bottom: 0.38rem;
}

.heading-ol {
  list-style: none;
  margin: 0;
  padding: 0;
}

.heading-ol > li {
  margin: 0;
}

/* —— Reading progress bar —— */
.reading-progress {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: rgba(15, 28, 46, 0.2);
  z-index: 1001;
  pointer-events: none;
}

.reading-progress-bar {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--gold-bright), var(--gold-soft));
  transition: width 0.1s linear;
}

/* —— Accessibility skip link —— */
.skip-link {
  position: absolute;
  left: -9999px;
  top: 0.5rem;
  background: var(--gold-bright);
  color: var(--navy);
  font-family: var(--font-sans);
  font-weight: 700;
  padding: 0.6rem 1.1rem;
  border-radius: 4px;
  z-index: 1100;
  text-decoration: none;
}

.skip-link:focus {
  left: 0.75rem;
}

/* —— Top Header & Primary Menu —— */
.site-header {
  position: sticky;
  top: 0;
  z-index: 900;
  background: rgba(15, 28, 46, 0.97);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border-navy);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.18);
}

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

.logo {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  font-family: var(--font-display);
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text-on-navy);
  text-decoration: none;
  letter-spacing: 0.01em;
  white-space: nowrap;
}

.logo:hover {
  color: var(--gold-soft);
}

.site-logo-img {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 1px solid var(--gold-bright);
  object-fit: cover;
  flex-shrink: 0;
}

.nav-toggle {
  display: none;
  align-items: center;
  gap: 0.5rem;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--border-navy);
  color: var(--text-on-navy);
  font-family: var(--font-sans);
  font-size: 0.85rem;
  font-weight: 600;
  padding: 0.45rem 0.75rem;
  border-radius: 4px;
  cursor: pointer;
}

.nav-toggle-bars {
  display: block;
  width: 1.15rem;
  height: 2px;
  background: var(--gold-soft);
  box-shadow: 0 5px 0 var(--gold-soft), 0 -5px 0 var(--gold-soft);
}

.site-nav .primary-menu,
.site-nav > ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  gap: 0.25rem 1rem;
  flex-wrap: wrap;
  align-items: center;
}

.site-nav li {
  margin: 0;
}

.site-nav a {
  font-family: var(--font-sans);
  color: var(--text-on-navy-muted);
  text-decoration: none;
  font-size: 0.82rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding: 0.42rem 0.15rem;
  border-bottom: 2px solid transparent;
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  transition: color 0.2s ease, border-color 0.2s ease;
}

.site-nav a:hover,
.site-nav a[aria-current="page"],
.site-nav .current-menu-item > a,
.site-nav .current_page_item > a,
.site-nav .current-menu-ancestor > a,
.site-nav .current-page-ancestor > a {
  color: var(--gold-soft);
  border-bottom-color: var(--gold-bright);
}

.site-nav .menu-item-has-children > a::after {
  content: "▾";
  font-size: 0.75rem;
  color: var(--gold-bright);
}

.site-nav .sub-menu {
  list-style: none;
  margin: 0;
  padding: 0;
}

@media (min-width: 961px) {
  .site-nav .menu-item-has-children {
    position: relative;
  }
  .site-nav .sub-menu {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    min-width: 14.5rem;
    background: var(--navy-soft);
    border: 1px solid var(--border-navy);
    border-radius: 6px;
    padding: 0.5rem 0.65rem;
    box-shadow: 0 12px 28px rgba(0, 0, 0, 0.35);
    z-index: 200;
    flex-direction: column;
    gap: 0.15rem;
  }
  .site-nav .sub-menu a {
    width: 100%;
    padding: 0.5rem 0.6rem;
    border-bottom: 0;
    border-radius: 4px;
    font-size: 0.82rem;
  }
  .site-nav .sub-menu a:hover,
  .site-nav .sub-menu .current-menu-item > a {
    background: rgba(200, 157, 60, 0.15);
    color: var(--gold-soft);
  }
  .site-nav .menu-item-has-children:hover > .sub-menu,
  .site-nav .menu-item-has-children:focus-within > .sub-menu {
    display: flex;
  }
}

@media (max-width: 960px) {
  .nav-toggle {
    display: inline-flex;
  }
  .site-logo-text {
    font-size: 1rem;
  }
  .site-nav {
    display: none;
    position: absolute;
    left: 0;
    right: 0;
    top: var(--header-h);
    background: var(--navy);
    border-bottom: 2px solid var(--gold-bright);
    padding: 1rem 1.25rem 1.4rem;
    box-shadow: 0 12px 24px rgba(0, 0, 0, 0.35);
  }
  .site-nav.is-open {
    display: block;
  }
  .site-nav .primary-menu,
  .site-nav > ul {
    flex-direction: column;
    gap: 0.55rem;
    align-items: flex-start;
  }
  .site-nav a {
    font-size: 0.92rem;
    padding: 0.35rem 0;
  }
  .site-nav .sub-menu {
    padding: 0.35rem 0 0.35rem 1.1rem;
    border-left: 2px solid var(--border-navy);
    margin-top: 0.3rem;
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
  }
}

/* —— Page Hero & Subnav —— */
.page-hero {
  text-align: center;
  padding: 2.2rem 1.25rem 1.85rem;
  background: linear-gradient(180deg, var(--navy) 0%, var(--navy-soft) 100%);
  color: var(--text-on-navy);
  border-bottom: 3px solid var(--gold-bright);
}

.page-hero h1 {
  color: var(--text-on-navy);
  margin-bottom: 0.4rem;
}

.page-hero .lead {
  max-width: 42rem;
  margin: 0.4rem auto 0;
  color: var(--text-on-navy-muted);
  font-family: var(--font-sans);
  font-size: 0.96rem;
}

.eyebrow {
  display: inline-block;
  margin: 0 0 0.4rem;
  font-family: var(--font-sans);
  font-size: 0.74rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--gold-soft);
  font-weight: 700;
}

.subnav {
  background: var(--bg-parchment);
  border-bottom: 1px solid var(--border);
  padding: 0.65rem 1.25rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1.25rem;
  justify-content: center;
}

.subnav a {
  font-family: var(--font-sans);
  color: var(--navy-soft);
  text-decoration: none;
  font-size: 0.85rem;
  font-weight: 600;
  padding: 0.28rem 0.65rem;
  border-radius: 4px;
  border: 1px solid transparent;
  transition: all 0.2s ease;
}

.subnav a:hover,
.subnav a[aria-current="page"],
.subnav a.is-active {
  background: var(--navy);
  color: var(--gold-soft);
  border-color: var(--gold-bright);
}

/* —— Dual Layout: Sticky Left Side Nav + Main Content —— */
.page-layout.has-sidebar {
  display: grid;
  grid-template-columns: 1fr;
  max-width: 1300px;
  margin: 0 auto;
  align-items: start;
}

@media (min-width: 980px) {
  .page-layout.has-sidebar {
    grid-template-columns: var(--side-w) minmax(0, 1fr);
    gap: 0 2rem;
    padding: 0 1.25rem 3rem;
  }
  .page-layout.has-sidebar .page-content > .page-hero {
    border-radius: 0 0 8px 8px;
    margin-bottom: 0;
  }
  .page-layout.has-sidebar .page-content > .subnav {
    border-radius: 0 0 8px 8px;
    margin-bottom: 0.4rem;
  }
  .page-layout.has-sidebar .page-content .container {
    max-width: none;
    padding-left: 0;
    padding-right: 0;
  }
}

.side-nav {
  z-index: 40;
}

.side-nav-toggle {
  display: flex;
  width: 100%;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  background: var(--bg-parchment);
  border: 0;
  border-bottom: 1px solid var(--border);
  color: var(--navy);
  font-family: var(--font-sans);
  font-size: 0.84rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 0.8rem 1.25rem;
  cursor: pointer;
}

.side-nav-toggle-icon {
  width: 0.55rem;
  height: 0.55rem;
  border-right: 2px solid var(--gold);
  border-bottom: 2px solid var(--gold);
  transform: rotate(45deg);
  transition: transform 0.2s ease;
}

.side-nav.is-open .side-nav-toggle-icon {
  transform: rotate(-135deg);
  margin-top: 0.25rem;
}

.side-nav-panel {
  display: none;
  background: var(--bg-parchment);
  border-bottom: 1px solid var(--border);
  padding: 0.9rem 1.25rem 1.15rem;
}

.side-nav.is-open .side-nav-panel {
  display: block;
}

.side-nav-title {
  margin: 0.65rem 0 0.55rem;
  font-family: var(--font-sans);
  font-size: 0.7rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--gold);
  font-weight: 700;
}

.side-nav-title:first-child {
  margin-top: 0;
}

.side-nav-list {
  list-style: none;
  margin: 0 0 0.85rem;
  padding: 0;
}

.side-nav-list li {
  margin: 0 0 0.15rem;
}

.side-nav-list a {
  display: grid;
  grid-template-columns: 1.65rem 1fr;
  gap: 0.4rem;
  align-items: baseline;
  padding: 0.38rem 0.45rem;
  font-family: var(--font-sans);
  color: var(--text-muted);
  text-decoration: none;
  border-left: 3px solid transparent;
  border-radius: 0 4px 4px 0;
  transition: all 0.18s ease;
  font-size: 0.82rem;
  line-height: 1.32;
}

.side-nav-list a:hover,
.side-nav-list li.is-current > a,
.side-nav-list a.is-active {
  color: var(--navy);
  font-weight: 600;
  border-left-color: var(--gold-bright);
  background: rgba(200, 157, 60, 0.14);
}

.side-nav-num {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.76rem;
  color: var(--gold);
}

@media (min-width: 980px) {
  .side-nav {
    position: sticky;
    top: calc(var(--header-h) + 1rem);
    align-self: start;
    max-height: calc(100vh - var(--header-h) - 2rem);
    overflow-y: auto;
    background: var(--bg-parchment);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 1rem 0.9rem;
    margin-top: 1.25rem;
    box-shadow: var(--shadow-sm);
  }
  .side-nav-toggle {
    display: none;
  }
  .side-nav-panel {
    display: block;
    background: transparent;
    border: 0;
    padding: 0;
  }
}

/* —— Main Container —— */
.container {
  max-width: var(--max);
  margin: 0 auto;
  padding: 1.65rem 1.25rem 3rem;
}

/* —— Home Page Hero & Cards (Compact & Proportional) —— */
.home-hero {
  background: linear-gradient(135deg, var(--navy) 0%, var(--navy-soft) 100%);
  color: var(--text-on-navy);
  border-bottom: 3px solid var(--gold-bright);
  padding: 2.25rem 1.25rem 2.5rem;
}

.home-hero > .intro,
.home-hero > .hero-portrait {
  max-width: 1080px;
}

@media (min-width: 780px) {
  .home-hero {
    display: grid;
    grid-template-columns: 1fr 245px;
    gap: 2.25rem;
    align-items: center;
    padding: 2.75rem max(1.5rem, calc((100vw - 1060px) / 2));
  }
}

.home-hero h1 {
  color: var(--text-on-navy);
  font-size: clamp(2.1rem, 4vw, 3rem);
  margin-bottom: 0.85rem;
}

.home-hero .hero-lead {
  font-size: 1.14rem;
  color: var(--text-on-navy);
  margin-bottom: 0.75rem;
}

.home-hero .hero-sub {
  font-size: 1rem;
  color: var(--gold-soft);
  font-style: italic;
}

.home-hero .hero-portrait {
  margin: 1.25rem auto 0;
  width: 235px;
  max-width: 235px;
  border-radius: 8px;
  overflow: hidden;
  border: 2px solid var(--gold-bright);
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.36);
  background: var(--navy-elevated);
}

.home-hero .hero-portrait .figure-img-wrap {
  padding: 0;
  background: var(--navy-elevated);
}

.home-hero .hero-portrait img {
  width: 100%;
  max-height: 270px;
  object-fit: cover;
}

@media (min-width: 780px) {
  .home-hero .hero-portrait {
    margin: 0;
    justify-self: end;
  }
}

.card-grid {
  display: grid;
  gap: 1.25rem;
  max-width: 1080px;
  margin: 2rem auto 3rem;
  padding: 0 1.25rem;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
}

.card {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  transition: transform 0.22s ease, box-shadow 0.22s ease, border-color 0.22s ease;
  display: flex;
  flex-direction: column;
}

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

.card-media-link {
  display: block;
  overflow: hidden;
  background: var(--navy);
}

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

.card:hover img {
  transform: scale(1.03);
}

.card .card-body {
  padding: 0.95rem 1.15rem 1.15rem;
}

.card h2 {
  font-size: 1.22rem;
  margin: 0 0 0.3rem;
  border: 0;
  padding: 0;
}

.card h2 a {
  color: var(--navy);
  text-decoration: none;
}

.card h2 a:hover {
  color: var(--gold);
}

.card p {
  margin: 0;
  font-family: var(--font-sans);
  color: var(--text-muted);
  font-size: 0.9rem;
}

/* —— Visible Inline Page Index (.toc) —— */
.toc {
  background: var(--bg-parchment);
  border: 1px solid var(--border);
  border-left: 4px solid var(--gold-bright);
  border-radius: 8px;
  padding: 1.15rem 1.35rem;
  margin: 0 0 1.85rem;
  box-shadow: var(--shadow-sm);
}

.toc h2 {
  font-size: 1.18rem;
  margin: 0 0 0.75rem;
  padding-bottom: 0.45rem;
  border-bottom: 1px solid var(--border);
  color: var(--navy);
}

.toc-body p,
.toc ol,
.toc ul {
  font-family: var(--font-sans);
  font-size: 0.9rem;
  margin-bottom: 0.4rem;
}

.toc-list {
  margin: 0;
  padding-left: 1.1rem;
  list-style: none;
}

@media (min-width: 680px) {
  .toc-body {
    columns: 2;
    column-gap: 1.75rem;
  }
  .toc-body p,
  .toc-body ol {
    break-inside: avoid;
  }
}

.toc-groups {
  display: grid;
  gap: 1.1rem;
}

@media (min-width: 680px) {
  .toc-groups {
    grid-template-columns: 1fr 1fr;
  }
}

.toc-group-title {
  font-family: var(--font-sans);
  font-weight: 700;
  margin-bottom: 0.35rem;
}

.toc a {
  color: var(--navy-soft);
  font-weight: 600;
  text-decoration: none;
}

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

/* —— Sections, Headings & Quotes —— */
.jrb-section {
  margin-bottom: 1.35rem;
  scroll-margin-top: calc(var(--header-h) + 1.25rem);
}

.jrb-section-heading {
  background: var(--navy);
  color: var(--text-on-navy);
  padding: 0.75rem 1.25rem;
  border-radius: 6px;
  border-left: 4px solid var(--gold-bright);
  margin: 2rem 0 1.15rem;
  box-shadow: var(--shadow-sm);
}

.jrb-section-heading h2,
.jrb-section-heading h3,
.jrb-section-heading li {
  color: var(--text-on-navy);
  margin: 0;
  border: 0;
  padding: 0;
}

.jrb-quote,
blockquote {
  margin: 1.15rem 0;
  padding: 1.05rem 1.35rem;
  border-left: 4px solid var(--gold-bright);
  background: var(--bg-parchment);
  border-radius: 0 8px 8px 0;
  color: var(--navy);
  font-family: var(--font-body);
  font-style: italic;
  font-size: 1.04rem;
  box-shadow: var(--shadow-sm);
}

.source-note {
  font-family: var(--font-sans);
  font-size: 0.82rem;
  color: var(--text-muted);
  font-style: normal;
  text-align: right;
  margin-top: 0.35rem;
}

/* ==========================================================================
   PROPORTIONAL, CONTAINED PHOTOGRAPHS & CLICK-TO-ENLARGE BADGE
   ========================================================================== */

.figure-block {
  margin: 0 0 0.85rem;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 7px;
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.figure-block:last-child {
  margin-bottom: 0;
}

.figure-block:hover {
  border-color: var(--gold-bright);
  box-shadow: var(--shadow-md);
}

.figure-img-wrap {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #f5f0e6;
  padding: 0.4rem;
  overflow: hidden;
}

.figure-img-wrap[data-zoomable="true"] {
  cursor: zoom-in;
}

/* Visible "🔍 Clic para ampliar" pill badge on every zoomable photo */
.figure-img-wrap[data-zoomable="true"]::after {
  content: "🔍";
  position: absolute;
  right: 0.4rem;
  bottom: 0.4rem;
  width: 1.65rem;
  height: 1.65rem;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(15, 28, 46, 0.82);
  color: var(--text-on-navy);
  border: 1px solid rgba(200, 157, 60, 0.65);
  font-size: 0.78rem;
  line-height: 1;
  border-radius: 50%;
  pointer-events: none;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.25);
  transition: background 0.2s ease, color 0.2s ease, transform 0.2s ease;
}

.figure-img-wrap[data-zoomable="true"]:hover::after {
  background: var(--gold-bright);
  color: var(--navy);
  border-color: var(--navy);
  transform: scale(1.04);
}

.figure-block img {
  display: block;
  width: 100%;
  height: auto;
  max-width: 100%;
  max-height: 210px;
  object-fit: contain;
  margin: 0 auto;
  border-radius: 4px;
  transition: transform 0.25s ease;
}

.figure-img-wrap[data-zoomable="true"]:hover img {
  transform: scale(1.02);
}

.figure-block figcaption {
  padding: 0.5rem 0.75rem;
  font-family: var(--font-sans);
  font-size: 0.79rem;
  line-height: 1.4;
  color: var(--text-muted);
  background: var(--bg-parchment);
  border-top: 1px solid var(--border);
  text-align: center;
}

/* 1. Standalone single figures in a section: compact & centered (max 320px wide, max 215px tall) */
.jrb-section > .figure-block {
  max-width: 320px;
  margin: 0.75rem auto 1rem;
}

.jrb-section > .figure-block img {
  max-height: 215px;
}

/* 2. Side-by-Side Image + Text Rows (.jrb-media-row): contained 220px media column */
.jrb-media-row {
  display: grid;
  gap: 1.25rem;
  align-items: center;
  margin: 0.9rem 0;
}

@media (max-width: 719px) {
  .jrb-media-row .jrb-col-media {
    max-width: 280px;
    margin: 0 auto;
    width: 100%;
  }
}

@media (min-width: 720px) {
  .jrb-media-row.cols-2 {
    grid-template-columns: 225px minmax(0, 1fr);
    gap: 1.65rem;
  }
  .jrb-media-row.cols-2:has(> .jrb-col-text:first-child) {
    grid-template-columns: minmax(0, 1fr) 225px;
  }
  /* When the media column is a small icon/logo, keep column compact (135px) */
  .jrb-media-row.cols-2:has(.figure-block.is-icon) {
    grid-template-columns: 135px minmax(0, 1fr);
  }
  .jrb-media-row.cols-2:has(> .jrb-col-text:first-child):has(.figure-block.is-icon) {
    grid-template-columns: minmax(0, 1fr) 135px;
  }
  /* When the media column is a QR code (160px) */
  .jrb-media-row.cols-2:has(.figure-block.is-qr) {
    grid-template-columns: 160px minmax(0, 1fr);
  }
  /* 3-column mixed media + text rows (e.g. Frondizi + Casa Rosada + text) */
  .jrb-media-row.cols-3 {
    grid-template-columns: 175px 175px minmax(0, 1fr);
    gap: 1.25rem;
  }
}

.jrb-media-row .figure-block img {
  max-height: 195px;
}

/* 3. Small icons, logos & QR codes (.is-icon, .is-qr) */
.figure-block.is-icon {
  max-width: 130px;
  margin-left: auto;
  margin-right: auto;
}

.figure-block.is-icon img {
  max-height: 92px;
}

.figure-block.is-icon .figure-img-wrap[data-zoomable="true"]::after {
  content: "🔍";
  font-size: 0.62rem;
  padding: 0.12rem 0.32rem;
  right: 0.25rem;
  bottom: 0.25rem;
}

.figure-block.is-qr {
  max-width: 155px;
  margin-left: auto;
  margin-right: auto;
}

.figure-block.is-qr img {
  max-height: 140px;
}

/* 4. Multi-Figure Grids (.figure-row.cols-2/3/4/5): clean, uniform gallery thumbnails */
.figure-row {
  display: grid;
  gap: 1rem;
  margin: 1rem auto;
  align-items: start;
}

.figure-row.cols-2 {
  max-width: 540px;
}

.figure-row.cols-3 {
  max-width: 740px;
}

@media (min-width: 560px) {
  .figure-row.cols-2 {
    grid-template-columns: repeat(2, 1fr);
  }
  .figure-row.cols-3 {
    grid-template-columns: repeat(3, 1fr);
  }
  .figure-row.cols-4 {
    grid-template-columns: repeat(2, 1fr);
  }
  .figure-row.cols-5 {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (min-width: 900px) {
  .figure-row.cols-4 {
    grid-template-columns: repeat(4, 1fr);
  }
  .figure-row.cols-5 {
    grid-template-columns: repeat(5, 1fr);
  }
}

.figure-row.cols-2 .figure-block img {
  max-height: 175px;
}

.figure-row.cols-3 .figure-block img {
  max-height: 160px;
}

.figure-row.cols-4 .figure-block img,
.figure-row.cols-5 .figure-block img {
  max-height: 140px;
}

/* —— Video & Map Embeds —— */
.video-frame-wrap {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  max-width: 440px;
}

.video-frame {
  position: relative;
  width: 100%;
  padding-top: 56.25%;
  background: #000;
}

.video-frame iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

.video-ext-link {
  margin: 0;
  padding: 0.45rem 0.75rem;
  font-family: var(--font-sans);
  font-size: 0.8rem;
  background: var(--bg-parchment);
  border-top: 1px solid var(--border);
  text-align: right;
}

.map-embed-frame {
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  background: var(--bg-parchment);
  max-width: 520px;
  margin: 0.5rem auto;
}

.map-embed-frame iframe {
  width: 100%;
  height: 280px;
  border: 0;
  display: block;
}

/* —— Buttons —— */
.jrb-btn-wrap {
  margin: 1.35rem 0;
}

.jrb-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: var(--navy);
  color: var(--gold-soft);
  border: 1px solid var(--gold-bright);
  font-family: var(--font-sans);
  font-size: 0.9rem;
  font-weight: 600;
  padding: 0.65rem 1.25rem;
  border-radius: 6px;
  text-decoration: none;
  box-shadow: var(--shadow-sm);
  transition: all 0.2s ease;
}

.jrb-btn:hover {
  background: var(--gold-bright);
  color: var(--navy);
}

/* —— Footer —— */
.site-footer {
  border-top: 3px solid var(--gold-bright);
  background: var(--navy);
  color: var(--text-on-navy-muted);
  padding: 2.5rem 1.25rem 2rem;
  text-align: center;
  font-family: var(--font-sans);
  font-size: 0.88rem;
}

.footer-inner {
  max-width: 1080px;
  margin: 0 auto;
}

.footer-name {
  font-family: var(--font-display);
  color: var(--text-on-navy);
  font-size: 1.22rem;
  font-weight: 700;
  margin-bottom: 0.35rem;
}

.footer-desc {
  max-width: 44rem;
  margin: 0 auto 1.15rem;
  font-size: 0.9rem;
}

.footer-social {
  display: flex;
  justify-content: center;
  gap: 0.9rem;
  margin: 1.1rem 0;
}

.footer-social a {
  display: inline-flex;
  padding: 0.3rem;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--border-navy);
  transition: transform 0.2s ease, border-color 0.2s ease;
}

.footer-social a:hover {
  transform: translateY(-2px);
  border-color: var(--gold-bright);
}

.footer-social img {
  width: 32px;
  height: 32px;
  border-radius: 6px;
  object-fit: contain;
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.45rem 1.1rem;
  margin: 1.1rem 0;
}

.footer-links a {
  color: var(--text-on-navy-muted);
  text-decoration: none;
  font-size: 0.83rem;
}

.footer-links a:hover {
  color: var(--gold-soft);
}

.footer-copy {
  margin: 0.9rem 0 0;
  font-size: 0.82rem;
  color: var(--text-on-navy-muted);
}

.footer-copy a {
  color: var(--gold-soft);
}

/* —— Back to Top Button —— */
.back-to-top {
  position: fixed;
  right: 1.25rem;
  bottom: 1.25rem;
  width: 2.65rem;
  height: 2.65rem;
  border-radius: 50%;
  background: var(--navy);
  color: var(--gold-soft);
  border: 1px solid var(--gold-bright);
  font-size: 1.15rem;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.28);
  opacity: 0;
  visibility: hidden;
  transform: translateY(10px);
  transition: all 0.25s ease;
  z-index: 800;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.back-to-top.is-visible {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.back-to-top:hover {
  background: var(--gold-bright);
  color: var(--navy);
}

/* ==========================================================================
   INTERACTIVE LIGHTBOX MODAL WITH ZOOM & PREV/NEXT NAVIGATION
   ========================================================================== */

.jrb-lightbox {
  position: fixed;
  inset: 0;
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

.jrb-lightbox[hidden] {
  display: none;
}

.jrb-lightbox-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(10, 18, 30, 0.93);
  backdrop-filter: blur(6px);
}

.jrb-lightbox-content {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 1120px;
  max-height: 94vh;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.jrb-lightbox-toolbar {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 0.5rem 0.65rem;
  color: var(--text-on-navy);
  font-family: var(--font-sans);
  font-size: 0.85rem;
}

.jrb-lightbox-counter {
  color: var(--gold-soft);
  font-weight: 600;
}

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

.jrb-lightbox-btn,
.jrb-lightbox-close {
  background: var(--navy-soft);
  color: var(--gold-soft);
  border: 1px solid var(--gold-bright);
  font-family: var(--font-sans);
  font-size: 0.82rem;
  font-weight: 600;
  padding: 0.38rem 0.8rem;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.18s ease;
}

.jrb-lightbox-btn:hover,
.jrb-lightbox-close:hover {
  background: var(--gold-bright);
  color: var(--navy);
}

.jrb-lightbox-stage {
  position: relative;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
}

.jrb-lightbox-nav {
  background: rgba(23, 42, 69, 0.85);
  color: var(--gold-soft);
  border: 1px solid var(--gold-bright);
  width: 2.6rem;
  height: 2.6rem;
  border-radius: 50%;
  font-size: 1.65rem;
  line-height: 1;
  cursor: pointer;
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: all 0.18s ease;
}

.jrb-lightbox-nav:hover {
  background: var(--gold-bright);
  color: var(--navy);
}

.jrb-lightbox-nav[hidden] {
  display: none;
}

.jrb-lightbox-figure {
  margin: 0;
  text-align: center;
  max-width: calc(100% - 6.5rem);
  display: flex;
  flex-direction: column;
  align-items: center;
}

.jrb-lightbox-img-holder {
  max-width: 84vw;
  max-height: 76vh;
  overflow: auto;
  border-radius: 6px;
  border: 1px solid var(--border-navy);
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.55);
  background: #f5f0e6;
  display: flex;
  align-items: center;
  justify-content: center;
}

.jrb-lightbox-img {
  max-width: 84vw;
  max-height: 76vh;
  width: auto;
  height: auto;
  object-fit: contain;
  cursor: zoom-in;
  transition: transform 0.25s ease;
  transform-origin: center center;
}

.jrb-lightbox-img.is-zoomed {
  transform: scale(1.75);
  cursor: zoom-out;
}

.jrb-lightbox-caption {
  margin-top: 0.65rem;
  color: var(--text-on-navy);
  font-family: var(--font-sans);
  font-size: 0.9rem;
  line-height: 1.45;
  max-width: 68ch;
}

@media (max-width: 640px) {
  .jrb-lightbox-figure {
    max-width: 100%;
  }
  .jrb-lightbox-nav {
    position: absolute;
    top: 42%;
    z-index: 3;
    width: 2.2rem;
    height: 2.2rem;
    font-size: 1.35rem;
  }
  .jrb-lightbox-prev {
    left: 0.25rem;
  }
  .jrb-lightbox-next {
    right: 0.25rem;
  }
}

.screen-reader-text {
  border: 0;
  clip: rect(1px, 1px, 1px, 1px);
  clip-path: inset(50%);
  height: 1px;
  margin: -1px;
  overflow: hidden;
  padding: 0;
  position: absolute;
  width: 1px;
  word-wrap: normal !important;
}

/* Ensure all figures inside side-by-side media rows have the exact same 225px box width */
.jrb-media-row .figure-block {
  width: 100%;
  max-width: 225px;
}
.jrb-media-row .figure-img-wrap {
  width: 100%;
}
