/* ===========================================================================
   gallery.css — categorized "reel wall" for the Cinema Production page.
   Filter pills + a masonry grid that keeps each clip's native aspect ratio
   (cinematic 16:9, square 1:1, vertical 9:16). Loads after cinema-page.css.
   Roll back: remove this <link>, js/gallery.js, and restore the old #work reels.
   =========================================================================== */

/* ----------------------------- filter pills ----------------------------- */
.gallery-filters { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; margin: clamp(28px, 4vw, 44px) auto 0; max-width: 860px; }
.gallery-pill {
  font: inherit; cursor: pointer; display: inline-flex; align-items: center; gap: 8px;
  padding: 9px 18px; border-radius: 999px; background: rgba(255, 255, 255, 0.04); color: #cdd8ea;
  border: 1px solid var(--cin-line); font-size: 14px; font-weight: 600;
  transition: background 0.25s var(--ease), color 0.25s var(--ease), border-color 0.25s var(--ease);
}
.gallery-pill:hover { color: #fff; border-color: rgba(201, 168, 106, 0.5); }
.gallery-pill.is-active { background: linear-gradient(180deg, #c9a86a, #a9854f); color: #1a1206; border-color: transparent; }
.gallery-pill-n { font-size: 12px; opacity: 0.7; font-variant-numeric: tabular-nums; }
.gallery-pill.is-active .gallery-pill-n { opacity: 0.85; }

/* ----------------------------- masonry grid ----------------------------- */
.gallery-grid { columns: 3; column-gap: clamp(14px, 1.6vw, 22px); margin-top: clamp(26px, 3.5vw, 40px); }
.gallery-card { break-inside: avoid; -webkit-column-break-inside: avoid; margin: 0 0 clamp(14px, 1.6vw, 22px); }
.gallery-card.is-hidden { display: none; }
.gallery-card.is-in { animation: galleryIn 0.45s var(--ease) both; }
@keyframes galleryIn { from { opacity: 0; transform: translateY(14px) scale(0.98); } to { opacity: 1; transform: none; } }

.gallery-frame {
  position: relative; display: block; width: 100%; padding: 0; cursor: pointer; background: #02060d;
  border: 1px solid var(--cin-line); border-radius: clamp(12px, 1.4vw, 18px); overflow: hidden;
  box-shadow: 0 24px 60px -34px rgba(0, 0, 0, 0.8);
  transition: transform 0.35s var(--ease), border-color 0.35s var(--ease), box-shadow 0.35s var(--ease);
}
.gallery-frame:hover { transform: translateY(-4px); border-color: rgba(201, 168, 106, 0.5); box-shadow: 0 34px 76px -30px rgba(0, 0, 0, 0.85), 0 0 60px -30px rgba(201, 168, 106, 0.4); }
.gallery-frame video { display: block; width: 100%; height: 100%; object-fit: cover; }
.gallery-frame::before { content: ""; position: absolute; inset: 0; z-index: 1; pointer-events: none; background: linear-gradient(0deg, rgba(2, 6, 13, 0.66) 0%, transparent 38%); }
.gallery-tag { position: absolute; left: 14px; bottom: 12px; z-index: 2; font-family: var(--font-head); font-size: 12.5px; font-weight: 700; letter-spacing: 0.02em; color: #fff; text-shadow: 0 1px 10px rgba(0, 0, 0, 0.7); }
.gallery-play {
  position: absolute; top: 50%; left: 50%; z-index: 2; transform: translate(-50%, -50%) scale(0.9);
  width: 54px; height: 54px; border-radius: 50%; display: grid; place-items: center;
  background: rgba(201, 168, 106, 0.92); color: #1a1206; font-size: 18px; padding-left: 3px;
  opacity: 0; transition: opacity 0.3s var(--ease), transform 0.3s var(--ease);
}
.gallery-frame:hover .gallery-play, .gallery-frame:focus-visible .gallery-play { opacity: 1; transform: translate(-50%, -50%) scale(1); }

.gallery-empty { text-align: center; color: var(--cin-text2); margin-top: 30px; }

@media (max-width: 900px) { .gallery-grid { columns: 2; } }
@media (max-width: 560px) { .gallery-grid { columns: 1; } }

/* ---- lightbox sized to the clip's native aspect (portrait / square / landscape) ---- */
.cinema-lightbox .lightbox-stage { width: auto; aspect-ratio: auto; max-width: min(1100px, 92vw); max-height: 86vh; background: transparent; box-shadow: none; border-radius: 0; overflow: visible; }
.cinema-lightbox #lightboxVideo { width: auto; height: auto; max-width: min(1100px, 92vw); max-height: 86vh; border-radius: 12px; background: #000; box-shadow: 0 40px 120px -30px rgba(0, 0, 0, 0.9); }
