/* RightEnergy: Welcome-Text (#service_section / #text-40) auf Smartphones lesbar.
   Desktop unverändert. Ursache: Theme-H1/H2/H3 (2.72em / …) + Textwidget max-width
   sprengen die Grid-Spalte und den Viewport (horizontaler Overflow). */

@media screen and (max-width: 767px) {
  /* Grid-Spalte darf Inhalt nicht nach außen drücken */
  #service_section .grid,
  #service_section .container > .grid {
    grid-template-columns: minmax(0, 1fr) !important;
    width: 100% !important;
    max-width: 100% !important;
  }

  #service_section .widget_text,
  #service_section #text-40,
  #service_section .textwidget {
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
    overflow-wrap: anywhere;
    word-wrap: break-word;
    hyphens: auto;
  }

  #service_section .textwidget h1,
  #service_section #text-40 h1 {
    font-size: clamp(1.35rem, 5.5vw, 1.75rem) !important;
    line-height: 1.25 !important;
    margin: 0.4em 0 0.5em !important;
    max-width: 100% !important;
  }

  #service_section .textwidget h2,
  #service_section #text-40 h2 {
    font-size: clamp(1.15rem, 4.5vw, 1.4rem) !important;
    line-height: 1.3 !important;
    margin: 0.5em 0 0.45em !important;
    max-width: 100% !important;
  }

  /* Langer Fließtext steckt fälschlich in h3 – mobil kompakter */
  #service_section .textwidget h3,
  #service_section #text-40 h3 {
    font-size: clamp(0.95rem, 3.8vw, 1.05rem) !important;
    line-height: 1.45 !important;
    font-weight: 400 !important;
    margin: 0.55em 0 !important;
    max-width: 100% !important;
  }

  #service_section .textwidget p,
  #service_section #text-40 p {
    font-size: clamp(0.95rem, 3.6vw, 1.05rem) !important;
    line-height: 1.5 !important;
  }

  #service_section {
    padding-top: 40px !important;
    padding-bottom: 40px !important;
  }

  /* Sicherheit gegen horizontalen Scroll durch Rest-Overflow */
  #service_section,
  #service_section .container {
    overflow-x: clip;
    max-width: 100%;
  }
}

/* ===== BEGIN RiE Design-Update 24.11.2026 (Mobil-Banner, Menü #233F6C + Terrakotta-Linie, Palette #BA5139, Banner-Buttons) ===== */
/* RightEnergy: Banner-Text (#banner_section) auf Smartphones ÜBER dem Kopfbild.
   Ursache: Theme Blossom Spa Pro setzt bei max-width:767px
   ".site-banner .banner-caption{position:static}" + dunkle Schrift (#333/#666),
   dadurch rutscht der Text unter das Bild. Desktop (>=768px) bleibt unverändert. */

@media screen and (max-width: 767px) {
  /* Bühne: Höhe ergibt sich aus dem Text, mindestens ~540px */
  body #banner_section.site-banner .item {
    position: relative !important;
    overflow: hidden;
    min-height: 540px;
  }

  /* Kopfbild + Crossfade-Bild der Rotation vollflächig hinter dem Text */
  body #banner_section #wp-custom-header {
    position: absolute !important;
    inset: 0;
    width: 100%;
    height: 100%;
    z-index: 0 !important;
  }
  body.custom-background #banner_section .item #wp-custom-header img,
  body #banner_section .item #wp-custom-header img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100% !important;
    height: 100% !important;
    max-width: none;
    object-fit: cover;
    object-position: center;
  }

  /* Text liegt im Fluss (bestimmt die Höhe) über dem Bild, mit dunkelblauem Verlauf */
  body #banner_section.site-banner .banner-caption {
    position: relative !important;
    z-index: 2;
    min-height: 540px;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 44px 0 40px !important;
    background: linear-gradient(180deg,
      rgba(20, 40, 80, .70) 0%,
      rgba(20, 40, 80, .74) 55%,
      rgba(20, 40, 80, .86) 100%) !important;
  }
  body #banner_section .banner-caption .container {
    padding-left: 20px;
    padding-right: 20px;
  }
  body #banner_section .banner-caption .title {
    color: #fff !important;
    font-size: clamp(1.6rem, 7.2vw, 2.1rem);
    line-height: 1.18;
    text-shadow: 0 2px 10px rgba(0, 0, 0, .45);
    overflow-wrap: break-word;
    hyphens: auto;
  }
  body #banner_section .banner-caption .description {
    color: #fff !important;
    font-size: clamp(.95rem, 4vw, 1.05rem);
    line-height: 1.55;
    margin-top: 14px;
    text-shadow: 0 1px 4px rgba(0, 0, 0, .6);
  }
  body #banner_section .banner-caption .btn-wrap {
    margin-top: 22px;
  }
  body #banner_section .banner-caption .btn-wrap a.btn {
    display: block;
    width: 100%;
    max-width: 340px;
    margin-left: auto !important;
    margin-right: auto !important;
    box-sizing: border-box;
    padding-top: 12px;
    padding-bottom: 12px;
    font-size: 1rem !important;
    letter-spacing: .02em;
    line-height: 1.35;
    white-space: normal;
  }
  body #banner_section .banner-caption .btn-wrap a.btn i { margin-left: 6px; }
  body #banner_section .banner-caption .btn-wrap a.btn + a.btn {
    margin-top: 10px !important;
  }
  body #banner_section .banner-caption .btn-wrap a.btn.btn-transparent {
    border-color: #fff !important;
    color: #fff !important;
    background: rgba(255, 255, 255, .08);
  }
  body #banner_section .banner-caption .btn-wrap a.btn.btn-transparent:hover {
    background: #fff !important;
    color: #233F6C !important;
  }
}

@media screen and (max-width: 380px) {
  body #banner_section.site-banner .item,
  body #banner_section.site-banner .banner-caption { min-height: 520px; }
  body #banner_section .banner-caption .description { font-size: .93rem; line-height: 1.5; }
}

/* Tablet (768–1024px): Text liegt schon über dem Bild, aber Theme-Overlay
   (rgba(0,0,0,.3)) ist bei hellen Bildern (z. B. Supermarkt) zu schwach. */
@media screen and (min-width: 768px) and (max-width: 1024px) {
  body #banner_section.site-banner .banner-caption {
    background: linear-gradient(180deg, rgba(20,40,80,.60) 0%, rgba(20,40,80,.72) 100%) !important;
  }
  body #banner_section .banner-caption .title { text-shadow: 0 2px 10px rgba(0,0,0,.45); }
  body #banner_section .banner-caption .description { text-shadow: 0 1px 4px rgba(0,0,0,.6); }
}

/* ===== Menüfarbe: Markenblau #233F6C statt Theme-Blau #0c3fcc, mit 3px Terrakotta-Unterkante (#BA5139) =====
   Gilt für Kopfzeile (Kontaktleiste), Sticky-Header, mobile Menüleiste,
   ausgeklapptes mobiles Menü und Untermenü-Hover. Weiß auf #233F6C = 10,5:1.
   Alternative dunkler: #0b2a4a (wie .re-band.navy auf /energie-ki/, 14,5:1). */
#masthead,
.responsive-nav,
.sticky-header {
  --primary-color: #233F6C;
  --primary-color-rgb: 35, 63, 108;
}
.sticky-header { background: #233F6C !important; border-bottom: 3px solid #BA5139 !important; box-shadow: 0 2px 10px rgba(0,0,0,.25); }
.responsive-nav { background: #233F6C !important; }
#masthead .main-navigation ul ul li:hover > a,
#masthead .main-navigation ul ul li.current-menu-item > a,
#masthead .main-navigation ul ul li.current_page_item > a { background: #233F6C !important; color: #fff !important; }
#masthead .header-t { background: #233F6C !important; }
.responsive-nav .main-navigation button.toggle-btn,
#masthead .main-navigation button.toggle-btn { border-color: transparent !important; }
@media screen and (max-width: 1024px) {
  #masthead .nav-wrap .container,
  .header-sticky #masthead .nav-wrap { background: #233F6C !important; }
  #masthead .nav-wrap .container { border-bottom: 3px solid #BA5139; }
}

/* ===== Einheitliche Palette =====
   Navy #0b2a4a  | Markenblau #233F6C (ersetzt Theme-Blau #0c3fcc)
   Sensor-Terrakotta #BA5139, Hover #9E4430 (Frontfläche Hype-225-Foto; Weiß darauf 4,9:1)
   Terrakotta hell #E8896B nur als Schrift/Linie auf Navy (5,7:1; #BA5139 hätte dort nur 3,0:1)
   Rot #C8463A für „AI“ bleibt unverändert. */

/* Theme-Primärfarbe global (Scroll-nach-oben-Button, Sticky, Untermenü-Hover …) */
:root { --primary-color: #233F6C; --primary-color-rgb: 35, 63, 108; }
body a { color: #233F6C; }
section.service-section.style-1, .service-price-section, section.team-section,
.gallery-section, section.service-section.style-2 { background: rgba(35, 63, 108, .05) !important; }
.back-to-top { border-color: rgba(35, 63, 108, .5) !important; }
.back-to-top:hover { background: #233F6C !important; color: #fff !important; }

/* Gefüllte Orange-Flächen -> Terrakotta (Weiß auf #F28C28 hatte nur 2,45:1) */
body .banner-caption .btn-wrap a.btn-green { background: #BA5139 !important; border-color: #BA5139 !important; }
body .banner-caption .btn-wrap a.btn-green:hover { background: #9E4430 !important; border-color: #9E4430 !important; }
body #text-40 a.re-home-btn { background: #BA5139 !important; }
body #text-40 a.re-home-btn:hover { background: #9E4430 !important; }
body .re-lp .re-btn:not(.alt) { background: #BA5139 !important; }
body .re-lp .re-btn:not(.alt):hover { background: #9E4430 !important; }
/* WPForms „Absenden“ (12021 Lastgang, 13249 Kontakt und überall sonst) */
body .wpforms-container button.wpforms-submit,
body .re-lp .re-contact button[type=submit],
body .re-lg-form-slot .wpforms-submit { background: #BA5139 !important; border-color: #BA5139 !important; color: #fff !important; }
body .wpforms-container button.wpforms-submit:hover,
body .re-lp .re-contact button[type=submit]:hover,
body .re-lg-form-slot .wpforms-submit:hover { background: #9E4430 !important; border-color: #9E4430 !important; }

/* /energie-ki/: Fläche „Bestellen oder Angebot anfordern“ */
body .re-lp .re-band.accent { background: #BA5139 !important; color: #fff; }
body .re-lp .re-band.accent .re-cta p { color: #fff !important; }
body .re-lp .re-band.accent .re-btn:not(.alt) { background: #0b2a4a !important; box-shadow: 0 0 0 2px rgba(255,255,255,.35); }
body .re-lp .re-band.accent .re-btn:not(.alt):hover { background: #071d34 !important; }
body .re-lp .re-band.accent .re-btn.alt:hover { background: rgba(255,255,255,.14) !important; }

/* Orange als Schrift/Linie auf hellem Grund -> Terrakotta (vorher 2,45:1, jetzt 4,9:1) */
body #text-40 .re-home-flow, body #text-40 .re-home-ai, body #text-40 .re-home-price { border-left-color: #BA5139 !important; border-color: #ead9c8; }
body #text-40 a.re-home-more, body #text-40 .re-home-ai-kicker, body #text-40 .re-home-ai-headline { color: #BA5139 !important; }
body #text-40 a.re-home-more:hover { color: #9E4430 !important; }
body .re-lp .re-card { border-left-color: #BA5139; }
body .re-lp .re-step, body .re-lp .re-eur { color: #BA5139; }
body .re-lg-more { border-bottom-color: #BA5139 !important; }
body .re-lg-more:hover { color: #BA5139 !important; }

/* Orange auf Navy -> helles Terrakotta (Lesbarkeit bleibt ~5,7:1) */
body .re-lp .re-band.navy .re-card, body .re-lp .re-band.deep .re-card { border-left-color: #E8896B !important; }
body .re-lp .re-band.navy .re-step, body .re-lp .re-band.deep .re-step,
body .re-lp .re-band.navy .re-eur, body .re-lp .re-band.deep .re-eur,
body .re-lp .re-kpi b { color: #E8896B !important; }
body .re-lp .re-contact .wpforms-required-label { color: #E8896B !important; }
body .re-lp [style*="color:#f28c28"] { color: #E8896B !important; }
body .re-lp [style*="solid #f28c28"] { border-left-color: #E8896B !important; }

/* ===== Banner-Buttons Startseite: größere Schrift (vorher .6666em ≈ 12px) ===== */
body #banner_section .banner-caption .btn-wrap a.btn {
  font-size: 17px;
  letter-spacing: .03em;
  padding: 16px 34px;
  line-height: 1.3;
}
body #banner_section .banner-caption .btn-wrap a.btn i { font-size: .85em; margin-left: 8px; }
@media screen and (min-width: 768px) and (max-width: 1024px) {
  body #banner_section .banner-caption .btn-wrap a.btn { font-size: 16px; padding: 14px 28px; }
}
@media screen and (max-width: 767px) {
  body #banner_section .banner-caption .btn-wrap a.btn { font-size: 16px !important; padding: 14px 14px; letter-spacing: 0; }
}
/* ===== END RiE Design-Update 24.11.2026 ===== */

/* ===== BEGIN RiE Seitenkopf-Fix 24./25.11.2026 (Seitentitel mobil, Brotkrümel hell, Beitragstitel + Badges) ===== */
@media screen and (max-width: 767px) {
  /* Beitrags- und Seitentitel im Hero: kleiner, kein Abschneiden.
     Ursache: Theme setzt .container auf 420px (breiter als 360/390px) und der
     bisherige Titel (36px, hyphens:manual ohne weiches Trennzeichen) brach
     „Energiedatenmanagement“ mitten im Wort und ragte über den Rand. */
  body header.page-header .page-title {
    font-size: clamp(1.5rem, 7vw, 1.9rem) !important; /* ≈ 25px bei 360, 27px bei 390, 29px bei 412 */
    line-height: 1.2 !important;
    /* Safari bricht bei overflow-wrap:break-word mitten im Wort und ignoriert &shy; */
    overflow-wrap: normal !important;
    word-break: normal !important;
    hyphens: manual !important;   /* nur am weichen Trennzeichen (Energie-/management) */
    -webkit-hyphens: manual !important;
    max-width: 100%;
    box-sizing: border-box;
  }
  /* /energie-ki/ (page-id-13217): dieselbe Schriftgröße wie die anderen Hero-Titel
     (ca. 25–29px). font-weight:700 kommt aus dem Seiten-CSS und bleibt. */
  body.page-id-13217 header.page-header h1.page-title {
    font-size: clamp(1.5rem, 7vw, 1.9rem) !important;
    overflow-wrap: normal !important;
    word-break: normal !important;
    hyphens: manual !important;
    -webkit-hyphens: manual !important;
  }
  body header.page-header > .container {
    padding-left: 16px;
    padding-right: 16px;
    box-sizing: border-box;
  }
  /* Theme setzt .container auf 420px (breiter als 360/390px) und schneidet ab.
     /energie-ki/ (page-id-13217) behält die bisherige Container-Breite. */
  body:not(.page-id-13217) header.page-header > .container {
    max-width: 100% !important;
    width: 100% !important;
  }
  body:not(.page-id-13217) header.page-header .breadcrumb-wrapper > .container {
    max-width: 100% !important;
    width: 100% !important;
    padding-left: 0;
    padding-right: 0;
    box-sizing: border-box;
  }
  /* Kategorie-Badges: umbrechen und im Viewport zentrieren, nichts abschneiden */
  body header.page-header span.category {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    gap: 4px 2px;
    max-width: 100%;
    box-sizing: border-box;
  }
  body header.page-header span.category a {
    margin-right: 0;
  }
}
body header.page-header #crumbs,
body header.page-header #crumbs a,
body header.page-header #crumbs .separator,
body header.page-header #crumbs .separator i { color: #fff !important; }
body header.page-header #crumbs a:hover { color: #fff !important; text-decoration: underline; }
body header.page-header #crumbs .current,
body header.page-header #crumbs .current a { color: rgba(255,255,255,.78) !important; }
body header.page-header #crumbs { text-shadow: 0 1px 4px rgba(0,0,0,.5); overflow-wrap: normal; word-break: normal; hyphens: manual; -webkit-hyphens: manual; }
/* ===== END RiE Seitenkopf-Fix 24.11.2026 ===== */

/* ===== BEGIN RiE Banner-Mobil-Fix 3 24.11.2026 (Titel ganze Wörter, Untertext immer sichtbar, Schleier heller) =====
   Ursache: Das Rotationsskript (WPCode-Footer) vergrößert im „Großer-Titel“-Modus die Überschrift per Inline-Style
   bis Bühnenhöhe (57–65px) und blendet den Untertext aus; mit hyphens:auto wurde dabei mitten im Wort getrennt.
   Nur #banner_section – der Seitenkopf (header.page-header, Energie-/management) ist nicht betroffen. */
@media screen and (max-width: 767px) {
  html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
  body #banner_section .banner-caption .banner-caption-inner { max-width: none !important; }
  body #banner_section .banner-caption .title {
    font-size: clamp(1.6rem, 7.4vw, 1.9rem) !important;   /* ≈ 27px bei 360, 29px bei 390, 30px bei 412 */
    line-height: 1.2 !important;
    hyphens: none !important;
    -webkit-hyphens: none !important;
    overflow-wrap: normal !important;
    word-break: normal !important;
    text-shadow: 0 2px 12px rgba(0,0,0,.75), 0 1px 3px rgba(0,0,0,.6) !important;
  }
  body #banner_section .banner-caption .description {
    display: block !important;
    opacity: 1 !important;
    transform: none !important;
    hyphens: none !important;
    -webkit-hyphens: none !important;
    text-shadow: 0 1px 3px rgba(0,0,0,.85), 0 0 10px rgba(0,0,0,.55) !important;
  }
  body #banner_section.site-banner .banner-caption {
    background: linear-gradient(180deg,
      rgba(20, 40, 80, .35) 0%,
      rgba(20, 40, 80, .45) 45%,
      rgba(20, 40, 80, .65) 100%) !important;
  }
}
/* ===== END RiE Banner-Mobil-Fix 3 24.11.2026 ===== */

/* ===== BEGIN RiE Seitenkopf /energie-ki/ Mobil-Overlay 25.11.2026 =====
   Das Kopfbild (header::before, Band 3973px auto, repeat-x) ist auf dem Handy
   niedriger als der Hero, daher dunkelblaue Streifen oben/unten. Der Schleier
   (::after) ist mit 62–68 % zu dunkel, das Motiv kaum erkennbar. */
@media screen and (max-width: 767px) {
  /* Bildwechsel: kein klassischer Slider, sondern die Site-Animation
     re-header-band (80s, linear, infinite) über das 3973×250-Panorama.
     cover + animation:none hatte die Bewegung auf dem Handy gestoppt.
     Jetzt: Höhe füllend (auto 100 %), nahtloses repeat-x, 80s-Pan über zwei Kacheln. */
  body.page-id-13217 header.page-header {
    overflow: hidden;
  }
  body.page-id-13217 header.page-header::before {
    top: 0 !important;
    left: 0 !important;
    height: 100% !important;
    width: auto !important;
    aspect-ratio: calc(2 * 3973 / 250);
    background-size: auto 100% !important;
    background-repeat: repeat-x !important;
    background-position: 0 50% !important;
    animation: rie-eki-header-pan 80s linear infinite !important;
  }
  body.page-id-13217 header.page-header::after {
    background: linear-gradient(180deg,
      rgba(11, 42, 74, .35) 0%,
      rgba(11, 42, 74, .45) 45%,
      rgba(11, 42, 74, .60) 100%) !important;
  }
  body.page-id-13217 header.page-header h1.page-title {
    text-shadow: 0 2px 12px rgba(0,0,0,.75), 0 1px 3px rgba(0,0,0,.6);
  }
}
@media screen and (max-width: 767px) and (prefers-reduced-motion: reduce) {
  body.page-id-13217 header.page-header::before {
    animation: none !important;
  }
}
@keyframes rie-eki-header-pan {
  from { transform: translateX(0); }
  to { transform: translateX(-50%); }
}
/* ===== END RiE Seitenkopf /energie-ki/ Mobil-Overlay 25.11.2026 ===== */
