/* ──────────────────────────────────────────────────────────────────
   Complianz cookie banner — centered consent modal (2026-07-04 v2).
   Consent-rate work: order attribution and ad signals only exist for
   visitors who opt in. Layer 1 is a centered, brand-logo modal over a
   page dim with exactly two actions — ghost "preferences" + solid
   brand-green "Accept" (competitor-informed; see the leiregister.ee
   recon in the 2026-07-04 review record). Deny moves to layer 2
   (categories view) as a quiet underlined link; category checkboxes
   stay UNCHECKED — pre-ticked boxes are invalid consent (Planet49),
   that's the line we don't cross. No header close: a dismissal stores
   no choice and loses the visitor's consent forever.
   Complianz generates its own banner CSS from settings; where it
   styles via --cmplz_* custom properties we override the properties,
   and the rest is targeted rules. Every rule is prefixed with the
   #cmplz-cookiebanner-container id because the plugin stylesheet
   loads after ours with equal-specificity selectors (its position/
   mobile/z-index rules silently won before). State classes (from
   complianz.js): .cmplz-hidden (server initial) → .cmplz-show
   (visible) → .cmplz-dismissed (after a choice);
   .cmplz-categories-visible marks the expanded layer 2.
   ────────────────────────────────────────────────────────────────── */

/* Dim the page while the banner asks (visual pressure only — the page
   stays interactive; pointer-events:none keeps this out of dark-pattern
   "cookie wall" territory). Must stay BELOW the banner's z-index 99999.
   Gate on .cmplz-show, the plugin's own visible-state class — matching
   :not(.cmplz-hidden) once left the dim on permanently after a choice.
   :has() misses on very old browsers, which then simply get no overlay. */
#cmplz-cookiebanner-container:has(> .cmplz-cookiebanner.cmplz-show)::before {
  content: "";
  position: fixed;
  inset: 0;
  background: rgba(13, 27, 22, 0.5);
  z-index: 99998;
  pointer-events: none;
}

#cmplz-cookiebanner-container .cmplz-cookiebanner {
  /* Complianz-generated CSS reads these custom properties. */
  --cmplz_banner_background_color: #ffffff;
  --cmplz_banner_border_color: transparent;
  --cmplz_banner_border_width: 0;
  --cmplz_banner_border_radius: 16px;
  --cmplz_banner_width: 480px;
  --cmplz_button_border_radius: 10px;
  --cmplz_button_accept_background_color: var(--leiu-cta-active, #386754);
  --cmplz_button_accept_border_color: var(--leiu-cta-active, #386754);
  --cmplz_button_accept_text_color: #ffffff;
  --cmplz_button_deny_background_color: transparent;
  --cmplz_button_deny_border_color: transparent;
  --cmplz_button_deny_text_color: var(--leiu-global-color-3, #67768e);
  --cmplz_button_settings_background_color: transparent;
  --cmplz_button_settings_border_color: var(--leiu-cta-active, #386754);
  --cmplz_button_settings_text_color: var(--leiu-cta-active, #386754);
  --cmplz_text_color: var(--leiu-global-color-2, #1e293b);
  --cmplz_title_font_size: 17px;
  --cmplz_text_font_size: 13.5px;
  --cmplz_hyperlink_color: var(--leiu-cta-active, #386754);
  --cmplz_slider_active_color: var(--leiu-cta-active, #386754);
  --cmplz_slider_inactive_color: #cbd5e1;
  --cmplz_slider_bullet_color: #ffffff;
  /* Centered modal on every viewport (overrides the position-file
     bottom-right/mobile-sheet placement). */
  top: 50%;
  left: 50%;
  right: auto;
  bottom: auto;
  transform: translate(-50%, -50%);
  width: min(480px, calc(100vw - 32px));
  max-height: calc(100vh - 40px);
  padding: 28px 28px 22px;
  box-shadow: 0 24px 64px rgba(10, 20, 16, 0.4);
}

/* The plugin sizes .cmplz-message/.cmplz-categories to
   calc(banner_width - 42px), wider than our 28px-padded content box —
   text clipped at the right edge until pinned to the real width. */
#cmplz-cookiebanner-container .cmplz-cookiebanner .cmplz-message,
#cmplz-cookiebanner-container .cmplz-cookiebanner .cmplz-categories,
#cmplz-cookiebanner-container .cmplz-cookiebanner .cmplz-body {
  width: 100%;
  min-width: 0;
}

/* Plain-title header (Tanel 2026-07-04: no logo, just "Küpsised"/
   "Cookies" — title text lives in {prefix}cmplz_cookiebanners.header
   per blog). The header is a grid of logo/title/close slots — collapse
   it so the title actually centers, and hide the empty logo slot. */
#cmplz-cookiebanner-container .cmplz-cookiebanner .cmplz-header {
  display: flex;
  justify-content: center;
}

#cmplz-cookiebanner-container .cmplz-cookiebanner .cmplz-logo {
  display: none;
}

#cmplz-cookiebanner-container .cmplz-cookiebanner .cmplz-title {
  font-weight: 700;
  text-align: center;
}

/* No silent dismissal: closing the dialog stores no choice. Force an
   explicit decision instead. */
#cmplz-cookiebanner-container .cmplz-cookiebanner .cmplz-close,
#cmplz-cookiebanner-container .cmplz-cookiebanner .cmplz-divider-header {
  display: none !important;
}

#cmplz-cookiebanner-container .cmplz-cookiebanner .cmplz-message {
  text-align: center;
  line-height: 1.55;
}

#cmplz-cookiebanner-container .cmplz-cookiebanner .cmplz-links,
#cmplz-cookiebanner-container .cmplz-cookiebanner .cmplz-documents {
  text-align: center;
}

/* Layer-1 button pair: ghost preferences + solid Accept, side by side
   on desktop, stacked (Accept on the bottom, thumb-reach) on mobile.
   The plugin gives every .cmplz-btn height:45px/width:100% and flips
   .cmplz-buttons to flex-direction:column under 768px — pin the whole
   layout here so both breakpoints behave identically. */
#cmplz-cookiebanner-container .cmplz-cookiebanner .cmplz-buttons {
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  gap: 10px;
}

#cmplz-cookiebanner-container .cmplz-cookiebanner .cmplz-buttons .cmplz-btn {
  margin: 0;
  height: auto;
  min-height: 48px;
  padding: 12px 18px;
  font-size: 15px;
  font-weight: 600;
}

#cmplz-cookiebanner-container .cmplz-cookiebanner .cmplz-buttons .cmplz-btn.cmplz-view-preferences,
#cmplz-cookiebanner-container .cmplz-cookiebanner .cmplz-buttons .cmplz-btn.cmplz-save-preferences {
  order: 1;
  flex: 1 1 44%;
  width: auto;
  border-width: 1.5px;
  border-style: solid;
}

#cmplz-cookiebanner-container .cmplz-cookiebanner .cmplz-buttons .cmplz-btn.cmplz-accept {
  order: 2;
  flex: 1 1 44%;
  width: auto;
  font-weight: 700;
}

/* base.css paints every <button> brand-green on hover — pin each
   button's hover ourselves (see theme-button-hover-green-bleed). */
#cmplz-cookiebanner-container .cmplz-cookiebanner .cmplz-buttons .cmplz-btn.cmplz-accept:hover,
#cmplz-cookiebanner-container .cmplz-cookiebanner .cmplz-buttons .cmplz-btn.cmplz-accept:focus {
  background-color: var(--leiu-global-color-1, #2c5243) !important;
  border-color: var(--leiu-global-color-1, #2c5243) !important;
  color: #ffffff !important;
}

#cmplz-cookiebanner-container .cmplz-cookiebanner .cmplz-buttons .cmplz-btn.cmplz-view-preferences:hover,
#cmplz-cookiebanner-container .cmplz-cookiebanner .cmplz-buttons .cmplz-btn.cmplz-view-preferences:focus,
#cmplz-cookiebanner-container .cmplz-cookiebanner .cmplz-buttons .cmplz-btn.cmplz-save-preferences:hover,
#cmplz-cookiebanner-container .cmplz-cookiebanner .cmplz-buttons .cmplz-btn.cmplz-save-preferences:focus {
  background-color: rgba(56, 103, 84, 0.08) !important;
  border-color: var(--leiu-global-color-1, #2c5243) !important;
  color: var(--leiu-global-color-1, #2c5243) !important;
}

/* Deny: visible on layer 1 per Tanel's AKI-informed copy round
   (2026-07-04) — a quiet underlined full-width link under the
   settings/accept pair, on both layers. AKI expects refusal to be
   available, so the leiregister-style hidden layer-1 deny is out. */
#cmplz-cookiebanner-container .cmplz-cookiebanner .cmplz-buttons .cmplz-btn.cmplz-deny {
  display: block;
  order: 3;
  flex: 1 1 100%;
  width: 100%;
  min-height: 0;
  padding: 6px 12px;
  font-size: 13px;
  font-weight: 500;
  text-decoration: underline;
  text-underline-offset: 3px;
}

#cmplz-cookiebanner-container .cmplz-cookiebanner .cmplz-buttons .cmplz-btn.cmplz-deny:hover,
#cmplz-cookiebanner-container .cmplz-cookiebanner .cmplz-buttons .cmplz-btn.cmplz-deny:focus,
#cmplz-cookiebanner-container .cmplz-cookiebanner .cmplz-buttons .cmplz-btn.cmplz-manage-options:hover,
#cmplz-cookiebanner-container .cmplz-cookiebanner .cmplz-buttons .cmplz-btn.cmplz-manage-options:focus {
  background-color: transparent !important;
  border-color: transparent !important;
  color: var(--leiu-global-color-2, #1e293b) !important;
}

/* Post-choice floating "manage consent" tab, brand-toned. */
#cmplz-manage-consent .cmplz-manage-consent {
  background-color: var(--leiu-cta-active, #386754);
  border-color: var(--leiu-cta-active, #386754);
  color: #ffffff;
}
