/* ============================================================
   CatalyseR — Video gallery (index + per-gallery)
   Depends on tokens.css + site.css. Mobile-first. Light only.
   Owned by pages/video-gallery.php, video-gallery-cat.php.
   ============================================================ */

.video-intro { margin-bottom: var(--sp-6); }
.video-intro .lead { margin-inline: 0; }

/* ---------- Gallery filter chips ---------- */
.video-filters {
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-2);
  margin-bottom: var(--sp-6);
}
.video-filters .chip { border: 1px solid var(--c-line); }
.video-filters .chip.is-active { border-color: var(--c-ink); }
.video-filters .chip .chip-count {
  font-weight: var(--fw-regular);
  opacity: .7;
  font-size: var(--fs-tiny);
}

/* ---------- Optional gallery section headings (index groups) ---------- */
.video-group { margin-bottom: var(--sp-8); }
.video-group:last-child { margin-bottom: 0; }
.video-group-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--sp-4);
  margin-bottom: var(--sp-5);
  flex-wrap: wrap;
}
.video-group-head h2 { margin: 0; font-size: var(--fs-h3); }
.video-group-head a { font-size: var(--fs-small); font-weight: var(--fw-semi); text-decoration: none; white-space: nowrap; }

/* ---------- Video grid ---------- */
.v-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--sp-5);
}
@media (min-width: 560px) { .v-grid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 900px) { .v-grid { grid-template-columns: repeat(3, 1fr); } }

.v-card {
  display: flex;
  flex-direction: column;
  background: var(--ground);
  border: 1px solid var(--c-line);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-card);
  transition: box-shadow var(--speed) var(--ease), transform var(--speed) var(--ease);
}
.v-card:hover { box-shadow: var(--shadow-pop); transform: translateY(-3px); }

/* Thumbnail acts as the click target (facade for the iframe) */
.v-thumb {
  position: relative;
  display: block;
  aspect-ratio: 16 / 9;
  background: var(--c-dark);
  overflow: hidden;
  cursor: pointer;
}
.v-thumb img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform var(--speed-slow) var(--ease), opacity var(--speed) var(--ease);
}
.v-card:hover .v-thumb img { transform: scale(1.05); }
.v-thumb::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(30,39,73,0) 40%, rgba(30,39,73,.55) 100%);
  opacity: 0;
  transition: opacity var(--speed) var(--ease);
}
.v-card:hover .v-thumb::before { opacity: 1; }

.v-play {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  width: 62px;
  height: 62px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--c-accent);
  color: #fff;
  box-shadow: 0 6px 20px rgba(0, 0, 0, .35);
  transition: transform var(--speed) var(--ease), background-color var(--speed) var(--ease);
  z-index: 1;
}
.v-thumb:hover .v-play,
.v-thumb:focus-visible .v-play { transform: translate(-50%, -50%) scale(1.08); background: var(--c-accent-press); }
.v-play svg { width: 24px; height: 24px; margin-left: 3px; }

/* When JS swaps in the player, the iframe fills the same box */
.v-thumb iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
  display: block;
}

.v-body {
  display: flex;
  flex-direction: column;
  gap: var(--sp-2);
  padding: var(--sp-4) var(--sp-5) var(--sp-5);
  flex: 1;
}
.v-title {
  margin: 0;
  font-size: var(--fs-body);
  font-weight: var(--fw-semi);
  line-height: 1.35;
  letter-spacing: -0.01em;
}
.v-title a { color: var(--c-ink); text-decoration: none; }
.v-title a:hover { color: var(--c-accent-press); }
.v-tag { margin-top: auto; }

.video-empty {
  text-align: center;
  padding: var(--sp-8) var(--sp-4);
  color: var(--c-ink-2);
}
