/* ================================================================
   site.css — globale Responsive-Korrekturen
   wird via nav-home.php auf jeder Seite eingebunden
   ================================================================ */

/* Verhindert horizontales Scrollen durch dekorative Hintergrund-Blobs,
   absolute Elemente und überlange Wörter. clip statt hidden, damit
   sticky-Positionierung in Vorfahren weiter funktioniert. */
html { overflow-x: clip; }
body { overflow-x: clip; min-width: 0; }

/* Lange deutsche Wörter (Bauzeitverlängerungen, Stockwerkeigentum, …)
   in Headings/Prosa-Text sicher umbrechen. */
h1, h2, h3, h4, h5, h6 {
  overflow-wrap: anywhere;
  word-wrap: break-word;
  hyphens: auto;
}

/* Bilder und Videos nie über Container hinaus */
img, video, svg, iframe, table {
  max-width: 100%;
}

/* ================================================================
   Mobile Navigation (Hamburger)
   ================================================================ */

.nav-mobile-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: 0.75rem;
  border: 1px solid #e2e8f0;
  background: #fff;
  color: #0f172a;
  transition: background-color .15s ease, color .15s ease;
}
.nav-mobile-toggle:hover { background: #f8fafc; }
.nav-mobile-toggle:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.35);
}
@media (min-width: 1024px) {
  .nav-mobile-toggle { display: none; }
}

.nav-mobile-panel {
  position: fixed;
  inset: 0;
  z-index: 60;
  background: rgba(15, 23, 42, 0.45);
  backdrop-filter: blur(2px);
  -webkit-backdrop-filter: blur(2px);
  opacity: 0;
  pointer-events: none;
  transition: opacity .2s ease;
}
.nav-mobile-panel.is-open {
  opacity: 1;
  pointer-events: auto;
}
.nav-mobile-panel-inner {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  width: min(86vw, 22rem);
  background: #fff;
  display: flex;
  flex-direction: column;
  padding: 1.25rem 1.25rem 2rem;
  transform: translateX(100%);
  transition: transform .25s ease;
  box-shadow: -24px 0 48px -12px rgba(15, 23, 42, 0.18);
}
.nav-mobile-panel.is-open .nav-mobile-panel-inner { transform: translateX(0); }

.nav-mobile-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: 1rem;
  margin-bottom: 1rem;
  border-bottom: 1px solid #f1f5f9;
}
.nav-mobile-close {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 0.625rem;
  background: #f8fafc;
  color: #0f172a;
  border: none;
  cursor: pointer;
}
.nav-mobile-close:hover { background: #f1f5f9; }

.nav-mobile-list {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  list-style: none;
  margin: 0;
  padding: 0;
}
.nav-mobile-list a {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.85rem 0.875rem;
  border-radius: 0.625rem;
  font-size: 0.95rem;
  font-weight: 700;
  color: #0f172a;
  text-decoration: none;
  transition: background-color .15s ease, color .15s ease;
}
.nav-mobile-list a:hover {
  background: #eff6ff;
  color: #2563eb;
}
.nav-mobile-list a i {
  color: #94a3b8;
  font-size: 0.75rem;
}

.nav-mobile-cta {
  margin-top: auto;
  padding-top: 1.25rem;
  border-top: 1px solid #f1f5f9;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}
.nav-mobile-cta a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.85rem 1rem;
  font-weight: 800;
  font-size: 0.875rem;
  border-radius: 0.75rem;
  text-decoration: none;
  transition: background-color .15s ease, color .15s ease;
}
.nav-mobile-cta a.primary {
  background: #0f172a;
  color: #fff;
}
.nav-mobile-cta a.primary:hover { background: #2563eb; }
.nav-mobile-cta a.secondary {
  background: #fff;
  color: #0f172a;
  border: 1px solid #e2e8f0;
}
.nav-mobile-cta a.secondary:hover { background: #f8fafc; }

/* Sperrt Body-Scroll, wenn das Panel offen ist */
body.nav-mobile-open { overflow: hidden; }

/* ================================================================
   Tabellen — auf schmalen Screens horizontal scrollbar machen,
   damit sie nicht den ganzen Layout sprengen.
   ================================================================ */
.table-scroll {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

/* ================================================================
   Cookie-Consent (Opt-out) — Banner unten + Settings-Popup
   ================================================================ */
.pd-cookie *,
.pd-cookie *::before,
.pd-cookie *::after { box-sizing: border-box; }

/* [hidden] muss display:none erzwingen — sonst überschreiben die
   display:flex-Regeln (Modal/Reopen) das HTML-hidden und das unsichtbare
   Overlay fängt alle Klicks ab. */
.pd-cookie[hidden],
.pd-cookie [hidden] { display: none !important; }

body.pd-cookie-lock { overflow: hidden; }

/* Banner (nicht blockierend, unten rechts) */
.pd-cookie-banner {
  position: fixed;
  bottom: 1.5rem;
  left: 1.5rem;
  right: 1.5rem;
  z-index: 100000;
  max-width: 30rem;
  margin-left: auto;
  opacity: 0;
  transform: translateY(16px);
  pointer-events: none;
  transition: opacity .4s cubic-bezier(.2,.8,.3,1), transform .4s cubic-bezier(.2,.8,.3,1);
}
.pd-cookie-banner.is-visible { opacity: 1; transform: translateY(0); pointer-events: auto; }

.pd-cookie-banner-inner {
  background: #fff;
  border: 1px solid rgba(37, 99, 235, 0.12);
  border-radius: 1.25rem;
  padding: 1.35rem 1.5rem;
  box-shadow: 0 12px 48px rgba(37,99,235,0.14), 0 4px 12px rgba(15,23,42,0.05);
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  gap: 0.6rem 0.9rem;
}

.pd-cookie-icon {
  flex-shrink: 0;
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 0.875rem;
  background: linear-gradient(135deg, #eff6ff, #e0f2fe);
  color: #2563eb;
}

.pd-cookie-text { flex: 1; min-width: 12rem; font-size: 0.875rem; line-height: 1.6; color: #475569; }
.pd-cookie-text strong { display: block; margin-bottom: 0.25rem; font-size: 1rem; font-weight: 800; color: #0f172a; }
.pd-cookie-text p { margin: 0; }
.pd-cookie-text a { color: #2563eb; font-weight: 600; text-decoration: underline; text-underline-offset: 2px; }
.pd-cookie-text a:hover { color: #1d4ed8; }

.pd-cookie-banner-actions { flex-basis: 100%; display: flex; gap: 0.625rem; margin-top: 0.35rem; }

/* Buttons */
.pd-cookie-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  padding: 0.65rem 1.3rem;
  border-radius: 0.75rem;
  font-size: 0.875rem;
  font-weight: 800;
  cursor: pointer;
  border: none;
  transition: background-color .2s ease, color .2s ease, border-color .2s ease, transform .2s ease;
}
.pd-cookie-btn-primary { background: #2563eb; color: #fff; flex: 1; }
.pd-cookie-btn-primary:hover { background: #1d4ed8; }
.pd-cookie-btn-ghost { background: #fff; color: #0f172a; border: 1px solid #e2e8f0; flex: 1; }
.pd-cookie-btn-ghost:hover { background: #f8fafc; border-color: #cbd5e1; }
.pd-cookie-btn-ghost svg { flex-shrink: 0; transition: transform .3s ease; }
.pd-cookie-btn-ghost:hover svg { transform: rotate(40deg); }

/* Settings-Popup */
.pd-cookie-modal {
  position: fixed;
  inset: 0;
  z-index: 100002;
  display: flex;
  align-items: flex-end;
  justify-content: center;
}
@media (min-width: 640px) { .pd-cookie-modal { align-items: center; } }
.pd-cookie-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.5);
  -webkit-backdrop-filter: blur(3px);
          backdrop-filter: blur(3px);
  opacity: 0;
  transition: opacity .22s ease;
}
.pd-cookie-modal.is-open .pd-cookie-modal-backdrop { opacity: 1; }
.pd-cookie-modal-sheet {
  position: relative;
  width: 100%;
  max-width: 38rem;
  background: #fff;
  border-radius: 1.5rem 1.5rem 0 0;
  padding: 1.5rem 1.5rem 1.75rem;
  max-height: 88vh;
  overflow-y: auto;
  box-shadow: 0 -12px 48px rgba(15,23,42,0.2);
  transform: translateY(24px);
  opacity: 0;
  transition: transform .25s cubic-bezier(.2,.8,.3,1), opacity .25s ease;
}
@media (min-width: 640px) {
  .pd-cookie-modal-sheet { border-radius: 1.5rem; margin: 1.5rem; transform: scale(.96); }
}
.pd-cookie-modal.is-open .pd-cookie-modal-sheet { transform: none; opacity: 1; }

.pd-cookie-modal-head { display: flex; align-items: flex-start; gap: 1rem; margin-bottom: 1.25rem; }
.pd-cookie-modal-head strong { display: block; font-size: 1.125rem; font-weight: 800; color: #0f172a; margin-bottom: 0.3rem; }
.pd-cookie-modal-head p { font-size: 0.875rem; line-height: 1.6; color: #64748b; margin: 0; }
.pd-cookie-close {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: none;
  background: #f1f5f9;
  color: #0f172a;
  cursor: pointer;
  transition: background-color .2s ease;
}
.pd-cookie-close:hover { background: #e2e8f0; }

.pd-cookie-cats { display: flex; flex-direction: column; gap: 0.625rem; }
.pd-cookie-cat {
  display: flex;
  align-items: center;
  gap: 0.9rem;
  padding: 0.9rem 1rem;
  background: #f8fafc;
  border: 1px solid #eef2f7;
  border-radius: 1rem;
}
.pd-cookie-cat-icon {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border-radius: 0.75rem;
  background: rgba(37, 99, 235, 0.08);
  color: #2563eb;
}
.pd-cookie-cat-text { flex: 1; min-width: 0; }
.pd-cookie-cat-title { font-size: 0.9375rem; font-weight: 700; color: #0f172a; margin-bottom: 0.15rem; }
.pd-cookie-cat-desc { font-size: 0.8125rem; line-height: 1.5; color: #64748b; }
.pd-cookie-cat-badge {
  flex-shrink: 0;
  padding: 0.35rem 0.7rem;
  border-radius: 99px;
  background: rgba(37, 99, 235, 0.1);
  color: #2563eb;
  font-size: 0.75rem;
  font-weight: 700;
}

/* Toggle-Switch */
.pd-cookie-switch {
  flex-shrink: 0;
  position: relative;
  width: 48px;
  height: 28px;
  border-radius: 99px;
  border: none;
  background: #cbd5e1;
  cursor: pointer;
  padding: 0;
  transition: background-color .25s ease;
}
.pd-cookie-switch-on { background: #2563eb; }
.pd-cookie-switch-thumb {
  position: absolute;
  top: 3px;
  left: 3px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 2px 6px rgba(0,0,0,0.15);
  transition: transform .25s cubic-bezier(.2,.8,.3,1);
}
.pd-cookie-switch-on .pd-cookie-switch-thumb { transform: translateX(20px); }

.pd-cookie-modal-actions { display: flex; gap: 0.625rem; margin-top: 1.25rem; }

/* Reopen-Button (nach Entscheidung), unten links – nur Desktop/Tablet */
.pd-cookie-reopen {
  position: fixed;
  bottom: 1.5rem;
  left: 1.5rem;
  z-index: 100000;
  display: none;
  align-items: center;
  justify-content: center;
  width: 50px;
  height: 50px;
  border-radius: 50%;
  border: 1px solid rgba(37, 99, 235, 0.12);
  background: #fff;
  color: #2563eb;
  box-shadow: 0 8px 28px rgba(37,99,235,0.18), 0 2px 8px rgba(15,23,42,0.06);
  cursor: pointer;
  transition: transform .2s ease, box-shadow .2s ease;
}
@media (min-width: 768px) { .pd-cookie-reopen { display: flex; } }
.pd-cookie-reopen:hover { transform: translateY(-2px) scale(1.04); box-shadow: 0 12px 32px rgba(37,99,235,0.26); }

/* Mobile: Banner-Buttons volle Breite stapeln */
@media (max-width: 480px) {
  .pd-cookie-banner { left: 0.75rem; right: 0.75rem; bottom: 0.75rem; }
  .pd-cookie-banner-inner { padding: 1.2rem 1.15rem; border-radius: 1rem; }
  .pd-cookie-banner-actions { flex-direction: column; }
  .pd-cookie-modal-actions { flex-direction: column; }
}

@media (prefers-reduced-motion: reduce) {
  .pd-cookie-banner,
  .pd-cookie-modal-backdrop,
  .pd-cookie-modal-sheet,
  .pd-cookie-switch-thumb { transition: none; }
}
