/* ============================================================
   MODULE: Media Section — YouTube, Instagram, TikTok
   Greater Tshwane Area — Church Website
   ============================================================ */

.media-section { background: white; }

/* ── Platform Tab Bar ── */
.media-tabs {
  display: flex;
  justify-content: center;
  gap: 10px;
  margin-bottom: 40px;
  flex-wrap: wrap;
}
.media-tab {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 11px 26px;
  border-radius: 50px;
  border: 2px solid var(--border);
  background: white;
  cursor: pointer;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-secondary);
  transition: all var(--duration) var(--ease);
}
.media-tab:hover { border-color: var(--soft-gold); color: var(--deep-brown); }
.media-tab-icon { font-size: 1.1rem; line-height: 1; }

/* Platform-specific active colours */
.media-tab[data-platform="youtube"].active  { background: #FF0000; border-color: #FF0000; color: white; }
.media-tab[data-platform="tiktok"].active   { background: #010101; border-color: #010101; color: white; }
.media-tab[data-platform="instagram"].active{ background: linear-gradient(135deg,#833AB4,#FD1D1D,#F77737); border-color: #FD1D1D; color: white; }

/* ── Panel Visibility ── */
.media-panel { display: none; animation: panelIn 0.4s var(--ease); }
.media-panel.active { display: block; }
@keyframes panelIn { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: translateY(0); } }

/* ==============================
   YOUTUBE PANEL
   ============================== */
.yt-layout {
  display: grid;
  grid-template-columns: 1fr 320px;
  gap: 28px;
  align-items: start;
}

/* Featured player */
.yt-player-wrap {
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: #000;
  box-shadow: var(--shadow-lg);
}
.yt-player-ratio {
  position: relative;
  padding-bottom: 56.25%;
  height: 0;
}
.yt-player-ratio iframe {
  position: absolute;
  top: 0; left: 0;
  width: 100%; height: 100%;
  border: none;
}
.yt-player-hint {
  text-align: center;
  font-size: 0.78rem;
  color: var(--text-light);
  margin-top: 10px;
}

/* Latest videos list */
.yt-sidebar-wrap { display: flex; flex-direction: column; gap: 20px; }

.yt-channel-badge {
  background: var(--cream);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 24px;
  text-align: center;
}
.yt-channel-avatar {
  width: 60px; height: 60px; border-radius: 50%;
  background: linear-gradient(135deg, #FF0000, #AA0000);
  margin: 0 auto 12px;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.6rem; color: white;
}
.yt-channel-name { font-family: var(--font-heading); font-size: 1rem; color: var(--deep-brown); margin-bottom: 5px; }
.yt-channel-sub  { font-size: 0.8rem; color: var(--text-secondary); margin-bottom: 14px; line-height: 1.55; }
.btn-yt-sub {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  width: 100%; padding: 10px; border-radius: var(--radius-sm);
  background: #FF0000; color: white; font-weight: 600; font-size: 0.86rem;
  transition: background var(--duration);
}
.btn-yt-sub:hover { background: #CC0000; }

/* Video list */
.yt-videos-card {
  background: var(--cream);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 18px;
  flex: 1;
}
.yt-videos-heading {
  font-size: 0.7rem; text-transform: uppercase; letter-spacing: 2px;
  color: var(--soft-gold); font-weight: 600; margin-bottom: 14px;
}
.yt-video-item {
  display: flex;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  transition: opacity var(--duration);
  text-decoration: none;
}
.yt-video-item:last-child { border-bottom: none; }
.yt-video-item:hover { opacity: 0.8; }
.yt-thumb {
  width: 72px; height: 46px;
  border-radius: 6px;
  overflow: hidden;
  flex-shrink: 0;
  background: var(--border);
  position: relative;
}
.yt-thumb img { width: 100%; height: 100%; object-fit: cover; }
.yt-thumb-play {
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  background: rgba(0,0,0,0.35);
  font-size: 1rem;
  color: white;
}
.yt-video-title {
  font-size: 0.8rem; font-weight: 500;
  color: var(--text-primary); line-height: 1.4;
}
.yt-video-meta {
  font-size: 0.71rem;
  color: var(--text-light);
  margin-top: 3px;
}

/* Skeleton loader */
.yt-skeleton .yt-thumb  { background: linear-gradient(90deg, #e8e0d5 25%, #f0e8df 50%, #e8e0d5 75%); background-size: 200% 100%; animation: shimmer 1.5s infinite; }
.yt-skeleton .yt-video-title { height: 12px; background: linear-gradient(90deg, #e8e0d5 25%, #f0e8df 50%, #e8e0d5 75%); background-size: 200% 100%; animation: shimmer 1.5s infinite; border-radius: 4px; width: 90%; margin-bottom: 6px; }
.yt-skeleton .yt-video-meta  { height: 10px; background: linear-gradient(90deg, #e8e0d5 25%, #f0e8df 50%, #e8e0d5 75%); background-size: 200% 100%; animation: shimmer 1.5s infinite; border-radius: 4px; width: 60%; }
@keyframes shimmer { to { background-position: -200% 0; } }

/* ==============================
   INSTAGRAM PANEL
   ============================== */
.ig-panel { max-width: 780px; margin: 0 auto; }
.ig-profile-bar {
  display: flex; align-items: center; gap: 20px;
  background: var(--cream); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 24px; margin-bottom: 20px;
}
.ig-avatar {
  width: 68px; height: 68px; border-radius: 50%;
  background: linear-gradient(135deg,#833AB4,#FD1D1D,#F77737);
  display: flex; align-items: center; justify-content: center;
  font-size: 1.8rem; flex-shrink: 0;
}
.ig-handle { font-size: 1.05rem; font-weight: 700; color: var(--deep-brown); margin-bottom: 3px; }
.ig-bio    { font-size: 0.84rem; color: var(--text-secondary); }
.btn-ig-follow {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 9px 18px; border-radius: var(--radius-sm);
  background: linear-gradient(135deg,#833AB4,#FD1D1D,#F77737);
  color: white; font-weight: 600; font-size: 0.84rem;
  margin-left: auto; flex-shrink: 0;
  transition: opacity var(--duration);
}
.btn-ig-follow:hover { opacity: 0.88; }
.ig-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 4px;
  border-radius: var(--radius-md);
  overflow: hidden;
  margin-bottom: 20px;
}
.ig-post {
  aspect-ratio: 1;
  position: relative;
  overflow: hidden;
  cursor: pointer;
}
.ig-post-bg { width: 100%; height: 100%; display: flex; align-items: center; justify-content: center; font-size: 2.2rem; }
.ig-post-overlay {
  position: absolute; inset: 0;
  background: rgba(0,0,0,0.44);
  display: flex; align-items: center; justify-content: center;
  opacity: 0; transition: opacity var(--duration);
}
.ig-post:hover .ig-post-overlay { opacity: 1; }
.ig-post-overlay span { color: white; font-size: 1.5rem; }
.ig-cta { text-align: center; }
.ig-cta p { font-size: 0.88rem; color: var(--text-secondary); margin-bottom: 12px; }

/* ==============================
   TIKTOK PANEL
   ============================== */
.tt-panel { max-width: 780px; margin: 0 auto; }
.tt-profile-bar {
  display: flex; align-items: center; gap: 20px;
  background: #010101; border-radius: var(--radius-lg);
  padding: 24px; margin-bottom: 20px; color: white;
}
.tt-avatar {
  width: 68px; height: 68px; border-radius: 50%;
  background: linear-gradient(135deg,#69C9D0,#1a1a1a,#EE1D52);
  border: 2.5px solid #EE1D52;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.8rem; flex-shrink: 0;
}
.tt-handle { font-size: 1.05rem; font-weight: 700; margin-bottom: 3px; }
.tt-bio    { font-size: 0.84rem; color: rgba(255,255,255,0.58); }
.btn-tt-follow {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 9px 18px; border-radius: var(--radius-sm);
  background: #EE1D52; color: white; font-weight: 600; font-size: 0.84rem;
  margin-left: auto; flex-shrink: 0;
  transition: background var(--duration);
}
.btn-tt-follow:hover { background: #C5143E; }
.tt-videos-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
  margin-bottom: 20px;
}
.tt-video-card {
  background: #111;
  border-radius: var(--radius-md);
  overflow: hidden;
  aspect-ratio: 9/16;
  max-height: 260px;
  position: relative;
  cursor: pointer;
  transition: transform var(--duration) var(--ease);
}
.tt-video-card:hover { transform: scale(1.02); }
.tt-video-card:hover .tt-video-overlay { opacity: 1; }
.tt-video-bg { width: 100%; height: 100%; display: flex; align-items: center; justify-content: center; font-size: 2.8rem; }
.tt-video-overlay {
  position: absolute; inset: 0;
  background: rgba(0,0,0,0.5);
  display: flex; align-items: center; justify-content: center;
  opacity: 0; transition: opacity var(--duration);
}
.tt-play-btn {
  width: 50px; height: 50px; border-radius: 50%;
  background: #EE1D52; display: flex; align-items: center; justify-content: center;
  color: white; font-size: 1.3rem;
}
.tt-video-caption {
  position: absolute; bottom: 0; left: 0; right: 0;
  padding: 10px 12px;
  background: linear-gradient(transparent, rgba(0,0,0,0.85));
}
.tt-video-label { font-size: 0.74rem; color: white; font-weight: 500; line-height: 1.4; }
.tt-cta { text-align: center; }
.tt-cta p { font-size: 0.88rem; color: var(--text-secondary); margin-bottom: 12px; }

/* ── Responsive ── */
@media (max-width: 900px) {
  .yt-layout { grid-template-columns: 1fr; }
  .yt-sidebar-wrap { flex-direction: row; flex-wrap: wrap; }
  .yt-channel-badge, .yt-videos-card { flex: 1; min-width: 260px; }
}
@media (max-width: 600px) {
  .ig-grid { grid-template-columns: repeat(2, 1fr); }
  .tt-videos-grid { grid-template-columns: repeat(2, 1fr); }
  .ig-profile-bar, .tt-profile-bar { flex-wrap: wrap; }
  .btn-ig-follow, .btn-tt-follow { margin-left: 0; width: 100%; justify-content: center; }
}
@media (max-width: 400px) {
  .tt-videos-grid { grid-template-columns: 1fr; }
}
