/* ============================================================
   MEDIA GALLERY — Cinematic editorial (dynamic)
   ============================================================ */

.gallery-page {
  --m-navy: var(--color-mba-blue, #0f2983);
  --m-navy-deep: var(--color-mba-dark-blue, #071444);
  --m-red: var(--color-mba-red, #b20202);
  --m-warm: var(--color-warm-white, #f5f0eb);
  --m-text: #131318;
  --m-muted: #5b6070;
  --m-line: #e8e8ee;
  --m-ease: cubic-bezier(0.22, 1, 0.36, 1);
}

/* ============================================================
   1. HERO
   ============================================================ */
.gallery-hero {
  position: relative;
  min-height: clamp(560px, 92vh, 820px);
  display: flex;
  align-items: flex-end;
  padding: clamp(80px, 12vh, 160px) 0 clamp(60px, 8vh, 100px);
  color: #fff;
  background-size: cover;
  background-position: center;
  overflow: hidden;
  isolation: isolate;
}

.gallery-hero::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background:
    radial-gradient(
      1000px 500px at 20% 100%,
      rgba(178, 2, 2, 0.32),
      transparent 60%
    ),
    linear-gradient(180deg, rgba(7, 20, 68, 0.5) 0%, rgba(7, 20, 68, 0.92) 100%);
}

.gallery-hero__overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(120deg, rgba(15, 41, 131, 0.35), transparent 65%);
  z-index: -1;
  pointer-events: none;
}

.gallery-hero__content {
  position: relative;
  max-width: 960px;
  padding-inline: var(--container-padding, 24px);
  margin: 0 auto;
  width: 100%;
}

.gallery-hero__tag {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  font-family: var(--font-body);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  margin-bottom: 28px;
}

.gallery-hero__tag::before {
  content: "";
  width: 44px;
  height: 1px;
  background: var(--m-red);
}

.gallery-hero__heading {
  font-family: var(--font-display);
  font-size: clamp(40px, 7.5vw, 104px);
  font-weight: 500;
  line-height: 0.98;
  letter-spacing: -0.03em;
  margin: 0 0 clamp(20px, 3vw, 36px);
  color: #fff;
  max-width: 14ch;
}

.gallery-hero__heading-italic {
  display: block;
  font-style: italic;
  font-weight: 400;
}

.gallery-hero__description {
  font-family: var(--font-body);
  font-size: clamp(15px, 1.25vw, 19px);
  line-height: 1.7;
  color: rgba(255, 255, 255, 0.82);
  max-width: 66ch;
  margin: 0 0 40px;
}

.gallery-hero__scroll {
  display: inline-flex;
  align-items: center;
  gap: 16px;
  font-family: var(--font-body);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.28em;
  color: rgba(255, 255, 255, 0.7);
  text-transform: uppercase;
}

.gallery-hero__scroll-line {
  width: 60px;
  height: 1px;
  background: rgba(255, 255, 255, 0.4);
  position: relative;
  overflow: hidden;
}

.gallery-hero__scroll-line::after {
  content: "";
  position: absolute;
  inset: 0;
  background: var(--m-red);
  transform: translateX(-100%);
  animation: gallery-scroll 2.4s infinite var(--m-ease);
}

@keyframes gallery-scroll {
  0% { transform: translateX(-100%); }
  50% { transform: translateX(0); }
  100% { transform: translateX(100%); }
}

/* ============================================================
   Section heading (scoped)
   ============================================================ */
.gallery-page .section-heading-block {
  max-width: 720px;
  margin: 0 auto clamp(48px, 6vw, 72px);
  text-align: center;
}

.gallery-page .section-heading-block .section-label {
  display: inline-block;
  font-family: var(--font-body);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.3em;
  color: var(--m-red);
  margin-bottom: 18px;
  text-transform: uppercase;
}

.gallery-page .section-heading-block .section-heading {
  font-family: var(--font-display);
  font-size: clamp(30px, 4.4vw, 60px);
  font-weight: 500;
  color: var(--m-navy-deep);
  line-height: 1.05;
  letter-spacing: -0.02em;
  margin: 0 0 20px;
}

.gallery-page .section-heading-block .section-heading em {
  font-style: italic;
  color: var(--m-red);
  font-weight: 400;
}

.gallery-page .section-heading-block .section-subheading {
  font-family: var(--font-body);
  font-size: clamp(15px, 1.15vw, 17px);
  color: var(--m-muted);
  line-height: 1.7;
  margin: 0 auto;
  max-width: 60ch;
}

/* ============================================================
   Empty state (shared)
   ============================================================ */
.gallery__empty {
  padding: clamp(48px, 6vw, 72px) 24px;
  text-align: center;
  border: 1px dashed var(--m-line);
  border-radius: 16px;
  background: #fff;
}

.gallery__empty p {
  font-family: var(--font-body);
  font-size: 15px;
  color: var(--m-muted);
  margin: 0;
}

/* ============================================================
   2. GALLERY
   ============================================================ */
.gallery {
  padding: clamp(72px, 10vw, 140px) 0;
  background: #fff;
}

.gallery__masonry {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  grid-auto-rows: 220px;
  gap: 16px;
}

.gallery-item {
  position: relative;
  overflow: hidden;
  border-radius: 14px;
  cursor: zoom-in;
  isolation: isolate;
  margin: 0;
  outline: none;
  transition: box-shadow 0.4s var(--m-ease), transform 0.5s var(--m-ease);
}

.gallery-item:focus-visible {
  box-shadow: 0 0 0 3px var(--m-red);
}

.gallery-item--small {
}
.gallery-item--medium {
  grid-row: span 2;
}
.gallery-item--large {
  grid-column: span 2;
  grid-row: span 2;
}

.gallery-item__image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 1s var(--m-ease);
}

.gallery-item:hover .gallery-item__image {
  transform: scale(1.06);
}

.gallery-item__overlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: flex-end;
  padding: 20px;
  background: linear-gradient(180deg, transparent 40%, rgba(7, 20, 68, 0.85) 100%);
  opacity: 0;
  transform: translateY(6px);
  transition: opacity 0.4s ease, transform 0.5s var(--m-ease);
  z-index: 1;
}

.gallery-item:hover .gallery-item__overlay,
.gallery-item:focus-visible .gallery-item__overlay {
  opacity: 1;
  transform: translateY(0);
}

.gallery-item__title {
  font-family: var(--font-display);
  font-size: 15px;
  font-weight: 500;
  color: #fff;
  letter-spacing: -0.005em;
}

.gallery-item.is-hidden {
  display: none;
}

.video-card.is-hidden {
  display: none;
}

.gallery__load-more {
  display: flex;
  justify-content: center;
  margin-top: clamp(32px, 4vw, 56px);
}

.btn-outline {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 14px 32px;
  background: transparent;
  border: 1px solid var(--m-navy-deep);
  color: var(--m-navy-deep);
  font-family: var(--font-body);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  border-radius: 999px;
  cursor: pointer;
  transition: all 0.35s var(--m-ease);
}

.btn-outline:hover {
  background: var(--m-navy-deep);
  color: #fff;
  transform: translateY(-3px);
  box-shadow: 0 12px 26px -12px rgba(7, 20, 68, 0.45);
}

.btn-outline svg {
  transition: transform 0.3s ease;
}

.btn-outline:hover svg {
  transform: rotate(90deg);
}

/* ============================================================
   3. FEATURED VIDEOS
   ============================================================ */
.featured-videos {
  padding: clamp(72px, 10vw, 140px) 0;
  background: var(--m-warm);
}

.featured-videos__grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: clamp(20px, 2.5vw, 32px);
}

.video-card {
  position: relative;
  transition: transform 0.5s var(--m-ease);
}

.video-card:hover {
  transform: translateY(-6px);
}

.video-card__trigger {
  display: block;
  width: 100%;
  padding: 0;
  background: none;
  border: none;
  text-align: left;
  color: inherit;
  cursor: pointer;
  font: inherit;
}

.video-card__thumb {
  position: relative;
  aspect-ratio: 16 / 10;
  border-radius: 16px;
  overflow: hidden;
  margin-bottom: 18px;
  box-shadow: 0 20px 40px -20px rgba(7, 20, 68, 0.3);
}

.video-card__thumb::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(7, 20, 68, 0) 40%, rgba(7, 20, 68, 0.6));
  z-index: 1;
}

.video-card__image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 1s var(--m-ease);
}

.video-card:hover .video-card__image {
  transform: scale(1.06);
}

.video-card__play {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 64px;
  height: 64px;
  background: rgba(255, 255, 255, 0.95);
  color: var(--m-red);
  border-radius: 50%;
  display: grid;
  place-items: center;
  z-index: 2;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.3);
  transition: transform 0.4s var(--m-ease), background 0.3s ease;
}

.video-card:hover .video-card__play {
  transform: translate(-50%, -50%) scale(1.1);
  background: var(--m-red);
  color: #fff;
}

.video-card__play svg {
  width: 24px;
  height: 24px;
  margin-left: 3px;
}

.video-card__duration {
  position: absolute;
  bottom: 14px;
  right: 14px;
  padding: 4px 10px;
  background: rgba(0, 0, 0, 0.7);
  color: #fff;
  border-radius: 6px;
  font-family: var(--font-body);
  font-size: 12px;
  font-weight: 600;
  z-index: 2;
  backdrop-filter: blur(4px);
}

.video-card__title {
  font-family: var(--font-display);
  font-size: clamp(16px, 1.4vw, 20px);
  font-weight: 500;
  color: var(--m-navy-deep);
  line-height: 1.3;
  letter-spacing: -0.005em;
  margin: 0;
  transition: color 0.3s ease;
}

.video-card:hover .video-card__title {
  color: var(--m-red);
}

/* ============================================================
   LIGHTBOX
   ============================================================ */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(4, 10, 32, 0.94);
  backdrop-filter: blur(6px);
  animation: lightbox-fade 0.25s ease;
}

.lightbox[hidden] {
  display: none;
}

@keyframes lightbox-fade {
  from { opacity: 0; }
  to { opacity: 1; }
}

.lightbox__stage {
  position: relative;
  max-width: min(1200px, 92vw);
  max-height: 88vh;
  text-align: center;
}

.lightbox__image {
  display: block;
  max-width: 100%;
  max-height: 76vh;
  width: auto;
  height: auto;
  margin: 0 auto;
  border-radius: 10px;
  box-shadow: 0 40px 80px -30px rgba(0, 0, 0, 0.7);
  animation: lightbox-zoom 0.3s var(--m-ease);
}

@keyframes lightbox-zoom {
  from { transform: scale(0.96); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}

.lightbox__caption {
  color: rgba(255, 255, 255, 0.9);
  font-family: var(--font-body);
  font-size: 15px;
  margin-top: 18px;
  min-height: 22px;
}

.lightbox__counter {
  color: rgba(255, 255, 255, 0.55);
  font-family: var(--font-body);
  font-size: 12px;
  letter-spacing: 0.2em;
  margin-top: 6px;
}

.lightbox__close,
.lightbox__nav {
  position: absolute;
  z-index: 2001;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: #fff;
  border-radius: 50%;
  cursor: pointer;
  display: grid;
  place-items: center;
  transition: background 0.3s ease, transform 0.3s ease;
}

.lightbox__close {
  top: 24px;
  right: 24px;
  width: 48px;
  height: 48px;
}

.lightbox__nav {
  top: 50%;
  transform: translateY(-50%);
  width: 52px;
  height: 52px;
}

.lightbox__nav--prev { left: 24px; }
.lightbox__nav--next { right: 24px; }

.lightbox__close:hover,
.lightbox__nav:hover {
  background: var(--m-red);
  border-color: var(--m-red);
}

.lightbox__nav:hover {
  transform: translateY(-50%) scale(1.06);
}

.lightbox__close svg,
.lightbox__nav svg {
  width: 20px;
  height: 20px;
}

/* ============================================================
   VIDEO MODAL
   ============================================================ */
.video-modal {
  position: fixed;
  inset: 0;
  z-index: 2100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(4, 10, 32, 0.94);
  backdrop-filter: blur(6px);
  animation: lightbox-fade 0.25s ease;
}

.video-modal[hidden] {
  display: none;
}

.video-modal__frame {
  position: relative;
  width: min(980px, 94vw);
  aspect-ratio: 16 / 9;
  background: #000;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 40px 80px -30px rgba(0, 0, 0, 0.7);
}

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

.video-modal__close {
  position: absolute;
  top: 20px;
  right: 20px;
  z-index: 2101;
  width: 48px;
  height: 48px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: #fff;
  border-radius: 50%;
  cursor: pointer;
  display: grid;
  place-items: center;
  transition: background 0.3s ease;
}

.video-modal__close:hover {
  background: var(--m-red);
  border-color: var(--m-red);
}

.video-modal__close svg {
  width: 20px;
  height: 20px;
}

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 1024px) {
  .gallery__masonry {
    grid-template-columns: repeat(3, 1fr);
  }
  .featured-videos__grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 768px) {
  .gallery-hero {
    min-height: clamp(480px, 78vh, 620px);
    align-items: center;
  }
  .gallery__masonry {
    grid-template-columns: repeat(2, 1fr);
    grid-auto-rows: 180px;
  }
  .gallery-item--large {
    grid-row: span 1;
  }
  .featured-videos__grid {
    grid-template-columns: 1fr;
    max-width: 460px;
    margin: 0 auto;
  }
  .lightbox__nav--prev { left: 12px; }
  .lightbox__nav--next { right: 12px; }
  .lightbox__nav {
    width: 44px;
    height: 44px;
  }
}

@media (max-width: 480px) {
  .gallery-hero {
    padding-top: 100px;
    padding-bottom: 60px;
  }
  .gallery,
  .featured-videos {
    padding: 64px 0;
  }
  .gallery__masonry {
    grid-template-columns: 1fr;
    grid-auto-rows: auto;
  }
  .gallery-item {
    aspect-ratio: 4 / 3;
    grid-column: span 1 !important;
    grid-row: span 1 !important;
  }
  .gallery-item__overlay {
    opacity: 1;
    transform: translateY(0);
  }
  .lightbox__close {
    top: 12px;
    right: 12px;
  }
}
