/* ==========================================================================
   Block: Floating Video — persistent docked explainer player
   Collapsed: glass card (desktop) / brand icon button (mobile)
   Expanded:  player in place (desktop) / centred sheet over a frosted scrim (mobile)
   ========================================================================== */

.adm-fv {
  position: fixed;
  inset: 0;
  z-index: var(--z-modal);
  pointer-events: none; /* only the dock and, when open, the scrim take clicks */
}

.adm-fv[hidden] { display: none; }

.adm-fv__dock {
  position: absolute;
  bottom: clamp(16px, 3vw, 28px);
  pointer-events: auto;
  display: flex;
  align-items: flex-end;
  gap: var(--space-2);
}

.adm-fv--bottom-right .adm-fv__dock { right: clamp(16px, 3vw, 28px); }
.adm-fv--bottom-left  .adm-fv__dock { left:  clamp(16px, 3vw, 28px); }

/* Entrance — rises into place once the delay has elapsed. */
.adm-fv__dock {
  opacity: 0;
  transform: translateY(14px) scale(0.98);
  transition: opacity 0.45s ease, transform 0.45s cubic-bezier(0.22, 1, 0.36, 1);
}
.adm-fv.is-ready .adm-fv__dock { opacity: 1; transform: none; }

/* ── Collapsed trigger: glass card ───────────────────────────────────────── */
/* Thumbnail-led card: the poster does the work, so it reads as a video at a glance
   rather than as a notification chip. */
.adm-fv__trigger {
  display: flex;
  flex-direction: column;
  gap: 0;
  width: clamp(320px, 26vw, 400px);
  padding: 8px;
  text-align: left;
  cursor: pointer;
  font-family: inherit;
  border-radius: var(--radius-xl);
  border: 1px solid var(--glass-border);
  background: var(--glass-bg-strong);
  -webkit-backdrop-filter: blur(var(--glass-blur));
  backdrop-filter: blur(var(--glass-blur));
  box-shadow: var(--shadow-xl), 0 0 0 1px rgba(0, 0, 0, 0.02);
  transition: transform 0.25s cubic-bezier(0.22, 1, 0.36, 1), box-shadow 0.25s ease, border-color 0.25s ease;
}

.adm-fv__trigger:hover {
  transform: translateY(-3px);
  border-color: var(--color-border-brand, var(--color-brand));
  box-shadow: var(--shadow-xl), var(--shadow-glow);
}

.adm-fv__trigger:focus-visible {
  outline: 2px solid var(--color-brand);
  outline-offset: 3px;
}

.adm-fv__thumb {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: var(--color-brand-dim);
  display: grid;
  place-items: center;
}

.adm-fv__thumb img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.adm-fv__play {
  position: relative;
  display: grid;
  place-items: center;
  width: 58px;
  height: 58px;
  border-radius: var(--radius-full);
  background: var(--color-brand);
  color: #fff;
  box-shadow: 0 6px 20px rgba(var(--color-brand-rgb), 0.5);
  transition: transform 0.25s cubic-bezier(0.22, 1, 0.36, 1);
}
.adm-fv__play svg { width: 24px; height: 24px; margin-left: 3px; }
.adm-fv__trigger:hover .adm-fv__play { transform: scale(1.09); }

/* Soft pulse to draw the eye, once the card has settled. */
@media (prefers-reduced-motion: no-preference) {
  .adm-fv.is-ready:not(.is-open) .adm-fv__play::after {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: inherit;
    box-shadow: 0 0 0 0 rgba(var(--color-brand-rgb), 0.5);
    animation: adm-fv-pulse 2.8s ease-out infinite;
  }
}
@keyframes adm-fv-pulse {
  0%   { box-shadow: 0 0 0 0 rgba(var(--color-brand-rgb), 0.45); }
  70%  { box-shadow: 0 0 0 12px rgba(var(--color-brand-rgb), 0); }
  100% { box-shadow: 0 0 0 0 rgba(var(--color-brand-rgb), 0); }
}

/* Caption strip beneath the thumbnail. */
.adm-fv__meta {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--space-3);
  min-width: 0;
  padding: 10px 8px 4px;
}
.adm-fv__label {
  font-size: var(--font-size-base);
  font-weight: var(--font-weight-semibold);
  color: var(--color-text);
  line-height: 1.25;
}
.adm-fv__dur {
  flex: 0 0 auto;
  font-size: var(--font-size-xs);
  font-weight: var(--font-weight-medium);
  color: var(--color-brand);
  background: var(--color-brand-dim);
  padding: 3px 8px;
  border-radius: var(--radius-full);
  line-height: 1.2;
}

/* ── Dismiss ─────────────────────────────────────────────────────────────── */
.adm-fv__dismiss {
  position: absolute;
  top: -8px;
  right: -8px;
  width: 24px;
  height: 24px;
  display: grid;
  place-items: center;
  border-radius: var(--radius-full);
  border: 1px solid var(--color-border);
  background: #fff;
  color: var(--color-text-secondary);
  cursor: pointer;
  box-shadow: var(--shadow-lg);
  opacity: 0;
  transition: opacity 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}
.adm-fv__dismiss svg { width: 12px; height: 12px; }
.adm-fv__dock:hover .adm-fv__dismiss,
.adm-fv__dismiss:focus-visible { opacity: 1; }
.adm-fv__dismiss:hover { color: var(--color-brand); border-color: var(--color-brand); }
.adm-fv.is-open .adm-fv__dismiss { display: none; }

/* ── Expanded panel ──────────────────────────────────────────────────────── */
.adm-fv__panel {
  position: relative;
  width: min(720px, calc(100vw - 2 * clamp(16px, 3vw, 28px)));
  padding: 10px;
  border-radius: var(--radius-xl);
  border: 1px solid var(--glass-border);
  background: var(--glass-bg-strong);
  -webkit-backdrop-filter: blur(var(--glass-blur));
  backdrop-filter: blur(var(--glass-blur));
  box-shadow: var(--shadow-xl);
}
.adm-fv__panel[hidden] { display: none; }

.adm-fv__stage {
  position: relative;
  aspect-ratio: 16 / 9;
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: var(--color-brand-dim);
  display: grid;
  place-items: center;
}
.adm-fv__stage video,
.adm-fv__stage iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
  object-fit: cover;
}

.adm-fv__empty {
  padding: var(--space-6);
  margin: 0;
  text-align: center;
  font-size: var(--font-size-sm);
  color: var(--color-text-secondary);
}

.adm-fv__collapse {
  position: absolute;
  top: -10px;
  right: -10px;
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  border-radius: var(--radius-full);
  border: 1px solid var(--color-border);
  background: #fff;
  color: var(--color-text);
  cursor: pointer;
  box-shadow: var(--shadow-lg);
  transition: color 0.2s ease, border-color 0.2s ease;
}
.adm-fv__collapse svg { width: 15px; height: 15px; }
.adm-fv__collapse:hover { color: var(--color-brand); border-color: var(--color-brand); }

/* Open state: the trigger gives way to the panel. */
.adm-fv.is-open .adm-fv__trigger { display: none; }

/* ── Frosted scrim (light — the site never goes to a dark surface) ───────── */
.adm-fv__scrim {
  position: absolute;
  inset: 0;
  background: rgba(255, 255, 255, 0.72);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
  opacity: 0;
  transition: opacity 0.3s ease;
}
.adm-fv__scrim[hidden] { display: none; }
.adm-fv.is-open .adm-fv__scrim { pointer-events: auto; opacity: 1; }

/* ── Small screens: collapse to a single brand icon button ───────────────── */
@media (max-width: 767px) {
  .adm-fv__trigger {
    width: 56px;
    height: 56px;
    padding: 0;
    border-radius: var(--radius-full);
    background: var(--color-brand);
    border-color: var(--color-brand);
    justify-content: center;
    box-shadow: 0 8px 22px rgba(var(--color-brand-rgb), 0.38);
  }
  .adm-fv__thumb,
  .adm-fv__meta { display: none; }
  .adm-fv__trigger::before {
    content: "";
    width: 0;
    height: 0;
    border-style: solid;
    border-width: 9px 0 9px 15px;
    border-color: transparent transparent transparent #fff;
    margin-left: 3px;
  }
  .adm-fv__dismiss { opacity: 1; }

  /* Player becomes a centred sheet rather than a docked panel. */
  /* `inset: 0` already clears the corner offsets — do not re-declare them as `auto`
     afterwards or the centring collapses back to the top edge. */
  .adm-fv.is-open .adm-fv__dock {
    position: absolute;
    inset: 0;
    display: grid;
    place-items: center;
    padding: var(--space-4);
  }
  .adm-fv__panel { width: min(92vw, 520px); }
  .adm-fv__collapse { top: -14px; right: -6px; }
}

/* Very small screens — keep the button clear of the viewport edge. */
@media (max-width: 380px) {
  .adm-fv__dock { bottom: 14px; }
  .adm-fv--bottom-right .adm-fv__dock { right: 14px; }
  .adm-fv--bottom-left  .adm-fv__dock { left: 14px; }
}

@media (prefers-reduced-motion: reduce) {
  .adm-fv__dock,
  .adm-fv__trigger,
  .adm-fv__play,
  .adm-fv__scrim { transition: none; }
}
