/* ==========================================================================
   Community video watch page (/Community/Videos/{title}-{id})
   Dark "cinema" band with an ambient glow taken from the thumbnail, a
   click-to-load player, a chapter timeline and a lights-off mode.
   ========================================================================== */

.video-hero {
  --video-bg: #0a0a0f;
  --video-fg: #f4f2f8;
  --video-muted: rgba(244, 242, 248, .66);
  --video-accent: #9b7be0;
  --video-red: #e62117;
  position: relative;
  overflow: hidden;
  background: var(--video-bg);
  color: var(--video-fg);
  padding: 28px 0 30px;
  isolation: isolate;
}

  /* Blurred, saturated copy of the thumbnail behind everything ("ambient mode") */
  .video-hero-ambient {
    position: absolute;
    inset: -80px;
    z-index: -1;
    background-size: cover;
    background-position: center;
    filter: blur(70px) saturate(1.8) brightness(.55);
    opacity: .75;
    transform: scale(1.1);
    animation: video-ambient-breathe 14s ease-in-out infinite alternate;
  }

  .video-hero::after {
    content: "";
    position: absolute;
    inset: 0;
    z-index: -1;
    background: linear-gradient(180deg, rgba(10, 10, 15, .15) 0%, rgba(10, 10, 15, .55) 60%, var(--video-bg) 100%);
    pointer-events: none;
  }

@keyframes video-ambient-breathe {
  from {
    transform: scale(1.1) translate3d(-1.5%, -1%, 0);
  }

  to {
    transform: scale(1.18) translate3d(1.5%, 1%, 0);
  }
}

.video-hero-inner {
  position: relative;
}

/* ---- Player ------------------------------------------------------------- */

.video-stage {
  position: relative;
  max-width: 1100px;
  margin: 0 auto;
}

.video-player {
  position: relative;
  aspect-ratio: 16 / 9;
  border-radius: 16px;
  overflow: hidden;
  background: #000;
  box-shadow: 0 30px 80px -20px rgba(0, 0, 0, .9), 0 0 0 1px rgba(255, 255, 255, .06);
}

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

.video-facade {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  padding: 0;
  border: 0;
  background: #000;
  cursor: pointer;
}

  .video-facade img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform .6s ease, filter .3s ease;
  }

  .video-facade:hover img,
  .video-facade:focus-visible img {
    transform: scale(1.03);
    filter: brightness(.85);
  }

.video-facade-play {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 96px;
  height: 96px;
  margin: -48px 0 0 -48px;
  border-radius: 50%;
  background: rgba(10, 10, 15, .6);
  backdrop-filter: blur(6px);
  box-shadow: 0 0 0 4px rgba(255, 255, 255, .9);
  transition: transform .25s ease, background .25s ease;
}

  .video-facade-play::before {
    content: "";
    position: absolute;
    left: 37px;
    top: 28px;
    border-style: solid;
    border-width: 20px 0 20px 32px;
    border-color: transparent transparent transparent #fff;
  }

  /* A slow ripple so the button begs to be pressed */
  .video-facade-play::after {
    content: "";
    position: absolute;
    inset: -4px;
    border-radius: 50%;
    border: 2px solid rgba(255, 255, 255, .7);
    animation: video-ripple 2.4s ease-out infinite;
  }

.video-facade:hover .video-facade-play {
  transform: scale(1.1);
  background: var(--video-red);
}

/* Pressed play, waiting for YouTube's player to show up */
.video-facade.is-loading .video-facade-play {
  background: var(--video-red);
  animation: video-loading 0.9s ease-in-out infinite alternate;
}

@keyframes video-loading {
  from {
    transform: scale(.92);
  }

  to {
    transform: scale(1.08);
  }
}

@keyframes video-ripple {
  from {
    transform: scale(1);
    opacity: .8;
  }

  to {
    transform: scale(1.6);
    opacity: 0;
  }
}

.video-facade-duration,
.video-facade-resume {
  position: absolute;
  bottom: 14px;
  padding: 3px 9px;
  border-radius: 6px;
  background: rgba(0, 0, 0, .8);
  color: #fff;
  font-size: .85rem;
  font-weight: 600;
}

.video-facade-duration {
  right: 14px;
}

.video-facade-resume {
  left: 14px;
  background: var(--video-accent);
}

/* ---- Chapter timeline ---------------------------------------------------- */

.video-timeline {
  display: flex;
  gap: 3px;
  margin-top: 12px;
  height: 6px;
}

.video-timeline-seg {
  position: relative;
  flex-basis: 0;
  min-width: 4px;
  height: 100%;
  padding: 0;
  border: 0;
  border-radius: 3px;
  overflow: hidden;
  background: rgba(255, 255, 255, .18);
  transition: transform .15s ease, background .15s ease;
}

button.video-timeline-seg {
  cursor: pointer;
}

  button.video-timeline-seg:hover {
    transform: scaleY(1.8);
    background: rgba(255, 255, 255, .35);
  }

  .video-timeline-seg.is-current {
    background: rgba(255, 255, 255, .3);
  }

.video-timeline-fill {
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 0;
  background: linear-gradient(90deg, var(--video-accent), #c7b3ff);
  box-shadow: 0 0 10px rgba(155, 123, 224, .9);
}

/* ---- Meta under the player ---------------------------------------------- */

.video-hero-meta {
  max-width: 1100px;
  margin: 22px auto 0;
}

.video-kicker {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: .75rem;
  font-weight: 700;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--video-muted);
}

.video-kicker-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--video-red);
  box-shadow: 0 0 0 0 rgba(230, 33, 23, .7);
  animation: video-live-dot 2s infinite;
}

@keyframes video-live-dot {
  70% {
    box-shadow: 0 0 0 8px rgba(230, 33, 23, 0);
  }

  100% {
    box-shadow: 0 0 0 0 rgba(230, 33, 23, 0);
  }
}

.video-pill {
  padding: 1px 8px;
  border-radius: 999px;
  background: rgba(255, 255, 255, .14);
  color: var(--video-fg);
  letter-spacing: .06em;
}

.video-pill-warn {
  background: #b58100;
}

.video-hero .video-title {
  color: var(--video-fg);
  font-size: clamp(1.5rem, 3vw, 2.4rem);
  font-weight: 800;
  line-height: 1.15;
  margin: 8px 0 14px;
  text-wrap: balance;
}

.video-byline {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 22px;
}

.video-channel {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--video-fg);
  font-weight: 700;
  text-decoration: none;
}

  .video-channel:hover {
    color: #fff;
    text-decoration: underline;
  }

.video-channel-avatar {
  display: inline-grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--video-accent), var(--video-red));
  color: #fff;
  font-weight: 800;
}

.video-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 18px;
  margin: 0;
  padding: 0;
  list-style: none;
  color: var(--video-muted);
  font-size: .92rem;
}

  .video-stats li,
  .video-stats li * {
    color: inherit;
  }

.video-stat-icon {
  margin-right: 6px;
  opacity: .8;
}

.video-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 18px;
}

.video-action {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 16px;
  border: 1px solid rgba(255, 255, 255, .16);
  border-radius: 999px;
  background: rgba(255, 255, 255, .08);
  color: var(--video-fg);
  font-size: .9rem;
  font-weight: 600;
  text-decoration: none;
  backdrop-filter: blur(6px);
  transition: background .2s ease, transform .2s ease, opacity .45s ease;
}

  .video-action:hover,
  .video-action:focus-visible {
    background: rgba(255, 255, 255, .18);
    color: #fff;
    transform: translateY(-1px);
  }

.video-action-yt:hover {
  background: var(--video-red);
  border-color: var(--video-red);
}

/* ---- Shorts: vertical player beside the details on wide screens -------- */

.video-hero.is-short .video-hero-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 28px 48px;
}

.video-hero.is-short .video-stage {
  width: min(380px, 100%);
  margin: 0;
}

.video-hero.is-short .video-player {
  aspect-ratio: 9 / 16;
  max-height: 78vh;
}

.video-hero.is-short .video-hero-meta {
  flex: 1 1 320px;
  max-width: 560px;
  margin: 0;
}

/* ---- Lights off --------------------------------------------------------- */

.video-lights-overlay {
  position: fixed;
  inset: 0;
  z-index: 1040;
  background: rgba(0, 0, 0, .92);
  opacity: 0;
  pointer-events: none;
  transition: opacity .45s ease;
}

body.video-lights-out .video-lights-overlay {
  opacity: 1;
  pointer-events: auto;
  cursor: pointer;
}

/* The hero is its own stacking context (isolation), so lift the whole band over the
   overlay and fade everything in it except the player and the lights switch */
body.video-lights-out .video-hero {
  z-index: 1041;
}

.video-hero-ambient,
.video-hero-meta > * {
  transition: opacity .45s ease;
}

body.video-lights-out .video-hero-ambient {
  opacity: .12;
}

body.video-lights-out .video-hero-meta > *:not(.video-actions),
body.video-lights-out .video-action:not(#video-lights) {
  opacity: .12;
}

body.video-lights-out .video-player {
  box-shadow: 0 0 120px 10px rgba(155, 123, 224, .35), 0 0 0 1px rgba(255, 255, 255, .08);
}

/* ---- Description -------------------------------------------------------- */

.video-description-card {
  padding: 18px 20px;
  border-radius: 14px;
  background: #f4f3f7;
}

.video-description-head {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 8px;
  margin-bottom: 10px;
  font-size: .9rem;
  color: #555;
}

.video-description {
  position: relative;
  line-height: 1.6;
  overflow-wrap: anywhere;
}

  .video-description.is-collapsed {
    max-height: 9.6em;
    overflow: hidden;
  }

    .video-description.is-collapsed::after {
      content: "";
      position: absolute;
      left: 0;
      right: 0;
      bottom: 0;
      height: 3.2em;
      background: linear-gradient(rgba(244, 243, 247, 0), #f4f3f7);
    }

.video-description-toggle {
  margin-top: 6px;
  padding: 0;
  border: 0;
  background: none;
  font-weight: 700;
  color: #222;
}

  .video-description-toggle:hover {
    text-decoration: underline;
  }

/* Timestamps anywhere on the page (description and comments) seek the player */
a.video-ts {
  padding: 0 4px;
  border-radius: 4px;
  background: rgba(68, 46, 95, .1);
  color: #442e5f;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  text-decoration: none;
}

  a.video-ts:hover {
    background: #442e5f;
    color: #fff;
  }

  a.video-ts::before {
    content: "\25B6\FE0E ";
    font-size: .7em;
    vertical-align: 1px;
  }

.video-hashtag {
  color: #3b5cb8;
}

.video-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 14px;
}

.video-tag {
  padding: 3px 10px;
  border-radius: 999px;
  background: #fff;
  border: 1px solid #ddd;
  color: #444;
  font-size: .82rem;
  text-decoration: none;
  transition: border-color .2s ease, color .2s ease;
}

  .video-tag:hover {
    border-color: #442e5f;
    color: #442e5f;
  }

/* ---- Sidebar ------------------------------------------------------------ */

.video-side-card {
  margin-bottom: 18px;
  padding: 16px;
  border-radius: 14px;
  border: 1px solid #ebe9f0;
  background: #fff;
}

.video-side-title {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
  font-size: 1.05rem;
  font-weight: 800;
  color: #222;
}

.video-side-count {
  padding: 0 8px;
  border-radius: 999px;
  background: #442e5f;
  color: #fff;
  font-size: .75rem;
}

.video-chapters {
  margin: 0;
  padding: 0;
  list-style: none;
  max-height: 420px;
  overflow-y: auto;
}

.video-chapter {
  position: relative;
  display: flex;
  gap: 10px;
  padding: 7px 10px;
  border-radius: 8px;
  color: #333;
  text-decoration: none;
  transition: background .15s ease;
}

  .video-chapter:hover {
    background: #f4f3f7;
    color: #000;
  }

  .video-chapter.is-current {
    background: #442e5f;
    color: #fff;
  }

    .video-chapter.is-current .video-chapter-time {
      color: #d9ccff;
    }

.video-chapter-time {
  flex: 0 0 auto;
  min-width: 44px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: #442e5f;
}

.video-mini {
  display: flex;
  gap: 10px;
  padding: 6px;
  margin: 0 -6px 4px;
  border-radius: 10px;
  color: #222;
  text-decoration: none;
  transition: background .15s ease;
}

  .video-mini:hover {
    background: #f4f3f7;
    color: #000;
  }

.video-mini-thumb {
  position: relative;
  flex: 0 0 140px;
  aspect-ratio: 16 / 9;
  border-radius: 8px;
  overflow: hidden;
  background: #111;
}

  .video-mini-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
  }

  .video-mini-thumb .content-card-duration {
    right: 4px;
    bottom: 4px;
    font-size: .7rem;
  }

.video-mini-body {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.video-mini-title {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  font-weight: 700;
  font-size: .92rem;
  line-height: 1.3;
}

.video-mini-meta {
  margin-top: 4px;
  font-size: .8rem;
  color: #6c757d;
}

/* ---- Video listing (/Community/Videos) ----------------------------------- */

.video-feature {
  --video-fg: #f4f2f8;
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr);
  gap: 28px;
  align-items: center;
  padding: 26px;
  margin-bottom: 28px;
  border-radius: 20px;
  overflow: hidden;
  isolation: isolate;
  background: #0a0a0f;
  color: var(--video-fg);
  text-decoration: none;
}

  .video-feature:hover {
    color: var(--video-fg);
  }

  .video-feature .video-hero-ambient {
    inset: -60px;
  }

.video-feature-thumb {
  position: relative;
  aspect-ratio: 16 / 9;
  border-radius: 14px;
  overflow: hidden;
  box-shadow: 0 24px 60px -18px rgba(0, 0, 0, .9);
}

  .video-feature-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform .6s ease;
  }

.video-feature:hover .video-feature-thumb img {
  transform: scale(1.04);
}

.video-feature:hover .video-facade-play {
  transform: scale(1.1);
  background: #e62117;
}

.video-feature-label {
  font-size: .75rem;
  font-weight: 700;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: rgba(244, 242, 248, .66);
}

.video-feature-title {
  margin: 8px 0 10px;
  font-size: clamp(1.3rem, 2.4vw, 2rem);
  font-weight: 800;
  line-height: 1.2;
  color: var(--video-fg);
}

.video-feature-text {
  color: rgba(244, 242, 248, .75);
  margin-bottom: 14px;
}

.video-feature-cta {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 18px;
  border-radius: 999px;
  background: #fff;
  color: #0a0a0f;
  font-weight: 700;
}

@media (max-width: 767.98px) {

  .video-hero {
    padding: 0 0 22px;
  }

    .video-hero > .container {
      padding-left: 0;
      padding-right: 0;
    }

  .video-player {
    border-radius: 0;
  }

  .video-timeline {
    margin: 8px 12px 0;
  }

  .video-hero-meta {
    padding: 0 16px;
  }

  .video-hero.is-short .video-stage {
    width: 100%;
  }

  .video-hero.is-short .video-player {
    max-height: 82vh;
    margin: 0 auto;
  }

  .video-feature {
    grid-template-columns: 1fr;
    padding: 16px;
  }

  .video-mini-thumb {
    flex-basis: 120px;
  }
}

@media (prefers-reduced-motion: reduce) {

  .video-hero-ambient,
  .video-facade-play::after,
  .video-kicker-dot {
    animation: none;
  }
}
