* {
  box-sizing: border-box;
}

.gallery-body {
  background-color: #0a0a0a;
  color: #ffffff;
}

.festival-container {
  max-width: 1400px;
  margin: 0 auto;
  padding: 4rem 2rem;
}

.gallery-header {
  margin-bottom: 3.5rem;
  text-align: center;
  text-transform: uppercase;
  letter-spacing: 0.15em;
}

.gallery-header .subtitle {
  font-size: 0.8rem;
  color: #c5a059;
  display: block;
  margin-bottom: 0.5rem;
}

.gallery-header h2 {
  font-size: 2.2rem;
  font-weight: 400;
  margin: 0;
}

.festival-grid {
  columns: 3;
  column-gap: 1.5rem;
}

.grid-item {
  position: relative;
  background-color: #111;
  margin-bottom: 1.5rem;
  break-inside: avoid;
  overflow: hidden;
  cursor: pointer;
}

.grid-item img,
.grid-item video,
.grid-item iframe {
  width: 100%;
  height: auto;
  display: block;
  filter: grayscale(15%);
  transition: transform 0.5s ease;
}

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

.item-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(to top, #000000dd 0%, #00000000 60%);
  display: flex;
  align-items: flex-end;
  padding: 2rem;
  opacity: 0;
  transition: opacity 0.4s ease;
}

.meta {
  transform: translateY(15px);
  transition: transform 0.5s ease;
  color: #ffffff;
}

.meta .director {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.2em;
  color: rgba(255,255,255,0.85);
  display: block;
  margin-bottom: 0.3rem;
}

.meta .film-title {
  font-size: 1.4rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  margin: 0;
  color: #ffffff;
}

.grid-item:hover .item-overlay {
  opacity: 1;
}

.grid-item:hover .meta {
  transform: translateY(0);
}

@media (max-width: 1024px) {
  .festival-grid {
    columns: 2;
  }
}

@media (max-width: 600px) {
  .festival-container {
    padding: 2rem 1rem;
  }
  .festival-grid {
    columns: 1;
  }
}

/* ========== VIDEO THUMBNAIL (grid) ========== */

.video-embed-wrap {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  cursor: pointer;
}

.video-thumb {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  filter: grayscale(15%);
  transition: transform 0.5s ease;
}

.grid-item:hover .video-thumb {
  transform: scale(1.08);
}

.video-play-icon {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 2.5rem;
  color: #ffffff;
  opacity: 0.9;
  text-shadow: 0 2px 10px rgba(0,0,0,0.6);
  pointer-events: none;
}

/* ========== LIGHTBOX ========== */

.lightbox-overlay {
  position: fixed;
  inset: 0;
  background-color: rgba(0, 0, 0, 0.6);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
}

.lightbox-overlay.is-active {
  opacity: 1;
  visibility: visible;
}

.lightbox-content {
  position: relative;
  max-width: 88vw;
  max-height: 88vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  transform: scale(0.96);
  transition: transform 0.3s ease;
}

.lightbox-overlay.is-active .lightbox-content {
  transform: scale(1);
}

.lightbox-img {
  max-width: 100%;
  max-height: 80vh;
  object-fit: contain;
  display: block;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
}

.lightbox-video-wrap {
  position: relative;
  width: min(85vw, 960px);
  aspect-ratio: 16 / 9;
  display: none;
}

.lightbox-video-wrap iframe {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
}

.lightbox-caption {
  margin-top: 1rem;
  color: #ffffff;
  font-size: 0.95rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  text-align: center;
  opacity: 0.85;
}

/* Selector is "button.lightbox-close" (not ".lightbox-close") so it
   outspecifics the global "[lang='en'] button" / "[lang='ka'] button" font
   rules in base.css + fonts.css. The system font stack is required because
   the Magistral font files have a broken cmap: U+00D7 (×) maps to the
   Cyrillic "Ч" glyph (afii10041), which looks like a "4" — so the close
   button rendered as "4" instead of "×". */
button.lightbox-close {
  position: absolute;
  top: 1.5rem;
  right: 2rem;
  background: none;
  border: none;
  color: #ffffff;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, Arial, sans-serif;
  font-size: 2.2rem;
  line-height: 1;
  cursor: pointer;
  opacity: 0.8;
  transition: opacity 0.2s ease;
}

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

.lightbox-arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  color: #ffffff;
  font-size: 1.8rem;
  cursor: pointer;
  padding: 1rem;
  opacity: 0.7;
  transition: opacity 0.2s ease;
}

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

.lightbox-arrow--prev {
  left: 1rem;
}

.lightbox-arrow--next {
  right: 1rem;
}

@media (max-width: 600px) {
  .lightbox-arrow {
    font-size: 1.3rem;
    padding: 0.6rem;
  }
  /* Must match the base rule's "button.lightbox-close" specificity,
     otherwise these mobile overrides lose the cascade. */
  button.lightbox-close {
    top: 1rem;
    right: 1rem;
    font-size: 1.8rem;
  }
}