/* ==========================================================================
   Archie - mascot widget (partials/archie.php, decision 026). Loaded only where the
   widget renders. Site tokens from main.css; bottom-LEFT because the back-to-top button
   owns bottom-right (.to-top, z 60) and the consent banner spans the bottom (z 60).
   ========================================================================== */
.archie-launch[hidden],
.archie-panel[hidden],
.archie-panel__play[hidden] { display: none; }

.archie-launch {
  position: fixed; left: 22px; bottom: 22px; z-index: 61;
  display: inline-flex; align-items: center; gap: 10px;
  padding: 5px 18px 5px 5px; border: 1px solid rgba(163, 230, 53, 0.35); border-radius: var(--radius-full);
  background: var(--pitch-ink); color: #fff; cursor: pointer;
  font-family: var(--font-display); font-weight: 700; font-size: 0.98rem; letter-spacing: -0.01em;
  box-shadow: var(--shadow-lg);
  transition: transform 0.25s var(--ease), background 0.25s var(--ease);
}
.archie-launch:hover { transform: translateY(-2px); background: var(--pitch-deep); }
.archie-launch:focus-visible { outline: 3px solid var(--lime); outline-offset: 3px; }
.archie-launch[aria-expanded="true"] { background: var(--pitch-deep); }
/* still on purpose: an endless idle bob is an attention pulse (children's code std 13) and
   moving content with no pause control (WCAG 2.2.2) - pre-deploy review, 2026-09-27 */
.archie-launch__face { width: 46px; height: 46px; display: block; flex-shrink: 0; }

/* Never stack overlays (decision 023): step aside while the mobile menu is open, and on
   pages that carry their own fixed CTA bar (directory listings at <=920px), where the
   launcher would sit hidden under the bar but still take keyboard focus (WCAG 2.4.11).
   display:none also takes it out of the tab order. */
body:has(.nav.menu-open) .archie-launch,
body:has(.nav.menu-open) .archie-panel { visibility: hidden; }
@media (max-width: 920px) {
  body:has(.dir-mobile-cta) .archie-launch,
  body:has(.dir-mobile-cta) .archie-panel { display: none; }
}

.archie-panel {
  position: fixed; left: 22px; bottom: 88px; z-index: 62;
  width: min(360px, calc(100vw - 28px)); max-height: calc(100vh - 110px); overflow-y: auto;
  padding: 14px; box-sizing: border-box; border-radius: var(--radius-lg);
  background: var(--pitch-ink); border: 1px solid rgba(163, 230, 53, 0.3); color: #fff;
  box-shadow: 0 34px 90px -24px rgba(0, 0, 0, 0.55);
}
@supports (height: 100dvh) { .archie-panel { max-height: calc(100dvh - 110px); } }
.archie-panel__head { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.archie-panel__head img { width: 40px; height: 40px; flex-shrink: 0; }
.archie-panel__title { margin: 0; font-family: var(--font-display); font-weight: 800; font-size: 1.08rem; line-height: 1.2; color: #fff; }
.archie-panel__sub { margin: 2px 0 0; font-size: 0.82rem; color: #a6d3b6; }
.archie-panel__close {
  margin-left: auto; flex-shrink: 0; width: 40px; height: 40px;
  display: inline-flex; align-items: center; justify-content: center;
  border: 0; border-radius: var(--radius-full); background: rgba(255, 255, 255, 0.08); color: #fff; cursor: pointer;
}
.archie-panel__close:hover { background: rgba(255, 255, 255, 0.16); }
.archie-panel__close:focus-visible,
.archie-panel__play:focus-visible,
.archie-panel__video video:focus-visible { outline: 3px solid var(--lime); outline-offset: 2px; }

.archie-panel__video { position: relative; aspect-ratio: 1 / 1; border-radius: var(--radius); overflow: hidden; background: var(--pitch-deep); }
.archie-panel__video video { display: block; width: 100%; height: 100%; object-fit: cover; cursor: pointer; }
/* top-right: the video's own CTA pill + URL fill the lower middle of its last frame */
.archie-panel__play {
  position: absolute; right: 10px; top: 10px;
  display: inline-flex; align-items: center; gap: 8px; padding: 8px 16px;
  border: 0; border-radius: var(--radius-full); background: var(--lime); color: var(--pitch-ink); cursor: pointer;
  font-family: var(--font-display); font-weight: 800; font-size: 0.95rem;
  box-shadow: 0 14px 34px -12px rgba(163, 230, 53, 0.5);
}
.archie-panel__play-ic { display: none; line-height: 0; }
.archie-panel__play[data-mode="play"] .archie-panel__play-ic[data-when="play"],
.archie-panel__play[data-mode="replay"] .archie-panel__play-ic[data-when="replay"] { display: inline-flex; }

.archie-panel__cta { display: flex; justify-content: center; width: 100%; margin-top: 12px; box-sizing: border-box; }
.archie-panel .btn-primary { background: var(--lime); color: var(--pitch-ink); box-shadow: 0 14px 34px -12px rgba(163, 230, 53, 0.45); }
.archie-panel .btn-primary:hover { background: #b8f24e; }
.archie-panel__note { margin: 8px 0 0; text-align: center; font-size: 0.8rem; color: #a6d3b6; }

/* phones: face-only launcher (label stays as its accessible name), panel as a bottom sheet */
@media (max-width: 640px) {
  .archie-launch { left: 14px; bottom: 14px; padding: 4px; }
  .archie-launch__label { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
  .archie-panel { left: 12px; right: 12px; bottom: 76px; width: auto; }
}
@media print { .archie-launch, .archie-panel { display: none !important; } }
