/* Klaro consent · Appléritif. klaro.js is the no-CSS build, so this file is all the styling there is.
   Values come only from the theme's css/tokens.css. Buttons mirror .knopf / .knopf--hell / .kachel .knopf from css/components.css
   (Klaro's markup cannot carry those classes): keep them in step.

   Notice: slim bar at the bottom, not a modal. No backdrop, no scroll lock, no layout shift (position: fixed).
   Short fade only: text first painted at opacity 0 is not an LCP candidate, so the bar cannot become the page's LCP element.
   z-index 65: above the note popup (60) and the buy bar (45), below the drawer veil (70), mobile menu (80) and drawer (90).
   --clo-klaro-unten and --clo-klaro-hoehe are set by klaro-config.js (buy bar height; bar height for scroll room).
   Decline and accept are styled identically on purpose: no colour or size nudging. Do not change one without the other. */

.klaro,
.klaro * { box-sizing: border-box; }

.klaro {
  font-family: var(--schrift-text);
  font-size: var(--gr-klein);
  color: var(--text);
}

/* ---------- Scroll room while the bar is open: page end and focused elements stay above it ---------- */
html.clo-consent-offen { scroll-padding-bottom: var(--clo-klaro-hoehe, 0); }
html.clo-consent-offen body { padding-bottom: var(--clo-klaro-hoehe, 0); }

/* The note popup waits for the consent decision (logic in klaro-config.js). */
html.clo-consent-offen .zettel-popup { visibility: hidden; }

/* ---------- Bar ---------- */
.klaro .cookie-notice {
  position: fixed;
  left: 0;
  right: 0;
  bottom: var(--clo-klaro-unten, 0);
  z-index: 65;
  background: var(--weiss);
  border-top: 1px solid var(--linie);
  padding: 12px var(--rand) calc(12px + env(safe-area-inset-bottom));
}
@keyframes clo-klaro-ein { from { opacity: 0; } to { opacity: 1; } }
.klaro .cookie-notice { animation: clo-klaro-ein 0.15s linear; }
.klaro .cookie-notice:focus { outline: none; }
.klaro .cookie-notice-hidden { display: none; }

.klaro .cn-body {
  display: grid;
  gap: 10px;
  max-width: var(--innen-max);
  margin-inline: auto;
}
.klaro .cn-body p {
  margin: 0;
  font-size: var(--gr-klein);
  line-height: 1.35;
  color: var(--text);
}

/* Three options on one level, equal width. .cn-buttons dissolves so all three are items of the same grid. */
.klaro .cn-ok {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}
.klaro .cn-buttons { display: contents; }

@media (min-width: 900px) {
  .klaro .cn-body {
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 12px 24px;
  }
  .klaro .cn-ok { grid-template-columns: repeat(3, 8.5rem); }
}

/* ---------- Buttons: .knopf ---------- */
.klaro .cm-btn,
.klaro a.cn-learn-more {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0 14px;
  border-radius: var(--radius-klein);
  border: 1.5px solid var(--gruen);
  background: var(--gruen);
  color: var(--weiss);
  font-family: var(--schrift-text);
  font-size: var(--gr-klein);
  font-weight: 400;
  line-height: 1.15;
  letter-spacing: 0.02em;
  text-align: center;
  text-decoration: none;
  text-transform: none;
  cursor: pointer;
  transition: transform 0.25s var(--kurve), background 0.25s, color 0.25s, box-shadow 0.25s;
}
.klaro .cm-btn:visited { color: var(--weiss); }
.klaro .cm-btn:hover,
.klaro .cm-btn:focus {
  background: var(--gruen);
  border-color: var(--gruen);
  color: var(--weiss);
}
.klaro .cm-btn:hover,
.klaro a.cn-learn-more:hover {
  transform: translateY(-2px);
  box-shadow: var(--schatten);
}
.klaro .cm-btn:active,
.klaro a.cn-learn-more:active { transform: none; }

/* .knopf--hell: settings in the bar, "save selection" in the dialog */
.klaro a.cn-learn-more,
.klaro a.cn-learn-more:visited,
.klaro .cm-btn.cm-btn-accept:not(.cm-btn-accept-all) {
  background: transparent;
  color: var(--gruen);
}
.klaro a.cn-learn-more:hover,
.klaro a.cn-learn-more:focus,
.klaro .cm-btn.cm-btn-accept:not(.cm-btn-accept-all):hover,
.klaro .cm-btn.cm-btn-accept:not(.cm-btn-accept-all):focus {
  background: var(--gruen);
  color: var(--weiss);
}
.klaro a.cn-learn-more:focus:not(:focus-visible),
.klaro .cm-btn.cm-btn-accept:not(.cm-btn-accept-all):focus:not(:focus-visible) {
  background: transparent;
  color: var(--gruen);
}

/* Narrow phones: three buttons in one row, the words must still fit */
@media (max-width: 479px) {
  .klaro .cookie-notice .cm-btn,
  .klaro a.cn-learn-more { padding: 0 4px; letter-spacing: 0; }
}

/* ---------- Links and focus ---------- */
.klaro a {
  color: var(--gruen);
  text-decoration: underline;
  text-underline-offset: 2px;
}
.klaro a:visited,
.klaro a:hover { color: var(--gruen); }

.klaro :focus-visible {
  outline: 2px solid var(--gruen);
  outline-offset: 3px;
  border-radius: 4px;
}
.klaro .cm-btn:focus-visible,
.klaro a.cn-learn-more:focus-visible { border-radius: var(--radius-klein); }

/* ---------- Settings dialog (opened on purpose, so it may sit in front of the page) ---------- */
.klaro .cookie-modal {
  position: fixed;
  inset: 0;
  z-index: 100000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}
.klaro .cookie-modal .cm-bg {
  position: fixed;
  inset: 0;
  background: var(--linie);
}
.klaro .cookie-modal .cm-modal {
  position: relative;
  display: flex;
  flex-direction: column;
  width: 100%;
  max-width: 560px;
  max-height: calc(100vh - 32px);
  max-height: calc(100dvh - 32px);
  background: var(--weiss);
  border: 1px solid var(--linie);
  border-radius: var(--radius);
  overflow: hidden;
}

.klaro .cm-header {
  position: relative;
  padding: 20px var(--rand) 16px 24px;
  border-bottom: 1px solid var(--linie);
}
.klaro .cm-header .title {
  margin: 0 40px 8px 0;
  font-family: var(--schrift-titel);
  font-size: var(--gr-m);
  font-weight: 500;
  line-height: 1.2;
  color: var(--gruen);
}
.klaro .cm-header p {
  margin: 0;
  font-size: var(--gr-klein);
  line-height: 1.4;
  color: var(--text);
}
.klaro .cm-header button.hide {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  padding: 0;
  border: 0;
  background: none;
  color: var(--gruen);
  cursor: pointer;
}
.klaro .cm-header button.hide:hover,
.klaro .cm-header button.hide:focus {
  background: none;
  color: var(--gruen);
}
.klaro .cm-header button.hide svg { width: 16px; height: 16px; stroke: currentColor; }
.klaro .cm-header button.hide svg line { stroke: currentColor; }

.klaro .cm-body {
  flex: 1 1 auto;
  min-height: 0;
  padding: 8px 24px;
  overflow-y: auto;
}
.klaro .cm-purposes,
.klaro .cm-content {
  list-style: none;
  margin: 0;
  padding: 0;
}
.klaro .cm-purpose {
  padding: 12px 0;
  border-bottom: 1px solid var(--linie);
}
.klaro .cm-purpose:last-child { border-bottom: 0; }
.klaro .cm-service { padding: 8px 0 0; }

/* Checkbox stays in the page for Klaro and the keyboard, visually hidden; the label toggles it and the switch shows its state. */
.klaro .cm-list-input {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: 0;
  opacity: 0;
}
.klaro .cm-list-label {
  position: relative;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0 8px;
  padding-right: 56px;
  min-height: 24px;
  cursor: pointer;
}
.klaro .cm-list-title {
  font-size: var(--gr-text);
  font-weight: 500;
  color: var(--gruen);
}
.klaro .cm-service .cm-list-title { font-size: var(--gr-klein); }
.klaro .cm-required,
.klaro .cm-opt-out {
  font-size: var(--gr-klein);
  color: var(--text-leise);
}
.klaro .cm-list-description,
.klaro .cm-list-description.purposes,
.klaro .purposes {
  margin: 4px 0 0;
  font-size: var(--gr-klein);
  line-height: 1.4;
  color: var(--text-leise);
}

.klaro .cm-switch {
  position: absolute;
  top: 0;
  right: 0;
  display: block;
  width: 44px;
  height: 24px;
  pointer-events: none;
}
.klaro .cm-switch .slider {
  position: absolute;
  inset: 0;
  border: 1.5px solid var(--text-leise);
  border-radius: var(--radius-pille);
  background: var(--weiss);
  transition: background 0.25s;
}
.klaro .cm-switch .slider::before {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 15px;
  height: 15px;
  border-radius: 50%;
  background: var(--text-leise);
  transition: transform 0.25s var(--kurve), background 0.25s;
}
.klaro .cm-list-input:checked + .cm-list-label .slider {
  border-color: var(--gruen);
  background: var(--gruen);
}
.klaro .cm-list-input:checked + .cm-list-label .slider::before {
  transform: translateX(20px);
  background: var(--weiss);
}
/* half-checked: some services of this purpose are on */
.klaro .cm-list-input.half-checked:checked + .cm-list-label .slider {
  border-color: var(--text-leise);
  background: var(--salbei-kraeftig);
}
.klaro .cm-list-input.half-checked:checked + .cm-list-label .slider::before {
  transform: translateX(10px);
  background: var(--gruen);
}
.klaro .cm-list-input[disabled]:checked + .cm-list-label .slider {
  border-color: var(--salbei-kraeftig);
  background: var(--salbei-kraeftig);
}
.klaro .cm-list-input:focus-visible + .cm-list-label .slider {
  outline: 2px solid var(--gruen);
  outline-offset: 3px;
}

.klaro .cm-caret { margin-top: 4px; }
.klaro .cm-caret a {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  min-height: 24px;
  font-size: var(--gr-klein);
}
.klaro .cm-content { display: none; }
.klaro .cm-content.expanded {
  display: block;
  margin-top: 4px;
  padding-left: 12px;
  border-left: 1.5px solid var(--linie);
}

.klaro .cm-footer {
  padding: 12px 24px calc(12px + env(safe-area-inset-bottom));
  border-top: 1px solid var(--linie);
}
.klaro .cm-footer-buttons {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(0, 1fr);
  gap: 8px;
}

@media (max-width: 479px) {
  .klaro .cookie-modal { align-items: flex-end; padding: 0; }
  .klaro .cookie-modal .cm-modal {
    max-width: none;
    max-height: 100vh;
    max-height: 100dvh;
    border-width: 1px 0 0;
    border-radius: var(--radius) var(--radius) 0 0;
  }
  .klaro .cm-header { padding-left: var(--rand); }
  .klaro .cm-body { padding-inline: var(--rand); }
  .klaro .cm-footer { padding-inline: var(--rand); }
  .klaro .cm-footer-buttons { grid-auto-flow: row; }
}

@media (prefers-reduced-motion: reduce) {
  .klaro .cm-btn,
  .klaro a.cn-learn-more,
  .klaro .cm-switch .slider,
  .klaro .cm-switch .slider::before { transition: none; }
  .klaro .cm-btn:hover,
  .klaro a.cn-learn-more:hover { transform: none; }
}
