@font-face {
    font-family: 'Poppins';
    src: url('../assets/fonts/poppins/Poppins-Regular.woff2') format('woff2');
    font-weight: 400; font-style: normal; font-display: swap;
  }
  @font-face {
    font-family: 'Poppins';
    src: url('../assets/fonts/poppins/Poppins-Medium.woff2') format('woff2');
    font-weight: 500; font-style: normal; font-display: swap;
  }
  @font-face {
    font-family: 'Poppins';
    src: url('../assets/fonts/poppins/Poppins-SemiBold.woff2') format('woff2');
    font-weight: 600; font-style: normal; font-display: swap;
  }
  @font-face {
    font-family: 'Poppins';
    src: url('../assets/fonts/poppins/Poppins-Bold.woff2') format('woff2');
    font-weight: 700; font-style: normal; font-display: swap;
  }
  @font-face {
    font-family: 'Gelasio';
    src: url('../assets/fonts/gelasio/Gelasio-Variable.woff2') format('woff2-variations');
    font-weight: 400 700; font-style: normal; font-display: swap;
  }
  @font-face {
    font-family: 'Gelasio';
    src: url('../assets/fonts/gelasio/Gelasio-Italic-Variable.woff2') format('woff2-variations');
    font-weight: 400 700; font-style: italic; font-display: swap;
  }

  * { box-sizing: border-box; margin: 0; padding: 0; }
  html { scroll-behavior: smooth; }
  body { font-family: var(--font-serif); font-size: 19px; color: var(--text); background: #fff; line-height: 1.6; }
  img { max-width: 100%; display: block; }
  h1, h2, h3, h4, h5 { font-family: var(--font-sans); font-weight: 700; }
  h1 { font-size: 30px; color: var(--heading-h1); margin-bottom: 1rem; }
  h2 { font-size: 29px; color: var(--heading-h2); margin-bottom: 1rem; }
  h5 { font-size: 17px; font-weight: 600; color: var(--text); margin-top: 1.8em; margin-bottom: 0.4em; }
  p { margin-bottom: 1em; }
  ul { padding-left: 20px; margin-bottom: 1.2em; }
  a { color: var(--red); }
  a:hover { color: var(--red-dark); }
  a[href^="tel"] { color: inherit; text-decoration: none; }

  /* Eine gemeinsame Breite für die ganze Seite: alle Container sind gleich breit
     wie die Google Map, damit Content und Map exakt dieselben Ränder teilen. */
  .container { max-width: var(--max-width); margin: 0 auto; padding: 0 24px; }
  section { padding: 60px 0; }
  section:nth-of-type(even) { background: var(--bg); }

  /* ---------- Sticky Anker-Navigation ---------- */

  #site-nav { position: fixed; top: 20px; left: 20px; z-index: 999; font-family: var(--font-sans); width: 160px; }
  #nav-toggle {
    display: flex; align-items: center; background: var(--nav-red); color: #fff; border: none;
    border-radius: 4px; width: 134px; height: 37px; padding: 0 12px;
    font-family: var(--font-sans); font-size: 1rem; font-weight: 500; cursor: pointer;
  }
  #nav-toggle span { flex: 1; text-align: left; }
  #nav-toggle svg { width: 12px; height: 9px; flex-shrink: 0; transition: transform .25s ease; }
  #nav-toggle[aria-expanded="true"] svg { transform: rotate(180deg); }
  #nav-panel {
    margin-top: 4px; background: rgba(255,255,255,0.96); border-radius: 11px;
    box-shadow: 0 4px 18px 0 #ececec, 0 1px 6px 0 rgba(0,0,0,0.07); overflow: hidden;
    opacity: 1; transition: opacity .4s ease;
  }
  #nav-panel[hidden] { display: block; opacity: 0; pointer-events: none; }
  #nav-panel a { display: block; padding: 11px 18px; font-size: 1rem; color: #565d69; text-decoration: none; border-bottom: 1px solid #f0f0f0; }
  #nav-panel a:last-child { border-bottom: none; }
  #nav-panel a:hover { color: var(--nav-red); }

  /* ---------- Hero: Logo/Text + Porträt ----------
     Standard: flex-row nebeneinander. Breakpoints unten regeln
     Proportionen explizit statt sich auf Auto-Wrap zu verlassen. */

  .hero { background: #fff; }
  .hero .container {
    display: flex;
    align-items: center;
    gap: 48px;
    padding-top: 40px;
    padding-bottom: 40px;
  }
  /* Logo und Name im Hero bleiben auf allen Bildschirmgrößen exakt gleich groß. */
  .hero-info { flex: 0 0 43%; text-align: center; }
  .hero-info img { width: 350px; margin: 0 auto 30px; }
  .hero-info p { font-size: 19px; line-height: 26.4px; }
  .hero-photo { flex: 0 0 50%; min-width: 0; margin-top: -40px; margin-bottom: -40px; }
  .hero-photo img { width: 100%; height: auto; border-radius: 4px; }

  .phone-bar { background: var(--phone-bar); color: #fff; }
  .phone-bar .container {
    display: flex; flex-wrap: wrap; align-items: center; justify-content: center;
    gap: 16px; padding-top: 20px; padding-bottom: 20px;
  }
  .phone-bar p { margin: 0; font-family: var(--font-sans); font-size: 21.2px; }

  .quote-bar { background: var(--phone-bar); color: #fff; }
  .quote-bar .container { padding-top: 32px; padding-bottom: 32px; text-align: center; }
  .quote-bar blockquote { margin: 0 0 10px; font-size: 21px; font-weight: 400; line-height: 1.5; }
  .quote-bar cite { display: block; font-family: var(--font-sans); font-style: normal; font-size: 14px; color: #d8e2e7; }
  .btn {
    display: inline-block; background: var(--nav-red); color: #fff; font-family: var(--font-sans);
    text-decoration: none; padding: 10px 24px; border-radius: 4px; font-weight: 500;
  }
  .btn:hover { background: var(--red-dark); color: #fff; }

  /* ---------- Willkommen: Slideshow-Panel + Text ---------- */

  .welcome-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 40px;
    align-items: stretch;
  }
  /* Slideshow-Panel: hoch genug, damit Köpfe nicht abgeschnitten werden.
     object-position oben-mittig statt zentriert, plus großzügige Mindesthöhe. */
  .slideshow {
    position: relative;
    overflow: hidden;
    border-radius: 4px;
    min-height: 440px;
    background: #333;
  }
  .slideshow img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center 20%;
    opacity: 0;
    transition: opacity 1.6s ease;
  }
  .slideshow img.is-active {
    opacity: 1;
    z-index: 1;
    /* Zoom endet exakt beim Slidewechsel (5s) bei scale(1) –
       identisch mit dem Ruhezustand, daher kein Sprung beim Ausblenden. */
    animation: kenburns-out 5s ease-out forwards;
  }

  @keyframes kenburns-out {
    0%   { transform: scale(1.12); }
    100% { transform: scale(1); }
  }

  @media (prefers-reduced-motion: reduce) {
    .slideshow img.is-active { animation: none; }
  }

  /* ---------- Kontakt ---------- */

  .map-block {
    position: relative; width: 100%; aspect-ratio: 4 / 3; margin-bottom: 24px;
    border-radius: 4px; overflow: hidden;
    background: url('../assets/images/map.jpg') center / cover no-repeat;
  }
  .map-block iframe { width: 100%; height: 100%; border: 0; display: block; }
  .map-consent {
    position: absolute; inset: 0; display: flex;
    align-items: flex-start; justify-content: flex-start; padding: 28px 24px;
  }
  .map-consent-btn {
    background: none; border: none; outline: none; box-shadow: none;
    padding: 0; margin: 0; cursor: pointer;
    font-family: var(--font-sans); font-size: 1.15rem; font-weight: 500;
    line-height: 1.4; color: #fff; text-align: left; max-width: 320px;
    text-shadow: 0 2px 10px rgba(0,0,0,0.65);
  }

  /* Zweispaltig, sobald der verfügbare Platz für zwei Spalten in "Handy-Breite"
     (340px) reicht – kein fester Breakpoint noetig, das ergibt sich von selbst. */
  .kontakt-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(340px, 1fr)); gap: 40px; align-items: stretch; }
  .kontakt-info, .kontakt-map { display: flex; flex-direction: column; }
  .kontakt-info .btn { align-self: flex-start; margin: 4px 0 28px; }
  .kontakt-bottom { margin-top: auto; }

  .section-note { margin-top: 56px; padding-top: 32px; border-top: 1px solid #cfcfcf; }
  .section-note p:last-child { margin-bottom: 0; font-style: italic; }

  /* ---------- Leistungen ---------- */

  .leistungen-liste { margin: 28px 0 32px; padding-bottom: 8px; border-bottom: 1px solid #cfcfcf; }
  .leistung-toggle {
    display: flex; align-items: center; justify-content: flex-start; width: 100%;
    background: none; border: none; padding: 12px 2px; margin: 0; cursor: pointer; text-align: left;
    font-family: inherit; color: inherit;
  }
  .leistung-toggle h3 { margin: 0; font-size: 19px; color: var(--heading-h2); font-weight: 600; }
  .leistung-toggle svg { width: 12px; height: 9px; flex: 0 0 12px; margin-right: 14px; fill: var(--heading-h2); transition: transform .25s ease; transform: rotate(-90deg); }
  .leistung-toggle[aria-expanded="true"] svg { transform: rotate(0deg); }
  .leistung-panel[hidden] { display: none; }
  .leistung-panel { padding: 0 2px 24px; }
  .leistung-content { display: flex; gap: 28px; align-items: flex-start; }
  .leistung-content p { flex: 1 1 60%; margin: 0; }
  .leistung-content img { order: -1; flex: 0 0 230px; width: 230px; height: auto; border-radius: 4px; }

  /* ---------- Team ---------- */

  .team-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 48px 24px; }
  .team-member { display: flex; align-items: center; gap: 20px; }
  .team-member img { width: 130px; height: 130px; flex: 0 0 130px; object-fit: cover; border-radius: 50%; }
  .team-member p { margin: 0; }
  .team-grid .team-member:nth-child(7) { grid-column: 2; }

  /* ---------- Ausbildung ---------- */

  .ausbildung .btn { margin-top: 12px; }

  /* ---------- Footer ---------- */
  /* Farben/Schrift 1:1 aus dev.herz-braunschweig.de (Impressum/Datenschutz-Box) übernommen */

  footer {
    background: #404040; color: #989797;
    font-family: "Poppins", Arial, sans-serif; font-size: 13px;
    padding: 60px 0;
  }
  footer h2 { color: #989797; font-size: 13px; font-weight: 700; margin-top: 40px; }
  footer h2:first-child { margin-top: 0; }
  footer h2#datenschutz { margin-top: 30px; }
  footer a { color: #989797; }
  footer a:hover { color: #fff; }

  /* Mehrspaltiger Fließtext wie in der Vorlage: 4 Spalten auf breiten Viewports,
     die auf Tablet/Mobil zurückgestuft werden (siehe Breakpoints unten). */
  .footer-cols { columns: 4; column-gap: 21px; }
  .footer-cols p { break-inside: avoid; }

  /* ============ Breakpoints ============
     Angelehnt an die Elementor-Werte (Tablet 1024 / Mobil 767),
     aber mit eigenen, expliziten Proportionen statt Auto-Wrap. */

  /* Tablet: 768–1024px */
  @media (max-width: 1024px) {
    .hero .container { gap: 32px; }
    .hero-info img { margin-bottom: 16px; }

    .welcome-grid { grid-template-columns: 1fr 1fr; gap: 28px; }
    .slideshow { min-height: 380px; }

    .footer-cols { columns: 2; }
  }

  /* Schmales Tablet / große Phablets: hier kippt die Hero-Zeile ins Gedränge,
     bevor sie umbricht – deshalb schon hier auf gestapelt wechseln. */
  @media (max-width: 900px) {
    .hero .container { flex-direction: column; text-align: center; }
    .hero-info { flex: 0 0 auto; }
    .hero-info img { margin-left: auto; margin-right: auto; }
    .hero-photo {
      position: relative;
      flex: 0 0 auto;
      width: 100%; max-width: 420px; margin: 0 auto -40px;
      height: clamp(220px, 42vw, 500px); overflow: hidden;
    }
    .hero-photo img {
      position: absolute; inset: 0;
      width: 100%; height: 100%;
      object-fit: cover; object-position: top center;
    }

    .welcome-grid { grid-template-columns: 1fr; }
    .slideshow { min-height: 420px; order: -1; }
  }

  /* Mobil: ≤767px */
  @media (max-width: 767px) {
    #site-nav { top: 12px; left: 12px; }
    section { padding: 40px 0; }
    h1 { font-size: 1.6rem; }

    .slideshow { min-height: 320px; }
    .slideshow img { object-position: center 12%; }

    .map-block { height: 280px; }

    .leistung-content { flex-direction: column; }
    .leistung-content img { width: 100%; flex-basis: auto; }

    /* Mobil: eine Spalte, Bild immer links */
    .team-grid { grid-template-columns: 1fr; gap: 28px; }
    .team-grid .team-member:nth-child(7) { grid-column: 1; }
    .team-member img { width: 100px; height: 100px; flex-basis: 100px; }

    .footer-cols { columns: 1; }
  }

/* wb-format-scaffold */
.format-body {
  font-family: var(--fmt-body-family);
  font-size: var(--fmt-body-size);
  font-weight: var(--fmt-body-weight);
  line-height: var(--fmt-body-line-height);
  letter-spacing: var(--fmt-body-letter-spacing);
  color: var(--fmt-body-color);
}
.format-h1 {
  font-family: var(--fmt-h1-family);
  font-size: var(--fmt-h1-size);
  font-weight: var(--fmt-h1-weight);
  line-height: var(--fmt-h1-line-height);
  letter-spacing: var(--fmt-h1-letter-spacing);
  color: var(--fmt-h1-color);
}
.format-h2 {
  font-family: var(--fmt-h2-family);
  font-size: var(--fmt-h2-size);
  font-weight: var(--fmt-h2-weight);
  line-height: var(--fmt-h2-line-height);
  letter-spacing: var(--fmt-h2-letter-spacing);
  color: var(--fmt-h2-color);
}
.format-h3 {
  font-family: var(--fmt-h3-family);
  font-size: var(--fmt-h3-size);
  font-weight: var(--fmt-h3-weight);
  line-height: var(--fmt-h3-line-height);
  letter-spacing: var(--fmt-h3-letter-spacing);
  color: var(--fmt-h3-color);
}
.format-h4 {
  font-family: var(--fmt-h4-family);
  font-size: var(--fmt-h4-size);
  font-weight: var(--fmt-h4-weight);
  line-height: var(--fmt-h4-line-height);
  letter-spacing: var(--fmt-h4-letter-spacing);
  color: var(--fmt-h4-color);
}
.format-h5 {
  font-family: var(--fmt-h5-family);
  font-size: var(--fmt-h5-size);
  font-weight: var(--fmt-h5-weight);
  line-height: var(--fmt-h5-line-height);
  letter-spacing: var(--fmt-h5-letter-spacing);
  color: var(--fmt-h5-color);
}

/* wb-visibility-scaffold */
.wb-hide-mobile, .wb-hide-tablet, .wb-hide-desktop { display: initial; }
