/* ═══════════════════════════════════════════════════════════════════════════
   heimseiten.de — THEME-NEUBAU: Basis (Reset, HTML-Elemente, Typografie, Fokus)
   Übernommen aus settings.css (Basis-Teil), wird beim Komponenten-Umzug um die
   Element-Regeln aus live-design/heimseiten ergänzt.
   ═══════════════════════════════════════════════════════════════════════════ */

*, *::before, *::after { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  scrollbar-gutter: stable;
  /* Anker-Versatz = GESCHRUMPFTE Header-Höhe am Ziel (130→83, Header-Schrumpf) */
  scroll-padding: 83px 0 0;
  @media (max-width: 1023px) {
    scroll-padding: var(--header_height_mobile, 51px) 0 0;
  }
}
[id] { scroll-margin-top: 2em; }

/* ── Artikel-Innenbreite — FRÜH-gebunden: war am Anfang von live-design und muss
   Reihenfolge-Duelle gegen dessen spätere Regeln (.hs-referenzen > * u. a.) VERLIEREN ── */
.mod_article > * {
  width: 1024px;
  margin: 0 auto;
  padding-left: 20px;
  padding-right: 20px;
  position: relative;
  z-index: 2;
}
@media (max-width: 1023px) {
  .mod_article > * { width: 95%; padding-left: 2.5%; padding-right: 2.5%; margin: 0 auto; }
}
.mod_article.hs-full-width > *, .mod_article.article_full_width > * { margin: 0; padding: 0; width: 100%; }

/* ── Reset-Reste (aus dem alten live-design-Reset, effektiv wirksam) ── */
/* HTML5-Display-Reset (live-design-FRÜH; heute UA-redundant, 1:1 — Stufe 13) */
header, footer, nav, section, aside, main, article, figure, figcaption { display: block; }
/* Contao-.block — verliert bewusst gegen .content-text{overflow:visible} (components, später) */
.block { overflow: hidden; }
body, div, h1, h2, h3, h4, h5, h6, p, blockquote, pre, code, ol, ul, li, dl, dt, dd,
figure, table, th, td, form, fieldset, legend, input, textarea { margin: 0; padding: 0; }
h1, h2, h3, h4, h5, h6, p, pre, blockquote, table, ol, ul, form { margin-bottom: 12px; }
fieldset, img, iframe { border: 0; }
img { max-width: 100%; height: auto; }
/* wertidentisch zur globalen img-Regel (live-design-FRÜH, 1014px-Grenze = Bestand — Stufe 13) */
@media (max-width: 1014px) { .content-image img { max-width: 100%; height: auto; } }
ul { list-style-type: none; }
input, button, textarea, select { font-family: inherit; font-size: 99%; font-weight: inherit; }
h1, h2, h3, h4, h5, h6 { font-size: 100%; font-weight: 400; margin-top: 1em; }

/* ── Galerie-Grundgerüst (Contao content-gallery) — FRÜH-gebunden: stand am ABSOLUTEN
   Anfang von live-design (Regel 1–2 von 1121) und darf spätere gleich-spezifische
   Galerie-Regeln (.content-gallery--cols-3 > ul, .hs-screenshot-galerie > ul in components)
   nicht per Reihenfolge schlagen (aktuell wertgleich/konfliktfrei — Position trotzdem
   herkunftstreu, Stufe-05-Verfeinerung). Schlägt ul-Reset (12px-margin) per Spezifität. ── */
.content-gallery > ul { margin: 0; padding: 0; overflow: hidden; list-style: none; }
.content-gallery > ul li { float: left; }

/* ── Media-Blöcke + Float-Basis (live-design-RESET-ZONE → FRÜH. Duell-Lage geprüft:
   text-image-positioning-`figure{float:none}` und alle #wrapper-/!important-Overrides
   gewinnen per Spezifität/!important wie im Bestand; `.fb-3798>*{display:flex}` (0,1,0-TIE
   mit .media auf display) bleibt später geladen (components) und gewinnt weiter = Bestand. ── */
.float_left, .media--left > figure { float: left; }
.float_right, .media--right > figure { float: right; }
.media { display: flow-root; }

/* ── Formular-Basis (live-design-Mittelteil; formlabelmover-Bundle spielt darüber) ── */
.ce_form .widget, .ce_form .submit_container { margin-bottom: 5px; }
.ce_form :is(.widget, .submit_container) input:is(.checkbox, .radio) { width: 20px; }
.ce_form :is(.widget, .submit_container).widget-textarea label { vertical-align: top; }
.ce_form :is(.widget, .submit_container):is(.widget-radio, .widget-checkbox) :is(.radio_container, .checkbox_container) legend {
  line-height: 1.7;
  display: inline-block;
  min-width: auto;
  width: auto;
  float: left;
  padding-right: 20px;
}
.ce_form :is(.widget, .submit_container):is(.widget-radio, .widget-checkbox) :is(.radio_container, .checkbox_container) span input { min-width: auto; }
.ce_form :is(.widget, .submit_container):is(.widget-radio, .widget-checkbox) :is(.radio_container, .checkbox_container) span label {
  width: auto;
  min-width: 0;
  margin-right: 20px;
  display: inline-block;
  text-align: center;
}
.ce_form :is(.widget, .submit_container):is(.widget-radio, .widget-checkbox) :is(.radio_container, .checkbox_container) span label i { font-size: 110px; display: block; line-height: 1.1; }
.ce_form :is(.widget, .submit_container).widget-captcha { display: flex; flex-flow: row-reverse wrap; align-items: baseline; justify-content: flex-end; }
@media (max-width: 1023px) {
  .ce_form :is(.widget, .submit_container).widget-captcha { flex-direction: column-reverse; }
}
.ce_form :is(.widget, .submit_container).widget-captcha .captcha_text { margin-right: 30px; }
.ce_form .widget-submit { text-align: right; }
.ce_form :is(input[type="text"], input[type="password"], input[type="date"], input[type="datetime"], input[type="email"], input[type="number"], input[type="search"], input[type="tel"], input[type="time"], input[type="url"], input:not([type]), textarea, input[type="submit"], .button) {
  line-height: normal;
  font-size: 99%;
  background: none;
  box-shadow: none;
  border-radius: 2px;
  appearance: none;
}
/* Schwebende Labels (Zusammenspiel mit formlabelmover-Bundle); Werte = effektiver Bestand
   (spätere live-design-Overrides einkonsolidiert: input-padding 9/6, bg .14, label 6/9) */
form .widget:not(.error) { position: relative; margin-top: 10px; }
form .widget:not(.error) label {
  position: absolute;
  top: 0;
  left: 0;
  padding: 6px 9px;
  height: auto;
  transition: var(--tr);
  transform-origin: left center;
}
form .widget:not(.error) :is(input, textarea, select) {
  width: 100%;
  border: 1px solid var(--c-border);
  border-radius: 0;
  background: rgba(255, 255, 255, 0.14);
  padding: 9px 6px;
  box-shadow: none;
  outline: none;
}
/* Schwebezustand (formlabelmover setzt .active bei Fokus/Wert): Label klein über die Feldkante */
form .widget:not(.error).active label {
  top: -11px;
  left: 6px;
  transform: scale(0.7);
  width: auto;
  background: var(--c-surface);
  border-radius: 3px;
  padding: 0 2px;
  line-height: 1;
}
form .widget:is(.widget-radio, .widget-checkbox) label { position: relative; }
/* #main-Felder: hellere Fläche (ID-Spezifität gewinnt gegen die .14-Basis — Bestand) */
#main :is(input, select, textarea) { background: rgba(255, 255, 255, 0.4); margin-left: 0; width: 100%; }

body {
  /* Startwert für Scroll-Fortschritt: theme.js setzt --scroll erst bei DOMContentLoaded —
     ohne Fallback ist calc(var(--scroll)*1000px) bis dahin invalid (Slogan sprang). */
  --scroll: 0;
  margin: 0;
  background: var(--c-page);
  overflow-x: clip; /* Off-Canvas-Mobilmenü erzeugt keinen horizontalen Scroll */
  min-width: 280px;
}
/* Doppel-Selektor body+Artikel = Bestands-Spezifität (Artikel-Kontext gewinnt gegen
   Element-Regeln); Werte = EFFEKTIVER Bestand (line-height 1.8 — settings' 1.7 war tot). */
body, body .mod_article {
  font-family: var(--font_family);
  font-size: var(--font_size);
  font-weight: 400;
  line-height: 1.8;
  color: var(--c-text-2);
}
body svg, body .mod_article svg { height: 1rem; margin-bottom: -2px; fill: var(--c-text-2); }
/* FontAwesome-Inline-SVGs (Twig/Editor-Icons) sauber auf der Zeile ausrichten */
body .svg-inline--fa, body .mod_article .svg-inline--fa { position: relative; height: 1em; top: 1px; }

::selection { background: var(--c-brand); color: #fff; }

.error { color: var(--c-error); margin-bottom: 1em; line-height: 1.2; font-size: 0.9em; }

/* Barrierefreiheit: Fokus + Skip-Link */
:focus:not(:focus-visible) { outline: none; }
:focus-visible { outline: 2px solid var(--c-brand); outline-offset: 2px; border-radius: 2px; }
/* Obermenge aus live-design (gewann bisher per Reihenfolge; border/margin/padding gemergt — Stufe 13) */
.invisible { position: absolute; clip: rect(0 0 0 0); width: 1px; height: 1px; overflow: hidden; border: 0; margin: -1px; padding: 0; }
.skip-link:focus {
  position: fixed; clip: auto; width: auto; height: auto; top: 8px; left: 8px; z-index: 1000;
  background: var(--c-surface); color: var(--c-brand); padding: 10px 16px; border-radius: var(--border_radius);
}

/* ═══════════ TYPOGRAFIE (Werte = effektiver Bestand, Selektor-Muster beibehalten) ═══════════ */
body :is(h1, h2, h3, h4), body .mod_article :is(h1, h2, h3, h4) {
  margin-top: 1.3em;   /* Standard-Abstand über Überschriften (Nutzer 2026-07-16; war 0 —
                          eigenständige Element-Überschriften bekamen sonst keinen Abstand,
                          nur RTE-Headings hatten 1.3em). h1/h5 werden unten auf margin:0 gesetzt. */
  color: var(--c-brand);
  line-height: 1.3;
  font-family: var(--font_family);
}
/* NUR die erste Überschrift des Artikels ohne Extra-Abstand (Artikel-Padding trägt) —
   nicht jede Element-Überschrift (die ist immer Erstes-Kind ihres CE-Wrappers). */
.mod_article > :is(h2, h3, h4):first-child,
.mod_article > *:first-child > :is(h2, h3, h4):first-child { margin-top: 0; }
@media (max-width: 1023px) {
  body :is(h1, h2, h3, h4), body .mod_article :is(h1, h2, h3, h4) { text-align: left; }
}
body :is(h1, h5), body .mod_article :is(h1, h5) { font-size: 45px; font-weight: 300; margin: 0; color: #3b3c42; }
body :is(h1, h5):first-child, body .mod_article :is(h1, h5):first-child { margin-top: 0; }
@media (max-width: 1024px) {
  body :is(h1, h5), body .mod_article :is(h1, h5) { font-size: 27px; }
}
body h2, body .mod_article h2 { font-size: 21px; font-weight: 500; margin-bottom: 10px; }
@media (max-width: 425px) {
  body h2, body .mod_article h2 { font-size: 16px; }
}
h2 { text-wrap: balance; }
body h3, body .mod_article h3 { font-size: 19px; margin: 0 0 11px; line-height: 25px; color: var(--c-brand); }
/* h4 aktuell ohne Vorkommen im Bestand — Stil bewusst behalten (CMS-Editor kann h4 anlegen) */
body h4, body .mod_article h4 {
  font-size: 15px;
  color: #555;
  line-height: 27px;
  margin: 0;
  padding: 0;
  letter-spacing: 2px;
  font-weight: 700;
  text-transform: uppercase;
}
body p, body .mod_article p { margin: 0; word-break: break-word; hyphens: auto; }
body strong, body .mod_article strong { font-weight: 600; }
body em, body .mod_article em { font-family: inherit; font-size: inherit; line-height: 1; }
body hr, body .mod_article hr {
  border-width: 1px 0;
  border-style: solid none;
  border-color: #ccc currentcolor #fff;
  display: block;
  height: 0;
  margin: 30px 0 0;
  padding: 0;
}
@media (max-width: 1023px) {
  body hr, body .mod_article hr { margin-bottom: 0; }
}
body iframe, body .mod_article iframe { max-width: 100%; }
body img, body .mod_article img { display: block; vertical-align: bottom; }
/* (figure-Float-Margins, rte-Abstände, rechtstext, Dark-Text-Layer: heimseiten-stämmig →
   liegen SPÄT-gebunden in components.css — Datei-Reihenfolge ist dort load-bearing!) */

/* ═══════════ LINKS (Grün + Unterstreich-Animation ab Tablet) ═══════════ */
body a, body .mod_article a { text-decoration: none; color: var(--c-brand); }
body a svg, body .mod_article a svg { fill: var(--c-brand); }
body .content-text a, body .mod_article .content-text a { hyphens: none; }
/* Fließtext-Links: echte Unterlinie (Lesbarkeit; Bild-/em-Links ausgenommen) */
/* (rte-Link-Unterlinie: heimseiten-stämmig → components.css) */
@media (min-width: 769px) {
  #header .mod_navigation a, #header .hs-info-box a, .mod_article a, #footer .underline a {
    color: var(--c-brand);
    position: relative;
    text-decoration: none;
    transition: 0.25s ease-in-out;
    outline: none !important; /* Bestand; :focus-visible-Ring bleibt separat erhalten */
  }
  #header .mod_navigation a.invisible, #header .hs-info-box a.invisible, .mod_article a.invisible, #footer .underline a.invisible { display: none; }
  #header .mod_navigation a::before, #header .hs-info-box a::before, .mod_article a::before, #footer .underline a::before {
    background-color: var(--c-brand);
    bottom: 0;
    content: "";
    height: 1px;
    left: 0;
    position: absolute;
    transform: scaleX(0);
    transition: 0.3s ease-in-out;
    visibility: hidden;
    width: 100%;
  }
  #header .mod_navigation a:hover, #header .hs-info-box a:hover, .mod_article a:hover, #footer .underline a:hover { color: var(--c-brand); }
  #header .mod_navigation a:hover::before, #header .hs-info-box a:hover::before, .mod_article a:hover::before, #footer .underline a:hover::before {
    transform: scaleX(1);
    visibility: visible;
  }
}

/* External-Link-Icon (currentColor-SVG als background → im Dark per filter geweißt) */
#container a[target="_blank"], .hs-footer-main a[target="_blank"], #header nav a[target="_blank"] { position: relative; padding-right: 1em; }
#container a[target="_blank"]::after, .hs-footer-main a[target="_blank"]::after, #header nav a[target="_blank"]::after {
  position: absolute;
  background: url("/files/layout/img/icons/external-link-light.svg") no-repeat;
  background-size: 0.7em;
  width: 0.7em;
  height: 0.7em;
  bottom: 0.3em;
  margin-left: 0.3em;
  content: "";
}
#container .hs-no-external-link-icon a[target="_blank"], .hs-footer-main .hs-no-external-link-icon a[target="_blank"], #header nav .hs-no-external-link-icon a[target="_blank"] { padding-right: 0; }
#container .hs-no-external-link-icon a[target="_blank"]::after, .hs-footer-main .hs-no-external-link-icon a[target="_blank"]::after, #header nav .hs-no-external-link-icon a[target="_blank"]::after { display: none; }
figure a[target="_blank"] { padding-right: 0; }
figure a[target="_blank"]::after { display: none; }
/* (Dark-Text-Layer + Dark-External-Icon: heimseiten-stämmig → components.css) */

.hs-preload * { transition: none !important; }

/* Sanfte Seitenübergänge (View Transitions) */
@view-transition { navigation: auto; }
main::view-transition-old(root) { animation: fade-out 0.4s ease forwards; }
main::view-transition-new(root) { animation: fade-in 0.4s ease forwards; }
@keyframes fade-out { to { opacity: 0; } }
@keyframes fade-in { from { opacity: 0; } }
