/* =====================================================
   MEDIA PAGE STYLES
   Clean uniform grid layout
   ===================================================== */

/* ----- Hero Section ----- */
.media-hero {
  padding: calc(70px + var(--space-3xl)) 0 var(--space-2xl);
  background: linear-gradient(135deg, var(--teal) 0%, var(--blue-accent) 100%);
  text-align: center;
  position: relative;
  overflow: hidden;
}

.media-hero::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1440 320"><path fill="rgba(0,0,0,0.1)" d="M0,224L48,213.3C96,203,192,181,288,181.3C384,181,480,203,576,202.7C672,203,768,181,864,165.3C960,149,1056,139,1152,144C1248,149,1344,171,1392,181.3L1440,192L1440,320L1392,320C1344,320,1248,320,1152,320C1056,320,960,320,864,320C768,320,672,320,576,320C480,320,384,320,288,320C192,320,96,320,48,320L0,320Z"></path></svg>');
  background-size: cover;
  background-position: bottom;
}

.media-hero h1 {
  color: var(--white);
  font-size: clamp(2.5rem, 5vw, 4rem);
  margin-bottom: var(--space-sm);
  position: relative;
  z-index: 2;
  text-shadow: 0 2px 10px rgba(0,0,0,0.2);
}

.media-hero .lead {
  color: rgba(255, 255, 255, 0.95);
  font-size: 1.25rem;
  position: relative;
  z-index: 2;
}

/* ----- Video Section ----- */
.video-section {
  padding: var(--space-2xl) 0;
  background: var(--dark);
}

.video-section .gallery-title {
  color: var(--white);
}

.video-section .gallery-subtitle {
  color: rgba(255, 255, 255, 0.7);
}

.video-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 24px;
}

.video-item {
  background: var(--dark-lighter);
  border-radius: var(--radius-md);
  overflow: hidden;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.video-item:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.4);
}

.video-wrapper {
  position: relative;
  padding-bottom: 56.25%; /* 16:9 aspect ratio */
  height: 0;
  overflow: hidden;
}

.video-wrapper iframe {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
}

.video-title {
  padding: var(--space-md);
  font-size: 1rem;
  font-weight: 600;
  color: var(--white);
  text-align: center;
  margin: 0;
}

.channel-cta {
  text-align: center;
  margin-top: var(--space-xl);
}

.channel-cta .btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.channel-cta .btn svg {
  flex-shrink: 0;
}

/* ----- Gallery Section ----- */
.gallery-section {
  padding: var(--space-2xl) 0;
}

.gallery-section.bg-gray {
  background: var(--gray-50);
}

.gallery-title {
  text-align: center;
  font-size: 2rem;
  margin-bottom: var(--space-xs);
  color: var(--dark);
}

.gallery-subtitle {
  text-align: center;
  color: var(--text-light);
  font-size: 1.1rem;
  margin-bottom: var(--space-lg);
}

/* ----- Clean Uniform Grid ----- */
.gallery-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}

.gallery-item {
  position: relative;
  overflow: hidden;
  border-radius: var(--radius-md);
  cursor: pointer;
  background: var(--gray-200);
  aspect-ratio: 4 / 3;
}

.gallery-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top center;
  display: block;
  transition: transform 0.4s ease;
}

.gallery-item:hover img {
  transform: scale(1.08);
}

.gallery-item::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(0,0,0,0.5) 0%, transparent 50%);
  opacity: 0;
  transition: opacity 0.3s ease;
}

.gallery-item:hover::after {
  opacity: 1;
}

/* ----- Lightbox ----- */
.lightbox {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.95);
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-lg);
  animation: fadeIn 0.3s ease;
}

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

.lightbox-content {
  position: relative;
  max-width: 90vw;
  max-height: 90vh;
  text-align: center;
}

.lightbox-content img {
  max-width: 100%;
  max-height: 80vh;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-xl);
  object-fit: contain;
}

.lightbox-close {
  position: absolute;
  top: -50px;
  right: 0;
  width: 44px;
  height: 44px;
  background: var(--white);
  border: none;
  border-radius: 50%;
  font-size: 28px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s ease;
  color: var(--dark);
}

.lightbox-close:hover {
  background: var(--teal);
  color: var(--white);
  transform: rotate(90deg);
}

.lightbox-caption {
  color: var(--white);
  font-size: 1.1rem;
  margin-top: var(--space-md);
  font-weight: 500;
}

/* ----- Responsive ----- */

/* Tablet Landscape (769px - 1024px) */
@media (min-width: 769px) and (max-width: 1024px) {
  .media-hero {
    padding: calc(70px + var(--space-2xl)) 0 var(--space-xl);
  }

  .media-hero h1 {
    font-size: 3rem;
  }

  .media-hero .lead {
    font-size: 1.1rem;
  }

  .video-section {
    padding: var(--space-xl) 0;
  }

  .video-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
  }

  .video-title {
    padding: var(--space-sm);
    font-size: 0.9rem;
  }

  .gallery-section {
    padding: var(--space-xl) 0;
  }

  .gallery-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 14px;
  }

  .gallery-title {
    font-size: 1.75rem;
  }

  .gallery-subtitle {
    font-size: 1rem;
    margin-bottom: var(--space-md);
  }
}

@media (max-width: 1024px) {
  .gallery-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
  }
  
  .video-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
  }
}

/* Tablet Portrait (768px) */
@media (max-width: 768px) {
  .media-hero {
    padding: calc(70px + var(--space-xl)) 0 var(--space-lg);
  }

  .media-hero h1 {
    font-size: 2.5rem;
  }

  .gallery-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
  }
  
  .video-grid {
    grid-template-columns: 1fr;
    gap: 16px;
  }
  
  .gallery-title {
    font-size: 1.5rem;
  }
  
  .gallery-subtitle {
    font-size: 0.95rem;
  }

  .video-section {
    padding: var(--space-lg) 0;
  }

  .channel-cta {
    margin-top: var(--space-lg);
  }
}

@media (max-width: 480px) {
  .gallery-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
  }
  
  .gallery-item {
    border-radius: var(--radius-sm);
  }

  .video-title {
    font-size: 0.85rem;
    padding: var(--space-sm);
  }
}
