/* ============================================
   Denzo Consent  Banner
   Neutral defaults. Style per site by overriding the variables in
   Additional CSS, for example:
     :root{ --dzc-accent:#0A505D; --dzc-radius:14px; }
   Accept and Decline get equal visual weight by default, so neither
   choice is pushed (regulators treat a hidden "Decline" as a dark pattern).
   ============================================ */
:root{
  --dzc-bg: #FFFFFF;
  --dzc-text: #1F2933;          /* 14.7:1 on white */
  --dzc-muted: #4A5560;         /* 7.5:1 on white */
  --dzc-accent: #1F2933;        /* button background */
  --dzc-accent-text: #FFFFFF;
  --dzc-border: rgba(31,41,51,.14);
  --dzc-radius: 14px;
  --dzc-btn-radius: 10px;
  --dzc-shadow: 0 12px 32px rgba(15,23,42,.18);
  --dzc-font: inherit;
  --dzc-z: 2147483647;          /* highest possible: above sticky headers, menus and chat widgets */
  --dzc-offset: 16px;
  --dzc-width: 420px;
  --dzc-focus: #2563EB;
}

.dzc{ display: none; }

/* "Cookie settings link only in banner countries": hide the link for
   everyone else, and its menu item only when that item holds nothing else
   (no submenu, no other links). Links inside visitor comments are never
   touched. The script does the same for browsers without :has().
   Separate rules on purpose: a browser that does not understand one
   selector drops only that rule, not the others. */
html.dzc-link-consent-only.dzc-region-other a[href$="#cookie-settings"],
html.dzc-link-consent-only.dzc-region-other .dzc-open{
  display: none !important;
}
html.dzc-link-consent-only.dzc-region-other .comment-content a[href$="#cookie-settings"],
html.dzc-link-consent-only.dzc-region-other .comment-body a[href$="#cookie-settings"]{
  display: revert !important;
}
html.dzc-link-consent-only.dzc-region-other li.menu-item:has(> a[href$="#cookie-settings"]:only-child),
html.dzc-link-consent-only.dzc-region-other li.wp-block-navigation-item:has(> a[href$="#cookie-settings"]:only-child){
  display: none !important;
}

/* The banner is a popover (top layer) where supported: reset the
   browser's popover defaults so only the rules below apply. */
.dzc[popover]{
  inset: auto;
  height: auto;
  margin: 0;
  overflow: visible;
}

html.dzc-pending .dzc,
.dzc.is-open{
  display: block;
  position: fixed;
  inset: auto;
  inset-inline-start: var(--dzc-offset);   /* left, or right in RTL */
  bottom: var(--dzc-offset);
  z-index: var(--dzc-z);
  width: min(var(--dzc-width), calc(100vw - (var(--dzc-offset) * 2)));
  /* Long texts, small screens and 200% zoom: scroll inside the banner */
  max-height: calc(100vh - (var(--dzc-offset) * 2));
  max-height: calc(100dvh - (var(--dzc-offset) * 2));
  overflow-y: auto;
  overscroll-behavior: contain;
  box-sizing: border-box;
  margin: 0;
  padding: 20px;
  border: 1px solid var(--dzc-border);
  border-radius: var(--dzc-radius);
  background: var(--dzc-bg);
  color: var(--dzc-text);
  font-family: var(--dzc-font);
  text-align: start;
  box-shadow: var(--dzc-shadow);
}

/* Keyboard focus never ends up hidden behind the banner (WCAG 2.4.11) */
html.dzc-pending{ scroll-padding-bottom: min(calc(var(--dzc-h, 0px) + (var(--dzc-offset) * 2)), 50vh); }

.dzc__inner{ position: relative; }

/* Title is an h2: reset theme heading styles */
.dzc .dzc__title{
  margin: 0 0 6px;
  padding: 0;
  padding-inline-end: 40px;     /* room for the close button */
  overflow-wrap: anywhere;
  font-family: var(--dzc-font);
  font-size: 1rem;
  font-weight: 700;
  line-height: 1.3;
  letter-spacing: normal;
  text-transform: none;
  color: var(--dzc-title, var(--dzc-text));
}
.dzc .dzc__title:focus{ outline: none; }
.dzc .dzc__title:focus-visible{ outline: 2px solid var(--dzc-focus); outline-offset: 2px; }

.dzc__text{
  margin: 0 0 16px;
  overflow-wrap: anywhere;      /* long URLs or words never scroll sideways */
  font-size: .875rem;
  line-height: 1.5;
  color: var(--dzc-muted);
}
.dzc__link{
  color: var(--dzc-text);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.dzc__actions{
  display: flex;
  flex-wrap: wrap;              /* buttons stack when there is no room (320px, 200% text) */
  gap: 8px;
}
.dzc__btn{
  flex: 1 1 8em;
  min-width: 0;
  min-height: 44px;             /* touch target */
  padding: 10px 16px;
  border: 1.5px solid var(--dzc-accent);
  border-radius: var(--dzc-btn-radius);
  background: var(--dzc-accent);
  color: var(--dzc-accent-text);
  font: inherit;
  font-size: .9375rem;
  font-weight: 600;
  line-height: 1.2;
  cursor: pointer;
}
.dzc__btn{ transition: transform .18s ease, box-shadow .18s ease, filter .18s ease; }
@media (hover: hover) and (pointer: fine){
  .dzc__btn:hover{ filter: brightness(1.08); transform: translateY(-1px); }
}
.dzc__btn:active{ transform: translateY(1px) scale(.98); filter: brightness(.9); }
@media (prefers-reduced-motion: reduce){
  .dzc__btn, .dzc__btn:hover, .dzc__btn:active{ transition: none; transform: none; }
}
/* Reopened banner: the current choice gets a tick (decorative: the
   alt text "" keeps it out of the button's name where supported) */
.dzc__btn[aria-pressed="true"]::before{
  content: "\2713\00a0";
  content: "\2713\00a0" / "";
}

/* Close button: only on a banner the visitor opened (never on the first,
   automatic one). Themes style every <button> (background, border,
   colour, sometimes position on hover or focus), so every state is set
   here explicitly, with enough specificity to win. */
html body .dzc .dzc__close,
html body .dzc .dzc__close:hover,
html body .dzc .dzc__close:focus,
html body .dzc .dzc__close:active{
  display: none;
  position: absolute;
  top: -8px;
  bottom: auto;
  left: auto;
  right: auto;
  inset-inline-end: -8px;
  inset-inline-start: auto;
  width: 44px;
  height: 44px;
  min-width: 0;
  min-height: 0;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: transparent;
  box-shadow: none;
  color: var(--dzc-title, var(--dzc-text));
  font: inherit;
  font-size: 1.5rem;
  line-height: 1;
  text-shadow: none;
  text-transform: none;
  transform: none;
  filter: none;
  appearance: none;
  cursor: pointer;
}
html body .dzc.can-close .dzc__close{ display: block; }
html body .dzc.can-close .dzc__close:hover{ display: block; background: rgba(31,41,51,.08); }
html body .dzc.can-close .dzc__close:focus,
html body .dzc.can-close .dzc__close:active{ display: block; }

.dzc__btn:focus-visible,
.dzc__close:focus-visible,
.dzc__link:focus-visible{
  outline: 3px solid var(--dzc-focus);
  outline-offset: 2px;
}

@media (max-width: 480px){
  html.dzc-pending .dzc,
  .dzc.is-open{
    inset-inline: 8px;
    bottom: 8px;
    width: auto;
    max-height: calc(100vh - 16px);
    max-height: calc(100dvh - 16px);
    padding: 16px;
  }
}

@media print{
  .dzc{ display: none !important; }
}
