/* GALLERY */
.gallery-page {
  max-width: 1100px;
  margin: 0 auto;
  padding: 16px 20px 64px;
}

.gallery-stage {
  position: relative;
  margin-top: 8px;
  padding: 36px 22px 8px;
}

.gallery-stage[hidden] {
  display: none;
}

.gallery-leaf {
  position: absolute;
  width: 78px;
  height: 78px;
  color: #1E5E35;
  pointer-events: none;
  z-index: 4;
  filter: drop-shadow(0 8px 10px rgba(11, 21, 15, 0.28));
}

.gallery-leaf.tl { top: 0; left: 4px; transform: rotate(-24deg); }
.gallery-leaf.tr { top: 2px; right: 4px; color: #2f8f57; transform: scaleX(-1) rotate(-16deg); }
.gallery-leaf.bl { bottom: 72px; left: 0; color: #3d9a62; transform: rotate(168deg); }
.gallery-leaf.br { bottom: 68px; right: 0; color: #1E5E35; transform: scaleX(-1) rotate(156deg); }

.gallery-frame {
  position: relative;
  background: #0B150F;
  border: 2px solid #FFB300;
  border-radius: 22px;
  box-shadow:
    0 0 0 6px rgba(0, 255, 204, 0.08),
    0 0 28px rgba(255, 179, 0, 0.12),
    0 28px 50px rgba(11, 21, 15, 0.38);
  overflow: hidden;
}

.gallery-viewport {
  position: relative;
  width: 100%;
  height: clamp(240px, 56vh, 560px);
  background:
    radial-gradient(ellipse at center, #24543a 0%, #163526 58%, #10281c 100%);
  overflow: hidden;
  touch-action: pan-y;
  cursor: grab;
  user-select: none;
  -webkit-user-select: none;
}

.gallery-viewport.is-dragging {
  cursor: grabbing;
}

.gallery-slide {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  max-width: none;
  display: grid;
  place-items: center;
  pointer-events: none;
  background: transparent;
}

.gallery-slide img {
  width: 100%;
  height: 100%;
  max-width: 100%;
  object-fit: contain;
  object-position: center;
  display: block;
  background: transparent;
}

#gallery-incoming {
  transform: translateX(100%);
}

.gallery-bolt {
  position: absolute;
  inset: -8% 0;
  z-index: 2;
  pointer-events: none;
  opacity: 0;
  background:
    linear-gradient(108deg,
      transparent 0 36%,
      rgba(255, 255, 255, 0.18) 44%,
      rgba(244, 255, 252, 0.96) 49%,
      rgba(0, 255, 204, 0.9) 51%,
      rgba(255, 179, 0, 0.62) 56%,
      transparent 66%);
  mix-blend-mode: screen;
}

.gallery-viewport.is-bolt .gallery-bolt {
  animation: galleryBolt 1.15s ease-out;
}

@keyframes galleryBolt {
  0% { opacity: 0; transform: translateX(-36%) skewX(-14deg); }
  16% { opacity: 1; transform: translateX(-4%) skewX(-14deg); }
  30% { opacity: 0.12; transform: translateX(6%) skewX(-10deg); }
  46% { opacity: 0.88; transform: translateX(14%) skewX(-8deg); }
  100% { opacity: 0; transform: translateX(42%) skewX(-8deg); }
}

.gallery-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 3;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 1px solid #FFB300;
  background: rgba(11, 21, 15, 0.78);
  color: #FFB300;
  cursor: pointer;
  display: grid;
  place-items: center;
}

.gallery-nav svg {
  width: 22px;
  height: 22px;
  fill: currentColor;
}

.gallery-nav.prev { left: 12px; }
.gallery-nav.next { right: 12px; }

.gallery-nav:hover,
.gallery-nav:focus-visible {
  background: #1E5E35;
  color: #00FFCC;
  outline: none;
}

.gallery-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 14px 18px 16px;
  background: linear-gradient(180deg, #122018 0%, #0B150F 100%);
}

.gallery-caption {
  margin: 0;
  font-family: Cinzel, serif;
  font-size: clamp(16px, 2.1vw, 22px);
  color: #FFB300;
  letter-spacing: 0.3px;
  min-height: 1.3em;
}

.gallery-counter {
  margin: 0;
  color: #00FFCC;
  font-family: Outfit, sans-serif;
  font-weight: 800;
  letter-spacing: 0.12em;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.gallery-status {
  text-align: center;
  color: #1E5E35;
  font-weight: 700;
  margin: 18px 0 0;
  min-height: 1.4em;
}

@media (max-width: 480px) {
  .tab-btn svg { display: none; }
  .tab-btn {
    padding: 8px 6px;
    font-size: 12px;
    gap: 0;
  }

  .gallery-page { padding: 12px 12px 64px; }
  .gallery-stage { padding: 22px 6px 4px; }
  .gallery-leaf { width: 46px; height: 46px; }
  .gallery-leaf.bl { bottom: 86px; }
  .gallery-leaf.br { bottom: 82px; }
  .gallery-viewport {
    height: clamp(210px, 48vh, 420px);
  }
  .gallery-nav { width: 40px; height: 40px; }
  .gallery-nav.prev { left: 8px; }
  .gallery-nav.next { right: 8px; }

  .gallery-meta {
    flex-direction: column;
    align-items: flex-start;
    padding: 12px 14px 14px;
  }
}

.gallery-switch {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin: 0 auto 18px;
}

.gallery-switch button {
  appearance: none;
  min-height: 40px;
  padding: 8px 18px;
  border-radius: 999px;
  border: 1px solid rgba(30, 94, 53, 0.28);
  background: rgba(255, 255, 255, 0.55);
  color: #1e5e35;
  font-family: var(--font-headings);
  font-weight: 800;
  cursor: pointer;
}

.gallery-switch button.is-on {
  background: #1e5e35;
  color: #ffb300;
  border-color: #1e5e35;
}

.gallery-player-wrap {
  position: relative;
  width: min(960px, 100%);
  margin: 0 auto 16px;
}

.gallery-player-frame {
  position: relative;
  width: 100%;
}

.gallery-player {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 16 / 9;
  object-fit: contain;
  background: #0b150f;
  border-radius: 18px;
  border: 2px solid rgba(255, 179, 0, 0.7);
}

.gallery-player-wrap.is-portrait {
  width: min(640px, 100%);
  display: grid;
  grid-template-columns: 72px minmax(0, 1fr) 72px;
  align-items: center;
  justify-items: center;
}

.gallery-player-wrap.is-portrait .gallery-player-frame {
  grid-column: 2;
  grid-row: 1;
}

.gallery-player-wrap.is-portrait .gallery-video-nav {
  position: static;
  top: auto;
  transform: none;
  grid-row: 1;
}

.gallery-player-wrap.is-portrait .gallery-video-nav.prev { grid-column: 1; left: auto; }
.gallery-player-wrap.is-portrait .gallery-video-nav.next { grid-column: 3; right: auto; }

#gallery-videos.is-portrait .gallery-video-meta {
  width: min(640px, 100%);
}

.gallery-play {
  position: absolute;
  left: 50%;
  top: 46%;
  transform: translate(-50%, -50%);
  width: 112px;
  height: 112px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  cursor: pointer;
  background:
    radial-gradient(circle at 50% 42%, rgba(255, 179, 0, 0.95), rgba(30, 94, 53, 0.92) 62%, #0b150f 100%);
  box-shadow:
    0 16px 28px rgba(11, 21, 15, 0.45),
    0 0 0 6px rgba(0, 255, 204, 0.28);
  animation: gallery-play-float 2.4s ease-in-out infinite;
}

.gallery-play img {
  width: 74px;
  height: 74px;
  object-fit: contain;
  filter: drop-shadow(0 6px 4px rgba(0, 0, 0, 0.35));
  pointer-events: none;
}

.gallery-play::after {
  content: "";
  position: absolute;
  left: 58%;
  top: 50%;
  transform: translate(-40%, -50%);
  border-style: solid;
  border-width: 14px 0 14px 22px;
  border-color: transparent transparent transparent #fff8e1;
  filter: drop-shadow(0 2px 2px rgba(0, 0, 0, 0.35));
}

.gallery-play[hidden] { display: none; }

@keyframes gallery-play-float {
  0%, 100% { transform: translate(-50%, -50%); }
  50% { transform: translate(-50%, calc(-50% - 8px)); }
}

@media (prefers-reduced-motion: reduce) {
  .gallery-play { animation: none; }
}

.gallery-video-nav {
  position: absolute;
  top: 42%;
  transform: translateY(-50%);
  z-index: 4;
  width: 58px;
  height: 58px;
  padding: 0;
  border-radius: 50%;
  border: 2px solid #FFB300;
  background: radial-gradient(circle at 50% 38%, #2f8f57, #0B150F 70%);
  color: #FFB300;
  box-shadow:
    0 12px 20px rgba(11, 21, 15, 0.42),
    0 0 0 5px rgba(0, 255, 204, 0.22);
  cursor: pointer;
  display: grid;
  place-items: center;
}

.gallery-video-nav svg {
  width: 30px;
  height: 30px;
  fill: currentColor;
}

.gallery-video-nav.prev { left: 14px; }
.gallery-video-nav.next { right: 14px; }

.gallery-video-nav:hover,
.gallery-video-nav:focus-visible {
  background: #FFB300;
  color: #0B150F;
  outline: none;
}

.gallery-video-nav[hidden] { display: none; }

.gallery-video-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  width: min(960px, 100%);
  margin: 0 auto 24px;
  padding: 12px 16px;
  border-radius: 16px;
  background: linear-gradient(180deg, #122018 0%, #0B150F 100%);
  border: 1px solid rgba(255, 179, 0, 0.45);
}

.gallery-video-caption {
  margin: 0;
  font-family: Cinzel, serif;
  font-size: clamp(15px, 2vw, 20px);
  color: #FFB300;
}

.gallery-video-caption small {
  display: block;
  margin-top: 2px;
  color: #00FFCC;
  font-family: Outfit, sans-serif;
  font-size: 13px;
  letter-spacing: 0.04em;
}

.gallery-video-counter {
  margin: 0;
  color: #00FFCC;
  font-family: Outfit, sans-serif;
  font-weight: 800;
  letter-spacing: 0.12em;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

@media (max-width: 480px) {
  .gallery-player-wrap,
  .gallery-player-wrap.is-portrait {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    gap: 0 8px;
  }

  .gallery-player-frame,
  .gallery-player-wrap.is-portrait .gallery-player-frame {
    width: 100%;
    grid-column: auto;
  }

  .gallery-player,
  .gallery-player-wrap.is-portrait .gallery-player {
    width: 100%;
    max-height: none;
    height: auto;
  }

  .gallery-video-nav,
  .gallery-player-wrap.is-portrait .gallery-video-nav {
    position: static;
    top: auto;
    left: auto;
    right: auto;
    transform: none;
    width: 36px;
    height: 36px;
    margin-top: 10px;
    grid-column: auto;
    box-shadow:
      0 6px 12px rgba(11, 21, 15, 0.28),
      0 0 0 3px rgba(0, 255, 204, 0.18);
  }

  .gallery-video-nav svg { width: 20px; height: 20px; }

  .gallery-play {
    width: 84px;
    height: 84px;
  }

  .gallery-play img { width: 54px; height: 54px; }

  #gallery-videos.is-portrait .gallery-video-meta { width: 100%; }
}
