/* Cookie consent banner + preference centre.
   Uses the site's own tokens (--odx-*) so it follows light and dark themes
   automatically and never introduces a second visual language. */

.consent {
  position: fixed;
  inset: 0;
  z-index: 1200;
  pointer-events: none;
}

.consent[hidden] { display: none; }

/* ── banner: bottom of the page ─────────────────────────────────────────── */

.consent__banner {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  pointer-events: auto;
  background: var(--odx-surface-raised, #fff);
  border-top: 1px solid var(--odx-border, #d8dee7);
  box-shadow: 0 -12px 34px rgba(24, 33, 47, .12);
  padding: 18px 20px;
}

.consent__inner {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  gap: 24px;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
}

.consent__copy { flex: 1 1 520px; min-width: 280px; }

.consent__title {
  margin: 0 0 6px;
  font-size: 16px;
  font-weight: 700;
  color: var(--odx-ink, #18212f);
}

.consent__text {
  margin: 0;
  font-size: 14px;
  line-height: 1.55;
  color: var(--odx-muted, #536174);
}

.consent__link { color: var(--odx-accent, #b84120); text-decoration: underline; }

.consent__actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: center;
}

/* Accept and Reject are the same size, weight and colour on purpose: consent
   rules require refusing to be no harder than agreeing. */
.consent__btn {
  font: inherit;
  font-size: 14px;
  font-weight: 650;
  line-height: 1;
  padding: 13px 20px;
  border-radius: 8px;
  border: 1.5px solid transparent;
  cursor: pointer;
  transition: background-color .15s ease, border-color .15s ease, color .15s ease;
}

.consent__btn--primary {
  background: var(--odx-accent, #b84120);
  border-color: var(--odx-accent, #b84120);
  color: var(--odx-on-accent, #fff);
}

.consent__btn--primary:hover { background: var(--odx-accent-hover, #9d3518); border-color: var(--odx-accent-hover, #9d3518); }

.consent__btn--ghost {
  background: transparent;
  border-color: var(--odx-control-border, #7d8999);
  color: var(--odx-ink, #18212f);
}

.consent__btn--ghost:hover { background: var(--odx-soft, #eef1f5); }

.consent__btn:focus-visible,
.consent__close:focus-visible,
.consent__switch input:focus-visible + .consent__switch-track {
  outline: 3px solid var(--odx-focus, #155bc1);
  outline-offset: 2px;
}

/* ── preference centre ──────────────────────────────────────────────────── */

.consent__overlay {
  position: fixed;
  inset: 0;
  pointer-events: auto;
  background: rgba(16, 22, 30, .55);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  overflow-y: auto;
}

.consent__overlay[hidden] { display: none; }

.consent__dialog {
  width: 100%;
  max-width: 660px;
  max-height: 90vh;
  overflow-y: auto;
  background: var(--odx-surface-raised, #fff);
  color: var(--odx-ink, #18212f);
  border: 1px solid var(--odx-border, #d8dee7);
  border-radius: 14px;
  box-shadow: var(--odx-shadow, 0 16px 50px rgba(24, 33, 47, .18));
}

.consent__dialog-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 20px 22px 14px;
  border-bottom: 1px solid var(--odx-border, #d8dee7);
}

.consent__dialog-title { margin: 0; font-size: 19px; font-weight: 700; }

.consent__close {
  background: none;
  border: 0;
  font-size: 28px;
  line-height: 1;
  cursor: pointer;
  color: var(--odx-muted, #536174);
  padding: 2px 8px;
  border-radius: 6px;
}

.consent__dialog-body { padding: 6px 22px 4px; }

.consent__row {
  display: flex;
  gap: 20px;
  align-items: flex-start;
  justify-content: space-between;
  padding: 16px 0;
  border-bottom: 1px solid var(--odx-border, #d8dee7);
}

.consent__row:last-of-type { border-bottom: 0; }

.consent__row-text { flex: 1 1 auto; }

.consent__row-label {
  margin: 0 0 4px;
  font-size: 15px;
  font-weight: 650;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.consent__always {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: var(--odx-success, #176a4d);
  border: 1px solid currentColor;
  border-radius: 999px;
  padding: 2px 8px;
}

.consent__row-desc { margin: 0; font-size: 13.5px; line-height: 1.55; color: var(--odx-muted, #536174); }

.consent__row-control { flex: 0 0 auto; padding-top: 2px; }

/* Switch built from a real checkbox, so it is keyboard and screen-reader
   native; the visible label is the control's own name. */
.consent__switch { display: inline-flex; align-items: center; gap: 10px; cursor: pointer; }
.consent__switch input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.consent__switch input:disabled + .consent__switch-track { opacity: .55; cursor: not-allowed; }
.consent__switch input:disabled ~ .consent__switch-label { opacity: .7; }

.consent__switch-track {
  position: relative;
  width: 46px;
  height: 26px;
  border-radius: 999px;
  background: var(--odx-soft, #eef1f5);
  border: 1px solid var(--odx-control-border, #7d8999);
  flex: 0 0 auto;
  transition: background-color .15s ease;
}

.consent__switch-track::after {
  content: "";
  position: absolute;
  top: 2px;
  left: 2px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--odx-surface, #fff);
  border: 1px solid var(--odx-border, #d8dee7);
  transition: transform .15s ease;
}

.consent__switch input:checked + .consent__switch-track {
  background: var(--odx-accent, #b84120);
  border-color: var(--odx-accent, #b84120);
}

.consent__switch input:checked + .consent__switch-track::after { transform: translateX(20px); }

.consent__switch-label {
  font-size: 13px;
  color: var(--odx-muted, #536174);
  clip-path: inset(50%);
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  white-space: nowrap;
}

.consent__meta {
  margin: 14px 0 0;
  font-size: 12.5px;
  line-height: 1.6;
  color: var(--odx-subtle, #606d7f);
}

.consent__dialog-foot {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  padding: 16px 22px 20px;
  border-top: 1px solid var(--odx-border, #d8dee7);
  background: var(--odx-surface, #fff);
  position: sticky;
  bottom: 0;
}

/* Keep the banner from covering the sticky call to action. */
body.consent-open .sticky-cta { transform: translateY(-100%); opacity: 0; pointer-events: none; }

@media (max-width: 720px) {
  .consent__banner { padding: 14px 16px; }
  .consent__inner { gap: 14px; }
  .consent__actions { width: 100%; }
  .consent__btn { flex: 1 1 auto; text-align: center; }
  .consent__row { flex-direction: column; gap: 10px; }
  .consent__row-control { align-self: flex-start; }
}

@media (prefers-reduced-motion: reduce) {
  .consent__btn, .consent__switch-track, .consent__switch-track::after, body.consent-open .sticky-cta {
    transition: none;
  }
}
