/* ==========================================================================
   Previously — cookie consent styles (shared/consent/consent.css)
   Tier 1 foundation · staged — pairs with consent.js
   Design law: Noir surfaces, Bone text, Signal Red accent, no gold, ever.
   Pill-first radii, near-black text on red fills, 44px touch targets.
   All colors reference design tokens with hardcoded fallbacks so the module
   survives even if tokens.css fails to load. Zero external references.
   ========================================================================== */

/* ---------- shared primitives ---------- */

.pv-consent-banner [hidden],
.pv-consent-overlay[hidden] { display: none !important; }

.pv-visually-hidden {
  position: absolute !important;
  width: 1px; height: 1px;
  margin: -1px; padding: 0; border: 0;
  clip: rect(0 0 0 0); clip-path: inset(50%);
  overflow: hidden; white-space: nowrap;
}

/* Buttons — same visual weight class, two honest styles (no dark patterns).
   Accept is Signal Red fill with NEAR-BLACK text (white-on-red is banned). */
.pv-btn {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 44px; min-width: 44px;
  padding: 12px 24px;
  border-radius: 999px; /* pill-first */
  font-family: var(--pv-sans, 'Inter', -apple-system, 'Segoe UI', sans-serif);
  font-size: 15px; font-weight: 600; line-height: 1.2;
  cursor: pointer; text-decoration: none;
  transition: transform .18s var(--pv-ease, cubic-bezier(.22,.8,.28,1)),
              box-shadow .18s var(--pv-ease, cubic-bezier(.22,.8,.28,1)),
              background-color .18s ease;
}
.pv-btn--accept {
  background: var(--pv-red, #ec4634);
  border: 2px solid var(--pv-red, #ec4634);
  color: var(--pv-noir, #0a0a0b); /* near-black on red — the law */
  box-shadow: var(--pv-shadow-btn, 0 10px 34px rgba(236,70,52,.35));
}
.pv-btn--accept:hover {
  background: var(--pv-red-ember, #ff6a52);
  border-color: var(--pv-red-ember, #ff6a52);
  transform: translateY(-1px);
}
.pv-btn--ghost {
  background: transparent;
  border: 2px solid rgba(244,239,230,.35);
  color: var(--pv-ivory, #f4efe6);
}
.pv-btn--ghost:hover {
  border-color: var(--pv-ivory, #f4efe6);
  background: rgba(244,239,230,.06);
  transform: translateY(-1px);
}
.pv-btn:focus-visible {
  outline: var(--pv-focus-outline, 2px solid #ec4634);
  outline-offset: 3px;
}

/* ---------- the banner ---------- */

.pv-consent-banner {
  position: fixed;
  left: 16px; bottom: 16px;
  z-index: var(--pv-z-consent, 90); /* token scale: above nav(50)/search(40), below modals(100) */
  max-width: 420px;
  padding: 22px 22px 20px;
  background: var(--pv-noir-2, #111113);
  color: var(--pv-ivory, #f4efe6);
  border: 1px solid var(--pv-rule, rgba(244,239,230,.12));
  border-radius: 20px;
  box-shadow: 0 24px 60px rgba(0,0,0,.55);
  animation: pv-consent-rise .45s var(--pv-ease, cubic-bezier(.22,.8,.28,1)) both;
}
@keyframes pv-consent-rise {
  from { transform: translateY(24px); opacity: 0; }
  to   { transform: translateY(0);    opacity: 1; }
}
.pv-consent-banner__title {
  margin: 0 0 8px;
  font-family: var(--pv-serif, 'Playfair Display', Georgia, serif);
  font-size: 21px; font-weight: 600; line-height: 1.25;
  color: var(--pv-ivory, #f4efe6);
}
.pv-consent-banner__text {
  margin: 0 0 16px;
  font-family: var(--pv-sans, 'Inter', -apple-system, 'Segoe UI', sans-serif);
  font-size: 14.5px; line-height: 1.55;
  color: var(--pv-ivory-dim, rgba(244,239,230,.62));
}
.pv-consent-banner__actions {
  display: flex; gap: 10px; flex-wrap: wrap;
}
.pv-consent-banner__actions .pv-btn { flex: 1 1 auto; }

/* Phone: full-width bottom sheet, thumb-reachable */
@media (max-width: 640px) {
  .pv-consent-banner {
    left: 0; right: 0; bottom: 0;
    max-width: none;
    border-radius: 20px 20px 0 0;
    border-left: 0; border-right: 0; border-bottom: 0;
    padding: 20px 20px calc(20px + env(safe-area-inset-bottom, 0px));
  }
}

/* ---------- preferences modal ---------- */

.pv-consent-overlay {
  position: fixed; inset: 0;
  z-index: var(--pv-z-consent, 90);
  display: flex; align-items: center; justify-content: center;
  padding: 20px;
  background: rgba(5,5,6,.72);
  backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
  animation: pv-consent-fade .25s ease both;
}
@keyframes pv-consent-fade { from { opacity: 0; } to { opacity: 1; } }

.pv-consent-modal {
  width: 100%; max-width: 480px;
  max-height: calc(100vh - 40px); max-height: calc(100dvh - 40px);
  overflow-y: auto;
  background: var(--pv-noir-2, #111113);
  color: var(--pv-ivory, #f4efe6);
  border: 1px solid var(--pv-rule, rgba(244,239,230,.12));
  border-radius: 20px;
  padding: 26px 26px 24px;
  box-shadow: 0 32px 80px rgba(0,0,0,.6);
  animation: pv-consent-rise .35s var(--pv-ease, cubic-bezier(.22,.8,.28,1)) both;
}
.pv-consent-modal__title {
  margin: 0 0 8px;
  font-family: var(--pv-serif, 'Playfair Display', Georgia, serif);
  font-size: 24px; font-weight: 600;
}
.pv-consent-modal__lede {
  margin: 0 0 18px;
  font-size: 14.5px; line-height: 1.55;
  color: var(--pv-ivory-dim, rgba(244,239,230,.62));
}

/* Two-switch list — real checkboxes, 44px+ hit rows */
.pv-consent-switch {
  display: flex; align-items: flex-start; gap: 14px;
  min-height: 44px;
  padding: 14px 4px;
  border-top: 1px solid var(--pv-rule, rgba(244,239,230,.12));
  cursor: pointer;
}
.pv-consent-switch:last-of-type { border-bottom: 1px solid var(--pv-rule, rgba(244,239,230,.12)); }
.pv-consent-switch input {
  position: absolute; opacity: 0; width: 1px; height: 1px; /* keep the real input, style the track */
}
.pv-consent-switch__track {
  flex: 0 0 auto;
  width: 52px; height: 30px; margin-top: 2px;
  border-radius: 999px;
  background: var(--pv-noir-3, #17171a);
  border: 1px solid rgba(244,239,230,.25);
  position: relative;
  transition: background-color .2s ease, border-color .2s ease;
}
.pv-consent-switch__track::after {
  content: ""; position: absolute;
  top: 3px; left: 3px; width: 22px; height: 22px;
  border-radius: 50%;
  background: var(--pv-ivory, #f4efe6);
  transition: transform .2s var(--pv-ease, cubic-bezier(.22,.8,.28,1));
}
.pv-consent-switch input:checked + .pv-consent-switch__track {
  background: var(--pv-red, #ec4634);
  border-color: var(--pv-red, #ec4634);
}
.pv-consent-switch input:checked + .pv-consent-switch__track::after { transform: translateX(22px); }
.pv-consent-switch input:disabled + .pv-consent-switch__track {
  opacity: .55; cursor: not-allowed;
}
.pv-consent-switch input:focus-visible + .pv-consent-switch__track {
  outline: var(--pv-focus-outline, 2px solid #ec4634);
  outline-offset: 3px;
}
.pv-consent-switch__text { display: block; }
.pv-consent-switch__text strong {
  display: block;
  font-size: 15px; font-weight: 600;
  color: var(--pv-ivory, #f4efe6);
}
.pv-consent-switch__text small {
  display: block; margin-top: 4px;
  font-size: 13.5px; line-height: 1.5;
  color: var(--pv-ivory-dim, rgba(244,239,230,.62));
}
.pv-consent-switch__locked {
  display: inline-block; margin-left: 8px;
  font-size: 11.5px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase;
  color: var(--pv-ivory-faint, rgba(244,239,230,.38));
}

.pv-consent-modal__legal {
  margin: 16px 0 20px;
  font-size: 13.5px;
  color: var(--pv-ivory-dim, rgba(244,239,230,.62));
}
.pv-consent-modal__legal a {
  color: var(--pv-ivory, #f4efe6);
  text-decoration: underline;
  text-decoration-color: var(--pv-red, #ec4634);
  text-underline-offset: 3px;
}
.pv-consent-modal__legal a:focus-visible {
  outline: var(--pv-focus-outline, 2px solid #ec4634);
  outline-offset: 2px;
}
.pv-consent-modal__actions { display: flex; gap: 10px; flex-wrap: wrap; }
.pv-consent-modal__actions .pv-btn { flex: 1 1 auto; }

/* Phone: modal becomes a bottom sheet */
@media (max-width: 640px) {
  .pv-consent-overlay { padding: 0; align-items: flex-end; }
  .pv-consent-modal {
    max-width: none; border-radius: 20px 20px 0 0;
    border-left: 0; border-right: 0; border-bottom: 0;
    max-height: 92vh; max-height: 92dvh;
    padding-bottom: calc(24px + env(safe-area-inset-bottom, 0px));
  }
}

/* ---------- click-to-load embed placeholder (static HTML, JS enhances) ---------- */

.pv-embed {
  position: relative;
  aspect-ratio: 16 / 9;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 12px; text-align: center;
  padding: 24px;
  background: var(--pv-noir-2, #111113);
  border: 1px dashed rgba(244,239,230,.28);
  border-radius: 16px;
  color: var(--pv-ivory, #f4efe6);
}
.pv-embed__provider {
  font-family: var(--pv-serif, 'Playfair Display', Georgia, serif);
  font-size: 17px; font-weight: 600;
}
.pv-embed__note {
  margin: 0; max-width: 34ch;
  font-size: 14px; line-height: 1.55;
  color: var(--pv-ivory-dim, rgba(244,239,230,.62));
}
.pv-embed__row { display: flex; gap: 10px; flex-wrap: wrap; justify-content: center; }
.pv-embed__watch {
  color: var(--pv-ivory, #f4efe6);
  font-size: 14px;
  text-decoration: underline; text-decoration-color: var(--pv-red, #ec4634);
  text-underline-offset: 3px;
  padding: 12px 8px; /* 44px-ish hit area alongside the button */
}
.pv-embed iframe {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  border: 0; border-radius: 16px;
}

/* ---------- reduced motion: appear, don't slide ---------- */
@media (prefers-reduced-motion: reduce) {
  .pv-consent-banner, .pv-consent-modal, .pv-consent-overlay { animation: none; }
  .pv-btn, .pv-consent-switch__track, .pv-consent-switch__track::after { transition: none; }
}

/* ---------- forced colors (Windows High Contrast): decoration steps aside ---------- */
@media (forced-colors: active) {
  .pv-consent-banner, .pv-consent-modal, .pv-embed { border: 1px solid ButtonText; }
  .pv-btn--accept { border: 2px solid ButtonText; forced-color-adjust: auto; }
  .pv-btn--ghost { border: 2px solid ButtonText; }
  .pv-consent-switch__track { border: 1px solid ButtonText; }
}

/* ---------- print: consent chrome never prints ---------- */
@media print {
  .pv-consent-banner, .pv-consent-overlay { display: none !important; }
}
