/* ===============================
   FOTO HERO CON HOTSPOT / LIGHTBOX
   =============================== */
.tlf-photo-hero {
  margin: 0 auto;
  position: relative;
  max-width: 100%;
  min-height: 90vh;
  overflow: hidden;
  display: flex;
  z-index: 10;
    scroll-snap-align: center; 
}

  .snap-hero {
    scroll-snap-align: start;
    min-height: 100vh;
    display: flex;
    align-items: center;
  }
.tlf-photo-hero img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  display: block;
  z-index: 1;
  opacity: 0.8;
  margin: 0 auto;
}

/* Excepción: imagen vertical (id=c) alineada arriba */
.tlf-photo-hero[data-foto-id="c"] img {
  object-position: top center;
}

.tlf-photo-hero,
.tlf-video-overlay {
  transition: opacity .002s linear;
  /* 2ms */
}


/* Estado apagado */
.fondo-hidden {
  opacity: 0 !important;
}

/* Botón flotante (punto + texto) */
.tlf-hotspot {
  position: absolute;
  bottom: 5%;
  left: 50%;
  transform: translateX(-50%);
  z-index: 3;
  display: flex;
  align-items: center;
  gap: 6px;
  background: rgba(0, 0, 0, 1);
  border: 1px solid #ffc116;
  color: #fff;
  font-weight: 500;
  padding: 6px 12px;
  cursor: pointer;
  transition: all 0.25s ease;
}

.tlf-hotspot:hover {
  background: rgba(0, 0, 0);
  border: 1px solid white;
}

/* Punto blanco animado */
.tlf-hotspot .dot {
  display: inline-block;
  width: 14px;
  height: 14px;
  aspect-ratio: 1/1;
  border-radius: 50%;
  background: #fff;
  box-shadow:
    0 0 0 2px rgba(255, 255, 255, .45) inset,
    0 0 8px rgba(255, 255, 255, .8);
  animation: pulse 2s infinite ease-in-out;
}

@keyframes pulse {

  0%,
  100% {
    opacity: 1;
    transform: scale(1);
  }

  50% {
    opacity: .6;
    transform: scale(1.25);
  }
}

.tlf-hotspot .label {
  font-size: 14px;
  font-weight: 700;
  letter-spacing: .2px;
  text-align: left;
}



/* ===============================
   LIGHTBOX GENERAL
   =============================== */
#lightbox {
  position: fixed;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, .97);
  z-index: 90000;
  flex-direction: column;
  padding: 40px;
      font-family: 'Heebo', 'Arial', sans-serif;

}

#lightbox.is-visible {
  display: flex;
}

#lightbox img {
  max-width: 90%;
  max-height: 80vh;
  border-radius: 10px;
  box-shadow: 0 0 15px rgba(0, 0, 0, .8);
}

#lightbox .caption {
  color: #eee;
  max-width: 80%;
  margin-top: 15px;
  text-align: center;
  font-size: 15px;
  line-height: 1.4;
}

/* Botón de cerrar */
#lightbox .close-btn {
  position: absolute;
  top: 10%;
  right: 15%;
  z-index: 10000;
  background: rgba(0, 0, 0, 0.65);
  border: 2px solid #fff;
  width: 38px;
  height: 38px;
  aspect-ratio: 1/1;
  border-radius: 50%;
  color: white;
  font-size: 20px;
  line-height: 32px;
  cursor: pointer;
  transition: all .2s ease;
}

#lightbox .close-btn:hover {
  background: rgba(0, 0, 0, 0.85);
  transform: scale(1.07);
}

/* ===============================
   FONDO DE VÍDEO — Carrero Blanco
   =============================== */


.tlf-video-overlay {
  position: absolute;
  inset: 0;
  z-index: 15 !important;
  overflow: hidden;
  pointer-events: none;
}

.tlf-video-overlay video {
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center;
  display: block;
  transition: opacity 1s ease-out;
}

/* ===============================
   VERSIÓN MÓVIL
   =============================== */

@media (max-width: 768px) {
  .tlf-photo-hero {
    width: 100vw;
    max-width: 1000%;
    height: 100%;
  }


  .tlf-photo-hero img {
    object-fit: cover;
    object-position: center;
    opacity: 0.85;
  }

  /* Excepción: imagen vertical (id=c) */
  .tlf-photo-hero[data-foto-id="c"] img {
    object-fit: contain;
    object-position: top center;
  }

  /* Hotspot más grande y táctil en móvil */
  .tlf-hotspot {
    bottom: 8%;
    padding: 10px 26px;
    font-size: 13px;
    border: 1px solid #ffffff;
    gap: 8px;
  }

  .tlf-hotspot .dot {
    aspect-ratio: 1/1;
    height: 1rem;
    width: 1rem;
  }

  .tlf-hotspot:active {
    background: rgba(0, 0, 0, 0.95);
    border: 1px solid #ffc116;
  }

  /* Video overlay móvil */
  .tlf-video-overlay {
    width: 100%;
    height: 100%;
  }

  .tlf-video-overlay video {
    object-fit: contain;
    object-position: center;
  }

  /* Lightbox móvil */
  #lightbox {
    padding: 20px;
    inset: 0;
  }

  #lightbox img {
    max-width: 100%;
    max-height: 75vh;
    border-radius: 8px;
  }

  #lightbox .caption {
    max-width: 95%;
    font-size: 14px;
    margin-top: 12px;
  }

  #lightbox .close-btn {
    top: 15px;
    right: 10px;
    font-size: 1rem;
    border-radius: 0%;
    aspect-ratio: 1/1;
  }
}

/* =============================
   DESKTOP
   ============================= */
@media (min-width: 769px) {

  /* Ocultar IMAGEN solo si hay vídeo */
  .tlf-photo-hero.has-video img {
    display: none !important;
  }

  /* Mostrar vídeo en desktop */
  .tlf-photo-hero.has-video .tlf-video-overlay video {
    display: block !important;
  }
}


/* =============================
   MÓVIL
   ============================= */
@media (max-width: 768px) {

  /* Mostrar la IMAGEN siempre en móvil */
  .tlf-photo-hero img {
    display: block !important;
  }

  /* Ocultar vídeo en móvil */
  .tlf-photo-hero .tlf-video-overlay video {
    display: none !important;
  }
    /* Botón de cerrar */
#lightbox .close-btn {
  top: 20%;
  right: 10%;
}
}

/* SOLO las imágenes de Carrero Blanco y Marcha Verde → object-fit: contain */
.tlf-photo-hero img[src*="mapa-carrero-blanco"],
.tlf-photo-hero img[src*="sahara-occidental"] {
  object-fit: contain !important;
  object-position: center !important;
}


/* ===== CONTROLES DE VIDEO EXTERNOS ===== */
.tlf-external-controls {
  position: absolute;
  top: 10%;
  left: 50%;
  z-index: 10;
  display: flex;
  gap: 12px;
}

.tlf-external-controls button {
  background: rgba(0, 0, 0, 0.8);
  border: 2px solid #ffc116;
  padding: 6px 12px;
  color: white;
  border-radius: 6px;
  font-size: 14px;
  cursor: pointer;
}

.tlf-external-controls button:hover {
  background: black;
}

/* Ocultar controles de vídeo en móvil */
@media (max-width: 768px) {
  .tlf-external-controls {
    display: none !important;
  }
}

.tlf-video-overlay video[src*="moneda-jc.mp4"] {
  object-fit: cover !important;
  object-position: center !important;
  width: 100% !important;
  height: 100% !important;
}

#portada-historia-scroll-linea-tiempo {
  position: relative;
  width: 100vw;
  height: 100vh;
  overflow: hidden;
}

.portada-media {
  position: relative;
  width: 100%;
  height: 100%;
}

.portada-img,
.portada-video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-position: center;
  display: block;
}

@media (max-width: 768px) {
  .tlf-photo-hero[data-foto-id="a"] img {
    object-position: right center !important;
  }
}