/* Cookie Consent Popup — shared by every site (2.3.7, Stage 1 §16.4)
   Markup:    sites/<site>/templates/components/cookie_consent.php
   Behaviour: sites/<site>/assets/js/cookie-consent.js — per site, it holds the GTM id

   Was two identical copies, sites/mhl and sites/mwd assets/css/cookie_consent.css, each
   hardcoded to MWD's dark panel. Merged here on 9 October 2026; the old copies are kept
   beside their originals as "cookie_consent - v1 (pre-2.3.7 core move).css".

   ⚠ COLOURS COME FROM THE --popup-* TOKENS, the same set core popup.css reads — its
   header explains them. The fallbacks are the core look (white box, black backdrop) that
   cor gets; mhl and mwd set their own on :root in main.css / main_mwd.css.

   ⚠ LINKED STRAIGHT AFTER THE SITE'S buttons.css in each layout, so the ghost buttons
   below win their ties with it. See .mwd-cookie__btn for the one rule that must NOT.

   Class names are still mwd-* from the MWD original; they get renamed when the copy is
   rewritten (Stage 1 §16.2).
-------------------------------------------------- */

.mwd-cookie[hidden],
.mwd-cookie__settings[hidden],
.mwd-cookie__btn[hidden] {
  display:none !important;
}

.mwd-cookie {
  position:fixed;
  inset:0;
  z-index:9999;
  color:var(--popup-text, #3f4449);
  display:flex;
  align-items:center;
  justify-content:center;
  background:var(--popup-backdrop, rgba(0,0,0,0.7));
  backdrop-filter:blur(5px);
  -webkit-backdrop-filter:blur(5px);
}

.mwd-cookie__panel {
  width:100%;
  padding:20px;
}

.mwd-cookie__inner {
  width:100%;
  max-width:1080px;
  margin:0 auto;
  padding:clamp(22px, 3vw, 36px);
  background:var(--popup-bg, #fff);
  border:1px solid var(--popup-line, rgba(0,0,0,0.12));
  border-radius:24px;
  box-shadow:0 28px 80px rgba(0,0,0,0.38);
  backdrop-filter:blur(16px);
}

.mwd-cookie__content {
  max-width:820px;
}

.mwd-cookie__eyebrow {
  margin:0 0 8px;
  color:var(--popup-accent, #2c3138);
  font-size:0.78rem;
  font-weight:700;
  letter-spacing:0.12em;
  text-transform:uppercase;
}

.mwd-cookie h2 {
  margin:0 0 12px;
  color:var(--popup-fg, #171717);
  font-size:clamp(1.35rem, 1rem + 1.2vw, 2.1rem);
  line-height:1.15;
}

.mwd-cookie p {
  margin:0;
  color:var(--popup-text, #3f4449);
  font-size:0.98rem;
  line-height:1.65;
}

.mwd-cookie__small {
  margin-top:10px !important;
  color:var(--popup-muted, #6b7076) !important;
  font-size:0.9rem !important;
}

.mwd-cookie__settings {
  margin-top:22px;
  display:grid;
  gap:12px;
}

.mwd-cookie__option {
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:20px;
  padding:18px;
  background:var(--popup-surface, rgba(0,0,0,0.04));
  border:1px solid var(--popup-line, rgba(0,0,0,0.12));
  border-radius:16px;
}

.mwd-cookie__option h3 {
  margin:0 0 5px;
  color:var(--popup-fg, #171717);
  font-size:1rem;
  line-height:1.3;
}

.mwd-cookie__option p {
  font-size:0.9rem;
  line-height:1.55;
}

.mwd-cookie__status {
  flex:0 0 auto;
  padding:7px 12px;
  color:var(--popup-accent-ink, #fff);
  background:var(--popup-accent, #2c3138);
  border-radius:999px;
  font-size:0.78rem;
  font-weight:700;
  white-space:nowrap;
}

/* align-items is left at flex's default, stretch, so the site's primary button and the
   ghost pills come out the same height even though their paddings differ. */
.mwd-cookie__actions {
  display:flex;
  flex-wrap:wrap;
  justify-content:flex-end;
  gap:2rem;
  margin-top:24px;
}

/* Every action button — LAYOUT ONLY.
   ⚠ "Accept all" is the SITE's own button: class="btn mwd-cookie__btn" on every site (mhl
   moved from "btn--gold" in 2.4.1). This file loads after the site's buttons.css, so
   any border, padding, radius, background or colour set here would win the tie and strip
   that button's look — and let mwd's ► overlap the text. font-size only, so the row reads
   at one size; .btn padding is in em, so the button scales with it. The look of the
   other three buttons is .mwd-cookie__btn--ghost below. */
.mwd-cookie__btn {
  font-size:0.85rem;
}

.mwd-cookie__btn:hover {
  transform:translateY(-2px);
}

/* Reject all / Manage choices / Save choices
   ⚠ The hover colour lives HERE, not on .mwd-cookie__btn. Until 2.3.7 it was
   `.mwd-cookie__btn:hover { color:#000 }`, which turned these black on mwd's near-black
   panel, and would now override the site button's own hover colour too. */
.mwd-cookie__btn--ghost {
  appearance:none;
  padding:1em 2em;
  border:1px solid var(--popup-ghost-line, rgba(0,0,0,0.3));
  border-radius:999px;
  background:var(--popup-ghost-bg, transparent);
  color:var(--popup-text, #3f4449);
  font:inherit;
  font-size:0.85rem;
  font-weight:700;
  line-height:1;
  cursor:pointer;
  transition:
    background-color 0.2s ease,
    color 0.2s ease,
    border-color 0.2s ease,
    transform 0.2s ease;
}

.mwd-cookie__btn--ghost:hover {
  color:var(--popup-fg, #171717);
}

/* Toggle */

.mwd-cookie__toggle {
  position:relative;
  display:inline-flex;
  align-items:center;
  flex:0 0 auto;
  cursor:pointer;
}

.mwd-cookie__toggle input {
  position:absolute;
  opacity:0;
  pointer-events:none;
}

.mwd-cookie__switch {
  position:relative;
  width:54px;
  height:30px;
  background:var(--popup-toggle-off, rgba(0,0,0,0.22));
  border:1px solid var(--popup-toggle-off, rgba(0,0,0,0.22));
  border-radius:999px;
  transition:background-color 0.2s ease, border-color 0.2s ease;
}

.mwd-cookie__switch::before {
  content:"";
  position:absolute;
  top:4px;
  left:4px;
  width:20px;
  height:20px;
  background:#fff;
  border-radius:50%;
  transition:transform 0.2s ease;
}

.mwd-cookie__toggle input:checked + .mwd-cookie__switch {
  background:var(--popup-accent, #2c3138);
  border-color:var(--popup-accent, #2c3138);
}

.mwd-cookie__toggle input:checked + .mwd-cookie__switch::before {
  transform:translateX(24px);
  background:var(--popup-accent-ink, #fff);
}

.mwd-cookie__toggle input:focus-visible + .mwd-cookie__switch {
  outline:3px solid var(--popup-focus, rgba(0,0,0,0.35));
  outline-offset:3px;
}

/* No .sr-only here — the old site copies carried their own; core base.css has one. */

@media only screen and (max-width:700px) {
  .mwd-cookie__panel {
    padding:12px;
  }

  .mwd-cookie__inner {
    border-radius:18px;
    max-height:calc(100vh - 24px);
    overflow:auto;
  }

  .mwd-cookie__option {
    align-items:flex-start;
    flex-direction:column;
  }

  .mwd-cookie__actions {
    display:grid;
    grid-template-columns:1fr;
    gap: 10px;
  }

  .mwd-cookie__btn {
    width:100%;
  }
}
