/* ============================================================
 * Theme-spezifische Layouts (Header, Nav, Hero, Sections).
 * Ergänzt tokens.css, nutzt dessen Custom Properties.
 * Mobile-first.
 * ============================================================ */

/* ---- Site Header ---- */
.site-header {
  position: sticky; top: 0; z-index: 30;
  background: rgba(255,255,255,.92);
  backdrop-filter: saturate(140%) blur(8px);
  -webkit-backdrop-filter: saturate(140%) blur(8px);
  border-bottom: 1px solid var(--border);
}

.top-bar {
  background: var(--bg-dark);
  color: #cfe9f6;
  font-size: 13px;
  padding: 8px 0;
}
.top-bar__inner {
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
}
.top-bar strong { color: #fff; }
.top-bar__freiplaetze {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}
.top-bar__freiplaetze .dot {
  width: 7px; height: 7px;
  border-radius: 999px;
  background: var(--sec-lindgruen);
  box-shadow: 0 0 0 4px rgba(84,189,163,.25);
}
.top-bar__kontakt {
  display: inline-flex;
  align-items: center;
  gap: 18px;
}
.top-bar__kontakt .muted { opacity: .7; }
.top-bar a { color: #fff; text-decoration: none; }
.top-bar a:hover { text-decoration: underline; }

.site-header__inner {
  display: flex;
  align-items: center;
  gap: 24px;
  padding: 14px 0;
}

/* Logo */
.site-logo {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
}
.site-logo:hover { text-decoration: none; }
.site-logo__mark {
  width: 38px; height: 38px;
  border-radius: 10px;
  background: linear-gradient(135deg, var(--talea-cyan) 0%, var(--sec-lindgruen) 100%);
  display: grid; place-items: center;
  box-shadow: 0 6px 14px rgba(0,159,227,.28);
  flex-shrink: 0;
}
.site-logo__text {
  display: flex;
  flex-direction: column;
  line-height: 1;
}
.site-logo__name {
  font-family: var(--font-body);
  font-weight: 700;
  font-size: 18px;
  color: var(--text);
  letter-spacing: -0.01em;
}
.site-logo__name em {
  color: var(--talea-cyan);
  font-style: normal;
}
.site-logo__city {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 3px;
  letter-spacing: .02em;
}

/* Main navigation */
.main-nav {
  display: flex;
  gap: 6px;
  margin-left: 24px;
  flex: 1;
}
.main-nav a {
  padding: 8px 14px;
  border-radius: 8px;
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
  text-decoration: none;
}
.main-nav a:hover { background: var(--gray-50); text-decoration: none; }
.main-nav a[aria-current="page"] {
  background: var(--talea-cyan-50);
  color: var(--primary-ink);
}

.site-header__cta {
  display: flex;
  gap: 10px;
  align-items: center;
}

/* Mobile nav toggle */
.nav-toggle {
  display: none;
  width: 40px; height: 40px;
  border: 1px solid var(--border-strong);
  background: #fff;
  border-radius: var(--r-md);
  padding: 0;
  align-items: center;
  justify-content: center;
}
.nav-toggle svg { width: 20px; height: 20px; }

/* ---- Hero ---- */
.hero {
  background: linear-gradient(180deg, var(--bg-soft) 0%, #fff 100%);
  padding: var(--s-10) 0 var(--s-11);
  position: relative;
  overflow: hidden;
}
.hero__eyebrow { margin-bottom: 14px; }
.hero__title {
  font-size: clamp(32px, 5vw, var(--fs-4xl));
  line-height: 1.05;
  max-width: 780px;
}
.hero__title em {
  color: var(--talea-cyan);
  font-style: normal;
}
.hero__lead {
  margin-top: 20px;
  font-size: var(--fs-md);
  color: var(--text-muted);
  max-width: 620px;
  line-height: 1.55;
}
.hero__cta {
  margin-top: 32px;
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}
.hero__trust {
  margin-top: var(--s-8);
}

/* ---- Hero-Split: Text links, organisches Bild rechts ---- */
.hero--split { padding: var(--s-9) 0 var(--s-10); position: relative; }
.hero__grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--s-8);
  align-items: center;
  position: relative;
  z-index: 1;
}
.hero__text { min-width: 0; }
.hero__figure {
  position: relative;
  min-width: 0;
  order: -1;                          /* mobile: Bild oben */
  max-width: 480px;
  margin: 0 auto;
}
@media (min-width: 900px) {
  .hero__grid {
    grid-template-columns: 1.05fr 1fr;
    gap: var(--s-9);
  }
  .hero__figure { order: 0; max-width: none; margin: 0; }
}

/* Weiche, organische Foto-Form */
.hero-photo {
  position: relative;
  margin: 0;
  aspect-ratio: 4 / 5;
  border-radius: 58% 42% 55% 45% / 42% 55% 45% 58%;
  overflow: hidden;
  box-shadow: 0 30px 60px rgba(11,58,82,.16), 0 12px 24px rgba(11,58,82,.08);
  isolation: isolate;
  transform: rotate(-1.5deg);
}
@media (min-width: 900px) {
  .hero-photo { aspect-ratio: 5 / 6; }
}
.hero-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 35%;
  display: block;
  transition: transform .8s ease;
}
.hero--split:hover .hero-photo img { transform: scale(1.03); }
@media (prefers-reduced-motion: reduce) {
  .hero-photo { transform: none; }
  .hero--split:hover .hero-photo img { transform: none; }
  .hero-photo img { transition: none; }
}

/* Dekorative Punkte neben dem Foto — drei unterschiedlich große Kreise */
.hero-photo__deco {
  position: absolute;
  z-index: 2;
  pointer-events: none;
  border-radius: 999px;
}
.hero-photo__deco--dot-lg {   /* grün, groß, unten links */
  width: 96px; height: 96px;
  bottom: -22px; left: -26px;
  background: var(--sec-lindgruen);
  opacity: .32;
}
.hero-photo__deco--dot-md {   /* cyan, mittel, oben rechts */
  width: 64px; height: 64px;
  top: -18px; right: -12px;
  background: var(--talea-cyan);
  opacity: .22;
}
.hero-photo__deco--dot-sm {   /* cyan-Ring, klein, mittig rechts */
  width: 26px; height: 26px;
  top: 34%; right: -32px;
  background: transparent;
  border: 3px solid var(--talea-cyan);
  opacity: .5;
}

/* Sanfte Hintergrund-Blobs für Waldorf-Feeling */
.hero__blob {
  position: absolute;
  border-radius: 50%;
  filter: blur(60px);
  opacity: .55;
  z-index: 0;
  pointer-events: none;
}
.hero__blob--a {
  width: 520px; height: 520px;
  top: -180px; right: -160px;
  background: radial-gradient(circle, rgba(0,159,227,.35), rgba(0,159,227,0) 65%);
}
.hero__blob--b {
  /* Kleiner grüner Akzent, weiter nach oben — kollidiert nicht mehr
     mit der weißen Welle am Section-Übergang. */
  width: 240px; height: 240px;
  top: 40px; left: -100px;
  background: radial-gradient(circle, rgba(84,189,163,.22), rgba(84,189,163,0) 65%);
}
@media (max-width: 700px) {
  .hero__blob--a { width: 320px; height: 320px; top: -120px; right: -120px; }
  .hero__blob--b { display: none; }
}

/* ---- Sections ---- */
.section-alt { background: var(--bg-section); }

/* ============================================================
 * Wellen-Divider — CSS-only mit inline SVG als data-URI.
 * Farbe wird via --wave-color gesetzt (default: Section-Hintergrund weiß).
 * Höhe via --wave-h.
 *
 * Nutzung: .section--wave-top oder .section--wave-bottom auf eine
 * Section legen; --wave-color auf die Farbe des ANGRENZENDEN Bereichs
 * setzen (die Welle "übergibt" dann optisch).
 * ============================================================ */
.section--wave-top,
.section--wave-bottom {
  --wave-h: 70px;
  position: relative;
}
/* Content darf nicht in die Welle laufen — Padding um Wellenhöhe erweitern.
   Doppelter Selektor erhöht Spezifität (0,0,2,0) und schlägt späteres
   `.listing-body { padding: … }` in wg.css. */
.section--wave-top.section--wave-top       { padding-top:    calc(var(--wave-h) + var(--s-7)); }
.section--wave-bottom.section--wave-bottom { padding-bottom: calc(var(--wave-h) + var(--s-7)); }
.section--wave-top::before,
.section--wave-bottom::after {
  content: "";
  position: absolute;
  left: 0; right: 0;
  height: var(--wave-h);
  pointer-events: none;
  background-repeat: no-repeat;
  background-size: 100% 100%;
  z-index: 0;
}
/* Welle oben: SVG "hängt" in die Section rein, Farbe = Nachbar (oben) */
.section--wave-top::before {
  top: 0;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 1440 80' preserveAspectRatio='none'><path d='M0,0 C240,80 480,80 720,40 C960,0 1200,0 1440,40 L1440,0 Z' fill='%23ffffff'/></svg>");
}
/* Welle unten: SVG hängt nach unten aus der Section, Farbe = Nachbar (unten) */
.section--wave-bottom::after {
  bottom: 0;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 1440 80' preserveAspectRatio='none'><path d='M0,80 C240,0 480,0 720,40 C960,80 1200,80 1440,40 L1440,80 Z' fill='%23ffffff'/></svg>");
}
/* Wenn die Nachbar-Farbe nicht weiß ist, überschreiben:
   .section--wave-top { --wave-fill: %23f3f8fb; } via inline style oder Modifier. */
.section--wave-top[data-wave-fill="section"]::before,
.section--wave-bottom[data-wave-fill="section"]::after {
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 1440 80' preserveAspectRatio='none'><path d='M0,0 C240,80 480,80 720,40 C960,0 1200,0 1440,40 L1440,0 Z' fill='%23f3f8fb'/></svg>");
}
.section--wave-bottom[data-wave-fill="section"]::after {
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 1440 80' preserveAspectRatio='none'><path d='M0,80 C240,0 480,0 720,40 C960,80 1200,80 1440,40 L1440,80 Z' fill='%23f3f8fb'/></svg>");
}
.section--wave-top[data-wave-fill="soft"]::before {
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 1440 80' preserveAspectRatio='none'><path d='M0,0 C240,80 480,80 720,40 C960,0 1200,0 1440,40 L1440,0 Z' fill='%23f7fbfe'/></svg>");
}
.section--wave-bottom[data-wave-fill="soft"]::after {
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 1440 80' preserveAspectRatio='none'><path d='M0,80 C240,0 480,0 720,40 C960,80 1200,80 1440,40 L1440,80 Z' fill='%23f7fbfe'/></svg>");
}
/* Section-Inhalt über der Welle */
.section--wave-top > *,
.section--wave-bottom > * {
  position: relative;
  z-index: 1;
}

/* ============================================================
 * Scroll-Reveal — Klassen werden von assets/js/reveal.js gesetzt.
 * Wichtig: NICHT die Section selbst faden — sonst würden farbige
 * Section-Hintergründe kurz unsichtbar und der Body-Hintergrund
 * blitzt durch. Wir faden nur die direkten Kinder (typisch: der
 * .container darin), der Section-Background bleibt jederzeit voll.
 * ============================================================ */
.reveal > * {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity .7s ease-out, transform .7s ease-out;
  will-change: opacity, transform;
}
.reveal.is-visible > * {
  opacity: 1;
  transform: none;
}
@media (prefers-reduced-motion: reduce) {
  .reveal > * { opacity: 1; transform: none; transition: none; }
}

/* 3-Schritte — asymmetrisch, mit organischen Radien und leichten Rotationen */
.steps {
  display: grid;
  gap: var(--s-6);
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
}
.step {
  background: #fff;
  border: 1px solid var(--border);
  padding: var(--s-7);
  box-shadow: var(--shadow-sm);
  position: relative;
  transition: transform .35s ease, box-shadow .25s ease;
}
/* Alternierende Formen, Rotationen und Höhen-Versatz — Waldorf-artig */
.step:nth-child(1) {
  border-radius: 28px 8px 22px 12px;
  transform: rotate(-.8deg);
}
.step:nth-child(2) {
  border-radius: 8px 24px 8px 24px;
  transform: rotate(.5deg) translateY(18px);
  background: var(--talea-cyan-50);
  border-color: var(--talea-cyan-200);
}
.step:nth-child(3) {
  border-radius: 22px 22px 8px 12px;
  transform: rotate(-.3deg);
}
.step:hover {
  transform: rotate(0deg) translateY(-4px);
  box-shadow: var(--shadow-md);
}
@media (prefers-reduced-motion: reduce) {
  .step, .step:hover { transform: none; transition: none; }
}
/* Große dekorative Nummer im Hintergrund, kleine als Chip vorne */
.step__num {
  display: inline-grid;
  place-items: center;
  width: 44px; height: 44px;
  border-radius: 999px;
  background: var(--talea-cyan);
  color: #fff;
  font-family: var(--font-body);
  font-weight: 700;
  font-size: 18px;
  margin-bottom: var(--s-4);
  box-shadow: 0 6px 14px rgba(0,159,227,.28);
  position: relative;
  z-index: 1;
}
.step:nth-child(2) .step__num {
  background: var(--sec-lindgruen);
  box-shadow: 0 6px 14px rgba(84,189,163,.32);
  color: #0d3a30;
}
.step::after {
  /* Große transparente Nummer als Watermark im Hintergrund */
  content: attr(data-step);
  position: absolute;
  top: -24px; right: 8px;
  font-family: var(--font-body);
  font-weight: 700;
  font-size: 140px;
  line-height: 1;
  color: var(--talea-cyan);
  opacity: .06;
  pointer-events: none;
  z-index: 0;
}
.step:nth-child(2)::after { color: var(--sec-lindgruen); opacity: .1; }
.step__title {
  font-size: var(--fs-lg);
  margin-bottom: var(--s-3);
  position: relative;
  z-index: 1;
}
.step__desc {
  color: var(--text-muted);
  line-height: 1.55;
  position: relative;
  z-index: 1;
}

/* Rechner-CTA */
.rechner-cta {
  background: linear-gradient(135deg, var(--talea-cyan) 0%, var(--talea-cyan-700) 100%);
  color: #fff;
  border-radius: var(--r-xl);
  padding: var(--s-9) var(--s-8);
  display: grid;
  gap: var(--s-6);
  align-items: center;
  box-shadow: var(--shadow-lg);
}
.rechner-cta h2 { color: #fff; font-size: var(--fs-2xl); }
.rechner-cta p { color: rgba(255,255,255,.88); margin-top: 12px; max-width: 560px; }
.rechner-cta .btn-success { flex-shrink: 0; }

@media (min-width: 768px) {
  .rechner-cta {
    grid-template-columns: 1fr auto;
    padding: var(--s-9) var(--s-9);
  }
}

/* ---- Footer ---- */
.site-footer {
  background: var(--bg-dark);
  color: #dbeaf3;
  margin-top: var(--s-10);
}
.site-footer__inner {
  padding: 56px 0 32px;
}
.site-footer__grid {
  display: grid;
  gap: 48px;
  grid-template-columns: 1fr;
}
@media (min-width: 768px) {
  .site-footer__grid {
    grid-template-columns: 1.4fr 1fr 1fr 1fr;
  }
}
.footer-brand p {
  color: rgba(255,255,255,.72);
  margin-top: 18px;
  max-width: 340px;
  font-size: 14px;
  line-height: 1.6;
}
.footer-brand .kontakt {
  margin-top: 18px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  font-size: 14px;
}
.footer-brand .kontakt strong { color: #fff; }
.footer-brand .kontakt a { color: rgba(255,255,255,.78); }

.footer-col h4 {
  font-size: 13px;
  color: #fff;
  letter-spacing: .1em;
  text-transform: uppercase;
  margin-bottom: 14px;
}
.footer-col ul {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
  font-size: 14px;
}
.footer-col a {
  color: rgba(255,255,255,.78);
  text-decoration: none;
}
.footer-col a:hover { color: #fff; text-decoration: underline; }

.site-footer__legal {
  border-top: 1px solid rgba(255,255,255,.12);
  margin-top: 48px;
  padding-top: 24px;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 16px;
  font-size: 13px;
  color: rgba(255,255,255,.62);
}
.site-footer__legal a { color: rgba(255,255,255,.78); }
.site-footer__legal .legal-links {
  display: flex;
  gap: 18px;
  flex-wrap: wrap;
}

/* Träger-Hinweis (Pflichtangabe UWG §5, §5a) — nur auf Startseite,
   unter dem sticky Header, scrollt beim Scrollen aus dem Viewport
   (der sticky Header schiebt sich darüber). */
.traeger-hinweis {
  background: var(--gray-50);
  border-bottom: 1px solid var(--border);
  padding: 14px 0;
  font-size: 13px;
  color: var(--text-muted);
  text-align: center;
}

/* ============================================================
 * Mobile
 * ============================================================ */
@media (max-width: 900px) {
  .main-nav {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: #fff;
    border-bottom: 1px solid var(--border);
    box-shadow: var(--shadow-md);
    flex-direction: column;
    padding: var(--s-4);
    gap: 4px;
    margin-left: 0;
  }
  .main-nav.is-open { display: flex; }
  .main-nav a { font-size: 16px; padding: 12px 14px; }

  .nav-toggle {
    display: inline-flex;
    order: 3;
    margin-left: auto;
  }
  .site-header__cta .btn { display: none; }
  .site-header__cta .btn.btn-primary { display: inline-flex; }

  .top-bar { font-size: 12px; }
  .top-bar__kontakt { gap: 12px; }
  .top-bar__kontakt .muted { display: none; }
}

@media (max-width: 600px) {
  .top-bar__freiplaetze { flex-basis: 100%; }
  .site-logo__city { display: none; }
  .hero { padding: var(--s-8) 0 var(--s-9); }
  .section { padding: var(--s-8) 0; }
  .rechner-cta { padding: var(--s-7) var(--s-6); }
  .rechner-cta h2 { font-size: var(--fs-xl); }
}
