/* Video cards in the implementation guides. Added 19 Nov 2026 (Joseph asked for a play icon; Reece chose the side panel).
   A card is a link to the video on Loom. taf-video.js opens it in a side panel instead, with a Larger button.
   On a screen narrower than 1200 px, the video opens in a pop-out. Without the script, the link opens Loom in a new tab.
   The Loom player loads only after a click. Spec: docs/how-to-edit-a-guide.md, "Add a video". */

/* The card */
a.taf-video { display: flex; align-items: center; gap: var(--s4); margin: var(--s5) 0; padding: var(--s3);
  border: 1px solid var(--border); border-radius: 14px; background: #fff; color: inherit; text-decoration: none;
  box-shadow: 0 1px 2px rgba(1, 49, 128, .06); transition: border-color .15s, box-shadow .15s, transform .15s; }
a.taf-video:hover { text-decoration: none; border-color: var(--app-accent-text); box-shadow: 0 6px 20px rgba(1, 49, 128, .12); transform: translateY(-1px); }
a.taf-video:focus-visible { outline: 3px solid var(--app-accent-text); outline-offset: 2px; }
.taf-video__thumb { flex: none; width: 136px; aspect-ratio: 16 / 9; border-radius: 10px; background: var(--navy);
  display: grid; place-items: center; position: relative; overflow: hidden; }
.taf-video__thumb::before { content: ""; position: absolute; inset: 0;
  background: repeating-linear-gradient(0deg, rgba(255, 255, 255, .05) 0 1px, transparent 1px 12px); }
.taf-video__play { position: relative; width: 44px; height: 44px; border-radius: 50%; background: var(--app-accent);
  display: grid; place-items: center; box-shadow: 0 0 0 6px color-mix(in srgb, var(--app-accent) 28%, transparent); }
.taf-video__play svg { width: 22px; height: 22px; fill: var(--navy); margin-left: 3px; }
.taf-video__text { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.taf-video__kicker { font-size: 12px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: var(--app-accent-text); }
.taf-video__title { font-weight: 800; color: var(--heading); font-size: 17px; line-height: 1.3; }
.taf-video__note { color: var(--muted); font-size: 14px; }
.taf-video-pair { display: grid; grid-template-columns: 1fr 1fr; gap: var(--s3); margin: var(--s5) 0; }
.taf-video-pair a.taf-video { margin: 0; }
@media (max-width: 760px) { .taf-video-pair { grid-template-columns: 1fr; } .taf-video__thumb { width: 104px; } }

/* The player box, in the side panel and the pop-out */
.taf-vplayer { aspect-ratio: 16 / 9; background: #0B1220; border-radius: 10px; overflow: hidden; }
.taf-vplayer iframe { width: 100%; height: 100%; border: 0; display: block; }
.taf-vbar { display: flex; align-items: center; gap: var(--s3); margin-bottom: var(--s3); }
.taf-vbar__title { margin: 0; flex: 1; min-width: 0; font-weight: 800; color: var(--heading); font-size: 17px; line-height: 1.3; }
.taf-vbar__ext { font-size: 14px; white-space: nowrap; }
.taf-vbtn { flex: none; display: inline-flex; align-items: center; justify-content: center; gap: 6px; height: 40px; min-width: 40px;
  padding: 0 12px; border-radius: 999px; border: 1px solid var(--border); background: #fff; color: var(--heading);
  font: inherit; font-weight: 800; font-size: 14px; cursor: pointer; }
.taf-vbtn:hover { background: var(--bg-alt); }
.taf-vbtn:focus-visible { outline: 2px solid var(--taf-blue); outline-offset: 2px; }
.taf-vbtn svg { width: 18px; height: 18px; stroke: currentColor; stroke-width: 2.2; fill: none; stroke-linecap: round; stroke-linejoin: round; }
.taf-vbtn--close { padding: 0; width: 40px; }

/* Side panel. The guide moves left, so the panel covers no step. On a wide screen, taf-video.js widens the panel
   to fill the space beside the steps (19 Nov 2026, Reece: most admins use large monitors). */
:root { --vpanel-w: min(480px, 36vw); }
.taf-vpanel { position: fixed; z-index: 900; top: calc(var(--header-h) + 12px); right: 16px; width: var(--vpanel-w);
  background: #fff; border: 1px solid var(--border); border-radius: 16px; padding: var(--s4);
  box-shadow: 0 16px 40px rgba(1, 49, 128, .18); transform: translateX(calc(100% + 32px)); visibility: hidden; transition: transform .25s ease; }
.taf-vpanel.is-open { transform: none; visibility: visible; }
.taf-vpanel__note { margin: var(--s3) 0 0; font-size: 14px; color: var(--muted); }
body.taf-vpanel-open .taf-guide-section .taf-wrap { max-width: none; margin-left: 0; padding-right: calc(var(--vpanel-w) + 32px); }
.taf-vbtn .is-large-only { display: none; }
.taf-vpanel.is-large .taf-vbtn .is-large-only { display: inline; }
.taf-vpanel.is-large .taf-vbtn .is-small-only { display: none; }
.taf-vpanel.is-large .taf-vpanel__keep { display: none; }
/* Larger: the same player grows to fill the screen. It keeps playing, because it does not reload. */
.taf-vpanel.is-large { top: 50%; right: 50%; width: min(calc(100vw - 48px), calc((100vh - 160px) * 16 / 9 + 34px)); transform: translate(50%, -50%); z-index: 1000; }

/* Pop-out, on narrow screens */
.taf-vmodal { position: fixed; inset: 0; z-index: 1000; display: grid; place-items: center; padding: var(--s5); }
.taf-vmodal[hidden], .taf-vdim[hidden] { display: none; }
.taf-vdim { position: fixed; inset: 0; z-index: 950; background: rgba(1, 20, 58, .62); }
.taf-vmodal .taf-vdim { position: absolute; }
.taf-vmodal__box { position: relative; width: min(100%, calc((100vh - 160px) * 16 / 9 + 34px)); background: #fff; border-radius: 16px; padding: var(--s4);
  box-shadow: 0 24px 60px rgba(0, 0, 0, .35); }
@media (prefers-reduced-motion: reduce) { .taf-vpanel, a.taf-video { transition: none; } }
