/**
 * Gallery Section Component
 *
 * @package Annecy_Unik_Lodges
 */

/* Section Gallery */
.section-gallery {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 55px;
}

/* Header */
.gallery__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 30px;
}

/* Title */
.gallery__title {
  margin: 0;
}

.gallery__title h2,
.gallery__title p {
  margin: 0;
  font-family: var(--font-heading);
  font-size: 42px;
  font-weight: 400;
  color: var(--color-gray-darker);
  font-style: italic;
}

.gallery__title em,
.gallery__title i {
  font-style: italic;
  color: var(--color-primary);
}

/* Social Links */
.gallery__links {
  display: flex;
  gap: 25px;
}

.gallery__link {
  font-family: var(--font-body);
  font-size: 16px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1.6px;
  color: var(--color-gray-darker);
  padding: 10px 0;
  text-decoration: none;
  position: relative;
  transition: color var(--transition-base);
}

.gallery__link::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 3px;
  background-color: var(--color-secondary);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.gallery__link:hover::after {
  transform: scaleX(1);
}

.gallery__link:hover {
  color: var(--color-secondary);
}

/* Container */
.gallery__container {
  width: 100%;
}

/* Grid Masonry */
.gallery__grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 24px;
}

/* Columns */
.gallery__column {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

/* Items */
.gallery__item {
  position: relative;
  overflow: hidden;
  cursor: pointer;
}

.gallery__item::after {
  content: '';
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0);
  transition: background-color 0.3s ease;
}

.gallery__item:hover::after {
  background: rgba(0, 0, 0, 0.1);
}

.gallery__item--tall {
  height: 520px;
}

.gallery__item--short {
  height: 275px;
}

.gallery__item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* ========================================
   RESPONSIVE
   ======================================== */

@media (max-width: 1200px) {
  .gallery__grid {
    grid-template-columns: repeat(3, 1fr);
  }

  .gallery__column:last-child {
    display: none;
  }
}

@media (max-width: 900px) {
  .gallery__grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .gallery__column:nth-child(3) {
    display: none;
  }

  .gallery__item--tall {
    height: 400px;
  }

  .gallery__item--short {
    height: 220px;
  }
}

@media (max-width: 768px) {
  .section-gallery {
    gap: 40px;
  }

  .gallery__header {
    flex-direction: column;
    align-items: flex-start;
  }

  .gallery__title h2,
  .gallery__title p {
    font-size: 32px;
  }

  .gallery__link {
    font-size: 14px;
    letter-spacing: 1.4px;
  }
}

@media (max-width: 600px) {
  .gallery__grid {
    display: flex;
    flex-direction: column;
    gap: 16px;
  }

  .gallery__column {
    display: contents;
  }

  .gallery__item--tall,
  .gallery__item--short {
    height: 280px;
  }
}

/* ========================================
   GALLERY LIGHTBOX
   ======================================== */

.gallery-lightbox {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: rgba(0, 0, 0, 0.4);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.4s ease, visibility 0.4s ease;
}

.gallery-lightbox.is-open {
  opacity: 1;
  visibility: visible;
}

/* Close Button */
.gallery-lightbox__close {
  position: absolute;
  top: 20px;
  right: 20px;
  z-index: 10;
  width: 50px;
  height: 50px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--color-primary);
  border: none;
  border-radius: 50%;
  cursor: pointer;
  transition: background-color 0.3s ease;
}

.gallery-lightbox__close:hover {
  background: var(--color-primary-dark, #2a4a45);
}

.gallery-lightbox__close svg {
  width: 24px;
  height: 24px;
  color: var(--color-white);
}

/* Swiper Container */
.gallery-lightbox__swiper {
  width: 100%;
  height: 100%;
}

.gallery-lightbox__swiper .swiper-slide {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 60px 80px;
}

.gallery-lightbox__swiper .swiper-slide img {
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
  object-fit: contain;
}

/* Navigation Buttons */
.gallery-lightbox__nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 10;
  width: 50px;
  height: 50px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--color-primary);
  border: none;
  border-radius: 50%;
  cursor: pointer;
  transition: background-color 0.3s ease;
}

.gallery-lightbox__nav:hover {
  background: var(--color-primary-dark, #2a4a45);
}

.gallery-lightbox__nav svg {
  width: 24px;
  height: 24px;
  color: var(--color-white);
}

.gallery-lightbox__nav--prev {
  left: 20px;
}

.gallery-lightbox__nav--next {
  right: 20px;
}

/* Lightbox Responsive */
@media (max-width: 768px) {
  .gallery-lightbox__swiper .swiper-slide {
    padding: 80px 20px;
  }

  .gallery-lightbox__nav {
    width: 44px;
    height: 44px;
  }

  .gallery-lightbox__nav--prev {
    left: 10px;
  }

  .gallery-lightbox__nav--next {
    right: 10px;
  }

  .gallery-lightbox__close {
    top: 15px;
    right: 15px;
    width: 44px;
    height: 44px;
  }
}
