/* Gallery Carousel */
.gallery-carousel {
  overflow: hidden;
  margin: 0 auto;
}

.gallery-carousel .gallery-grid {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: 16px;
}

.gallery-carousel .thumb {
  aspect-ratio: 16 / 10;
  background: #1a1a1e;
  border: 1px solid var(--border);
  border-radius: 14px;
  overflow: hidden;
  cursor: pointer;
}

.gallery-carousel .thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  filter: saturate(115%);
}

.gallery-carousel .carousel-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: min(1440px, 92vw);
  padding: 0 15px;
  margin: 0 auto 32px;
}

.gallery-carousel .carousel-header h3 {
  color: var(--silver);
  font-family: "NexaRust Slab", "Aptos", sans-serif;
  font-size: 2.5rem;
  font-weight: 900;
  line-height: 1.25;
  text-transform: uppercase;
  padding: 12px 24px;
  margin: 0;
}

.gallery-carousel .carousel-controls {
  display: flex;
  gap: 8px;
}

.gallery-carousel .carousel-btn {
  background: none;
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 41px;
  height: 41px;
  cursor: pointer;
  margin: 0 0 0 4px;
  transition: opacity 0.3s ease;
}

.gallery-carousel .carousel-btn img {
  width: 41px;
  height: 41px;
  object-fit: contain;
}

.gallery-carousel .carousel-btn:hover {
  opacity: 0.7;
}

.gallery-carousel .carousel-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.gallery-carousel .carousel-container {
  overflow: hidden;
  position: relative;
}

.gallery-carousel .carousel-track {
  display: flex;
  transition: transform 0.5s ease;
}

.gallery-carousel .carousel-slide {
  flex: 0 0 100%;
  width: 100%;
}

.gallery-carousel .carousel-slide .gallery-grid {
  display: grid;
  gap: 16px;
  min-height: 400px;
}

.gallery-carousel .thumb.landscape {
  aspect-ratio: 16 / 10;
}

.gallery-carousel .thumb.portrait {
  aspect-ratio: 3 / 4;
}

/* Lightbox */
.lightbox {
  display: none;
  position: fixed;
  z-index: 10000;
  padding-top: 100px;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  background-color: rgba(0, 0, 0, 0.9);
}

.lightbox-content {
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 90%;
  max-width: 1200px;
  height: 90%;
  position: relative;
  padding: 0;
  margin: auto;
}

.lightbox-image {
  width: 100%;
  max-height: 80vh;
  object-fit: contain;
  border-radius: 8px;
}

.lightbox-caption {
  color: #fff;
  margin: 15px 0;
  padding: 10px;
  background: rgba(0, 0, 0, 0.7);
  border-radius: 8px;
}

.lightbox-title {
  font-size: 1.5rem;
  margin: 0 0 10px 0;
  color: #fff;
}

.lightbox-description {
  font-size: 1rem;
  margin: 0;
  color: #ccc;
}

.lightbox-close {
  position: absolute;
  top: -40px;
  right: 15px;
  color: #fff;
  font-size: 35px;
  font-weight: bold;
  cursor: pointer;
  background: none;
  border: none;
}

.lightbox-close:hover,
.lightbox-close:focus {
  color: #bbb;
  text-decoration: none;
  cursor: pointer;
}

.lightbox-nav {
  position: absolute;
  top: 50%;
  width: auto;
  padding: 16px;
  margin-top: -50px;
  color: white;
  font-weight: bold;
  font-size: 30px;
  transition: 0.3s ease;
  border-radius: 0 3px 3px 0;
  user-select: none;
  background: none;
  border: none;
  cursor: pointer;
}

.lightbox-nav:hover {
  background-color: rgba(0, 0, 0, 0.8);
}

.lightbox-prev {
  left: 0;
  border-radius: 3px 0 0 3px;
}

.lightbox-next {
  right: 0;
  border-radius: 0 3px 3px 0;
}

/* Responsive carousel grid */
@media (min-width: 1024px) {
  /* Large screens: 4 landscape images, 8 portrait images per slide */
  .gallery-carousel .carousel-slide .gallery-grid {
    grid-template-columns: repeat(8, 1fr);
    grid-auto-flow: row;
  }

  .gallery-carousel .carousel-slide .gallery-grid .thumb.landscape {
    grid-column: span 2;
  }

  .gallery-carousel .carousel-slide .gallery-grid .thumb.portrait {
    grid-column: span 1;
  }
}

@media (max-width: 1023px) and (min-width: 768px) {
  /* Tablet screens: 2 landscape images, 4 portrait images per slide */
  .gallery-carousel .carousel-slide .gallery-grid {
    grid-template-columns: repeat(4, 1fr);
    grid-auto-flow: row;
  }

  .gallery-carousel .carousel-slide .gallery-grid .thumb.landscape {
    grid-column: span 2;
  }

  .gallery-carousel .carousel-slide .gallery-grid .thumb.portrait {
    grid-column: span 1;
  }
}

@media (max-width: 767px) {
  /* Mobile screens: 1 landscape image, 2 portrait images per slide */
  .gallery-carousel .carousel-slide .gallery-grid {
    grid-template-columns: repeat(2, 1fr);
    grid-auto-flow: row;
  }

  .gallery-carousel .carousel-slide .gallery-grid .thumb.landscape {
    grid-column: span 2;
  }

  .gallery-carousel .carousel-slide .gallery-grid .thumb.portrait {
    grid-column: span 1;
  }
  
  .lightbox-content {
    width: 95%;
    padding: 10px;
  }
  
  .lightbox-nav {
    font-size: 24px;
    padding: 12px;
    margin-top: -40px;
  }
  
  .lightbox-title {
    font-size: 1.2rem;
  }
  
  .lightbox-description {
    font-size: 0.9rem;
  }
}
