/* CW-1425. The measurement consent banner and the privacy page's
   measurement controls. The build ships this file, and links it from every
   page, only when the release sets SITE_GA4_MEASUREMENT_ID; it uses the
   G2M1 tokens from site.css. */

.mz-consent {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 900;
  max-height: 50vh;
  overflow-y: auto;
  overscroll-behavior: contain;
  background: var(--surface);
  color: var(--ink-text);
  border-top: 4px solid var(--teal);
  box-shadow: var(--shadow);
}

.mz-consent-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem 1.5rem;
  max-width: 80rem;
  min-width: 0;
  margin: 0 auto;
  padding: 1rem var(--m) 1.25rem;
}

.mz-consent p {
  flex: 1 1 22em;
  min-width: 0;
  margin: 0;
  font-size: 1rem;
  line-height: 1.5;
  overflow-wrap: anywhere;
}

.mz-consent a {
  color: var(--teal);
  text-decoration: underline;
  text-underline-offset: 0.15em;
}

.mz-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  min-width: 0;
  max-width: 100%;
}

.mz-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 3rem;
  min-width: 3rem;
  max-width: 100%;
  padding: 0.5rem 1.25rem;
  border: 2px solid var(--chapter-ink);
  border-radius: 1rem;
  background: var(--surface);
  color: var(--chapter-ink);
  font: inherit;
  font-weight: 600;
  line-height: 1.3;
  white-space: normal;
  overflow-wrap: anywhere;
  cursor: pointer;
}

.mz-btn.is-primary {
  background: var(--chapter-ink);
  color: #ffffff;
}

.mz-btn:hover {
  background: var(--chapter-ink-top);
  border-color: var(--chapter-ink-top);
  color: #ffffff;
}

.mz-btn:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 2px;
}

.mz-btn[hidden] {
  display: none;
}

.mz-settings .mz-status {
  font-weight: 600;
}

.mz-settings .mz-actions {
  margin-top: 0.75rem;
}

/* The sticky contents list on Privacy, Terms and Delete account stays above
   the banner: the page scroll cannot move it once it is stuck, so it ends
   above the banner's live height (set on the root while the banner shows)
   and scrolls on its own, keeping every focused link in view (WCAG 2.4.11). */
.toc {
  max-height: calc(100vh - 3rem - var(--mz-banner-height, 0px));
  max-height: calc(100dvh - 3rem - var(--mz-banner-height, 0px));
}

@media print {
  .mz-consent {
    display: none;
  }
}
