@charset "UTF-8";
/* =========================================================
   Verdandi Weaver — Cookie banner, preference panel, and
   external-media placeholders. Reuses tokens from tokens.css;
   introduces no new colors, fonts, or radii.
   ========================================================= */

/* ------------------ First-layer banner ------------------ */
.vw-consent-banner {
  position: fixed;
  left: 0; right: 0; bottom: 0;
  z-index: 200;
  background: var(--c-bg-elev);
  border-top: var(--border-hairline);
  box-shadow: var(--shadow-lg);
  padding: var(--sp-5) var(--sp-5) calc(var(--sp-5) + env(safe-area-inset-bottom, 0px));
}
.vw-consent-banner__inner {
  max-width: var(--container);
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1fr auto;
  column-gap: var(--sp-6);
  row-gap: var(--sp-4);
  align-items: start;
}
.vw-consent-banner__text { grid-column: 1; }
.vw-consent-banner__title {
  font-family: var(--font-display);
  font-size: var(--fs-md);
  color: var(--c-ink);
  margin-bottom: var(--sp-2);
}
.vw-consent-banner__body {
  font-size: var(--fs-sm);
  line-height: var(--lh-body);
  color: var(--c-ink-soft);
  max-width: 68ch;
}
.vw-consent-banner__actions {
  grid-column: 2;
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-3);
  align-items: center;
  justify-content: flex-end;
}
/* Accept and Reject must carry equal visual weight: same size, same
   padding, same border-radius — only the fill color differs. */
.vw-consent-banner__actions .btn { white-space: nowrap; }
.vw-consent-banner__link {
  grid-column: 1 / -1;
  font-size: var(--fs-xs);
  color: var(--c-ink-mute);
  text-decoration: underline;
  text-underline-offset: 3px;
  justify-self: start;
}
.vw-consent-banner__link:hover { color: var(--c-ink); }

@media (max-width: 760px) {
  .vw-consent-banner__inner { grid-template-columns: 1fr; }
  .vw-consent-banner__actions { grid-column: 1; justify-content: stretch; }
  .vw-consent-banner__actions .btn { flex: 1 1 auto; justify-content: center; }
  .vw-consent-banner__link { grid-column: 1; }
}

/* ------------------ Overlay + panel (second layer) ------------------ */
.vw-consent-overlay {
  position: fixed; inset: 0;
  background: oklch(15% 0.01 160 / 0.45);
  z-index: 210;
}
.vw-consent-panel {
  position: fixed;
  left: 50%; top: 50%;
  transform: translate(-50%, -50%);
  z-index: 220;
  width: min(640px, calc(100vw - var(--sp-6)));
  max-height: min(88vh, 900px);
  overflow-y: auto;
  background: var(--c-bg-elev);
  border: var(--border-hairline);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
}
.vw-consent-panel__inner { padding: var(--sp-6); }
.vw-consent-panel__head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--sp-4);
  margin-bottom: var(--sp-4);
}
.vw-consent-panel__close { flex-shrink: 0; }
.vw-consent-panel__intro {
  color: var(--c-ink-soft);
  line-height: var(--lh-body);
  margin-bottom: var(--sp-5);
}

.vw-consent-categories {
  list-style: none;
  margin: 0 0 var(--sp-5);
  padding: 0;
  display: flex;
  flex-direction: column;
}
.vw-consent-category {
  padding: var(--sp-4) 0;
  border-top: var(--border-hairline);
}
.vw-consent-category:first-child { border-top: none; }
.vw-consent-category__row {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
}
.vw-consent-category__label {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  font-family: var(--font-body);
  font-weight: 500;
  color: var(--c-ink);
  cursor: pointer;
}
.vw-consent-category__row input[type="checkbox"] {
  /* Real control lives here for screen readers / keyboard; the visual
     switch is the <span> the label already renders. */
  position: absolute;
  width: 1px; height: 1px;
  margin: -1px; padding: 0;
  overflow: hidden;
  clip: rect(0,0,0,0);
  white-space: nowrap;
  border: 0;
}
.vw-consent-category__row > .t-meta { margin-left: auto; }
.vw-consent-category__desc {
  margin-top: var(--sp-2);
  line-height: var(--lh-body);
}

/* Toggle switch — built from a checkbox + two spans, tokens only */
.vw-switch {
  --sw-w: 42px; --sw-h: 24px;
  position: relative;
  display: inline-block;
  width: var(--sw-w); height: var(--sw-h);
  border-radius: var(--radius-pill);
  background: var(--c-bg-sunk);
  border: var(--border-hairline);
  flex-shrink: 0;
  transition: background-color 0.2s ease;
}
.vw-switch__thumb {
  position: absolute;
  top: 2px; left: 2px;
  width: calc(var(--sw-h) - 6px); height: calc(var(--sw-h) - 6px);
  border-radius: 50%;
  background: var(--c-bg-elev);
  box-shadow: var(--shadow-sm);
  transition: transform 0.2s ease;
}
/* The checkbox is a sibling of the label (not nested inside it) so the
   visible switch can stay perfectly circular while the real control
   keeps a normal, screen-reader-friendly hit target — so :has() here
   is scoped to their shared parent row, not the label itself. */
.vw-consent-category__row:has(input:checked) .vw-switch {
  background: var(--c-accent);
}
.vw-consent-category__row:has(input:checked) .vw-switch__thumb {
  transform: translateX(calc(var(--sw-w) - var(--sw-h)));
}
.vw-switch--locked { background: var(--c-accent); opacity: 0.55; }
.vw-switch--locked .vw-switch__thumb { transform: translateX(calc(var(--sw-w) - var(--sw-h))); }

.vw-consent-category__row:has(input:focus-visible) .vw-switch {
  outline: 2px solid var(--c-accent);
  outline-offset: 2px;
}

.vw-consent-panel__actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-3);
  justify-content: flex-end;
}

@media (max-width: 560px) {
  .vw-consent-panel__actions { flex-direction: column-reverse; }
  .vw-consent-panel__actions .btn { width: 100%; justify-content: center; }
}

/* ------------------ External-media placeholder ------------------ */
.vw-embed-placeholder {
  position: absolute; inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--sp-3);
  text-align: center;
  background: var(--c-bg-sunk);
  padding: var(--sp-4);
  overflow: auto;
}
.vw-embed-placeholder__title {
  font-family: var(--font-display);
  font-size: var(--fs-base);
  color: var(--c-ink);
}
.vw-embed-placeholder__body {
  font-size: var(--fs-xs);
  line-height: var(--lh-body);
  color: var(--c-ink-soft);
  max-width: 42ch;
}
.vw-embed-placeholder__check {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  font-size: var(--fs-xs);
  color: var(--c-ink-mute);
}
.vw-embed-placeholder__check input { accent-color: var(--c-accent); }
