.gallery-page {
  padding-top: 6rem;
}

.gallery-hero {
  padding: 2rem 0 1rem;
}

.gallery-intro {
  color: var(--text-secondary);
  max-width: 520px;
  margin: 1rem auto 0;
  font-size: 1.05rem;
  line-height: 1.65;
}

/* Filters */
.gallery-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  justify-content: center;
  margin-top: 2rem;
}

.filter-btn {
  font-family: var(--font-sans);
  font-size: 0.875rem;
  font-weight: 500;
  padding: 0.55rem 1.2rem;
  border-radius: 999px;
  border: 1px solid var(--glass-border);
  background: var(--glass-bg);
  color: var(--text-secondary);
  cursor: pointer;
  transition: all var(--transition);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.filter-btn:hover {
  border-color: var(--glass-border-strong);
  color: var(--text-primary);
}

.filter-btn.active {
  background: linear-gradient(135deg, #4fc3f7, #0288d1);
  border-color: transparent;
  color: #0a0e17;
}

/* Grid */
.gallery-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.25rem;
}

.gallery-item {
  overflow: hidden;
  padding: 0;
  transition: transform var(--transition), opacity 0.35s ease;
}

.gallery-item.is-hidden {
  display: none;
}

.gallery-card {
  display: block;
  width: 100%;
  border: none;
  background: none;
  color: inherit;
  text-align: left;
  cursor: pointer;
  padding: 0;
  font-family: inherit;
}

.gallery-thumb {
  position: relative;
  aspect-ratio: 4 / 3;
  overflow: hidden;
  background: linear-gradient(135deg, rgba(30, 70, 120, 0.5), rgba(10, 30, 60, 0.8));
}

.gallery-thumb img,
.gallery-thumb video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s ease;
  display: block;
}

.gallery-card:hover .gallery-thumb img,
.gallery-card:hover .gallery-thumb video {
  transform: scale(1.05);
}

.thumb-fallback {
  display: none;
  position: absolute;
  inset: 0;
  align-items: center;
  justify-content: center;
  font-family: var(--font-serif);
  color: rgba(255, 255, 255, 0.35);
  font-size: 1.1rem;
}

.gallery-thumb.no-img .thumb-fallback {
  display: flex;
}

.gallery-thumb.no-img img {
  display: none;
}

.play-badge {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(8, 12, 22, 0.35);
  color: #fff;
  transition: background var(--transition);
  pointer-events: none;
}

.gallery-card:hover .play-badge {
  background: rgba(8, 12, 22, 0.2);
}

.play-badge svg {
  width: 48px;
  height: 48px;
  padding: 12px;
  background: linear-gradient(135deg, #4fc3f7, #0288d1);
  border-radius: 50%;
  color: #0a0e17;
  box-shadow: 0 4px 20px rgba(79, 195, 247, 0.4);
}

.gallery-caption {
  padding: 1rem 1.15rem 1.2rem;
}

.gallery-caption h3 {
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 0.25rem;
}

.gallery-caption p {
  font-size: 0.85rem;
  color: var(--text-muted);
}

/* ========== Lightbox ========== */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 300;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
}

.lightbox[hidden] {
  display: none !important;
}

.lightbox-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(5, 8, 14, 0.88);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.lightbox-inner {
  position: relative;
  z-index: 1;
  width: min(960px, 100%);
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.lightbox-close {
  position: absolute;
  top: -2.5rem;
  right: 0;
  background: none;
  border: none;
  color: var(--text-primary);
  font-size: 2rem;
  line-height: 1;
  cursor: pointer;
  opacity: 0.7;
  transition: opacity var(--transition);
  z-index: 2;
}

.lightbox-close:hover {
  opacity: 1;
}

.lightbox-photo {
  border-radius: var(--radius);
  overflow: hidden;
  background: #000;
  border: 1px solid var(--glass-border);
}

.lightbox-photo img {
  width: 100%;
  max-height: 75vh;
  object-fit: contain;
  display: block;
  margin: 0 auto;
}

.lightbox-caption h3 {
  font-family: var(--font-serif);
  font-size: 1.2rem;
  font-weight: 500;
  text-align: center;
  color: var(--text-primary);
}

.lightbox-caption p {
  text-align: center;
  color: var(--text-muted);
  font-size: 0.9rem;
  margin-top: 0.35rem;
}

/* ========== Фирменный видеоплеер ========== */
.baikal-player {
  position: relative;
  background: #000;
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid rgba(79, 195, 247, 0.25);
  box-shadow: 0 12px 48px rgba(0, 0, 0, 0.5), 0 0 0 1px rgba(79, 195, 247, 0.1);
  aspect-ratio: 16 / 9;
}

.baikal-player video {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: contain;
  background: #000;
  cursor: pointer;
}

.player-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(8, 12, 22, 0.25);
  transition: opacity 0.3s ease;
  pointer-events: none;
}

.player-overlay.is-playing {
  opacity: 0;
}

.player-big-play {
  pointer-events: auto;
  width: 72px;
  height: 72px;
  border-radius: 50%;
  border: none;
  background: linear-gradient(135deg, #4fc3f7, #0288d1);
  color: #0a0e17;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 8px 32px rgba(79, 195, 247, 0.45);
  transition: transform 0.25s ease;
}

.player-big-play:hover {
  transform: scale(1.08);
}

.player-big-play svg {
  width: 28px;
  height: 28px;
  margin-left: 3px;
}

.player-controls {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.75rem 1rem;
  background: linear-gradient(transparent, rgba(8, 12, 22, 0.92));
  opacity: 0;
  transition: opacity 0.3s ease;
}

.baikal-player:hover .player-controls,
.baikal-player.is-paused .player-controls {
  opacity: 1;
}

.player-btn {
  background: none;
  border: none;
  color: var(--text-primary);
  cursor: pointer;
  padding: 0.35rem;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  transition: color var(--transition), background var(--transition);
  flex-shrink: 0;
}

.player-btn:hover {
  color: var(--accent);
  background: rgba(79, 195, 247, 0.12);
}

.player-btn svg {
  width: 18px;
  height: 18px;
}

.player-progress-wrap {
  flex: 1;
  display: flex;
  align-items: center;
}

.player-progress {
  width: 100%;
  height: 4px;
  -webkit-appearance: none;
  appearance: none;
  background: rgba(255, 255, 255, 0.2);
  border-radius: 2px;
  outline: none;
  cursor: pointer;
}

.player-progress::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: linear-gradient(135deg, #4fc3f7, #0288d1);
  border: none;
  box-shadow: 0 0 8px rgba(79, 195, 247, 0.5);
  cursor: pointer;
}

.player-progress::-moz-range-thumb {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: linear-gradient(135deg, #4fc3f7, #0288d1);
  border: none;
  cursor: pointer;
}

.player-time {
  font-size: 0.75rem;
  color: var(--text-muted);
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
  min-width: 5.5rem;
  text-align: right;
}

.baikal-player:fullscreen,
.baikal-player:-webkit-full-screen {
  width: 100%;
  height: 100%;
  border-radius: 0;
  aspect-ratio: auto;
}

/* Responsive */
@media (max-width: 1024px) {
  .gallery-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 768px) {
  .gallery-page {
    padding-top: 5rem;
  }

  .gallery-grid {
    grid-template-columns: 1fr;
  }

  .gallery-filters {
    gap: 0.45rem;
  }

  .filter-btn {
    font-size: 0.8rem;
    padding: 0.45rem 0.9rem;
  }

  .lightbox {
    padding: 0.75rem;
  }

  .lightbox-close {
    top: 0.5rem;
    right: 0.5rem;
    background: rgba(0, 0, 0, 0.5);
    border-radius: 50%;
    width: 36px;
    height: 36px;
    font-size: 1.5rem;
  }

  .player-controls {
    opacity: 1;
    padding: 0.5rem 0.75rem;
  }

  .player-time {
    min-width: auto;
    font-size: 0.7rem;
  }
}
