/* Clean video player (.ytc) + aftermovie band + page-head images + video filters */
@layer components {
  .ytc { position: relative; aspect-ratio: 16/9; border-radius: var(--r); overflow: hidden; background: #000; isolation: isolate; box-shadow: 0 40px 90px -40px rgb(0 0 0 / .9), 0 0 0 1px rgb(255 255 255 / .08); cursor: pointer; }
  .ytc > img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform 1.4s var(--ease-out), opacity .6s; }
  .ytc:hover > img { transform: scale(1.03); }
  .ytc.is-live > img { opacity: 0; pointer-events: none; }
  /* the frame is oversized so YouTube's title bar and bottom strip are cropped away */
  .ytc-frame { position: absolute; left: 50%; top: 50%; width: 100%; height: 124%; transform: translate(-50%, -50%); border: 0; pointer-events: none; }
  .ytc::before { content: ""; position: absolute; inset: 0; z-index: 1; pointer-events: none; background: linear-gradient(to top, rgb(0 0 0 / .7), transparent 38%); opacity: 1; transition: opacity .4s; }
  .ytc.is-playing::before { opacity: 0; }
  .ytc.is-playing:hover::before { opacity: 1; }
  .ytc-play { position: absolute; inset: 0; z-index: 2; display: grid; place-items: center; }
  .ytc-play span { width: 76px; height: 76px; border-radius: 50%; background: rgb(255 255 255 / .08); backdrop-filter: blur(14px) saturate(160%); border: 1px solid rgb(255 255 255 / .25); box-shadow: inset 0 1px 0 rgb(255 255 255 / .35); display: grid; place-items: center; transition: transform .5s var(--ease-out), background .3s; }
  .ytc-play svg { width: 22px; height: 22px; fill: #fff; margin-left: 3px; }
  .ytc:hover .ytc-play span { transform: scale(1.08); background: var(--g-red); border-color: transparent; }
  .ytc.is-live .ytc-play { display: none; }
  .ytc .cap { position: absolute; left: 1.2rem; right: 1.2rem; bottom: 1.1rem; z-index: 2; display: flex; justify-content: space-between; align-items: flex-end; gap: 1rem; color: #fff; pointer-events: none; transition: opacity .4s, transform .4s; }
  .ytc .cap b { display: block; font-size: var(--t-small); font-weight: 600; }
  .ytc .cap small { font-size: var(--t-micro); letter-spacing: .22em; text-transform: uppercase; opacity: .7; }
  .ytc.is-live .cap { opacity: 0; transform: translateY(6px); }
  .ytc-bar { position: absolute; left: .8rem; right: .8rem; bottom: .8rem; z-index: 3; display: none; align-items: center; gap: .6rem; padding: .45rem .6rem .45rem .45rem; border-radius: 999px; background: rgb(10 8 9 / .55); backdrop-filter: blur(16px) saturate(160%); border: 1px solid rgb(255 255 255 / .14); box-shadow: inset 0 1px 0 rgb(255 255 255 / .18); transition: opacity .4s, transform .4s var(--ease-out); }
  .ytc.is-live .ytc-bar { display: flex; }
  .ytc.is-playing .ytc-bar { opacity: 0; transform: translateY(8px); }
  .ytc.is-playing:hover .ytc-bar, .ytc.is-playing:focus-within .ytc-bar { opacity: 1; transform: none; }
  .ytc-bar button { width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; color: #fff; flex: 0 0 auto; transition: background .3s; }
  .ytc-bar button:hover { background: rgb(255 255 255 / .12); }
  .ytc-bar button svg { width: 18px; height: 18px; fill: currentColor; }
  .ytc-bar [data-act=toggle] { background: var(--g-red); }
  .ytc .i-pause, .ytc.is-playing .i-play { display: none; }
  .ytc.is-playing .i-pause { display: block; }
  .ytc .i-mute, .ytc.is-muted .i-vol { display: none; }
  .ytc.is-muted .i-mute { display: block; }
  .ytc-time, .ytc-dur { font-size: .68rem; letter-spacing: .08em; color: rgb(255 255 255 / .8); font-variant-numeric: tabular-nums; min-width: 2.6em; text-align: center; }
  .ytc-track { flex: 1; height: 18px; display: flex; align-items: center; cursor: pointer; position: relative; }
  .ytc-track::before { content: ""; position: absolute; left: 0; right: 0; height: 3px; border-radius: 3px; background: rgb(255 255 255 / .18); }
  .ytc-track i { position: relative; display: block; height: 3px; width: 0; border-radius: 3px; background: var(--g-red); box-shadow: 0 0 10px var(--red-glow); transition: width .25s linear; }
  .ytc:fullscreen { border-radius: 0; aspect-ratio: auto; width: 100vw; height: 100vh; }
  .ytc:fullscreen .ytc-frame { height: 100%; width: 100%; }

  /* native file videos get the same frame */
  .vfile { position: relative; aspect-ratio: 16/9; border-radius: var(--r); overflow: hidden; background: #000; box-shadow: 0 40px 90px -40px rgb(0 0 0 / .9), 0 0 0 1px rgb(255 255 255 / .08); }
  .vfile video { width: 100%; height: 100%; object-fit: cover; display: block; }

  /* aftermovie: full-bleed, autoplaying muted, click for sound */
  .aftermovie { position: relative; margin-inline: var(--gutter); border-radius: 36px; overflow: hidden; background: #000; aspect-ratio: 21/9; min-height: 420px; isolation: isolate; box-shadow: 0 60px 140px -50px rgb(0 0 0 / .95), inset 0 1px 0 rgb(255 255 255 / .18), 0 0 0 1px rgb(255 255 255 / .06); }
  .aftermovie .ytc { position: absolute; inset: 0; aspect-ratio: auto; border-radius: 0; box-shadow: none; }
  .aftermovie .ytc-frame { height: 130%; }
  .aftermovie .ytc::before { background: linear-gradient(to top, rgb(0 0 0 / .85), rgb(0 0 0 / .2) 45%, rgb(0 0 0 / .35)), linear-gradient(105deg, rgb(216 15 26 / .25), transparent 55%); }
  .aftermovie .ytc.is-playing:not(.is-muted)::before { opacity: .25; }
  .aftermovie .am-copy { position: absolute; left: clamp(1.2rem, 4vw, 3.5rem); right: clamp(1.2rem, 4vw, 3.5rem); bottom: clamp(1.4rem, 4vw, 3.2rem); z-index: 4; display: flex; justify-content: space-between; align-items: flex-end; gap: 1.5rem; color: #fff; pointer-events: none; transition: opacity .5s, transform .5s var(--ease-out); }
  .aftermovie .am-copy h2 { font-size: clamp(2rem, 5vw, 4.6rem); font-weight: 700; letter-spacing: -.04em; line-height: .95; }
  .aftermovie .am-copy p { color: rgb(255 255 255 / .75); max-width: 44ch; margin-top: .6rem; }
  .aftermovie .am-copy .eyebrow { color: #fff; }
  .aftermovie .ytc.is-playing:not(.is-muted) ~ .am-copy { opacity: 0; transform: translateY(10px); }
  .aftermovie .ytc.is-playing:not(.is-muted):hover ~ .am-copy { opacity: 1; transform: none; }
  .aftermovie .ytc-play { place-items: end start; padding: clamp(1.4rem, 4vw, 3.2rem); }
  .aftermovie .ytc-play span { width: auto; height: auto; padding: .9rem 1.5rem .9rem 1.2rem; border-radius: 999px; display: inline-flex; align-items: center; gap: .7rem; font-weight: 600; font-size: var(--t-small); color: #fff; background: var(--g-red); border-color: transparent; }
  .aftermovie .ytc-play span::after { content: attr(data-label); }
  .aftermovie .ytc-play svg { width: 16px; height: 16px; margin: 0; }
  .aftermovie .ytc.is-live .ytc-play { display: grid; }
  .aftermovie .ytc.is-live:not(.is-muted) .ytc-play { display: none; }
  @media (max-width: 760px) { .aftermovie { aspect-ratio: 4/5; min-height: 0; margin-inline: 1rem; border-radius: 24px; } .aftermovie .am-copy { flex-direction: column; align-items: flex-start; } }

  /* video page: filters + grid */
  .vfilters { display: flex; gap: .4rem; flex-wrap: wrap; margin: var(--s-3) 0 var(--s-4); }
  .vfilters button { padding: .55rem 1rem; border-radius: 999px; border: 1px solid var(--line); color: var(--fg-2); font-size: var(--t-micro); letter-spacing: .2em; text-transform: uppercase; transition: color .3s, border-color .3s, background .3s; }
  .vfilters button.is-on, .vfilters button:hover { color: #fff; border-color: transparent; background: var(--g-red); }
  .vgrid { display: grid; grid-template-columns: repeat(2, 1fr); gap: var(--s-3); }
  .vgrid > [hidden] { display: none; }
  @media (max-width: 760px) { .vgrid { grid-template-columns: 1fr; } }

  /* page-head header image (from Admin > Faqet) */
  .page-head.has-image::after { content: ""; position: absolute; inset: 0; z-index: -1; background: var(--page-image) center 30% / cover no-repeat; opacity: .28; filter: grayscale(1) contrast(1.05); -webkit-mask: linear-gradient(#000, transparent 92%); mask: linear-gradient(#000, transparent 92%); }
}
@layer components {
  /* paused: our own dark cover and play button sit over whatever YouTube draws */
  .ytc.is-live:not(.is-playing)::before { opacity: 1; background: rgb(5 4 5 / .78); }
  .ytc.is-live:not(.is-playing) .ytc-play { display: grid; }
  .ytc.is-live:not(.is-playing) .ytc-bar { opacity: 1; transform: none; }
  .aftermovie .ytc.is-live.is-muted .ytc-play { display: grid; }
}
@layer components {
  /* the "watch with sound" pill and the title share the bottom-left corner;
     keep the text clear of the pill by reserving its height under the copy */
  .aftermovie .am-copy { padding-bottom: 4rem; }
  @media (max-width: 760px) {
    .aftermovie .am-copy { padding-bottom: 4.2rem; gap: .6rem; }
    .aftermovie .am-copy h2 { font-size: clamp(1.7rem, 8.5vw, 2.4rem); }
    .aftermovie .am-copy p { font-size: var(--t-small); max-width: none; }
    .aftermovie .ytc-play span { padding: .75rem 1.2rem .75rem 1rem; font-size: .8rem; }
  }
}
@layer components {
  /* phones: a 16:9 loop inside a tall box left black bars above and below.
     Let the muted loop cover the box (cropped at the sides, like a poster) and
     only open up to the full 16:9 frame once sound is on and people watch it. */
  @media (max-width: 760px) {
    .aftermovie { aspect-ratio: 1 / 1; transition: aspect-ratio .5s var(--ease-out); }
    .aftermovie .ytc-frame { width: auto; height: 130%; aspect-ratio: 16 / 9; }
    .aftermovie:has(.ytc.is-live:not(.is-muted)) { aspect-ratio: 16 / 9; }
    .aftermovie:has(.ytc.is-live:not(.is-muted)) .ytc-frame { width: 100%; height: 124%; aspect-ratio: auto; }
    .aftermovie:has(.ytc.is-live:not(.is-muted)) .am-copy { display: none; }
  }
}
