/* ══════════════════════════════════════════════════════
   PHOTO & VIDEO GALLERY
   ══════════════════════════════════════════════════════ */

.gallery-page {
  padding: 72px 32px 96px;
  max-width: 1440px;
  margin: 0 auto;
}

.gallery-tabs .year-tab {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.gallery-tab-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 24px;
  height: 22px;
  padding: 0 7px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.08);
  font-size: 12px;
  font-weight: 700;
}

.year-tab.active .gallery-tab-count {
  background: rgba(255, 255, 255, 0.25);
}

.gallery-album-title {
  font-size: clamp(24px, 3vw, 34px);
  font-weight: 700;
  letter-spacing: -0.01em;
  margin-bottom: 32px;
  padding-bottom: 16px;
  border-bottom: 2px solid var(--black);
}

/* ── Photo grid ────────────────────────────────────── */

.photo-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
}

.photo-item {
  position: relative;
  display: block;
  padding: 0;
  border: 0;
  background: var(--gray-light);
  aspect-ratio: 4 / 3;
  overflow: hidden;
  cursor: zoom-in;
}

.photo-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.6s cubic-bezier(0.22, 1, 0.36, 1), filter 0.4s;
}

.photo-item:hover img,
.photo-item:focus-visible img {
  transform: scale(1.06);
  filter: brightness(0.72);
}

.photo-item-zoom {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--white);
  opacity: 0;
  transform: scale(0.85);
  transition: opacity 0.35s, transform 0.35s;
  pointer-events: none;
}

.photo-item-zoom svg {
  width: 34px;
  height: 34px;
}

.photo-item:hover .photo-item-zoom,
.photo-item:focus-visible .photo-item-zoom {
  opacity: 1;
  transform: scale(1);
}

/* ── Video grid ────────────────────────────────────── */

.video-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 36px 24px;
}

.video-item-btn {
  display: block;
  width: 100%;
  padding: 0;
  border: 0;
  background: none;
  text-align: left;
  cursor: pointer;
}

.video-thumb {
  position: relative;
  display: block;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  background: #101014;
}

.video-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.6s cubic-bezier(0.22, 1, 0.36, 1), filter 0.4s;
}

.video-item-btn:hover .video-thumb img,
.video-item-btn:focus-visible .video-thumb img {
  transform: scale(1.05);
  filter: brightness(0.68);
}

.video-play {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 68px;
  height: 48px;
  transition: transform 0.35s;
}

.video-play svg {
  width: 100%;
  height: 100%;
}

.video-play-bg {
  fill: rgba(0, 0, 0, 0.6);
  transition: fill 0.3s;
}

.video-item-btn:hover .video-play {
  transform: translate(-50%, -50%) scale(1.1);
}

.video-item-btn:hover .video-play-bg {
  fill: var(--red);
}

.video-title {
  margin: 16px 0 0;
  font-size: 19px;
  font-weight: 700;
  line-height: 1.3;
  letter-spacing: -0.01em;
  transition: color 0.3s;
}

.video-item-btn:hover .video-title {
  color: var(--red);
}

/* ── Lightbox ──────────────────────────────────────── */

.lightbox {
  position: fixed;
  inset: 0;
  z-index: 1200;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 18px;
  padding: 72px 88px;
  background: rgba(0, 0, 0, 0.94);
  opacity: 0;
  transition: opacity 0.25s ease;
}

.lightbox.is-open {
  opacity: 1;
}

/* display:flex would otherwise beat the [hidden] attribute */
.lightbox[hidden],
.lightbox-nav[hidden],
.lightbox-caption[hidden] {
  display: none;
}

.lightbox-body {
  display: flex;
  align-items: center;
  justify-content: center;
  max-width: 100%;
  max-height: 100%;
}

.lightbox-image {
  max-width: 100%;
  max-height: 78vh;
  width: auto;
  height: auto;
  object-fit: contain;
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.6);
}

.lightbox--video .lightbox-body {
  width: min(1100px, 100%);
}

.lightbox-video {
  width: min(1100px, 100%);
  aspect-ratio: 16 / 9;
  border: 0;
  background: #000;
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.6);
}

.lightbox-caption {
  color: rgba(255, 255, 255, 0.8);
  font-size: 15px;
  font-weight: 600;
  text-align: center;
  max-width: 720px;
}

.lightbox-close {
  position: absolute;
  top: 22px;
  right: 26px;
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.1);
  color: var(--white);
  transition: background 0.25s, transform 0.3s;
}

.lightbox-close:hover {
  background: var(--red);
  transform: rotate(90deg);
}

.lightbox-close svg {
  width: 26px;
  height: 26px;
}

.lightbox-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 52px;
  height: 52px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.1);
  color: var(--white);
  transition: background 0.25s;
}

.lightbox-nav:hover {
  background: var(--red);
}

.lightbox-nav svg {
  width: 26px;
  height: 26px;
}

.lightbox-prev { left: 22px; }
.lightbox-next { right: 22px; }

/* ── Responsive ────────────────────────────────────── */

@media (max-width: 1100px) {
  .photo-grid {
    grid-template-columns: repeat(3, 1fr);
  }

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

@media (max-width: 860px) {
  .gallery-page {
    padding: 56px 20px 72px;
  }

  .lightbox {
    padding: 64px 16px 24px;
  }

  .lightbox-nav {
    width: 44px;
    height: 44px;
  }

  .lightbox-prev { left: 8px; }
  .lightbox-next { right: 8px; }
}

@media (max-width: 640px) {
  .photo-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
  }

  .video-grid {
    grid-template-columns: 1fr;
    gap: 28px;
  }

  .video-title {
    font-size: 17px;
  }

  .lightbox-image {
    max-height: 70vh;
  }
}

@media (prefers-reduced-motion: reduce) {
  .photo-item img,
  .photo-item-zoom,
  .video-thumb img,
  .video-play,
  .lightbox,
  .lightbox-close {
    transition: none;
  }
}
