/* ── GALLERY & VIDEOS STYLING ── */

body.page-template-page-gallery,
body.page-template-page-videos {
  background: var(--light);
  color: var(--text-primary);
}

/* ── HERO SPECIFICS ── */
.hero-subpage.media-hero {
  background: linear-gradient(135deg, #0a1a3a 0%, #1565c0 70%, #0288d1 100%);
  border-bottom: 2px solid var(--gold);
}
.hero-subpage.media-hero .subpage-badge {
  background: rgba(255, 193, 7, 0.1);
  border-color: var(--gold);
  color: var(--gold);
}
.hero-subpage.media-hero .subpage-title {
  background: linear-gradient(135deg, var(--white) 30%, var(--sky) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}
.hero-subpage.media-hero .subpage-desc {
  color: rgba(255, 255, 255, 0.8);
}

/* ── FOLDERS GRID ── */
.folders-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 32px;
  margin-top: 50px;
  margin-bottom: 50px;
}

.folder-card {
  position: relative;
  background: var(--navy);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 0 16px 16px 16px;
  height: 200px;
  cursor: pointer;
  box-shadow: 0 8px 32px rgba(10, 26, 58, 0.25);
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 28px;
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.3s ease, border-color 0.3s ease;
  margin-top: 15px; /* Leave space for the folder tab */
  overflow: visible;
}
/* Folder tab on top-left */
.folder-card::before {
  content: '';
  position: absolute;
  top: -14px;
  left: -1px;
  width: 100px;
  height: 16px;
  background: var(--navy);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-bottom: none;
  border-radius: 8px 8px 0 0;
  z-index: 1;
}
/* Folder inner accent line */
.folder-card::after {
  content: '';
  position: absolute;
  top: 20px;
  left: 28px;
  right: 28px;
  height: 2px;
  background: linear-gradient(90deg, var(--gold), transparent);
  opacity: 0.35;
}
.folder-card:hover {
  transform: translateY(-8px);
  box-shadow: 0 16px 40px rgba(10, 26, 58, 0.45);
  border-color: var(--gold);
}
.folder-card:hover::before {
  background: var(--navy);
  border-color: var(--gold);
}

.folder-icon-wrapper {
  margin-bottom: auto;
  font-size: 3.5rem;
  line-height: 1;
  color: var(--gold);
  transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}
.folder-card:hover .folder-icon-wrapper {
  transform: scale(1.15) rotate(-5deg);
}

.folder-title {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 2.5rem;
  color: var(--white);
  letter-spacing: 2px;
  line-height: 1;
  margin-top: 15px;
}
.folder-count {
  font-family: 'Montserrat', sans-serif;
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--sky);
  margin-top: 4px;
  text-transform: uppercase;
  letter-spacing: 1.5px;
}

/* ── BACK BUTTON & ACTIVE TITLE ── */
.back-btn-container {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 24px;
  margin-top: 50px;
  margin-bottom: 32px;
  border-bottom: 1px solid rgba(10, 26, 58, 0.08);
  padding-bottom: 24px;
}
.back-btn {
  background: transparent;
  border: 1px solid var(--navy);
  color: var(--navy);
  font-family: 'Montserrat', sans-serif;
  font-weight: 700;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  padding: 8px 18px;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  display: flex;
  align-items: center;
  gap: 8px;
  outline: none;
}
.back-btn:hover {
  background: var(--navy);
  color: var(--white);
  box-shadow: 0 4px 12px rgba(10, 26, 58, 0.15);
  transform: translateX(-4px);
}
.back-btn-arrow {
  font-size: 1.1rem;
  font-weight: bold;
}
.active-year-heading {
  font-family: 'Montserrat', sans-serif;
  font-weight: 800;
  font-size: 2.2rem;
  color: var(--navy);
  line-height: 1.2;
  margin: 0;
  letter-spacing: -0.5px;
}
.active-year-heading span {
  font-family: 'Open Sans', sans-serif;
  font-weight: 600;
  font-size: 0.85rem;
  color: var(--gray);
  display: block;
  margin-top: 6px;
  letter-spacing: 1px;
  text-transform: uppercase;
}

@media (max-width: 768px) {
  .folders-grid {
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 24px;
  }
  .folder-card {
    height: 180px;
    padding: 20px;
  }
  .folder-title {
    font-size: 2.2rem;
  }
}

/* ── GALLERY GRID ── */
.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 24px;
}

.gallery-card {
  background: var(--white);
  border: 1px solid var(--card-border);
  border-radius: 12px;
  overflow: hidden;
  position: relative;
  aspect-ratio: 4 / 3;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(15, 23, 42, 0.04);
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.3s ease, border-color 0.3s ease;
}
.gallery-card:hover {
  transform: translateY(-6px);
  box-shadow: 0 12px 24px rgba(15, 23, 42, 0.1);
  border-color: rgba(21, 101, 192, 0.25);
}

.gallery-img-container {
  width: 100%;
  height: 100%;
  position: relative;
}
.gallery-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s ease;
}
.gallery-card:hover .gallery-img {
  transform: scale(1.08);
}

.gallery-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(10, 26, 58, 0.85) 0%, rgba(10, 26, 58, 0.2) 60%, rgba(10, 26, 58, 0) 100%);
  opacity: 0;
  transition: opacity 0.3s ease;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 20px;
}
.gallery-card:hover .gallery-overlay {
  opacity: 1;
}

.gallery-card-title {
  color: var(--white);
  font-family: 'Montserrat', sans-serif;
  font-weight: 700;
  font-size: 0.95rem;
  margin-bottom: 4px;
  text-shadow: 0 1px 4px rgba(0,0,0,0.5);
  transform: translateY(10px);
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}
.gallery-card-year {
  color: var(--gold);
  font-family: 'Montserrat', sans-serif;
  font-weight: 800;
  font-size: 0.7rem;
  letter-spacing: 1px;
  text-transform: uppercase;
  transform: translateY(10px);
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1) 0.05s;
}
.gallery-card:hover .gallery-card-title,
.gallery-card:hover .gallery-card-year {
  transform: translateY(0);
}

.gallery-zoom-indicator {
  position: absolute;
  top: 15px;
  right: 15px;
  background: rgba(10, 26, 58, 0.7);
  backdrop-filter: blur(4px);
  border: 1px solid rgba(255, 255, 255, 0.15);
  width: 38px;
  height: 38px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--gold);
  font-size: 1rem;
  opacity: 0;
  transform: scale(0.8);
  transition: opacity 0.3s ease, transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}
.gallery-card:hover .gallery-zoom-indicator {
  opacity: 1;
  transform: scale(1);
}

/* ── VIDEOS GRID ── */
.videos-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: 32px;
}

.video-card {
  background: var(--white);
  border: 1px solid var(--card-border);
  border-radius: 16px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.3s ease, border-color 0.3s ease;
  box-shadow: 0 4px 15px rgba(15, 23, 42, 0.03);
}
.video-card:hover {
  transform: translateY(-8px);
  box-shadow: 0 12px 28px rgba(15, 23, 42, 0.08);
  border-color: rgba(21, 101, 192, 0.25);
}

.video-thumbnail-wrapper {
  position: relative;
  width: 100%;
  padding-bottom: 56.25%; /* 16:9 Aspect Ratio */
  background: #0f172a;
  overflow: hidden;
  cursor: pointer;
}
.video-thumbnail {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.6s ease;
}
.video-card:hover .video-thumbnail {
  transform: scale(1.06);
}

.video-play-btn {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) scale(0.95);
  width: 64px;
  height: 64px;
  background: var(--gold);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 8px 24px rgba(255, 193, 7, 0.4);
  transition: background 0.3s ease, transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275), box-shadow 0.3s ease;
  z-index: 5;
  color: var(--navy);
  font-size: 1.5rem;
  padding-left: 4px; /* offset play icon slightly to center visually */
  border: none;
  cursor: pointer;
}
.video-thumbnail-wrapper:hover .video-play-btn {
  background: var(--orange);
  transform: translate(-50%, -50%) scale(1.08);
  box-shadow: 0 10px 28px rgba(255, 111, 0, 0.5);
  color: var(--white);
}

.video-card-content {
  padding: 24px;
  display: flex;
  flex-direction: column;
  flex: 1;
}
.video-year-tag {
  display: inline-block;
  align-self: flex-start;
  font-size: 0.65rem;
  font-weight: 800;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--blue);
  margin-bottom: 8px;
  font-family: 'Montserrat', sans-serif;
  background: rgba(21, 101, 192, 0.06);
  padding: 4px 10px;
  border-radius: 4px;
}
.video-title {
  font-family: 'Montserrat', sans-serif;
  font-weight: 700;
  font-size: 1.1rem;
  color: var(--navy);
  line-height: 1.4;
  margin-bottom: 10px;
}
.video-desc {
  font-size: 0.88rem;
  color: var(--text-secondary);
  line-height: 1.6;
}

/* ── LIGHTBOX CUSTOM CONTROLS (GALLERY NAVIGATION) ── */
.lightbox-prev,
.lightbox-next {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: var(--white);
  font-size: 24px;
  width: 52px;
  height: 52px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
  z-index: 1010;
  box-shadow: 0 4px 12px rgba(0,0,0,0.3);
}
.lightbox-prev { left: 24px; }
.lightbox-next { right: 24px; }

.lightbox-prev:hover,
.lightbox-next:hover {
  background: rgba(255, 255, 255, 0.15);
  color: var(--gold);
  border-color: rgba(255, 193, 7, 0.3);
  transform: translateY(-50%) scale(1.05);
}

.lightbox-counter {
  position: absolute;
  bottom: 24px;
  left: 24px;
  color: rgba(255,255,255,0.5);
  font-family: 'Montserrat', sans-serif;
  font-size: 0.85rem;
  letter-spacing: 1px;
}

/* ── LIGHTBOX RESPONSIVE VIDEO IFRAME ── */
.lightbox-video-container {
  width: 80vw;
  max-width: 900px;
  aspect-ratio: 16 / 9;
  background: #000;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 20px 60px rgba(0,0,0,0.8);
  border: 1px solid rgba(255,255,255,0.1);
}
.lightbox-video-container iframe {
  width: 100%;
  height: 100%;
  border: none;
}

/* ── RESPONSIVE ADAPTATIONS ── */
@media (max-width: 768px) {
  .gallery-grid {
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 16px;
  }
  .videos-grid {
    grid-template-columns: 1fr;
    gap: 24px;
  }
  .lightbox-prev,
  .lightbox-next {
    width: 44px;
    height: 44px;
    font-size: 18px;
  }
  .lightbox-prev { left: 10px; }
  .lightbox-next { right: 10px; }
  .lightbox-video-container {
    width: 95vw;
  }
}

/* ── GENERAL LIGHTBOX SYSTEM ── */
.lightbox {
  display: none; position: fixed; z-index: 1000; left: 0; top: 0; width: 100%; height: 100%;
  background-color: rgba(4, 13, 30, 0.95); backdrop-filter: blur(12px);
  align-items: center; justify-content: center; opacity: 0; transition: opacity 0.35s ease;
}
.lightbox.active {
  display: flex; opacity: 1;
}
.lightbox-wrapper {
  position: relative; max-width: 90%; max-height: 88%; display: flex; flex-direction: column;
  align-items: center; transform: scale(0.9); transition: transform 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.lightbox.active .lightbox-wrapper {
  transform: scale(1);
}
.lightbox-content {
  max-width: 100%; max-height: 78vh; border-radius: 10px;
  box-shadow: 0 15px 50px rgba(0,0,0,0.7); border: 1px solid rgba(255,255,255,0.15);
  object-fit: contain;
}
.lightbox-caption {
  margin-top: 20px; font-family: 'Montserrat', sans-serif; font-weight: 700;
  font-size: clamp(1rem, 3vw, 1.3rem); color: var(--gold); text-align: center;
  text-shadow: 0 2px 8px rgba(0,0,0,0.6); letter-spacing: 1px;
}
.lightbox-close {
  position: absolute; top: 24px; right: 24px; color: var(--white); font-size: 36px;
  font-weight: bold; background: transparent; border: none; cursor: pointer;
  transition: all 0.2s; width: 52px; height: 52px; display: flex;
  align-items: center; justify-content: center; border-radius: 50%;
  background: rgba(255,255,255,0.06); border: 1px solid rgba(255,255,255,0.1);
  box-shadow: 0 4px 12px rgba(0,0,0,0.3);
}
.lightbox-close:hover {
  color: var(--gold); background: rgba(255,255,255,0.12);
  transform: scale(1.08) rotate(90deg); border-color: rgba(255,193,7,0.3);
}
