/*
  Media Hub template family: /brand-videos and /tutorial-videos.
  Loads after: tailwind.css, site.css, launch.css, consumer-bar.css.
  Sections: Hero, Video grid, Video card, Video frame, Footer note, Public watch pages.
  Reuses tokens from site.css / launch.css (--navy, --forest, --teal, --mist, --line, --muted).
*/

/* ---------- Hero ---------- */
.media-page main:focus {
  outline: none;
}
.media-hero {
  background: var(--mist);
  border-block: 1px solid var(--line);
  padding-block: 48px 52px;
}
.media-hero h1 {
  max-width: 21ch;
  font-size: clamp(36px, 4.3vw, 62px);
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: -0.035em;
  text-wrap: balance;
}
.media-intro {
  max-width: 64ch;
  margin-top: 22px;
  color: var(--muted);
  font-size: 18px;
  line-height: 1.75;
}

/* ---------- Video grid ---------- */
.media-section {
  padding-block: 64px 88px;
}
.media-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 48px 32px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.media-grid--numbered {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

/* ---------- Video card ---------- */
.media-card {
  display: flex;
  flex-direction: column;
}
.media-title {
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: 6px;
  margin: 0 0 16px;
  font-size: 20px;
  font-weight: 600;
  line-height: 1.3;
  letter-spacing: -0.01em;
  text-wrap: balance;
}
.media-ep {
  color: var(--forest);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

/* ---------- Video frame ---------- */
.media-frame {
  position: relative;
  aspect-ratio: 16/9;
  overflow: hidden;
  border-radius: 16px;
  background: radial-gradient(
    120% 120% at 15% 10%,
    #24415f 0%,
    var(--navy) 55%,
    #0d1b2a 100%
  );
  box-shadow:
    0 1px 0 rgba(23, 40, 62, 0.06),
    0 10px 28px -14px rgba(23, 40, 62, 0.35);
}
.media-frame iframe,
.media-thumb {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
  object-fit: cover;
}
.media-play {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  width: 100%;
  height: 100%;
  padding: 0;
  border: 0;
  background: linear-gradient(
    180deg,
    rgba(13, 27, 42, 0) 40%,
    rgba(13, 27, 42, 0.45)
  );
  cursor: pointer;
}
.media-play-icon {
  width: 64px;
  height: 64px;
  padding: 18px 16px 18px 20px;
  border-radius: 50%;
  background: #fff;
  fill: var(--forest);
  box-shadow: 0 8px 24px -8px rgba(0, 0, 0, 0.5);
  transition:
    transform 0.2s ease,
    background-color 0.2s ease;
}
.media-play:hover .media-play-icon {
  transform: scale(1.08);
  background: var(--teal-tint);
}
.media-play:focus-visible {
  outline: 3px solid var(--teal);
  outline-offset: -3px;
}
.media-frame--soon {
  display: grid;
  place-items: center;
  align-content: center;
  gap: 14px;
}
.media-mark {
  width: 56px;
  height: 56px;
  object-fit: contain;
  opacity: 0.9;
}
.media-soon {
  padding: 6px 14px;
  border: 1px solid rgba(255, 255, 255, 0.35);
  border-radius: 999px;
  color: #fff;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.02em;
}

/* ---------- Footer note ---------- */
.media-more {
  margin-top: 56px;
  padding-top: 28px;
  border-top: 1px solid var(--line);
}

/* ---------- Public watch pages ---------- */
.watch-video-page main { min-width: 0; }
.watch-video-page .watch-content {
  min-width: 0;
  padding-block: clamp(28px, 5vw, 40px) clamp(56px, 9vw, 88px);
}
.watch-content h1 {
  max-width: 100%;
  margin: 0 0 clamp(20px, 4vw, 28px);
  color: var(--navy);
  font-size: clamp(28px, 4vw, 48px);
  line-height: 1.12;
  overflow-wrap: anywhere;
}
.watch-frame {
  position: relative;
  width: 100%;
  max-width: 100%;
  aspect-ratio: 16 / 9;
  min-height: 200px;
  overflow: hidden;
  border-radius: clamp(12px, 2vw, 18px);
  background: var(--navy);
}
.watch-frame iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}
.watch-frame--soon {
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 16px;
  color: white;
  font-weight: 600;
}
.watch-frame--soon img { opacity: .85; }

@media (max-width: 1199px) {
  .media-grid--numbered {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}
@media (max-width: 899px) {
  .media-grid,
  .media-grid--numbered {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
@media (max-width: 599px) {
  .media-hero {
    padding-block: 32px 36px;
  }
  .media-intro {
    font-size: 16.5px;
  }
  .media-section {
    padding-block: 40px 64px;
  }
  .media-grid,
  .media-grid--numbered {
    grid-template-columns: 1fr;
    gap: 36px;
  }
  .media-title {
    font-size: 19px;
  }
}
@media (prefers-reduced-motion: reduce) {
  .media-play-icon {
    transition: none;
  }
  .media-play:hover .media-play-icon {
    transform: none;
  }
}
