/* Video gallery page (gallery.html only). Tokens come from main.css. */
.gallery-hero { padding: clamp(50px, 8vw, 100px) 0 36px; text-align: center; }
.gallery-hero h1 { font-size: clamp(2.6rem, 6vw, 4.4rem); margin: 6px 0 14px; }
.gallery-hero-sub { color: var(--dim); max-width: 56ch; margin: 0 auto; font-size: 1.1rem; }
.gallery-section { padding: 0 0 110px; }

.gallery-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 26px; }
.gallery-count { color: var(--faint); font-size: 0.92rem; margin: 0; }
.grid-size-control { display: inline-flex; align-items: center; gap: 4px; padding: 4px; border: 1px solid var(--line-strong); border-radius: 999px; background: rgba(255, 255, 255, 0.02); }
.grid-size-label { color: var(--faint); font-size: 0.8rem; padding: 0 8px 0 12px; white-space: nowrap; }
.grid-size-btn { display: inline-flex; align-items: center; justify-content: center; width: 36px; height: 32px; border: 0; border-radius: 999px; background: transparent; color: var(--faint); cursor: pointer; transition: background 0.2s, color 0.2s; }
.grid-size-btn svg { width: 18px; height: 18px; fill: currentColor; }
.grid-size-btn:hover { color: var(--ivory); background: rgba(232, 195, 106, 0.1); }
.grid-size-btn.is-active { color: #1a1205; background: var(--gold-grad-flat); }

/* Language filter: the chosen one is pressed in (darker), the others stay lit. */
.gallery-filters { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 22px; }
.gallery-filters[hidden] { display: none; }
.gallery-filter-btn { padding: 9px 22px; border: 1px solid var(--line-strong); border-radius: 999px; background: #241b11; color: var(--dim); font: 600 0.9rem var(--sans); cursor: pointer; transition: background 0.2s, color 0.2s, border-color 0.2s, box-shadow 0.2s; }
.gallery-filter-btn:hover { background: #2f2316; color: var(--ivory); }
.gallery-filter-btn.is-active, .gallery-filter-btn.is-active:hover { background: #060403; color: var(--gold-1); border-color: var(--gold-2); box-shadow: inset 0 2px 8px rgba(0, 0, 0, 0.85); }

.gallery-playlist + .gallery-playlist { margin-top: 56px; }
.gallery-playlist-title { display: flex; align-items: baseline; gap: 14px; flex-wrap: wrap; font-size: clamp(1.7rem, 3vw, 2.3rem); margin: 0 0 16px; padding-bottom: 12px; border-bottom: 1px solid var(--line); }
.gallery-playlist-title:has(+ .gallery-playlist-description) { margin-bottom: 6px; padding-bottom: 0; border-bottom: 0; }
.gallery-playlist-description { margin: 0 0 20px; padding-bottom: 12px; border-bottom: 1px solid var(--line); color: var(--dim); max-width: 70ch; }
.gallery-playlist-count { color: var(--faint); font: 400 0.85rem var(--sans); }

.gallery-grid { display: grid; gap: 22px; grid-template-columns: repeat(3, 1fr); }
.gallery-grid[data-grid-size="2"] { grid-template-columns: repeat(2, 1fr); }
.gallery-grid[data-grid-size="3"] { grid-template-columns: repeat(3, 1fr); }
.gallery-grid[data-grid-size="4"] { grid-template-columns: repeat(4, 1fr); }
.gallery-grid[data-grid-size="6"] { grid-template-columns: repeat(6, 1fr); }
@media (max-width: 980px) { .gallery-grid[data-grid-size="4"], .gallery-grid[data-grid-size="6"] { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 640px) { .gallery-grid, .gallery-grid[data-grid-size] { grid-template-columns: repeat(2, 1fr); } }

.gallery-tile { display: block; width: 100%; border: 1px solid var(--line); border-radius: var(--radius); background: linear-gradient(165deg, var(--card-2), var(--card)); overflow: hidden; cursor: pointer; text-align: left; padding: 0; color: inherit; font: inherit; transition: border-color 0.3s, transform 0.5s var(--ease), box-shadow 0.4s; }
.gallery-tile:hover, .gallery-tile:focus-visible { border-color: var(--line-strong); transform: translateY(-4px); box-shadow: 0 26px 50px -26px rgba(0, 0, 0, 0.9); }
.gallery-tile-thumb-wrap { position: relative; aspect-ratio: 16 / 9; background: #000; overflow: hidden; }
.gallery-tile-thumb-wrap img { width: 100%; height: 100%; object-fit: cover; display: block; pointer-events: none; transition: transform 0.8s var(--ease); }
.gallery-tile:hover .gallery-tile-thumb-wrap img { transform: scale(1.06); }
.gallery-tile-play { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; pointer-events: none; }
.gallery-tile-play svg { width: 48px; height: 48px; filter: drop-shadow(0 2px 10px rgba(0, 0, 0, 0.6)); transition: transform 0.4s var(--ease); }
.gallery-tile:hover .gallery-tile-play svg { transform: scale(1.12); }
.gallery-tile-title { padding: 13px 15px 15px; font-size: 0.94rem; font-weight: 600; color: var(--ivory); line-height: 1.35; }
.gallery-grid[data-grid-size="4"] .gallery-tile-title, .gallery-grid[data-grid-size="6"] .gallery-tile-title { font-size: 0.84rem; padding: 9px 10px 11px; }
.gallery-grid[data-grid-size="6"] .gallery-tile-play svg { width: 30px; height: 30px; }
.gallery-empty, .gallery-error { text-align: center; color: var(--faint); padding: 56px 0; }

.lightbox { position: fixed; inset: 0; z-index: 400; display: flex; align-items: center; justify-content: center; }
.lightbox[hidden] { display: none; }
.lightbox-backdrop { position: absolute; inset: 0; background: rgba(5, 4, 3, 0.94); backdrop-filter: blur(6px); animation: fadeIn 0.3s ease; }
.lightbox-panel { position: relative; z-index: 1; width: min(1600px, 96vw); max-height: 96vh; display: flex; flex-direction: column; align-items: center; animation: popIn 0.5s var(--ease); }
.lightbox-stage { width: 100%; aspect-ratio: 16 / 9; max-height: 88vh; background: #000; border-radius: var(--radius); overflow: hidden; touch-action: pan-y; border: 1px solid var(--line); }
.lightbox-stage iframe { width: 100%; height: 100%; display: block; background: #000; border: 0; }
.lightbox-close { position: absolute; top: -48px; right: 0; width: 38px; height: 38px; border-radius: 50%; border: 1px solid var(--line-strong); background: var(--card-2); color: var(--ivory); font-size: 1.4rem; line-height: 1; cursor: pointer; display: flex; align-items: center; justify-content: center; }
.lightbox-close:hover { border-color: var(--gold-2); }
.lightbox-nav { position: absolute; top: 50%; transform: translateY(-50%); width: 46px; height: 46px; border-radius: 50%; border: 1px solid var(--line-strong); background: rgba(21, 16, 11, 0.88); color: var(--ivory); cursor: pointer; display: flex; align-items: center; justify-content: center; z-index: 2; }
.lightbox-nav svg { width: 22px; height: 22px; }
.lightbox-nav:hover { border-color: var(--gold-2); }
.lightbox-nav:disabled { opacity: 0.3; cursor: default; }
.lightbox-prev { left: -62px; }
.lightbox-next { right: -62px; }
.lightbox-caption { width: 100%; padding: 16px 4px 0; text-align: center; }
.lightbox-caption h2 { font: 600 1.4rem/1.2 var(--serif); margin: 0 0 4px; }
.lightbox-position { margin: 0; color: var(--faint); font-size: 0.85rem; }
@media (max-width: 900px) {
  .lightbox-panel { width: 100vw; max-height: 100vh; }
  .lightbox-stage { max-height: 100vh; border-radius: 0; border-left: 0; border-right: 0; }
  .lightbox-caption { padding: 10px 12px 0; }
  .lightbox-prev { left: 8px; }
  .lightbox-next { right: 8px; }
  .lightbox-close { top: 8px; right: 8px; background: rgba(21, 16, 11, 0.88); }
}
