/* ============================================================
   Esse Werks — Consent banner (G-1 Commit A)

   Companion to snippets/ew-consent-banner.liquid + assets/ew-consent.js.
   The banner is the Consent Mode v2 opt-in/opt-out surface. It is a
   non-modal bottom-anchored region: it never blocks page content and
   never traps focus (aria-modal="false" in the markup).

   PALETTE / WCAG 2.1 AA (computed against the values used here):
     - banner bg   #1F1F22 (--ew-carbon)
     - body text   #E8E8EA (--ew-paper)  → 13.45:1 vs bg   (AA: 4.5:1)
     - title       #FFFFFF (--ew-white)  → 16.5:1  vs bg
     - link        #2EC4D8 (oem+ cyan)   →  7.83:1 vs bg
     - Accept btn  #0A0A0B text on #E8E8EA fill → 16.6:1
     - Reject btn  #E8E8EA text on #1F1F22 bg, 1px paper border → 13.45:1
     - focus ring  #2EC4D8 (cyan) — NOT the reserved lime/red signals
   Both buttons are NEUTRAL by design: lime = "go" and red = brand/error
   are reserved, so neither is placed on a consent choice. Reject is
   exactly as easy to find/press as Accept (same size, same row, no
   dark pattern).

   Target size: buttons are min 44x44px (exceeds the 24px AA floor).
   Motion: the slide-up entrance is suppressed under
   prefers-reduced-motion.
   ============================================================ */

.ew-consent {
  position: fixed;
  inset: auto 0 0 0;          /* bottom-anchored, full width */
  z-index: 2147483000;         /* above page chrome; below nothing it must beat */
  background: var(--ew-carbon, #1f1f22);
  color: var(--ew-paper, #e8e8ea);
  border-top: 1px solid var(--ew-steel, #3a3a40);
  box-shadow: 0 -8px 24px rgba(0, 0, 0, 0.45);
  font-family: var(--ew-font-body, "Inter", system-ui, sans-serif);
}

.ew-consent[hidden] {
  display: none;
}

/* Slide-up entrance — added by JS as .is-visible after unhide. */
.ew-consent {
  transform: translateY(100%);
  transition: transform 280ms ease;
}
.ew-consent.is-visible {
  transform: translateY(0);
}

.ew-consent__inner {
  max-width: var(--page-width, 1200px);
  margin: 0 auto;
  padding: 16px 20px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 16px 24px;
}

.ew-consent__copy {
  flex: 1 1 320px;
  min-width: 0;
}

.ew-consent__title {
  margin: 0 0 4px;
  color: var(--ew-white, #fff);
  font-size: var(--ew-text-sm, 14px);
  font-weight: 600;
  letter-spacing: 0.01em;
}

.ew-consent__desc {
  margin: 0;
  color: var(--ew-paper, #e8e8ea);
  font-size: var(--ew-text-sm, 14px);
  line-height: 1.45;
}

.ew-consent__link {
  color: var(--ew-cyan, #5fd2ff);
  text-decoration: underline;
  text-underline-offset: 2px;
}
.ew-consent__link:hover {
  text-decoration-thickness: 2px;
}

.ew-consent__actions {
  flex: 0 0 auto;
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.ew-consent__btn {
  appearance: none;
  -webkit-appearance: none;
  min-height: 44px;
  min-width: 44px;
  padding: 11px 22px;
  border-radius: 4px;
  font-family: inherit;
  font-size: var(--ew-text-sm, 14px);
  font-weight: 600;
  line-height: 1.2;
  cursor: pointer;
  transition: background-color 140ms ease, border-color 140ms ease, color 140ms ease;
}

/* Reject all — neutral outline, equal weight to Accept. */
.ew-consent__btn--decline {
  background: transparent;
  color: var(--ew-paper, #e8e8ea);
  border: 1px solid var(--ew-paper, #e8e8ea);
}
.ew-consent__btn--decline:hover {
  background: rgba(232, 232, 234, 0.10);
}

/* Accept all — neutral filled (paper on carbon), NOT the lime "go". */
.ew-consent__btn--accept {
  background: var(--ew-paper, #e8e8ea);
  color: var(--ew-black, #0a0a0b);
  border: 1px solid var(--ew-paper, #e8e8ea);
}
.ew-consent__btn--accept:hover {
  background: var(--ew-white, #fff);
  border-color: var(--ew-white, #fff);
}

/* Visible focus indicator — cyan ring (#2EC4D8 / 7.83:1), 3px, offset for clarity.
   Cyan is deliberately neither the reserved lime nor red. */
.ew-consent__btn:focus-visible,
.ew-consent__link:focus-visible {
  outline: 3px solid var(--ew-cyan, #5fd2ff);
  outline-offset: 2px;
}

@media (max-width: 599px) {
  .ew-consent__actions {
    width: 100%;
  }
  .ew-consent__btn {
    flex: 1 1 0;   /* equal-width, full-row buttons on phones */
  }
}

@media (prefers-reduced-motion: reduce) {
  .ew-consent {
    transition: none;
    transform: none;
  }
  .ew-consent.is-visible {
    transform: none;
  }
}
