/*!
 * cookieblocker.de – Banner & Zwei-Klick-Platzhalter
 * Alle Klassen mit Präfix .cb- · Farben über CSS-Variablen
 */

/* ---------- Farbwelten ---------- */

.cb-root,
.cb-embed,
.cb-decl {
  --cb-bg: #ffffff;
  --cb-text: #14213d;
  --cb-muted: #52607a;
  --cb-accent: #0b2350;
  --cb-accent-text: #ffffff;
  --cb-border: #d6deeb;
  --cb-soft: #eef3fc;
  --cb-focus: #3b6fd8;
  --cb-radius: 12px;
  --cb-font: inherit;
  --cb-shadow: 0 10px 40px rgba(11, 35, 80, .18), 0 2px 8px rgba(11, 35, 80, .08);
}

/* Einstellungsdialog mit eigener Farbwelt (themeDetail) */
.cb-modal.cb-theme-light {
  --cb-bg: #ffffff;
  --cb-text: #14213d;
  --cb-muted: #52607a;
  --cb-accent: #0b2350;
  --cb-accent-text: #ffffff;
  --cb-border: #d6deeb;
  --cb-soft: #eef3fc;
  --cb-focus: #3b6fd8;
}

.cb-root.cb-theme-dark,
.cb-modal.cb-theme-dark {
  --cb-bg: #0f1d3a;
  --cb-text: #f2f5fb;
  --cb-muted: #b3bfd6;
  --cb-accent: #ffffff;
  --cb-accent-text: #0b2350;
  --cb-border: #2b3d63;
  --cb-soft: #172a52;
  --cb-focus: #93b4f5;
}

/* ---------- Grundlagen ---------- */

.cb-root,
.cb-root *,
.cb-embed,
.cb-embed *,
.cb-decl,
.cb-decl * {
  box-sizing: border-box;
}

.cb-root {
  font-family: var(--cb-font);
  font-size: 15px;
  line-height: 1.5;
  color: var(--cb-text);
  letter-spacing: normal;
  text-align: left;
}

.cb-sr {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

.cb-icon {
  display: inline-flex;
  line-height: 0;
}

.cb-icon svg {
  width: 1.25em;
  height: 1.25em;
}

.cb-root a,
.cb-embed a {
  color: inherit;
  text-decoration: underline;
  text-underline-offset: 2px;
}

/* Hover-/Besucht-Farben des Templates nicht übernehmen – eigenes, festes Design */
.cb-root a:hover,
.cb-root a:focus,
.cb-root a:active,
.cb-root a:visited,
.cb-embed a:hover,
.cb-embed a:focus,
.cb-embed a:active,
.cb-embed a:visited {
  color: inherit;
  background: none;
  text-decoration: underline;
}

.cb-root a:hover,
.cb-embed a:hover { text-decoration-thickness: 2px; }

.cb-root :focus-visible,
.cb-embed :focus-visible {
  outline: 3px solid var(--cb-focus);
  outline-offset: 2px;
}

.cb-title {
  margin: 0 0 .5em;
  font-family: inherit;
  font-size: 1.1em;
  font-weight: 700;
  line-height: 1.3;
  color: var(--cb-text);
  text-transform: none;
}

.cb-text {
  margin: 0 0 1em;
  color: var(--cb-muted);
  font-size: .93em;
}

/* ---------- Buttons ---------- */

.cb-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .5em;
  min-height: 44px;
  padding: .6em 1.2em;
  margin: 0;
  border: 2px solid var(--cb-accent);
  border-radius: min(var(--cb-radius), 999px);
  background: var(--cb-accent);
  color: var(--cb-accent-text);
  font: inherit;
  font-size: .93em;
  font-weight: 600;
  line-height: 1.2;
  text-align: center;
  text-decoration: none;
  text-transform: none;
  cursor: pointer;
  transition: filter .15s, background-color .15s, color .15s;
}

.cb-btn:hover {
  filter: brightness(1.15);
}

.cb-btn--outline {
  background: transparent;
  color: var(--cb-accent);
}

.cb-btn--outline:hover {
  background: var(--cb-soft);
  filter: none;
}

.cb-actions {
  display: flex;
  flex-wrap: wrap;
  gap: .5em;
}

.cb-actions .cb-btn {
  flex: 1 1 auto;
}

.cb-links {
  display: flex;
  gap: 1em;
  margin: .9em 0 0;
  font-size: .8em;
  color: var(--cb-muted);
}

/* ---------- Banner (1. Ebene) ---------- */

.cb-banner {
  position: fixed;
  z-index: 2147483000;
  background: var(--cb-bg);
  color: var(--cb-text);
  border: 1px solid var(--cb-border);
  border-radius: var(--cb-radius);
  box-shadow: var(--cb-shadow);
  padding: 1.25em 1.25em 1em;
  animation: cb-in .25s ease-out;
}

.cb-root[data-layout="corner"] .cb-banner {
  width: min(400px, calc(100vw - 32px));
  max-height: calc(100vh - 32px);
  overflow-y: auto;
}

.cb-root[data-layout="corner"][data-position="bottom"] .cb-banner { bottom: 16px; }
.cb-root[data-layout="corner"][data-position="top"] .cb-banner { top: 16px; }
.cb-root[data-layout="corner"][data-side="left"] .cb-banner { left: 16px; }
.cb-root[data-layout="corner"][data-side="right"] .cb-banner { right: 16px; }

.cb-root[data-layout="corner"] .cb-actions {
  flex-direction: column;
}

.cb-root[data-layout="bottom"] .cb-banner {
  left: 0;
  right: 0;
  border-radius: 0;
  border-width: 1px 0 0;
  padding: 1.25em max(16px, calc((100vw - 1140px) / 2));
  display: grid;
  grid-template-columns: 1fr auto;
  column-gap: 2em;
  align-items: center;
}

.cb-root[data-layout="bottom"][data-position="bottom"] .cb-banner { bottom: 0; }
.cb-root[data-layout="bottom"][data-position="top"] .cb-banner { top: 0; border-width: 0 0 1px; }

.cb-root[data-layout="bottom"] .cb-title,
.cb-root[data-layout="bottom"] .cb-text,
.cb-root[data-layout="bottom"] .cb-links { grid-column: 1; }
.cb-root[data-layout="bottom"] .cb-text { margin-bottom: 0; }
.cb-root[data-layout="bottom"] .cb-actions { grid-column: 2; grid-row: 1 / span 6; align-self: center; }

/* Center-Banner & Einstellungsdialog teilen sich den Hintergrund */
.cb-backdrop {
  position: fixed;
  inset: 0;
  z-index: 2147483001;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  background: rgba(8, 20, 45, .55);
  animation: cb-fade .2s ease-out;
}

.cb-backdrop .cb-banner {
  position: relative;
  width: min(520px, 100%);
  max-height: calc(100vh - 32px);
  overflow-y: auto;
}

/* Kopfzeile mit Logo und Schließen-Button */
.cb-banner__head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1em;
  margin-bottom: .75em;
}

.cb-logo {
  display: block;
  max-width: min(180px, 100%);
  max-height: 40px;
  width: auto;
  height: auto;
}

.cb-logo--m { max-width: min(240px, 100%); max-height: 56px; }
.cb-logo--l { max-width: min(300px, 100%); max-height: 72px; }

.cb-logo-link { display: inline-block; border-radius: 4px; }
.cb-logo-link:hover .cb-logo { opacity: .85; }

.cb-banner__head .cb-close { margin: -.5em -.6em 0 auto; }

/* Kategorien als Checkboxen im ersten Banner */
.cb-checks {
  display: flex;
  flex-wrap: wrap;
  gap: .4em 1.1em;
  margin: 0 0 1em;
  padding: .7em .8em;
  border-radius: calc(var(--cb-radius) * .6);
  background: var(--cb-soft);
}

.cb-check {
  display: inline-flex;
  align-items: center;
  gap: .45em;
  font-size: .9em;
  color: var(--cb-text);
  cursor: pointer;
}

.cb-check__input {
  width: 18px;
  height: 18px;
  margin: 0;
  accent-color: var(--cb-accent);
  cursor: pointer;
}

.cb-theme-dark .cb-check__input { accent-color: #3b6fd8; }
.cb-check__input:disabled { cursor: not-allowed; }

.cb-root[data-layout="bottom"] .cb-banner__head,
.cb-root[data-layout="bottom"] .cb-checks { grid-column: 1; }

/* Hoher Kontrast (WCAG AAA): gedeckte Texte werden voll, Rahmen kräftiger, Links unterstrichen */
.cb-root.cb-hc,
.cb-root.cb-hc .cb-modal { --cb-muted: var(--cb-text); --cb-border: var(--cb-text); }
.cb-root.cb-hc[data-glass] .cb-banner,
.cb-root.cb-hc[data-glass] .cb-modal { background: var(--cb-bg); -webkit-backdrop-filter: none; backdrop-filter: none; }
.cb-root.cb-hc .cb-banner,
.cb-root.cb-hc .cb-modal { border: 2px solid var(--cb-text); }
.cb-root.cb-hc .cb-btn { border-width: 3px; }
.cb-root.cb-hc .cb-btn--outline { border-color: var(--cb-text); color: var(--cb-text); }
.cb-root.cb-hc a { text-decoration-thickness: 2px; }
.cb-root.cb-hc .cb-switch__track { background: #4a5568; }
.cb-root.cb-hc :focus-visible { outline-width: 4px; }

/* Milchglas: 88 % Deckkraft hält den Textkontrast auf jedem Seitenhintergrund über 4,5:1 */
@supports ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) and (background: color-mix(in srgb, red 50%, transparent)) {
  .cb-root[data-glass] .cb-banner,
  .cb-root[data-glass] .cb-modal {
    background: color-mix(in srgb, var(--cb-bg) 88%, transparent);
    -webkit-backdrop-filter: blur(16px) saturate(1.6);
    backdrop-filter: blur(16px) saturate(1.6);
    border-color: color-mix(in srgb, var(--cb-border) 70%, transparent);
  }
  .cb-root[data-glass] .cb-backdrop {
    background: rgba(8, 20, 45, .35);
    -webkit-backdrop-filter: blur(4px);
    backdrop-filter: blur(4px);
  }
}

@media (prefers-reduced-transparency: reduce) {
  .cb-root[data-glass] .cb-banner,
  .cb-root[data-glass] .cb-modal { background: var(--cb-bg); backdrop-filter: none; }
}

/* ---------- Einstellungen (2. Ebene) ---------- */

.cb-backdrop--modal {
  z-index: 2147483002;
}

.cb-modal {
  display: flex;
  flex-direction: column;
  width: min(640px, 100%);
  max-height: min(760px, calc(100vh - 32px));
  background: var(--cb-bg);
  color: var(--cb-text);
  border-radius: var(--cb-radius);
  box-shadow: var(--cb-shadow);
  animation: cb-in .25s ease-out;
}

.cb-modal__head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1em;
  padding: 1.25em 1.25em .5em;
}

.cb-modal__head .cb-title { margin: 0; }
.cb-modal__brand { display: flex; flex-direction: column; align-items: flex-start; gap: .7em; min-width: 0; }

.cb-modal__body {
  flex: 1;
  overflow-y: auto;
  padding: 0 1.25em;
}

.cb-modal__foot {
  padding: 1em 1.25em;
  border-top: 1px solid var(--cb-border);
}

.cb-close {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  margin: -.4em -.4em 0 0;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--cb-muted);
  cursor: pointer;
}

.cb-close:hover { background: var(--cb-soft); color: var(--cb-text); }

.cb-consent-id {
  margin: .5em 0 0;
  font-size: .72em;
  color: var(--cb-muted);
  word-break: break-all;
}

/* Templates färben <code> oft ein (z. B. YOOtheme gelb) – hier bewusst neutral */
.cb-consent-id code {
  padding: 0;
  border: 0;
  background: none;
  color: inherit;
  font-family: ui-monospace, Consolas, monospace;
  font-size: inherit;
}

.cb-cats { margin-bottom: 1em; }

.cb-cat {
  padding: 1em 0;
  border-top: 1px solid var(--cb-border);
}

.cb-cat__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1em;
}

.cb-cat__name {
  margin: 0;
  font-family: inherit;
  font-size: 1em;
  font-weight: 700;
  color: var(--cb-text);
}

.cb-cat__desc {
  margin: .35em 0 0;
  font-size: .88em;
  color: var(--cb-muted);
}

.cb-details {
  margin-top: .6em;
  font-size: .85em;
}

.cb-details summary {
  cursor: pointer;
  color: var(--cb-accent);
  font-weight: 600;
  width: max-content;
}

.cb-theme-dark .cb-details summary { color: var(--cb-text); }

.cb-services {
  margin-top: .6em;
  display: grid;
  gap: .6em;
}

.cb-service {
  padding: .8em;
  background: var(--cb-soft);
  border-radius: calc(var(--cb-radius) * .6);
}

.cb-service p { margin: 0 0 .3em; color: var(--cb-muted); }
.cb-service strong { color: var(--cb-text); font-weight: 600; }
.cb-service__name { font-weight: 700; color: var(--cb-text) !important; }

.cb-table {
  width: 100%;
  margin-top: .5em;
  border-collapse: collapse;
  font-size: .95em;
}

.cb-table th,
.cb-table td {
  padding: .35em .5em .35em 0;
  border-bottom: 1px solid var(--cb-border);
  text-align: left;
  vertical-align: top;
  color: var(--cb-muted);
  word-break: break-word;
}

.cb-table th { color: var(--cb-text); font-weight: 600; }

/* ---------- Schalter ---------- */

.cb-switch {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: .5em;
  flex-shrink: 0;
  cursor: pointer;
}

.cb-switch__input {
  position: absolute;
  opacity: 0;
  width: 44px;
  height: 26px;
  margin: 0;
  cursor: pointer;
}

.cb-switch__track {
  position: relative;
  width: 44px;
  height: 26px;
  border-radius: 13px;
  background: #9aa6bd;
  transition: background-color .2s;
}

.cb-switch__track::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 3px rgba(0, 0, 0, .25);
  transition: transform .2s;
}

.cb-switch__input:checked + .cb-switch__track { background: var(--cb-accent); }
.cb-theme-dark .cb-switch__input:checked + .cb-switch__track { background: #3b6fd8; }
.cb-switch__input:checked + .cb-switch__track::after { transform: translateX(18px); }
.cb-switch__input:disabled + .cb-switch__track { opacity: .55; cursor: not-allowed; }
.cb-switch__input:focus-visible + .cb-switch__track { outline: 3px solid var(--cb-focus); outline-offset: 2px; }

.cb-switch__label {
  font-size: .8em;
  color: var(--cb-muted);
  order: -1;
}

/* ---------- Badge ---------- */

.cb-badge {
  position: fixed;
  z-index: 2147482999;
  bottom: 16px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  padding: 0;
  border: 1px solid var(--cb-border);
  border-radius: 50%;
  /* Farbwelt des Banners: hell → heller Kreis mit Akzent-Symbol, dunkel → umgekehrt */
  background: var(--cb-bg);
  color: var(--cb-accent);
  box-shadow: var(--cb-shadow);
  font-size: 18px;
  cursor: pointer;
  transition: transform .15s;
}

.cb-badge:hover { transform: scale(1.06); }

.cb-badge--label {
  width: auto;
  gap: .5em;
  padding: 0 1.1em 0 .8em;
  border-radius: 999px;
  font-family: var(--cb-font);
  font-size: 14px;
  font-weight: 600;
}

.cb-badge--label:hover { transform: none; background: var(--cb-soft); }
.cb-badge[hidden] { display: none; }
.cb-root[data-side="left"] .cb-badge { left: 16px; }
.cb-root[data-side="right"] .cb-badge { right: 16px; }

html.cb-noscroll,
html.cb-noscroll body { overflow: hidden; }

/* ---------- Zwei-Klick-Platzhalter ---------- */

.cb-embed {
  position: relative;
  display: block;
  width: 100%;
  max-width: 100%;
  aspect-ratio: 16 / 9;
  margin: 0 0 1em;
  overflow: hidden;
  border-radius: var(--cb-radius);
  background: #0b2350;
  color: #fff;
  font-family: var(--cb-font);
  font-size: 15px;
  line-height: 1.45;
}

.cb-embed.is-loaded { background: transparent; }

.cb-embed__frame {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

.cb-embed__thumb,
.cb-embed__bg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.cb-embed__bg {
  background:
    radial-gradient(circle at 30% 30%, rgba(59, 111, 216, .35), transparent 55%),
    linear-gradient(135deg, #0b2350, #1e3a8a);
}

/* Neutrale Kartengrafik – rein lokal, keine Tiles */
.cb-embed--osm .cb-embed__bg {
  background-color: #e8eef7;
  background-image:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='240' height='240' viewBox='0 0 240 240'%3E%3Cg fill='none' stroke-linecap='round'%3E%3Cpath d='M-10 70 C60 40 90 120 250 80' stroke='%23ffffff' stroke-width='14'/%3E%3Cpath d='M-10 70 C60 40 90 120 250 80' stroke='%23c9d5e8' stroke-width='2'/%3E%3Cpath d='M80 -10 C100 80 60 150 120 250' stroke='%23ffffff' stroke-width='10'/%3E%3Cpath d='M-10 180 L250 200' stroke='%23ffffff' stroke-width='6'/%3E%3Cpath d='M170 -10 L190 250' stroke='%23ffffff' stroke-width='6'/%3E%3C/g%3E%3Crect x='120' y='110' width='36' height='26' rx='3' fill='%23d3e4cf'/%3E%3Crect x='20' y='110' width='40' height='50' rx='3' fill='%23d8dfea'/%3E%3Ccircle cx='205' cy='40' r='18' fill='%23cfe0f3'/%3E%3C/svg%3E");
  background-size: 240px 240px;
}

.cb-embed__overlay {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: .7em;
  padding: 1em 1.25em;
  text-align: center;
  background: rgba(8, 20, 45, .62);
  overflow-y: auto;
}

.cb-embed--osm .cb-embed__overlay { background: rgba(8, 20, 45, .72); }

.cb-embed__title {
  margin: 0;
  font-weight: 700;
  font-size: 1.05em;
  color: #fff;
}

.cb-embed__text {
  max-width: 34em;
  margin: 0;
  font-size: .9em;
  color: #fff;
}

.cb-embed__text a { color: #fff; }

.cb-embed .cb-btn--primary {
  --cb-accent: #ffffff;
  --cb-accent-text: #0b2350;
  border-color: #fff;
}

.cb-embed__btn .cb-icon svg { width: 1.4em; height: 1.4em; }

.cb-embed__always {
  display: inline-flex;
  align-items: center;
  gap: .5em;
  font-size: .85em;
  color: #fff;
  cursor: pointer;
}

.cb-embed__check {
  width: 18px;
  height: 18px;
  margin: 0;
  accent-color: #3b6fd8;
  cursor: pointer;
}

.cb-embed__ext {
  font-size: .8em;
  color: #dbe6ff !important;
}

.cb-embed :focus-visible { outline-color: #93b4f5; }

/* ---------- Klein & Mobil ---------- */

@media (max-width: 640px) {
  .cb-root[data-layout="bottom"] .cb-banner {
    display: block;
    padding: 1em 16px;
  }
  .cb-root[data-layout="bottom"] .cb-actions { margin-top: 1em; flex-direction: column; }
  .cb-root[data-layout="corner"] .cb-banner {
    left: 8px !important;
    right: 8px !important;
    bottom: 8px;
    width: auto;
  }
  .cb-backdrop { padding: 8px; align-items: flex-end; }
  .cb-modal { max-height: calc(100vh - 16px); }
  .cb-embed { font-size: 13px; }
  .cb-embed__overlay { gap: .45em; padding: .75em; }
  .cb-embed__title { display: none; }
  .cb-embed .cb-btn { min-height: 40px; padding: .45em 1em; }
}

@media (max-width: 380px) {
  .cb-embed__always { font-size: .8em; }
}

@media (prefers-reduced-motion: reduce) {
  .cb-banner,
  .cb-modal,
  .cb-backdrop { animation: none; }
  .cb-btn,
  .cb-badge,
  .cb-switch__track,
  .cb-switch__track::after { transition: none; }
}

@media (forced-colors: active) {
  .cb-switch__track { border: 1px solid CanvasText; }
  .cb-btn { border: 2px solid ButtonText; }
}

@keyframes cb-in {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: none; }
}

@keyframes cb-fade {
  from { opacity: 0; }
  to { opacity: 1; }
}

/* ---------- Cookie-Erklärung auf der Datenschutzseite ---------- */

.cb-decl {
  margin: 2em 0;
  font-size: inherit;
  line-height: 1.6;
}

.cb-decl h2 { margin: 0 0 .8em; }
.cb-decl h3 { margin: 1.6em 0 .3em; }
.cb-decl p { margin: 0 0 .8em; }

.cb-decl__box {
  padding: 1.1em 1.25em;
  border: 1px solid var(--cb-border);
  border-radius: var(--cb-radius);
  background: var(--cb-soft);
  color: var(--cb-text);
}

.cb-decl__status { margin-bottom: 1em !important; }

.cb-decl__choices {
  display: flex;
  flex-wrap: wrap;
  gap: .5em 1.4em;
  margin: 0 0 1em;
  padding: 0;
  border: 0;
}

.cb-decl__choices legend {
  width: 100%;
  margin-bottom: .4em;
  padding: 0;
  font-weight: 700;
}

.cb-decl .cb-actions .cb-btn { flex: 0 1 auto; }
.cb-decl .cb-consent-id { margin: .9em 0 0; font-size: .8em; }

.cb-decl__scroll { overflow-x: auto; }

.cb-decl__table {
  width: 100%;
  border-collapse: collapse;
  font-size: .9em;
}

.cb-decl__table th,
.cb-decl__table td {
  padding: .5em .8em .5em 0;
  border-bottom: 1px solid var(--cb-border);
  text-align: left;
  vertical-align: top;
}

.cb-decl__table th { font-weight: 700; white-space: nowrap; }
.cb-decl__name { font-family: ui-monospace, Consolas, monospace; word-break: break-all; }

/* Platzhalter über YOOtheme-Karten ([uk-map]) – liegt über der leeren Kartenfläche */
.cb-embed.cb-map-placeholder {
  position: absolute;
  inset: 0;
  z-index: 1000;
  width: auto;
  height: auto;
  aspect-ratio: auto;
  margin: 0;
}
