/*
 * Cookie consent banner (includes/consent.php, assets/js/consent.js).
 * Standalone file rather than part of style.css so it also loads on the
 * Loveable templates, which swap out most theme styles.
 */
.zt-consent {
  --zt-consent-bg: #ffffff;
  --zt-consent-text: #10242b;
  --zt-consent-muted: #51626a;
  --zt-consent-border: #d5e3e7;
  /* Brand primary and its soft tint, as used by the landing page design (--primary, --primary-soft). */
  --zt-consent-accent: #0d657d;
  --zt-consent-accent-hover: #0a5266;
  --zt-consent-accent-soft: #e7fbff;
  --zt-consent-accent-text: #ffffff;
  --zt-consent-focus: #18a6a5;
  /*
   * Fonts the theme already self-hosts, so the banner downloads nothing extra. Landing-design
   * pages define --font-body / --font-display (Open Sans / Lato); every other page has PT Sans.
   */
  --zt-consent-font: var(--font-body, "PT Sans", "Open Sans", system-ui, -apple-system, "Segoe UI", sans-serif);
  --zt-consent-font-title: var(--font-display, "PT Sans", "Open Sans", system-ui, -apple-system, "Segoe UI", sans-serif);

  /* Centred on screen, both ways: pinned to every edge, sized to its content, auto margins. */
  position: fixed;
  inset: 0;
  z-index: 2147483000;
  width: calc(100% - 32px);
  max-width: 960px;
  height: fit-content;
  margin: auto;
  max-height: calc(100vh - 32px);
  max-height: calc(100dvh - 32px);
  overflow-y: auto;
  background: var(--zt-consent-bg);
  color: var(--zt-consent-text);
  border: 1px solid var(--zt-consent-border);
  border-radius: 12px;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.18);
  font-family: var(--zt-consent-font);
  font-size: 15px;
  line-height: 1.5;
  text-align: left;
}

.zt-consent[hidden] {
  display: none !important;
}

.zt-consent__inner {
  padding: 20px 24px;
}

.zt-consent__title {
  margin: 0 0 8px;
  font-family: var(--zt-consent-font-title);
  font-size: 18px;
  font-weight: 700;
  line-height: 1.3;
  color: var(--zt-consent-accent);
}

.zt-consent__text {
  margin: 0 0 16px;
  color: var(--zt-consent-muted);
}

.zt-consent__text a {
  color: var(--zt-consent-accent);
  text-decoration: underline;
}

.zt-consent__prefs {
  margin: 0 0 16px;
  border-top: 1px solid var(--zt-consent-border);
}

.zt-consent__prefs[hidden] {
  display: none;
}

.zt-consent__category {
  padding: 12px 0;
  border-bottom: 1px solid var(--zt-consent-border);
}

.zt-consent__toggle {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0;
  font-weight: 600;
  cursor: pointer;
}

.zt-consent__toggle input {
  width: 18px;
  height: 18px;
  margin: 0;
  accent-color: var(--zt-consent-accent);
  flex: none;
}

.zt-consent__toggle input:disabled {
  cursor: not-allowed;
}

.zt-consent__always {
  margin-left: auto;
  font-size: 13px;
  font-weight: 400;
  color: var(--zt-consent-muted);
}

.zt-consent__category-text {
  margin: 4px 0 0 28px;
  font-size: 14px;
  color: var(--zt-consent-muted);
}

.zt-consent__id {
  margin: 12px 0 0;
  font-size: 13px;
  color: var(--zt-consent-muted);
  word-break: break-all;
}

.zt-consent__id[hidden] {
  display: none;
}

.zt-consent__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

/* Accept and Reject share one style: equal prominence is a legal requirement. */
.zt-consent__btn {
  appearance: none;
  min-height: 44px;
  padding: 10px 20px;
  border: 2px solid var(--zt-consent-accent);
  border-radius: 999px;
  background: var(--zt-consent-accent);
  color: var(--zt-consent-accent-text);
  font: inherit;
  font-weight: 600;
  line-height: 1.2;
  cursor: pointer;
}

.zt-consent__btn--link {
  background: transparent;
  color: var(--zt-consent-accent);
}

.zt-consent__btn[hidden] {
  display: none;
}

.zt-consent__btn:hover {
  background-color: var(--zt-consent-accent-hover);
  border-color: var(--zt-consent-accent-hover);
}

.zt-consent__btn--link:hover {
  background-color: var(--zt-consent-accent-soft);
  border-color: var(--zt-consent-accent);
}

.zt-consent__btn:focus-visible,
.zt-consent__toggle input:focus-visible,
.zt-consent a:focus-visible,
button.zt-consent-open:focus-visible {
  outline: 3px solid var(--zt-consent-focus);
  outline-offset: 2px;
}

/*
 * Footer "Cookie settings" link: a button styled like the policy links. Scoped to the button
 * element: the page's <html> carries a state class while the banner is open, and a bare class
 * selector here once matched it and reset the whole page's font.
 */
button.zt-consent-open {
  appearance: none;
  padding: 0;
  border: 0;
  background: none;
  color: inherit;
  font: inherit;
  text-decoration: underline;
  cursor: pointer;
}

@media (max-width: 600px) {
  .zt-consent__inner {
    padding: 16px;
  }

  .zt-consent__btn {
    flex: 1 1 100%;
  }
}

@media print {
  .zt-consent {
    display: none !important;
  }
}

/* --------------------------------------------------------------------------
 * YouTube click-to-load placeholder (includes/consent-embeds.php)
 * -------------------------------------------------------------------------- */
.zt-video-consent {
  position: relative;
  display: block;
  width: 100%;
  max-width: 100%;
  background: #10181c;
  overflow: hidden;
  /* Size the overlay by the embed's own width, not the screen's. */
  container-type: inline-size;
}

/* Inside WordPress's responsive embed wrapper, which already sets the ratio. */
.wp-has-aspect-ratio .zt-video-consent {
  position: absolute;
  inset: 0;
  height: 100%;
  aspect-ratio: auto !important;
}

.zt-video-consent > iframe {
  position: absolute;
  inset: 0;
  width: 100% !important;
  height: 100% !important;
  border: 0;
  visibility: hidden;
}

.zt-video-consent.is-loaded > iframe {
  visibility: visible;
}

.zt-video-consent__overlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  background-color: #10181c;
  background-position: center;
  background-size: cover;
  color: #fff;
  text-align: center;
}

/* Darken the preview image so the text stays readable. */
.zt-video-consent__overlay::before {
  content: "";
  position: absolute;
  inset: 0;
  background: rgba(8, 14, 18, 0.62);
}

.zt-video-consent.is-loaded .zt-video-consent__overlay {
  display: none;
}

.zt-video-consent__panel {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  max-width: 520px;
  font-size: 15px;
  line-height: 1.45;
}

.zt-video-consent__title {
  font-size: 18px;
  font-weight: 700;
}

.zt-video-consent__actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
}

.zt-video-consent__btn {
  appearance: none;
  min-height: 44px;
  padding: 10px 20px;
  border: 2px solid #fff;
  border-radius: 999px;
  background: #fff;
  color: #10181c;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}

.zt-video-consent__btn--secondary {
  background: transparent;
  color: #fff;
}

.zt-video-consent__link {
  color: #fff !important;
  font-size: 14px;
  text-decoration: underline;
}

.zt-video-consent__btn:focus-visible,
.zt-video-consent__link:focus-visible {
  outline: 3px solid #18a6a5;
  outline-offset: 2px;
}

/* Small embeds (phones, sidebars): keep only what fits. */
@container (max-width: 560px) {
  .zt-video-consent__overlay {
    padding: 10px;
  }
  .zt-video-consent__panel {
    gap: 8px;
    font-size: 13px;
    line-height: 1.35;
  }
  .zt-video-consent__title {
    display: none;
  }
  .zt-video-consent__btn {
    min-height: 40px;
    padding: 8px 14px;
    font-size: 14px;
  }
}

@container (max-width: 380px) {
  .zt-video-consent__link {
    display: none;
  }
  .zt-video-consent__actions {
    gap: 6px;
  }
}

@container (max-width: 300px) {
  .zt-video-consent__text {
    display: none;
  }
}

/*
 * Notice on forms whose Google reCAPTCHA is waiting for consent (assets/js/consent.js).
 */
.zt-recaptcha-consent {
  margin: 0 0 16px;
  padding: 14px 16px;
  border: 1px solid #d5e3e7;
  border-left: 4px solid #0d657d;
  border-radius: 8px;
  background: #e7fbff;
  color: #10242b;
  font-size: 15px;
  line-height: 1.5;
  text-align: left;
}

.zt-recaptcha-consent.is-required {
  border-color: #b61b46;
  border-left-color: #b61b46;
  background: #fdf3f5;
}

.zt-recaptcha-consent__text {
  margin: 0 0 10px;
}

.zt-recaptcha-consent__btn {
  display: inline-block;
  padding: 9px 16px;
  border: 0;
  border-radius: 8px;
  background: #0d657d;
  color: #ffffff;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
}

.zt-recaptcha-consent__btn:hover {
  background: #0a5266;
}

.zt-recaptcha-consent__btn:focus-visible {
  outline: 3px solid #18a6a5;
  outline-offset: 2px;
}

/*
 * Theme and Tailwind resets style every button ("button, [type='button'] { background-color:
 * transparent }") with the same weight as a single class, and load after this file. Repeat the
 * button colours with a heavier selector so the labels can never end up white on white.
 */
button.zt-consent__btn.zt-consent__btn {
  background-color: var(--zt-consent-accent);
  background-image: none;
  border: 2px solid var(--zt-consent-accent);
  color: var(--zt-consent-accent-text);
  text-transform: none;
  box-shadow: none;
}

button.zt-consent__btn.zt-consent__btn--link {
  background-color: transparent;
  color: var(--zt-consent-accent);
}

button.zt-consent__btn.zt-consent__btn:hover {
  background-color: var(--zt-consent-accent-hover);
  border-color: var(--zt-consent-accent-hover);
}

button.zt-consent__btn.zt-consent__btn--link:hover {
  background-color: var(--zt-consent-accent-soft);
  border-color: var(--zt-consent-accent);
  color: var(--zt-consent-accent);
}

button.zt-consent__btn.zt-consent__btn[hidden] {
  display: none;
}

button.zt-video-consent__btn.zt-video-consent__btn {
  background-color: #fff;
  background-image: none;
  color: #10181c;
}

button.zt-video-consent__btn.zt-video-consent__btn--secondary {
  background-color: transparent;
  color: #fff;
}

button.zt-recaptcha-consent__btn.zt-recaptcha-consent__btn {
  background-color: #0d657d;
  background-image: none;
  color: #ffffff;
}

button.zt-recaptcha-consent__btn.zt-recaptcha-consent__btn:hover {
  background-color: #0a5266;
}

/*
 * "Cookie settings" in the theme footer: match the Privacy Policy and Terms links that sit
 * beside it under the newsletter form (.zt-footer__legal-widget-area a in the theme).
 */
button.zt-consent-open.zt-footer__cookie-settings {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0;
  border: 0;
  background: none;
  box-shadow: none;
  color: rgba(255, 255, 255, 0.7);
  font-family: inherit;
  font-size: 0.75rem;
  font-weight: inherit;
  line-height: inherit;
  letter-spacing: inherit;
  text-transform: none;
  text-decoration: underline;
  transition: color 0.2s ease;
}

button.zt-consent-open.zt-footer__cookie-settings:hover {
  background: none;
  color: #fff;
}

/* --------------------------------------------------------------------------
 * "Cookie settings" state panel (zt_consent_render_status): opens from the
 * footer link once the visitor has made a choice.
 * -------------------------------------------------------------------------- */
/* Dims and blurs the page behind the settings panel only; the first-visit banner has none. */
.zt-consent-backdrop {
  position: fixed;
  inset: 0;
  z-index: 2147482999;
  background: rgba(16, 36, 43, 0.45);
  -webkit-backdrop-filter: blur(4px);
  backdrop-filter: blur(4px);
}

.zt-consent-backdrop[hidden] {
  display: none !important;
}

@media print {
  .zt-consent-backdrop {
    display: none !important;
  }
}

.zt-consent.zt-consent--status {
  width: 420px;
  max-width: calc(100% - 32px);
}

.zt-consent__status-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 8px 8px 24px;
  border-bottom: 1px solid var(--zt-consent-border);
}

.zt-consent__status-head .zt-consent__title {
  margin: 0;
  font-size: 16px;
  color: var(--zt-consent-text);
}

button.zt-consent__close.zt-consent__close {
  appearance: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: none;
  width: 44px;
  height: 44px;
  min-height: 0;
  padding: 0;
  border: 0;
  border-radius: 8px;
  background: transparent none;
  box-shadow: none;
  color: var(--zt-consent-text);
  cursor: pointer;
}

button.zt-consent__close.zt-consent__close:hover {
  background-color: var(--zt-consent-accent-soft);
  color: var(--zt-consent-accent);
}

.zt-consent__status-body {
  padding: 20px 24px;
}

.zt-consent__status-heading {
  margin: 0 0 10px;
  font-family: var(--zt-consent-font-title);
  font-size: 15px;
  font-weight: 700;
  line-height: 1.3;
  color: var(--zt-consent-text);
}

.zt-consent__status-list {
  margin: 0 0 18px;
  padding: 0;
  list-style: none;
}

.zt-consent__status-item {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0;
  padding: 3px 0;
  list-style: none;
  color: var(--zt-consent-text);
}

.zt-consent__status-item::before,
.zt-consent__status-item::marker {
  content: none;
}

.zt-consent__icon {
  flex: none;
  color: var(--zt-consent-accent);
}

.zt-consent__icon--off {
  color: var(--zt-consent-muted);
}

.zt-consent__status-item .zt-consent__icon--on,
.zt-consent__status-item .zt-consent__icon--off {
  display: none;
}

.zt-consent__status-item.is-on .zt-consent__icon--on,
.zt-consent__status-item.is-off .zt-consent__icon--off {
  display: block;
}

.zt-consent__status-item.is-off {
  color: var(--zt-consent-muted);
}

.zt-consent__sr {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
}

button.zt-consent__details-toggle.zt-consent__details-toggle {
  appearance: none;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  padding: 0;
  border: 0;
  background: transparent none;
  box-shadow: none;
  color: var(--zt-consent-accent);
  font: inherit;
  font-weight: 700;
  text-transform: none;
  cursor: pointer;
}

.zt-consent__details-toggle[aria-expanded="true"] .zt-consent__caret {
  transform: rotate(180deg);
}

.zt-consent__status-details {
  padding-top: 6px;
  font-size: 14px;
  color: var(--zt-consent-muted);
  word-break: break-word;
}

.zt-consent__status-details[hidden],
.zt-consent__status-details p[hidden] {
  display: none;
}

.zt-consent__status-details p {
  margin: 0 0 6px;
}

.zt-consent__status-details a {
  color: var(--zt-consent-accent);
  text-decoration: underline;
}

.zt-consent__status-actions {
  padding: 16px 24px;
  border-top: 1px solid var(--zt-consent-border);
}

.zt-consent__status-actions .zt-consent__btn {
  flex: 1 1 auto;
}

.zt-consent__close:focus-visible,
.zt-consent__details-toggle:focus-visible {
  outline: 3px solid var(--zt-consent-focus);
  outline-offset: 2px;
}

@media (max-width: 600px) {
  .zt-consent__status-head {
    padding-left: 16px;
  }

  .zt-consent__status-body,
  .zt-consent__status-actions {
    padding-left: 16px;
    padding-right: 16px;
  }
}
