/**
 * Gallery Section Styles
 *
 * @package Yusuf_Theme
 */

/* ========================================
   GALLERY SECTION
   ======================================== */

.gallery-section {
  background-color: var(--color-bg-light);
  padding: var(--spacing-section-mobile) 0;
  overflow: hidden;
}

@media (min-width: 768px) {
  .gallery-section {
    padding: var(--spacing-section-tablet) 0;
  }
}

/* Header */
.gallery-section__header {
  text-align: center;
  margin-bottom: var(--spacing-12);
}

.gallery-section__headline {
  font-size: clamp(32px, 5vw, 48px);
  font-weight: var(--font-weight-bold);
  font-style: italic;
  color: var(--color-teal-dark);
  margin-bottom: var(--spacing-4);
}

.gallery-section__subheadline {
  font-size: var(--font-size-lg);
  color: var(--color-text-medium);
}

/* ========================================
   YEAR GROUPS
   ======================================== */

.gallery-year {
  margin-bottom: var(--spacing-12);
}

.gallery-year:last-child {
  margin-bottom: 0;
}

.gallery-year__title {
  font-size: clamp(48px, 8vw, 80px);
  font-weight: var(--font-weight-bold);
  color: var(--color-text-dark);
  text-align: center;
  margin-bottom: var(--spacing-6);
}

/* ========================================
   GALLERY SLIDER
   ======================================== */

.gallery-slider {
  display: flex;
  gap: var(--spacing-4);
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scroll-behavior: smooth;
  padding: 0 var(--container-padding-mobile);
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.gallery-slider::-webkit-scrollbar {
  display: none;
}

@media (min-width: 768px) {
  .gallery-slider {
    padding: 0 var(--container-padding-tablet);
  }
}

@media (min-width: 1200px) {
  .gallery-slider {
    padding: 0 var(--container-padding-desktop);
  }
}

/* ========================================
   GALLERY ITEM
   ======================================== */

.gallery-item {
  position: relative;
  flex: 0 0 auto;
  height: 250px;
  border-radius: var(--border-radius-md);
  overflow: hidden;
  cursor: pointer;
  scroll-snap-align: start;
  background: none;
  border: none;
  padding: 0;
}

@media (min-width: 768px) {
  .gallery-item {
    height: 300px;
  }
}

@media (min-width: 1024px) {
  .gallery-item {
    height: 350px;
  }
}

.gallery-item img {
  width: auto;
  height: 100%;
  object-fit: cover;
  transition: transform var(--transition-slow);
}

.gallery-item:hover img {
  transform: scale(1.05);
}

/* Hover Overlay */
.gallery-item::after {
  content: '';
  position: absolute;
  inset: 0;
  background-color: rgba(0, 0, 0, 0);
  transition: background-color var(--transition-normal);
  pointer-events: none;
}

.gallery-item:hover::after {
  background-color: rgba(0, 0, 0, 0.2);
}

/* Zoom Icon */
.gallery-item__zoom {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) scale(0);
  width: 50px;
  height: 50px;
  background-color: var(--color-bg-white);
  border-radius: var(--border-radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1;
  opacity: 0;
  transition: all var(--transition-normal);
}

.gallery-item:hover .gallery-item__zoom {
  transform: translate(-50%, -50%) scale(1);
  opacity: 1;
}

.gallery-item__zoom svg {
  width: 24px;
  height: 24px;
  color: var(--color-text-dark);
}

/* ========================================
   LIGHTBOX
   ======================================== */

.lightbox {
  position: fixed;
  inset: 0;
  z-index: var(--z-modal);
  background-color: rgba(0, 0, 0, 0.95);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transition: all var(--transition-normal);
}

.lightbox.is-open {
  opacity: 1;
  visibility: visible;
}

.lightbox__image {
  max-width: 90vw;
  max-height: 90vh;
  object-fit: contain;
}

.lightbox__close {
  position: absolute;
  top: var(--spacing-4);
  right: var(--spacing-4);
  width: 50px;
  height: 50px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: none;
  border: none;
  color: var(--color-text-light);
  cursor: pointer;
  transition: opacity var(--transition-fast);
}

.lightbox__close:hover {
  opacity: 0.7;
}

.lightbox__close svg {
  width: 32px;
  height: 32px;
}

.lightbox__nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 50px;
  height: 50px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: none;
  border: none;
  color: var(--color-text-light);
  cursor: pointer;
  transition: opacity var(--transition-fast);
}

.lightbox__nav:hover {
  opacity: 0.7;
}

.lightbox__nav--prev {
  left: var(--spacing-4);
}

.lightbox__nav--next {
  right: var(--spacing-4);
}

.lightbox__nav svg {
  width: 32px;
  height: 32px;
}

.lightbox__counter {
  position: absolute;
  bottom: var(--spacing-4);
  left: 50%;
  transform: translateX(-50%);
  color: var(--color-text-light);
  font-size: var(--font-size-sm);
}

/* Lightbox open body state */
body.lightbox-open {
  overflow: hidden;
}
