/* =====================================================
   VIDEO PAGE STYLES
   Used by: page-videos.php
   Extends: archive-styles.css (hero, filter bar, pagination)
===================================================== */

/* ── Video Card ─────────────────────────────────────── */
.video-card {
  border-radius: 12px;
  overflow: hidden;
  background: var(--white);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.10);
  cursor: pointer;
  transition: transform 0.25s ease, box-shadow 0.25s ease;
  display: flex;
  flex-direction: column;
  height: 100%;
}

.video-card:hover,
.video-card:focus {
  transform: translateY(-4px);
  box-shadow: 0 10px 32px rgba(0, 0, 0, 0.16);
  outline: none;
}

/* Thumbnail wrapper — enforces 16:9 aspect ratio */
.video-card-thumb {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  background: #1a1a1a;
  flex-shrink: 0;
}

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

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

/* Placeholder when no thumbnail */
.video-card-thumb-placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #1a1a2e, #2d2d44);
  color: rgba(255, 255, 255, 0.3);
  font-size: 3rem;
}

/* Dark gradient overlay on thumbnail bottom */
.video-card-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    to bottom,
    rgba(0, 0, 0, 0)   40%,
    rgba(0, 0, 0, 0.55) 100%
  );
  pointer-events: none;
}

/* Play button — centered circle */
.video-play-btn {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) scale(1);
  width: 56px;
  height: 56px;
  background: rgba(204, 0, 0, 0.90);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #ffffff;
  font-size: 18px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.45);
  transition: transform 0.25s ease, background 0.25s ease;
  pointer-events: none;
  padding-left: 3px; /* optical centre for play icon */
}

.video-card:hover .video-play-btn {
  transform: translate(-50%, -50%) scale(1.12);
  background: rgba(204, 0, 0, 1);
}

/* Card body */
.video-card-body {
  padding: 16px 18px 18px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex: 1;
}

.video-card-title {
  font-family: 'Noto Sans Sinhala', sans-serif;
  font-size: clamp(13px, 1.3vw, 15px);
  color: var(--text-dark);
  line-height: 1.6;
  margin: 0;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.video-card-date {
  font-family: 'Poppins', sans-serif;
  font-size: 11px;
  color: var(--gold-dark);
  font-weight: 500;
  letter-spacing: 0.3px;
}

/* ── Video hero — white bg + blue gradient overlay ─── */
.video-hero {
  background: #ffffff !important;
  background-image: none !important;
  height: auto;
}

.video-hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(179deg,
      rgba(15, 77, 179, 1) 0%,
      rgba(255, 255, 255, 0) 80%);
  height: 200px;
  z-index: 1;
  pointer-events: none;
}

.video-hero .archive-hero-overlay {
  display: none;
}

.video-hero .container-xl {
  position: relative;
  z-index: 2;
}

/* ── Hero two-column layout (when featured video exists) ── */
.video-hero-inner {
  display: flex;
  align-items: stretch;
  gap: 32px;
  width: 100%;
}

.video-hero-panel {
  flex: 0 0 45%;
  max-width: 45%;
}

.video-hero-featured {
  flex: 0 0 50%;
  max-width: 50%;
  display: flex;
  align-items: stretch;
}

.video-hero-card {
  width: 100%;
  height: 100%;
  box-shadow: 0 8px 40px rgba(0, 0, 0, 0.45);
  cursor: pointer;
}

/* Hero card: thumb fills full height, no body */
.video-hero-card .video-card-thumb {
  aspect-ratio: unset;
  flex: 1;
  min-height: 0;
}

.video-hero-card .video-card-body {
  display: none;
}

@media (max-width: 991.98px) {
  .video-hero-inner {
    flex-direction: column;
    gap: 24px;
    padding-bottom: 24px;
  }

  .video-hero-panel,
  .video-hero-featured {
    flex: 0 0 100%;
    max-width: 100%;
  }
}

/* ── Grid section spacing ───────────────────────────── */
.video-grid-section {
  padding: 60px 0 0;
}

/* ── Video Lightbox ─────────────────────────────────── */
.video-lightbox {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  visibility: hidden;
  opacity: 0;
  transition: opacity 0.25s ease, visibility 0.25s ease;
}

.video-lightbox.is-open {
  visibility: visible;
  opacity: 1;
}

.video-lightbox-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.88);
  cursor: pointer;
}

.video-lightbox-dialog {
  position: relative;
  width: 100%;
  max-width: 900px;
  z-index: 1;
  transform: scale(0.92);
  transition: transform 0.25s ease;
}

.video-lightbox.is-open .video-lightbox-dialog {
  transform: scale(1);
}

.video-lightbox-close {
  position: absolute;
  top: -44px;
  right: 0;
  width: 36px;
  height: 36px;
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.25);
  border-radius: 50%;
  color: #ffffff;
  font-size: 16px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s ease;
  z-index: 2;
}

.video-lightbox-close:hover {
  background: rgba(255, 255, 255, 0.25);
}

/* 16:9 iframe container */
.video-lightbox-embed {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  background: #000;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.6);
}

.video-lightbox-embed iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

/* ── Responsive ─────────────────────────────────────── */
@media (max-width: 991.98px) {
  .video-grid-section {
    padding: 48px 0 64px;
  }

  .video-play-btn {
    width: 48px;
    height: 48px;
    font-size: 16px;
  }
}

@media (max-width: 575.98px) {
  .video-grid-section {
    padding: 36px 0 48px;
  }

  .video-lightbox-close {
    top: -40px;
  }

  .video-lightbox {
    padding: 16px;
  }
}
