:root {
  --color-primary: #1f6f43;
  --color-primary-dark: #12462b;
  --color-secondary: #c58b31;
  --color-terra: #8f4f24;
  --color-cream: #fff7e8;
  --color-light: #f7f3ea;
  --color-dark: #172319;
  --color-muted: #5f6d61;
  --color-white: #ffffff;
  --shadow-soft: 0 18px 45px rgba(23, 35, 25, 0.12);
  --shadow-strong: 0 25px 70px rgba(23, 35, 25, 0.22);
  --radius-xl: 32px;
  --radius-lg: 22px;
  --radius-md: 16px;
  --container: min(1160px, calc(100% - 36px));
  --font-main: "Montserrat", system-ui, sans-serif;
  --font-title: "Playfair Display", Georgia, serif;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: 90px;
}

body {
  margin: 0;
  font-family: var(--font-main);
  color: var(--color-dark);
  background:
    radial-gradient(circle at top left, rgba(197, 139, 49, 0.14), transparent 32rem),
    linear-gradient(180deg, #fffaf0 0%, #f7f3ea 48%, #fffaf0 100%);
  overflow-x: hidden;
}

body.menu-open,
body.lightbox-open {
  overflow: hidden;
}

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

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

p {
  line-height: 1.75;
}

#preloader {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: grid;
  place-items: center;
  background: var(--color-cream);
  transition: opacity 0.35s ease, visibility 0.35s ease;
}

#preloader.hidden {
  opacity: 0;
  visibility: hidden;
}

.loader {
  width: 54px;
  height: 54px;
  border: 5px solid rgba(31, 111, 67, 0.18);
  border-top-color: var(--color-primary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* Hero */
.hero {
  position: relative;
  min-height: 100vh;
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(280px, 0.55fr);
  align-items: center;
  gap: 42px;
  width: var(--container);
  margin: 0 auto;
  padding: 140px 0 70px;
}

.hero-bg {
  position: absolute;
  inset: var(--header-bottom-offset, 90px) -8vw 40px -8vw;
  z-index: -1;
  border-radius: 0 0 54px 54px;
  overflow: hidden;
  background:
    url("../img/fondo-acatitla.jpg"),
    linear-gradient(120deg, rgba(18, 70, 43, 0.82), rgba(31, 111, 67, 0.52)),
    radial-gradient(circle at 25% 35%, rgba(255, 255, 255, 0.42), transparent 16rem),
    linear-gradient(135deg, #315f31, #a46d27);
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  background-blend-mode: hard-light, normal, normal, normal;
}

.hero-bg::before,
.hero-bg::after {
  content: "";
  position: absolute;
  pointer-events: none;
}

.hero-bg::before {
  inset: auto -5% -8% -5%;
  height: 42%;
  background:
    repeating-linear-gradient(115deg, rgba(255, 255, 255, 0.18) 0 2px, transparent 2px 16px);
  border-radius: 50% 50% 0 0;
}

.hero-bg::after {
  width: 420px;
  height: 420px;
  right: -90px;
  top: 70px;
  border-radius: 50%;
  border: 70px solid rgba(255, 255, 255, 0.08);
}

.hero-content {
  color: var(--color-white);
  max-width: 780px;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 14px;
  color: var(--color-secondary);
  font-size: 0.78rem;
  font-weight: 900;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.eyebrow::before {
  content: "";
  width: 32px;
  height: 2px;
  border-radius: 99px;
  background: currentColor;
}

.hero h1,
.section h2,
.closing-section h2 {
  margin: 0;
  font-family: var(--font-title);
  font-size: clamp(3.1rem, 8vw, 6.8rem);
  line-height: 0.93;
  letter-spacing: -0.05em;
}

.hero p {
  max-width: 720px;
  margin: 26px 0 0;
  font-size: clamp(1rem, 1.6vw, 1.25rem);
  color: rgba(255, 255, 255, 0.88);
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin-top: 34px;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 13px 22px;
  border: 0;
  border-radius: 999px;
  font-weight: 800;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.btn:hover {
  transform: translateY(-2px);
}

.btn-primary {
  color: var(--color-white);
  background: linear-gradient(135deg, var(--color-secondary), var(--color-terra));
  box-shadow: 0 15px 32px rgba(143, 79, 36, 0.3);
}

.btn-secondary {
  color: var(--color-primary-dark);
  background: rgba(255, 255, 255, 0.9);
  box-shadow: 0 15px 32px rgba(23, 35, 25, 0.12);
}

.hero-card {
  position: relative;
  padding: 28px;
  border-radius: var(--radius-xl);
  color: var(--color-white);
  background: rgba(255, 255, 255, 0.14);
  border: 1px solid rgba(255, 255, 255, 0.28);
  backdrop-filter: blur(20px);
  box-shadow: var(--shadow-strong);
}

.hero-card::before {
  content: "";
  position: absolute;
  inset: 14px;
  border: 1px dashed rgba(255, 255, 255, 0.28);
  border-radius: 24px;
  pointer-events: none;
}

.card-label {
  margin: 0 0 18px;
  color: rgba(255, 255, 255, 0.68);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.hero-stat {
  position: relative;
  z-index: 1;
  display: grid;
  gap: 3px;
  padding: 18px 0;
  border-top: 1px solid rgba(255, 255, 255, 0.2);
}

.hero-stat strong {
  font-size: 2.4rem;
  line-height: 1;
}

.hero-stat span {
  color: rgba(255, 255, 255, 0.78);
  font-weight: 600;
}

/* Sections */
.section,
.quick-facts {
  width: var(--container);
  margin: 0 auto;
}

.section {
  padding: 92px 0;
}

.section-heading {
  max-width: 780px;
  margin: 0 auto 42px;
  text-align: center;
}

.section-heading .eyebrow {
  justify-content: center;
}

.section h2,
.closing-section h2 {
  color: var(--color-primary-dark);
  font-size: clamp(2.2rem, 5vw, 4.6rem);
}

.section-heading p,
.section-text p {
  color: var(--color-muted);
  font-size: 1rem;
}

.quick-facts {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 18px;
  margin-top: -52px;
  position: relative;
  z-index: 10;
}

.fact-card,
.story-panel,
.eco-card,
.population-card,
.counter-card,
.culture-card,
.map-card {
  border: 1px solid rgba(31, 111, 67, 0.08);
  border-radius: var(--radius-lg);
  background: rgba(255, 255, 255, 0.78);
  box-shadow: var(--shadow-soft);
}

.fact-card {
  min-height: 210px;
  padding: 26px;
  backdrop-filter: blur(16px);
}

.fact-icon {
  display: grid;
  place-items: center;
  width: 54px;
  height: 54px;
  margin-bottom: 18px;
  border-radius: 18px;
  font-size: 1.55rem;
  background: rgba(31, 111, 67, 0.09);
}

.fact-card h2 {
  margin: 0 0 10px;
  font-size: 1.1rem;
}

.fact-card p {
  margin: 0;
  color: var(--color-muted);
  font-size: 0.94rem;
}

.split-section,
.population-section,
.shield-section {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(320px, 0.72fr);
  gap: 38px;
  align-items: center;
}

.story-panel {
  padding: 12px;
}

.timeline-item {
  padding: 22px;
  border-radius: 18px;
  background: linear-gradient(135deg, rgba(31, 111, 67, 0.08), rgba(197, 139, 49, 0.1));
}

.timeline-item + .timeline-item {
  margin-top: 12px;
}

.timeline-item span {
  display: block;
  color: var(--color-secondary);
  font-size: 0.75rem;
  font-weight: 900;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.timeline-item strong {
  display: block;
  margin-top: 5px;
  color: var(--color-primary-dark);
  font-size: 1.25rem;
}

.timeline-item p {
  margin: 8px 0 0;
  color: var(--color-muted);
  font-size: 0.95rem;
}

/* Ecosistema */
.eco-grid,
.culture-grid,
.gallery-grid {
  display: grid;
  gap: 20px;
}

.eco-grid {
  grid-template-columns: repeat(4, 1fr);
}

.eco-card {
  min-height: 390px;
  padding: 26px;
  overflow: hidden;
  position: relative;
}

.eco-card::after {
  content: "";
  position: absolute;
  right: -52px;
  bottom: -52px;
  width: 160px;
  height: 160px;
  border-radius: 50%;
  background: rgba(31, 111, 67, 0.07);
}

.eco-card-head {
  display: flex;
  align-items: center;
  gap: 12px;
}

.eco-card-head span {
  width: 48px;
  height: 48px;
  display: grid;
  place-items: center;
  border-radius: 16px;
  background: var(--color-light);
  font-size: 1.4rem;
}

.eco-card h3,
.culture-card h3,
.map-card h3 {
  margin: 0;
  color: var(--color-primary-dark);
  font-size: 1.25rem;
}

.eco-card p {
  color: var(--color-muted);
  font-size: 0.93rem;
}

.tag-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 0;
  margin: 20px 0 0;
  list-style: none;
}

.tag-list li {
  padding: 7px 10px;
  border-radius: 999px;
  color: var(--color-primary-dark);
  background: rgba(31, 111, 67, 0.09);
  font-size: 0.75rem;
  font-weight: 800;
}

/* Habitantes */
.population-card {
  padding: 34px;
}

.population-card h2 {
  margin-bottom: 18px;
}

.population-bars {
  display: grid;
  gap: 18px;
  margin-top: 28px;
}

.bar-row {
  display: grid;
  grid-template-columns: 92px minmax(120px, 1fr) 54px;
  align-items: center;
  gap: 14px;
  font-size: 0.9rem;
  font-weight: 800;
}

.bar-track {
  height: 13px;
  border-radius: 999px;
  overflow: hidden;
  background: rgba(31, 111, 67, 0.1);
}

.bar-fill {
  width: var(--bar);
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--color-primary), var(--color-secondary));
  transform-origin: left;
  animation: growBar 1.3s ease both;
}

@keyframes growBar {
  from {
    transform: scaleX(0);
  }
}

.counter-card {
  display: grid;
  place-items: center;
  min-height: 315px;
  padding: 30px;
  text-align: center;
  color: var(--color-white);
  background:
    radial-gradient(circle at 30% 10%, rgba(255, 255, 255, 0.22), transparent 16rem),
    linear-gradient(135deg, var(--color-primary-dark), var(--color-primary));
}

.counter-number {
  font-family: var(--font-title);
  font-size: clamp(4.2rem, 9vw, 7rem);
  line-height: 0.9;
  font-weight: 800;
}

.counter-card p {
  margin: 12px 0 0;
  color: rgba(255, 255, 255, 0.78);
  font-weight: 800;
}

/* Cultura */
.culture-grid {
  grid-template-columns: repeat(3, 1fr);
}

.culture-card {
  padding: 28px;
}

.large-card {
  grid-column: span 2;
  background:
    linear-gradient(135deg, rgba(31, 111, 67, 0.1), rgba(197, 139, 49, 0.1)),
    rgba(255, 255, 255, 0.86);
}

.culture-icon {
  display: grid;
  place-items: center;
  width: 58px;
  height: 58px;
  margin-bottom: 18px;
  border-radius: 20px;
  font-size: 1.55rem;
  background: rgba(197, 139, 49, 0.13);
}

.culture-card p {
  margin-bottom: 0;
  color: var(--color-muted);
}

/* Galería profesional */
.gallery-section {
  position: relative;
}

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

.gallery-item {
  width: 100%;
  min-height: 0;
  aspect-ratio: 16 / 10;
  position: relative;
  isolation: isolate;
  overflow: hidden;
  display: block;
  padding: 0;
  border: 0;
  border-radius: 28px;
  cursor: zoom-in;
  background: #102819;
  box-shadow:
    0 18px 42px rgba(23, 35, 25, 0.15),
    inset 0 0 0 1px rgba(255, 255, 255, 0.08);
  transition:
    transform 0.28s ease,
    box-shadow 0.28s ease,
    filter 0.28s ease;
}

.gallery-item::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background:
    linear-gradient(180deg, rgba(13, 33, 22, 0.01), rgba(13, 33, 22, 0.22)),
    radial-gradient(circle at 30% 15%, rgba(255, 255, 255, 0.12), transparent 24rem);
  opacity: 0.8;
  transition: opacity 0.25s ease;
}

.gallery-item::after {
  content: "Ampliar imagen";
  position: absolute;
  left: 18px;
  bottom: 18px;
  z-index: 2;
  display: inline-flex;
  align-items: center;
  min-height: 38px;
  padding: 9px 14px;
  border-radius: 999px;
  color: #ffffff;
  background: rgba(13, 33, 22, 0.58);
  backdrop-filter: blur(14px);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.02em;
  opacity: 0;
  transform: translateY(10px);
  transition:
    opacity 0.25s ease,
    transform 0.25s ease;
}

.gallery-item:hover {
  transform: translateY(-6px);
  box-shadow:
    0 28px 70px rgba(23, 35, 25, 0.26),
    inset 0 0 0 1px rgba(255, 255, 255, 0.14);
}

.gallery-item:hover::before {
  opacity: 1;
}

.gallery-item:hover::after {
  opacity: 1;
  transform: translateY(0);
}

.gallery-item:focus-visible {
  outline: 4px solid rgba(197, 139, 49, 0.55);
  outline-offset: 4px;
}

.gallery-item img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
  object-position: center;
  transform: scale(1.01);
  transition:
    transform 0.45s ease,
    filter 0.45s ease;
}

.gallery-item:hover img {
  transform: scale(1.07);
  filter: saturate(1.08) contrast(1.04);
}

.gallery-item span {
  display: none !important;
}

/* Mapa */
.map-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 26px;
  margin-top: 22px;
  padding: 30px;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.88), rgba(255, 247, 232, 0.92));
}

.map-card p {
  margin-bottom: 0;
  color: var(--color-muted);
}

/* Escudo */
.shield-section {
  grid-template-columns: minmax(300px, 0.72fr) minmax(0, 1fr);
}

.shield-visual {
  display: grid;
  place-items: center;
  min-height: 450px;
  padding: 34px;
  border-radius: var(--radius-xl);
  background:
    radial-gradient(circle at 50% 25%, rgba(255, 255, 255, 0.55), transparent 14rem),
    linear-gradient(135deg, rgba(31, 111, 67, 0.15), rgba(197, 139, 49, 0.18));
  box-shadow: var(--shadow-soft);
}

.shield-image-box {
  width: min(360px, 82vw);
  aspect-ratio: 1 / 1;
  margin: 0;
  display: grid;
  place-items: center;
  padding: 18px;
  border-radius: 30px;
  background: rgba(255, 255, 255, 0.86);
  border: 1px solid rgba(31, 111, 67, 0.12);
  box-shadow:
    0 28px 60px rgba(23, 35, 25, 0.18),
    inset 0 0 0 8px rgba(255, 247, 232, 0.75);
}

.shield-image {
  width: 100%;
  height: 100%;
  object-fit: contain;
  border-radius: 20px;
}

/* Closing */
.closing-section {
  margin: 30px 0 0;
  padding: 110px 0;
  text-align: center;
  color: var(--color-white);
  background:
    linear-gradient(120deg, rgba(18, 70, 43, 0.92), rgba(31, 111, 67, 0.76)),
    radial-gradient(circle at 30% 20%, rgba(255, 255, 255, 0.28), transparent 18rem);
}

.closing-content {
  width: var(--container);
  max-width: 850px;
  margin: 0 auto;
}

.closing-section h2 {
  color: var(--color-white);
}

.closing-section p {
  color: rgba(255, 255, 255, 0.82);
  font-size: 1.06rem;
}

/* Lightbox con zoom */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 3000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 84px 22px 42px;
  background:
    radial-gradient(circle at 50% 10%, rgba(31, 111, 67, 0.32), transparent 32rem),
    rgba(8, 22, 14, 0.92);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.25s ease, visibility 0.25s ease;
}

.lightbox.active {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

.lightbox-close {
  position: fixed;
  top: 22px;
  right: 22px;
  z-index: 3010;
  width: 52px;
  height: 52px;
  border: 0;
  border-radius: 999px;
  color: #102116;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 18px 42px rgba(0, 0, 0, 0.28);
  font-size: 2.05rem;
  line-height: 1;
  cursor: pointer;
  transition: transform 0.2s ease, background 0.2s ease;
}

.lightbox-close:hover {
  transform: scale(1.06);
  background: #ffffff;
}

.lightbox-toolbar {
  position: fixed;
  top: 24px;
  left: 50%;
  z-index: 3010;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 999px;
  background: rgba(13, 33, 22, 0.72);
  backdrop-filter: blur(16px);
  transform: translateX(-50%);
  box-shadow: 0 18px 42px rgba(0, 0, 0, 0.18);
}

.lightbox-toolbar button {
  min-width: 42px;
  height: 38px;
  border: 0;
  border-radius: 999px;
  color: #ffffff;
  background: rgba(255, 255, 255, 0.12);
  font-size: 1rem;
  font-weight: 900;
  cursor: pointer;
  transition: background 0.2s ease, transform 0.2s ease;
}

.lightbox-toolbar button:hover {
  background: rgba(255, 255, 255, 0.2);
  transform: translateY(-1px);
}

#zoom-reset {
  min-width: 64px;
  font-size: 0.82rem;
}

.lightbox-figure {
  width: min(1180px, 100%);
  height: min(78vh, 780px);
  margin: 0;
  display: grid;
  grid-template-rows: minmax(0, 1fr) auto;
  gap: 16px;
}

.lightbox-image-stage {
  position: relative;
  width: 100%;
  height: 100%;
  overflow: hidden;
  display: grid;
  place-items: center;
  border-radius: 28px;
  background:
    linear-gradient(135deg, rgba(18, 70, 43, 0.38), rgba(197, 139, 49, 0.24)),
    rgba(0, 0, 0, 0.28);
  box-shadow:
    0 30px 90px rgba(0, 0, 0, 0.38),
    inset 0 0 0 1px rgba(255, 255, 255, 0.12);
  touch-action: none;
  user-select: none;
  cursor: grab;
}

.lightbox-image-stage.dragging {
  cursor: grabbing;
}

#lightbox-image {
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
  object-fit: contain;
  transform-origin: center center;
  will-change: transform;
  user-select: none;
  pointer-events: none;
}

#lightbox-title {
  margin: 0;
  color: rgba(255, 255, 255, 0.82);
  font-size: 0.92rem;
  font-weight: 700;
  text-align: center;
}

/* Animaciones */
.reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.65s ease, transform 0.65s ease;
}

.reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
}

/* Responsive */
@media (max-width: 1040px) {
  .hero,
  .split-section,
  .population-section,
  .shield-section {
    grid-template-columns: 1fr;
  }

  .hero {
    min-height: auto;
    padding-top: 150px;
  }

  .hero-card {
    max-width: 540px;
  }

  .quick-facts,
  .eco-grid,
  .culture-grid,
  .gallery-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .large-card {
    grid-column: span 2;
  }
}

@media (max-width: 760px) {
  :root {
    --container: min(100% - 24px, 1160px);
  }
.hero {
    padding-top: 132px;
  }

  .hero h1 {
    font-size: clamp(2.9rem, 18vw, 4.5rem);
  }

  .hero-bg {
    inset: var(--header-bottom-offset, 80px) -18px 20px -18px;
    border-radius: 0 0 32px 32px;
  }

  .quick-facts,
  .eco-grid,
  .culture-grid,
  .gallery-grid {
    grid-template-columns: 1fr;
  }

  .quick-facts {
    margin-top: 24px;
  }

  .section {
    padding: 68px 0;
  }

  .large-card {
    grid-column: span 1;
  }

  .bar-row {
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .map-card {
    display: grid;
    align-items: flex-start;
  }

  .gallery-item {
    aspect-ratio: 4 / 3;
    border-radius: 22px;
  }

  .gallery-item::after {
    display: none;
  }

  .lightbox {
    padding: 78px 12px 30px;
  }

  .lightbox-close {
    top: 16px;
    right: 16px;
    width: 48px;
    height: 48px;
  }

  .lightbox-toolbar {
    top: 18px;
    left: 18px;
    right: 76px;
    justify-content: center;
    transform: none;
  }

  .lightbox-toolbar button {
    min-width: 38px;
    height: 36px;
  }

  #zoom-reset {
    min-width: 58px;
  }

  .lightbox-figure {
    height: min(78vh, 720px);
  }

  .lightbox-image-stage {
    border-radius: 22px;
  }

  #lightbox-title {
    font-size: 0.82rem;
  }
}

@media (max-width: 420px) {
  .hero-actions,
  .btn {
    width: 100%;
  }

  .hero-card,
  .population-card,
  .culture-card,
  .eco-card,
  .map-card {
    padding: 22px;
  }

  .fact-card {
    min-height: auto;
  }

  .gallery-item {
    aspect-ratio: 1 / 0.78;
    border-radius: 20px;
  }

  .lightbox {
    padding-inline: 10px;
  }

  .lightbox-toolbar {
    gap: 6px;
    padding: 6px;
  }

  .lightbox-toolbar button {
    min-width: 34px;
    height: 34px;
  }

  #zoom-reset {
    min-width: 54px;
    font-size: 0.76rem;
  }
}
/* =========================================================
   MEJORA GLOBAL DE IMÁGENES: VISOR TIPO FACEBOOK
   Integrado sin afectar las secciones y estilos existentes.
   ========================================================= */

[data-gallery-item],
.zoomable-content-image {
  cursor: zoom-in;
  -webkit-tap-highlight-color: transparent;
}

[data-gallery-item]:focus-visible,
.zoomable-content-image:focus-visible {
  outline: 4px solid rgba(197, 139, 49, 0.72);
  outline-offset: 5px;
}

.shield-image-box[data-gallery-item] {
  cursor: zoom-in;
  transition: transform 0.28s ease, box-shadow 0.28s ease;
}

.shield-image-box[data-gallery-item]:hover {
  transform: translateY(-5px) scale(1.01);
  box-shadow:
    0 34px 74px rgba(23, 35, 25, 0.24),
    inset 0 0 0 8px rgba(255, 247, 232, 0.75);
}

.lightbox-toolbar button:disabled {
  opacity: 0.42;
  cursor: not-allowed;
  transform: none;
}

.lightbox-nav {
  position: fixed;
  top: 50%;
  z-index: 3010;
  width: 54px;
  height: 72px;
  padding: 0;
  border: 0;
  border-radius: 999px;
  color: #ffffff;
  background: rgba(13, 33, 22, 0.72);
  box-shadow: 0 18px 42px rgba(0, 0, 0, 0.24);
  backdrop-filter: blur(16px);
  font-size: 3rem;
  line-height: 0;
  cursor: pointer;
  transform: translateY(-50%);
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
  transition: opacity 0.2s ease, background 0.2s ease, transform 0.2s ease;
}

.lightbox-nav:hover {
  background: rgba(197, 139, 49, 0.72);
  transform: translateY(-50%) scale(1.05);
}

.lightbox-nav:focus-visible,
.lightbox-image-stage:focus-visible {
  outline: 3px solid #f4d88a;
  outline-offset: 3px;
}

.lightbox-nav--prev {
  left: 22px;
}

.lightbox-nav--next {
  right: 22px;
}

.lightbox.is-zoomed .lightbox-nav {
  opacity: 0;
  pointer-events: none;
}

.lightbox-image-stage {
  cursor: zoom-in;
  overscroll-behavior: none;
  -webkit-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
  contain: layout paint;
}

.lightbox-image-stage.can-pan {
  cursor: grab;
}

.lightbox-image-stage.is-dragging,
.lightbox-image-stage.is-gesturing,
.lightbox-image-stage.dragging {
  cursor: grabbing;
}

#lightbox-image {
  transition: transform 0.18s ease-out, opacity 0.2s ease;
  -webkit-user-drag: none;
}

.lightbox-image-stage.is-dragging #lightbox-image,
.lightbox-image-stage.is-gesturing #lightbox-image {
  transition: none;
}

.lightbox-image-stage.is-loading #lightbox-image {
  opacity: 0.24;
}

@media (max-width: 760px) {
  .lightbox-nav {
    top: auto;
    bottom: 24px;
    width: 48px;
    height: 48px;
    font-size: 2.45rem;
    transform: none;
  }

  .lightbox-nav:hover {
    transform: scale(1.04);
  }

  .lightbox-nav--prev {
    left: 16px;
  }

  .lightbox-nav--next {
    right: 16px;
  }
}

/* El visor siempre permanece por encima del header global. */
.lightbox {
  z-index: 10000;
}

.lightbox-close,
.lightbox-toolbar,
.lightbox-nav {
  z-index: 10020;
}
