/**
 * Video templates — shared styles.
 *
 * Layers on top of home-test/base.css: reuses the --ht-* tokens, header,
 * footer, and button vocabulary. Everything here is scoped to .vd-vid.
 */

/*
 * The two veils are derived from --ht-ivory rather than restating it: they were
 * frozen at rgba(244, 239, 229, …), the pre-Figma ivory, and drifted the moment
 * the token moved to #F7F3EA. --vid-rule is the matching hairline for the light
 * grounds (ivory / white), warm rather than the cool rgba(24, 24, 27, …) that
 * came from the retired --ht-text.
 */
.vd-vid {
  --vid-hairline: color-mix(in srgb, var(--ht-ivory) 16%, transparent);
  --vid-dim: color-mix(in srgb, var(--ht-ivory) 72%, transparent);
  --vid-rule: color-mix(in srgb, var(--ht-brown) 24%, transparent);
  --vid-radius: 2px;
}

/* ── Layout primitives ───────────────────────────────────────── */

.vd-vid .vid-container {
  width: 100%;
  max-width: 1440px;
  margin-inline: auto;
  padding-inline: clamp(24px, 8.93vw, 50px);
}

.vd-vid .vid-container--narrow {
  max-width: 900px;
}

/* Dark sections sit under the transparent site header. */
.vd-vid .vid-feature-hero,
.vd-vid .vid-short {
  background: var(--ht-dark);
  color: var(--ht-white);
}

.vd-vid .vid-feature-hero h1,
.vd-vid .vid-short h1 {
  color: var(--ht-white);
}

/* ── Player ──────────────────────────────────────────────────── */

.vd-vid .vid-player {
  position: relative;
  overflow: hidden;
  width: 100%;
  border-radius: var(--vid-radius);
  background: var(--ht-dark);
}

.vd-vid .vid-player--landscape {
  aspect-ratio: 16 / 9;
}

.vd-vid .vid-player--vertical {
  aspect-ratio: 9 / 16;
}

.vd-vid .vid-player__embed,
.vd-vid .vid-player__video,
.vd-vid .vid-player iframe {
  display: block;
  width: 100%;
  height: 100%;
  border: 0;
}

.vd-vid .vid-player__video {
  object-fit: cover;
}

/* Click-to-load poster: the whole thing is one button. */
.vd-vid .vid-player__poster {
  position: relative;
  display: block;
  width: 100%;
  height: 100%;
  padding: 0;
  border: 0;
  background: var(--ht-dark);
  cursor: pointer;
}

.vd-vid .vid-player__thumb {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 400ms ease, opacity 300ms ease;
}

.vd-vid .vid-player__poster:hover .vid-player__thumb,
.vd-vid .vid-player__poster:focus-visible .vid-player__thumb {
  opacity: 0.82;
  transform: scale(1.02);
}

.vd-vid .vid-player__poster:focus-visible {
  outline: 3px solid var(--ht-gold);
  outline-offset: 3px;
}

.vd-vid .vid-player__play {
  position: absolute;
  top: 50%;
  left: 50%;
  display: grid;
  width: clamp(64px, 6vw, 88px);
  height: clamp(64px, 6vw, 88px);
  place-items: center;
  border-radius: 50%;
  background: var(--ht-gold);
  color: var(--ht-dark);
  box-shadow: 0 12px 40px color-mix(in srgb, var(--ht-dark) 45%, transparent);
  transform: translate(-50%, -50%);
  transition: background-color 200ms ease, transform 200ms ease;
}

.vd-vid .vid-player__play svg {
  width: 44%;
  height: 44%;
  margin-left: 6%;
}

.vd-vid .vid-player__poster:hover .vid-player__play,
.vd-vid .vid-player__poster:focus-visible .vid-player__play {
  background: var(--ht-white);
  transform: translate(-50%, -50%) scale(1.06);
}

.vd-vid .vid-player__duration {
  position: absolute;
  right: 14px;
  bottom: 14px;
  padding: 5px 10px;
  border-radius: var(--vid-radius);
  background: color-mix(in srgb, var(--ht-dark) 78%, transparent);
  color: var(--ht-white);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.4px;
  line-height: 1.4;
}

/* Same shape and weight as .ht-btn — it is a button in everything but class. */
.vd-vid .vid-player__fallback {
  position: absolute;
  bottom: 20px;
  left: 20px;
  padding: 12px 22px;
  border-radius: var(--ht-radius);
  background: var(--ht-gold);
  color: var(--ht-text);
  font-size: var(--ht-fs-btn);
  font-weight: 600;
  line-height: var(--ht-lh-btn);
  text-decoration: none;
}

/* Editor-only placeholder when no video has been set. */
.vd-vid .vid-player--empty {
  display: grid;
  place-items: center;
  padding: 24px;
  border: 2px dashed var(--ht-gold);
  background: color-mix(in srgb, var(--ht-gold) 8%, transparent);
  color: var(--ht-white);
  text-align: center;
}

.vd-vid .vid-player--empty p {
  max-width: 34ch;
  margin: 0;
  font-size: 15px;
}

/* ── Meta row ────────────────────────────────────────────────── */

.vd-vid .vid-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 28px;
  margin: 0;
  padding: 0;
  list-style: none;
  color: var(--vid-dim);
  font-size: 14px;
  font-weight: 600;
}

.vd-vid .vid-meta__item {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.vd-vid .vid-meta__icon {
  width: 18px;
  height: 18px;
  flex: 0 0 auto;
  color: var(--ht-gold);
}

/* ── Highlights ──────────────────────────────────────────────── */

.vd-vid .vid-highlights__heading {
  margin-bottom: 20px;
  font-size: clamp(1.25rem, 1.5vw, 1.5rem);
  line-height: 1.25;
}

.vd-vid .vid-highlights__list {
  display: grid;
  gap: 18px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.vd-vid .vid-highlights--grid .vid-highlights__list {
  gap: 20px;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
}

.vd-vid .vid-highlights__item {
  display: flex;
  gap: 16px;
  align-items: flex-start;
}

.vd-vid .vid-highlights--grid .vid-highlights__item {
  padding: 22px;
  border-left: 3px solid var(--ht-gold);
  background: var(--ht-ivory);
}

.vd-vid .vid-highlights__marker {
  flex: 0 0 auto;
  color: var(--ht-gold);
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 1px;
  line-height: 1.6;
}

.vd-vid .vid-highlights__body {
  min-width: 0;
}

.vd-vid .vid-highlights__title {
  margin: 0;
  font-size: 1.0625rem;
  font-weight: 700;
  line-height: 1.4;
}

.vd-vid .vid-highlights__text {
  margin: 6px 0 0;
  font-size: 0.9375rem;
  line-height: 1.6;
  opacity: 0.85;
}

/* ── Prose ───────────────────────────────────────────────────── */

.vd-vid .vid-prose {
  color: var(--ht-text);
  font-size: 1.0625rem;
  line-height: 1.75;
}

.vd-vid .vid-prose > *:first-child {
  margin-top: 0;
}

.vd-vid .vid-prose h2 {
  margin-top: 40px;
  margin-bottom: 14px;
  font-size: clamp(1.5rem, 2vw, 1.875rem);
}

.vd-vid .vid-prose h3 {
  margin-top: 32px;
  margin-bottom: 10px;
  font-size: 1.25rem;
}

.vd-vid .vid-prose p,
.vd-vid .vid-prose ul,
.vd-vid .vid-prose ol {
  margin-bottom: 20px;
}

.vd-vid .vid-prose a {
  color: var(--ht-gold-deep);
  text-underline-offset: 3px;
}

.vd-vid .vid-editor-content {
  padding-block: clamp(48px, 6vw, 80px);
}

.vd-vid .vid-editor-content:empty {
  display: none;
}

/* ── Transcript ──────────────────────────────────────────────── */

.vd-vid .vid-transcript-section {
  padding-block: clamp(40px, 5vw, 64px);
  background: var(--ht-ivory);
}

.vd-vid .vid-transcript {
  border-top: 1px solid var(--vid-rule);
  border-bottom: 1px solid var(--vid-rule);
}

.vd-vid .vid-transcript__summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-block: 24px;
  cursor: pointer;
  gap: 20px;
  list-style: none;
}

.vd-vid .vid-transcript__summary::-webkit-details-marker {
  display: none;
}

.vd-vid .vid-transcript__summary:focus-visible {
  outline: 3px solid var(--ht-gold);
  outline-offset: 4px;
}

.vd-vid .vid-transcript__heading {
  margin: 0;
  font-size: clamp(1.25rem, 1.6vw, 1.5rem);
}

/* Chevron rotates when the panel opens. */
.vd-vid .vid-transcript__hint {
  width: 14px;
  height: 14px;
  flex: 0 0 auto;
  border-right: 2px solid var(--ht-gold);
  border-bottom: 2px solid var(--ht-gold);
  transform: rotate(45deg) translate(-3px, -3px);
  transition: transform 200ms ease;
}

.vd-vid .vid-transcript[open] .vid-transcript__hint {
  transform: rotate(225deg) translate(-3px, -3px);
}

.vd-vid .vid-transcript__body {
  max-width: 76ch;
  padding-bottom: 32px;
  color: var(--ht-muted);
  font-size: 1rem;
  line-height: 1.8;
}

.vd-vid .vid-transcript__body p {
  margin-bottom: 16px;
}

/* ── Closing CTA band ────────────────────────────────────────── */

/*
 * Left alone deliberately. The token move turned this from a near-flat
 * #241A10 -> #14100B wash into a real brown -> black ramp, which looks like a
 * regression until you notice mid.css:297 draws the same #4B3D2A -> #000000
 * gradient straight from the Figma frame. The band now matches the design's
 * own gradient rather than a muted approximation of it.
 */
.vd-vid .vid-cta {
  padding-block: clamp(56px, 6vw, 88px);
  background: linear-gradient(180deg, var(--ht-brown) 0%, var(--ht-dark) 100%);
  color: var(--ht-white);
}

.vd-vid .vid-cta__inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 32px;
}

.vd-vid .vid-cta__copy {
  max-width: 640px;
}

/* Plain `.vd-ht h2` at 30/44, in --ht-beige — the design's colour for a heading
   on a dark ground, and exactly what `.ht-cta-band h2` uses. Was 34.6px white. */
.vd-vid .vid-cta__heading {
  margin-bottom: 12px;
  color: var(--ht-beige);
}

.vd-vid .vid-cta__text {
  margin: 0;
  color: var(--vid-dim);
  font-size: var(--ht-fs-body);
  font-weight: 300;
  line-height: var(--ht-lh-body);
}

.vd-vid .vid-cta__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
}

.vd-vid .vid-cta .ht-btn-outline {
  color: var(--ht-white);
}

/* ── Motion preferences ──────────────────────────────────────── */

@media (prefers-reduced-motion: reduce) {
  .vd-vid .vid-player__thumb,
  .vd-vid .vid-player__play,
  .vd-vid .vid-transcript__hint {
    transition: none;
  }

  .vd-vid .vid-player__poster:hover .vid-player__thumb {
    transform: none;
  }
}
