/* ==========================================================================
   CARRUSELES Y CONTROLES DEL LIBRO - RESPONSIVE
   ========================================================================== */

/* --------------------------------------------------------------------------
   NAVEGACIÓN LATERAL (DESKTOP)
   -------------------------------------------------------------------------- */
.journey-nav nav {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  padding-bottom: 12px;
  scrollbar-width: thin;
  scrollbar-color: var(--gold) transparent;
}

.nav-contact {
  flex: 0 0 auto;
  margin: 0 0 25px;
}

/* --------------------------------------------------------------------------
   CONTROLES DEL LIBRO (RUTA Y FLECHAS)
   -------------------------------------------------------------------------- */
.book-controls {
  position: absolute;
  top: 24px;
  left: 50%;
  width: min(620px, 70vw);
  transform: translateX(-50%);
  z-index: 100;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  pointer-events: auto;
  transition: top 0.3s ease, width 0.3s ease;
}

.book-route {
  position: relative;
  width: 100%;
  height: 34px;
  pointer-events: none;
}

.book-route-line {
  position: absolute;
  left: 18px;
  right: 18px;
  top: 50%;
  height: 1px;
  background: rgba(235, 192, 112, 0.4);
  transform: translateY(-50%);
}

.book-route-stop {
  position: absolute;
  top: 50%;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.75);
  border: 1px solid rgba(255, 255, 255, 0.9);
  transform: translate(-50%, -50%);
  box-shadow: 0 1px 8px rgba(0, 0, 0, 0.35);
  transition: background 0.3s ease, transform 0.3s ease;
}

.book-car {
  position: absolute;
  left: 0%;
  top: 50%;
  transform: translate(-50%, -50%);
  font-size: 22px;
  line-height: 1;
  filter: drop-shadow(0 3px 5px rgba(0, 0, 0, 0.5));
  transition: left 0.65s cubic-bezier(0.65, 0, 0.35, 1);
  pointer-events: none;
  z-index: 10;
}

.book-navigation {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  pointer-events: auto;
}

.book-prev,
.book-next {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  border: 1px solid rgba(235, 192, 112, 0.65);
  background: rgba(5, 18, 24, 0.85);
  color: var(--paper);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 22px;
  line-height: 1;
  padding: 0;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  box-shadow: 0 4px 18px rgba(0, 0, 0, 0.3);
  pointer-events: auto;
  transition: transform 0.15s ease, background 0.2s ease, border-color 0.2s ease;
}

.book-prev:hover:not(:disabled),
.book-next:hover:not(:disabled) {
  background: var(--gold);
  color: #071012;
  border-color: var(--gold);
  transform: scale(1.05);
}

.book-counter {
  min-width: 52px;
  text-align: center;
  color: #fff;
  font-size: 11px;
  letter-spacing: 2px;
  font-family: var(--sans);
  text-shadow: 0 1px 8px rgba(0, 0, 0, 0.6);
  pointer-events: none;
}

.book-counter .book-current {
  color: var(--gold);
  font-weight: 700;
}

/* --------------------------------------------------------------------------
   CARRUSEL DE FOTOS DENTRO DEL CAPÍTULO
   -------------------------------------------------------------------------- */
.photo-slider {
  position: absolute;
  z-index: 2;
  bottom: 44px;
  width: min(43%, 570px);
}

.chapter-left .photo-slider {
  right: 6%;
}

.chapter-right .photo-slider {
  left: 6%;
}

.slider-heading {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 9px;
  color: #f1cd79;
  text-transform: uppercase;
  font-size: 10px;
  letter-spacing: 1.1px;
}

.slider-heading button {
  width: 30px;
  height: 30px;
  margin-left: 5px;
  border: 1px solid var(--gold);
  border-radius: 50%;
  background: rgba(5, 12, 13, 0.7);
  color: var(--paper);
  font: 22px / 1 var(--serif);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s, color 0.2s;
}

.slider-heading button:hover {
  background: var(--gold);
  color: #050c0d;
}

.slider-window {
  overflow: hidden;
  border-radius: 6px;
}

.slider-track {
  display: flex;
  gap: 10px;
  transition: transform 0.45s ease;
  will-change: transform;
}

.photo-card {
  flex: 0 0 calc(50% - 5px);
  margin: 0;
  background: #081012;
  border: 1px solid rgba(235, 192, 112, 0.5);
  border-radius: 6px;
  overflow: hidden;
  cursor: pointer;
  transition: border-color 0.2s, transform 0.2s;
}

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

.photo-card:focus-within {
  outline: 2px solid var(--gold);
  outline-offset: 2px;
}

.photo-card img {
  display: block;
  width: 100%;
  height: 130px;
  object-fit: cover;
  transition: filter 0.25s ease;
}

.photo-card:hover img {
  filter: saturate(1.1);
}

.photo-card span {
  display: block;
  padding: 9px 10px;
  color: var(--paper);
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  background: #081215;
}

/* --------------------------------------------------------------------------
   LIGHTBOX DE FOTOS
   -------------------------------------------------------------------------- */
.photo-lightbox[hidden] {
  display: none;
}

.photo-lightbox {
  position: fixed;
  z-index: 2500;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 5vh 6vw;
}

.lightbox-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.88);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.lightbox-content {
  position: relative;
  width: min(1080px, 100%);
  max-height: 88vh;
  padding: 16px 56px 36px;
  background: #081316;
  border: 1px solid rgba(235, 192, 112, 0.7);
  border-radius: 10px;
  box-shadow: 0 22px 70px rgba(0, 0, 0, 0.85);
  z-index: 10;
}

.lightbox-content figure {
  margin: 0;
}

.lightbox-content figure img {
  display: block;
  width: 100%;
  max-height: 70vh;
  object-fit: contain;
  background: #030707;
  border-radius: 6px;
}

.lightbox-content figcaption {
  padding: 12px 4px 0;
  color: #f5d58e;
  font-size: 12px;
  letter-spacing: 1px;
  text-transform: uppercase;
  text-align: center;
}

.lightbox-close,
.lightbox-arrow {
  position: absolute;
  border: 1px solid var(--gold);
  color: var(--paper);
  background: rgba(5, 12, 13, 0.85);
  cursor: pointer;
  z-index: 20;
  display: grid;
  place-items: center;
  transition: all 0.2s ease;
}

.lightbox-close:hover,
.lightbox-arrow:hover {
  background: var(--gold);
  color: #060e10;
}

.lightbox-close {
  top: 12px;
  right: 12px;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  font: 24px / 1 var(--sans);
}

.lightbox-arrow {
  top: 50%;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  font: 30px / 0.8 var(--serif);
  transform: translateY(-50%);
}

.lightbox-arrow.previous {
  left: 10px;
}

.lightbox-arrow.next {
  right: 10px;
}

.lightbox-count {
  position: absolute;
  bottom: 8px;
  left: 0;
  right: 0;
  margin: 0;
  text-align: center;
  color: #d9c9a0;
  font-size: 10px;
  letter-spacing: 1.2px;
}

/* --------------------------------------------------------------------------
   RESPONSIVE EN MÓVILES (hasta 992px)
   -------------------------------------------------------------------------- */
@media (max-width: 992px) {
  /* Controles del libro en móvil: ubicados debajo del header */
  .book-controls {
    top: 70px !important;
    width: min(92%, 460px) !important;
    gap: 4px;
  }

  .book-route {
    height: 30px;
  }

  .book-car {
    font-size: 20px;
  }

  .book-prev,
  .book-next {
    width: 38px;
    height: 38px;
    font-size: 20px;
  }

  /* Carrusel en móvil: flujo natural bajo el texto */
  .photo-slider {
    position: relative !important;
    inset: auto !important;
    width: 100% !important;
    max-width: 520px;
    margin: 18px auto 20px !important;
  }

  /* 1 sola tarjeta visible por slide en móvil */
  .photo-card {
    flex: 0 0 100% !important;
    max-width: 100% !important;
  }

  .photo-card img {
    height: 160px;
  }

  .slider-heading {
    font-size: 9.5px;
    margin-bottom: 8px;
  }

  .slider-heading button {
    width: 34px;
    height: 34px;
    font-size: 22px;
  }

  /* Lightbox móvil */
  .photo-lightbox {
    padding: 4vh 14px;
  }

  .lightbox-content {
    padding: 12px 14px 34px;
    max-height: 85vh;
  }

  .lightbox-content figure img {
    max-height: 64vh;
  }

  .lightbox-close {
    top: 8px;
    right: 8px;
    width: 34px;
    height: 34px;
    font-size: 20px;
  }

  .lightbox-arrow {
    width: 38px;
    height: 38px;
    font-size: 24px;
  }

  .lightbox-arrow.previous {
    left: 6px;
  }

  .lightbox-arrow.next {
    right: 6px;
  }
}
