.photo-gallery {
  max-width: 120rem;
  margin: 0 auto 4rem;
}

.photo-gallery .heading {
  margin-bottom: 0.5rem;
}

.gallery-lead {
  text-align: center;
  font-size: 1.8rem;
  color: #555;
  max-width: 72rem;
  margin: 0 auto 3.5rem;
  line-height: 1.7;
}

.gallery-stage {
  position: relative;
  background: #1f2438;
  border-radius: 14px;
  overflow: hidden;
  aspect-ratio: 16 / 10;
  min-height: 36rem;
  box-shadow: var(--secondary-box-shadow, 0 8px 24px rgba(0, 0, 0, 0.12));
}

.gallery-slide {
  position: absolute;
  inset: 0;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.45s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #1f2438;
}

.gallery-slide[data-active] {
  opacity: 1;
  pointer-events: auto;
  z-index: 1;
}

.gallery-slide img,
.gallery-slide video {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}

.gallery-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 3;
  width: 4.8rem;
  height: 4.8rem;
  border: none;
  border-radius: 50%;
  background: var(--yellow);
  color: var(--black);
  font-size: 2.8rem;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
}

.gallery-nav:hover {
  transform: translateY(-50%) scale(1.06);
}

.gallery-nav.prev {
  left: 1.6rem;
}

.gallery-nav.next {
  right: 1.6rem;
}

.gallery-counter {
  position: absolute;
  right: 1.8rem;
  bottom: 1.6rem;
  z-index: 3;
  background: rgba(31, 36, 56, 0.82);
  color: #fff;
  font-size: 1.4rem;
  letter-spacing: 0.08em;
  padding: 0.6rem 1.2rem;
  border-radius: 999px;
}

.gallery-thumbs {
  display: flex;
  gap: 1rem;
  overflow-x: auto;
  padding: 1.6rem 0.2rem 1rem;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
}

.gallery-thumbs::-webkit-scrollbar {
  height: 6px;
}

.gallery-thumbs::-webkit-scrollbar-thumb {
  background: #ccc;
  border-radius: 4px;
}

.gallery-thumb {
  flex: 0 0 9.5rem;
  height: 7.2rem;
  border: 2px solid transparent;
  border-radius: 8px;
  overflow: hidden;
  padding: 0;
  cursor: pointer;
  background: #1f2438;
  scroll-snap-align: start;
  position: relative;
}

.gallery-thumb img,
.gallery-thumb video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  pointer-events: none;
}

.gallery-thumb.is-active {
  border-color: var(--yellow);
  box-shadow: 0 0 0 2px rgba(255, 200, 0, 0.35);
}

.gallery-thumb .play-badge,
.grid-item .play-badge {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.28);
  color: #fff;
  font-size: 2rem;
  pointer-events: none;
}

.gallery-grid-wrap {
  margin-top: 4rem;
}

.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(22rem, 1fr));
  gap: 1.6rem;
}

.grid-item {
  position: relative;
  border: none;
  padding: 0;
  border-radius: 10px;
  overflow: hidden;
  cursor: pointer;
  background: #1f2438;
  aspect-ratio: 4 / 3;
  box-shadow: var(--secondary-box-shadow, 0 4px 14px rgba(0, 0, 0, 0.08));
}

.grid-item img,
.grid-item video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.35s ease;
  pointer-events: none;
}

.grid-item:hover img,
.grid-item:hover video {
  transform: scale(1.05);
}

.grid-item.is-active {
  outline: 3px solid var(--yellow);
  outline-offset: 2px;
}

@media (max-width: 768px) {
  .gallery-stage {
    aspect-ratio: 4 / 5;
    min-height: 28rem;
    border-radius: 10px;
  }

  .gallery-nav {
    width: 3.8rem;
    height: 3.8rem;
    font-size: 2.2rem;
  }

  .gallery-nav.prev {
    left: 0.8rem;
  }

  .gallery-nav.next {
    right: 0.8rem;
  }

  .gallery-thumb {
    flex: 0 0 7.6rem;
    height: 5.8rem;
  }

  .gallery-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
  }
}
