/* ============================================================
   Videos Page — css/pages/videos-page.css
   Follows the same design language as letter-page.css and
   the inline styles used in letters.html / index.html.
   ============================================================ */

:root {
  --brand-blue:      #4a90e2;
  --brand-blue-dark: #2a64b8;
  --ink:             #2c3e50;
  --muted:           #6c757d;
}

/* ─── Hero ──────────────────────────────────────────────────────────────────── */

.videos-hero {
  background: radial-gradient(
      1100px 480px at 50% -40%,
      rgba(74, 144, 226, 0.18),
      transparent
    ),
    linear-gradient(135deg, rgba(74, 144, 226, 0.06), rgba(53, 122, 189, 0.08));
  padding: 84px 0 48px;
  text-align: center;
}

.videos-hero h1 {
  font-weight: 800;
  letter-spacing: -0.3px;
}

.videos-hero p {
  max-width: 820px;
  margin: 10px auto 0;
  color: #3e4a57;
}

@media (max-width: 575.98px) {
  .videos-hero {
    padding-top: 68px;
  }
}

/* ─── Sections ───────────────────────────────────────────────────────────────── */

.section {
  padding: 56px 0;
}

.section.bg-gray {
  background: #f4f6fb;
}

.section-head {
  border-bottom: 1px solid #e9edf3;
  padding-bottom: 0.6rem;
  margin-bottom: 1.5rem;
}

.section-head h2 {
  font-weight: 800;
  font-size: 1.4rem;
  margin: 0;
  color: var(--ink);
}

.section-head p {
  color: var(--muted);
  margin: 0.35rem 0 0;
}

/* ─── Filter bars ────────────────────────────────────────────────────────────── */

.videos-filters {
  margin-bottom: 2rem;
}

.filter-bar-label {
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: rgba(44, 62, 80, 0.55);
  margin-bottom: 0.4rem;
}

.filter-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-bottom: 0.75rem;
}

.filter-btn {
  display: inline-flex;
  align-items: center;
  padding: 0.4rem 0.9rem;
  border: 1.5px solid #d0d8e4;
  border-radius: 999px;
  background: #fff;
  color: #4a5568;
  font-size: 0.85rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.18s ease;
  white-space: nowrap;
  line-height: 1.4;
}

.filter-btn:hover {
  border-color: var(--brand-blue);
  color: var(--brand-blue);
  background: rgba(74, 144, 226, 0.05);
}

.filter-btn-active,
.filter-btn.filter-btn-active {
  background: var(--brand-blue) !important;
  border-color: var(--brand-blue) !important;
  color: #fff !important;
  font-weight: 600;
}

/* ─── Video cards ────────────────────────────────────────────────────────────── */

.video-card {
  background: #fff;
  border: 1px solid #edf1f6;
  border-radius: 14px;
  box-shadow: 0 6px 18px rgba(2, 8, 20, 0.06);
  height: 100%;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transition: box-shadow 0.2s ease, transform 0.2s ease;
}

.video-card:hover {
  box-shadow: 0 10px 28px rgba(2, 8, 20, 0.11);
  transform: translateY(-2px);
}

.video-card-featured {
  border-color: rgba(74, 144, 226, 0.35);
  box-shadow: 0 6px 20px rgba(74, 144, 226, 0.14);
}

/* ─── Thumbnail ──────────────────────────────────────────────────────────────── */

.video-thumb-wrap {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  background: linear-gradient(135deg, #dce8f8 0%, #c8d9f0 100%);
  overflow: hidden;
  flex-shrink: 0;
}

/* Fallback for browsers without aspect-ratio */
@supports not (aspect-ratio: 16 / 9) {
  .video-thumb-wrap::before {
    content: '';
    display: block;
    padding-top: 56.25%;
  }
}

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

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

.video-thumb-placeholder .video-thumb {
  display: none;
}

.video-play-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.18);
  transition: background 0.2s ease;
}

.video-thumb-wrap:hover .video-play-overlay,
.video-thumb-wrap[style*="cursor"] .video-play-overlay {
  background: rgba(0, 0, 0, 0.3);
}

.video-play-overlay i {
  font-size: 2.4rem;
  color: rgba(255, 255, 255, 0.9);
  filter: drop-shadow(0 2px 6px rgba(0, 0, 0, 0.4));
  transition: transform 0.2s ease;
}

.video-thumb-wrap:hover .video-play-overlay i {
  transform: scale(1.15);
}

/* ─── Card body ──────────────────────────────────────────────────────────────── */

.video-card-body {
  padding: 1rem 1.1rem 1.1rem;
  display: flex;
  flex-direction: column;
  flex: 1;
}

.video-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem;
  align-items: center;
}

.video-badge {
  display: inline-block;
  padding: 0.18rem 0.55rem;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.3px;
  white-space: nowrap;
}

.video-badge-lang {
  background: #e8f1fd;
  color: #2554a0;
}

.video-badge-topic {
  background: #e9f5ee;
  color: #1c6a3a;
}

.video-badge-featured {
  background: #fff3cd;
  color: #856404;
}

.video-duration {
  font-size: 0.72rem;
  color: var(--muted);
  margin-left: auto;
  padding-left: 0.5rem;
  white-space: nowrap;
}

/* RTL: flip duration margin */
[dir="rtl"] .video-duration {
  margin-left: 0;
  margin-right: auto;
  padding-left: 0;
  padding-right: 0.5rem;
}

.video-title {
  font-size: 0.98rem;
  font-weight: 800;
  color: var(--ink);
  margin: 0.5rem 0 0.3rem;
  line-height: 1.4;
}

.video-desc {
  font-size: 0.88rem;
  color: #5b6b7c;
  margin: 0 0 0.6rem;
  line-height: 1.55;
  flex: 1;
}

/* ─── Scripture quote ────────────────────────────────────────────────────────── */

.video-scripture {
  border-left: 3px solid var(--brand-blue);
  padding: 0.4rem 0.75rem;
  margin: 0 0 0.75rem;
  background: #f7f9fc;
  border-radius: 0 6px 6px 0;
}

[dir="rtl"] .video-scripture {
  border-left: none;
  border-right: 3px solid var(--brand-blue);
  border-radius: 6px 0 0 6px;
  text-align: right;
}

.video-scripture-text {
  display: block;
  font-size: 0.82rem;
  color: #3e4a57;
  font-style: italic;
  line-height: 1.5;
  margin-bottom: 0.2rem;
}

.video-scripture-ref {
  display: block;
  font-size: 0.75rem;
  color: var(--muted);
  font-style: normal;
  font-weight: 600;
}

/* ─── Watch button ───────────────────────────────────────────────────────────── */

.video-card-footer {
  margin-top: auto;
  padding-top: 0.5rem;
}

.btn-video {
  background: var(--brand-blue);
  border: 2px solid var(--brand-blue);
  color: #fff;
  border-radius: 8px;
  font-size: 0.88rem;
  font-weight: 600;
  padding: 0.45rem 1.1rem;
  transition: all 0.2s ease;
  cursor: pointer;
}

.btn-video:hover:not(:disabled) {
  background: var(--brand-blue-dark);
  border-color: var(--brand-blue-dark);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(74, 144, 226, 0.35);
}

.btn-video-disabled,
.btn-video:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

/* ─── No-results ─────────────────────────────────────────────────────────────── */

.videos-no-results {
  padding: 2.5rem 1rem;
  text-align: center;
  color: var(--muted);
  font-size: 0.95rem;
}

/* ─── Video modal ────────────────────────────────────────────────────────────── */

.video-modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.72);
  z-index: 1050;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  animation: vmFadeIn 0.18s ease;
}

@keyframes vmFadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}

.video-modal-dialog {
  background: #fff;
  border-radius: 12px;
  width: 100%;
  max-width: 820px;
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.35);
  overflow: hidden;
  animation: vmSlideUp 0.22s ease;
}

@keyframes vmSlideUp {
  from { transform: translateY(24px); opacity: 0; }
  to   { transform: translateY(0);    opacity: 1; }
}

.video-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.9rem 1.2rem;
  border-bottom: 1px solid #e8ecf0;
  background: #f8f9fa;
}

.video-modal-title {
  font-size: 1rem;
  font-weight: 700;
  color: var(--ink);
  margin: 0;
  flex: 1;
  padding-right: 1rem;
  word-break: break-word;
}

[dir="rtl"] .video-modal-title {
  padding-right: 0;
  padding-left: 1rem;
}

.video-modal-close {
  background: none;
  border: none;
  font-size: 1.4rem;
  color: var(--muted);
  cursor: pointer;
  padding: 0.2rem 0.4rem;
  border-radius: 6px;
  line-height: 1;
  transition: all 0.15s ease;
  flex-shrink: 0;
}

.video-modal-close:hover {
  background: #e9ecef;
  color: var(--ink);
}

.video-modal-body {
  padding: 0;
}

/* ─── Responsive embed ───────────────────────────────────────────────────────── */

.video-embed-responsive {
  position: relative;
  width: 100%;
  padding-bottom: 56.25%; /* 16:9 */
  height: 0;
  background: #000;
}

.video-embed-responsive iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: none;
  display: block;
}

/* ─── Featured section banner ────────────────────────────────────────────────── */

.featured-section-banner {
  background: linear-gradient(135deg, #f0f6ff 0%, #e8f0fd 100%);
  border: 1px solid rgba(74, 144, 226, 0.18);
  border-radius: 12px;
  padding: 1.25rem 1.5rem;
  margin-bottom: 0.5rem;
}

.featured-section-banner h2 {
  font-size: 1.1rem;
  font-weight: 800;
  color: var(--ink);
  margin: 0 0 0.2rem;
}

.featured-section-banner p {
  font-size: 0.9rem;
  color: #4a5568;
  margin: 0;
}

/* ─── CTA band ────────────────────────────────────────────────────────────────── */

/* Reuses .cta-band from components.css — no duplication needed */

/* ─── RTL overrides ──────────────────────────────────────────────────────────── */

[dir="rtl"] .filter-bar {
  direction: rtl;
}

[dir="rtl"] .video-card-body {
  text-align: right;
}

[dir="rtl"] .video-badges {
  justify-content: flex-end;
}

[dir="rtl"] .video-scripture {
  text-align: right;
}

[dir="rtl"] .btn-video i {
  margin-left: 0.25rem;
  margin-right: 0;
}

/* ─── Responsive ─────────────────────────────────────────────────────────────── */

@media (max-width: 767.98px) {
  .videos-hero {
    padding: 60px 0 36px;
  }

  .video-modal-dialog {
    max-width: 100%;
    margin: 0 0.5rem;
  }

  .filter-btn {
    font-size: 0.8rem;
    padding: 0.35rem 0.75rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  .video-card,
  .video-thumb,
  .video-play-overlay i,
  .filter-btn,
  .btn-video {
    transition: none !important;
    transform: none !important;
    animation: none !important;
  }
}
