/* ==========================================================================
   MÓDULO: GALERÍA BENTO + SLIDER MÓVIL
   ========================================================================== */

.gallery-f1 {
  background-color: var(--color-dark, #000000);
  color: #FFFFFF;
  padding: 3rem 1.5rem;
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  box-sizing: border-box;
}

.gallery-f1 * {
  box-sizing: border-box;
}

.gallery-f1__container {
  max-width: 1200px;
  margin: 0 auto;
}

/* ENCABEZADO */
.gallery-f1__header {
  text-align: center;
  margin-bottom: 2rem;
}

.gallery-f1__title {
  font-size: clamp(1.8rem, 4vw, 3rem);
  font-weight: 900;
  font-style: italic;
  text-transform: uppercase;
  color: #FFFFFF;
  margin: 0 0 0.5rem 0;
  line-height: 1.1;
}

.gallery-f1__subtitle {
  font-size: 1rem;
  color: #E0E0E0;
  margin: 0 auto;
  max-width: 600px;
}

/* --- MÓVIL: SLIDER HORIZONTAL CON SCROLL TOUCH --- */
.gallery-f1__track {
  display: flex;
  gap: 1rem;
  overflow-x: auto;
  padding: 0.5rem 0;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.gallery-f1__track::-webkit-scrollbar {
  display: none;
}

.gallery-f1__item {
  flex: 0 0 82%; /* Muestra 1 foto + pista de la siguiente */
  scroll-snap-align: center;
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.15);
  background-color: #111111;
  aspect-ratio: 4 / 3;
  cursor: pointer;
  position: relative;
  user-select: none;
}

.gallery-f1__item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  pointer-events: none;
  transition: transform 0.3s ease;
}

/* --- LIGHTBOX MODAL (PANTALLA COMPLETA) --- */
.gallery-f1__modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0, 0, 0, 0.92);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 99999;
  justify-content: center;
  align-items: center;
  padding: 1rem;
}

.gallery-f1__modal.is-open {
  display: flex !important;
}

.gallery-f1__modal-close {
  position: absolute;
  top: 1rem;
  right: 1.5rem;
  font-size: 3rem;
  color: #FFFFFF;
  cursor: pointer;
  line-height: 1;
}

.gallery-f1__modal-content img {
  max-width: 92vw;
  max-height: 85vh;
  object-fit: contain;
  border-radius: 8px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.8);
}

/* ==========================================================================
   ESCRITORIO: BENTO BOX LAYOUT (>= 992px)
   ========================================================================== */
@media (min-width: 992px) {
  
  .gallery-f1__track {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    grid-auto-rows: 220px;
    gap: 1.25rem;
    overflow: visible;
    padding: 0;
  }

  .gallery-f1__item {
    flex: none;
    width: 100%;
    height: 100%;
    aspect-ratio: auto;
  }

  .gallery-f1__item:hover img {
    transform: scale(1.05);
  }

/* DISTRIBUCIÓN BENTO INTELIGENTE PARA 10 FOTOS */
  .gallery-f1__item:nth-child(1) {
    grid-column: span 2;
    grid-row: span 2; /* Foto Principal (Grande) */
  }

  .gallery-f1__item:nth-child(6) {
    grid-column: span 2; /* Foto Panorámica (Fila 3) */
  }

  .gallery-f1__item:nth-child(9),
  .gallery-f1__item:nth-child(10) {
    grid-column: span 2; /* Dos fotos anchas al final para cerrar el rectángulo */
  }