/*
 Theme Name:   fresch-webdesign Child
 Description:  Child Theme für Kunden - DIVI 5
 Author:       fresch-webdesign
 Template:     Divi
 Version:      1.0
 License:      GNU General Public License v2 or later
 License URI:  http://www.gnu.org/licenses/gpl-2.0.html
*/

/* ==========================================================================
   Accessibility & Performance
   ========================================================================== */

/* Animation für Nutzer mit reduzierten Bewegungspräferenzen fast vollständig deaktivieren.
   Reduces animation/transition to near-zero for users with reduced-motion preference. */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* Einheitliches Box-Modell: Padding/Border werden in die angegebene Breite/Höhe eingerechnet,
   nicht addiert. Verhindert unerwartete Breitenverschiebungen. In Divi meist bereits Standard,
   hier zur Sicherheit explizit gesetzt.
   Consistent box model: padding/border are included in the given width/height rather than
   added on top. Prevents unexpected width shifts. Usually Divi's default already, set here
   explicitly as a safeguard. */
* {
  box-sizing: border-box;
}

/* ==========================================================================
   HTML-/Body-Basics: UX & Accessibility --> Sitekrafter
   ========================================================================== */
/* scroll-behavior: smooth --> weiches Scrollen bei Sprung-Ankern (z.B. #anchor-links).
                                Smooth scrolling for anchor-link jumps.
 * font-smoothing (webkit/moz)  --> feinere, gleichmäßigere Schriftdarstellung.
                                     Finer, more even font rendering.
 * text-size-adjust --> verhindert automatische Schriftvergrößerung durch mobile Browser,
                         hält die Darstellung konsistent.
                         Prevents mobile browsers from auto-adjusting font size, keeps
                         rendering consistent across devices. */
html {
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  -webkit-text-size-adjust: 100%;
  -ms-text-size-adjust: 100%;
}

/* Smooth Scrolling auch bei Tastatur-/Tab-Navigation aktiv halten. Sinnvoll für Accessibility.
   Keeps smooth scrolling active during keyboard/tab navigation. Useful for accessibility. */
html:focus-within {
  scroll-behavior: smooth;
}

/* ==========================================================================
   HTML-Basics: Performance-Trade-off
   ========================================================================== */
/* text-rendering: optimizeSpeed --> beschleunigt das Rendering, v.a. bei viel Text.
   Trade-off: Schrift kann dadurch minimal "roher" wirken als mit optimizeLegibility.
   Speeds up rendering, especially with large amounts of text. Trade-off: text may
   appear slightly less refined than with optimizeLegibility. */
html {
  text-rendering: optimizeSpeed;
}

/* ==========================================================================
   Grundlayout / Base layout
   ========================================================================== */

/* Verhindert horizontales Scrollen durch versehentlich überstehende Elemente.
   Prevents horizontal scrolling caused by accidentally overflowing elements. */
body {
  overflow-x: hidden;
}

/* ==========================================================================
   Silbentrennung / Hyphenation
   ========================================================================== */

/* Fließtext: automatische Silbentrennung durch den Browser.
   Voraussetzung: <html lang="..."> muss korrekt gesetzt sein, passend zur Inhaltssprache
   (bei fresch meistens: de-DE). Browser-Unterstützung ist sprachabhängig und nicht für
   jede Sprache gleich vollständig.
   Body text: automatic browser-based hyphenation.
   Requires <html lang="..."> to be set correctly, matching the content language
   (for fresch usually: de-DE). Browser support is language-dependent and not equally
   complete for every language. */
body {
  hyphens: auto;
}

/* Überschriften: nur an manuell gesetzten Stellen trennen (&shy;),
   nicht nach Browser-Wörterbuch – vermeidet unschöne Trennungen in großer Schrift.
   Headings: hyphenate only at manually placed soft hyphens (&shy;),
   not via browser dictionary – avoids awkward breaks at large font sizes. */
h1,
h2,
h3,
h4,
h5,
h6 {
  hyphens: manual;
}

/* ==========================================================================
   TYPOGRAPHY RESET --> Divi-Defaults überschreiben / Override Divi defaults
   ========================================================================== */

/* Divi setzt am Heading-Modul standardmäßig padding-bottom: 10px. Wird hier auf 0 gesetzt,
   um den Abstand vollständig über das Designsystem (Presets/Spacing) zu steuern.
   ⚠️ Zwei Varianten parallel im Einsatz (Element- und Wrapper-Selector via :has()) – Redundanz
   noch nicht final geprüft, Stand 20.07.2026.
   Divi sets padding-bottom: 10px on the heading module by default. Set to 0 here so spacing
   is fully controlled via the design system (presets/spacing scale).
   ⚠️ Two variants currently in parallel use (element and wrapper selector via :has()) –
   redundancy not yet finally confirmed, as of 2026-07-20. */
.et_pb_heading h1, .et_pb_heading h2, .et_pb_heading h3, .et_pb_heading h4, .et_pb_heading h5, .et_pb_heading h6 {
    padding-bottom: 0;
}

.et_pb_heading:has(h1, h2, h3, h4, h5, h6) {
  padding-bottom: 0;
}

/* Verhindert zusätzlichen Divi-Modulabstand zwischen Heading- und direkt folgendem Text-Modul.
   Prevents extra Divi module spacing between a heading module and an immediately
   following text module. */
.et_pb_heading:has(h1, h2, h3, h4, h5, h6) + .et_pb_text {
  margin-top: 0 !important;
}

/* Divi setzt für UL/OL eine feste line-height, die eigene Presets überschreibt.
   Wird hier zurückgesetzt, damit Preset-Werte greifen können.
   Divi applies a fixed line-height to UL/OL that overrides custom presets.
   Reset here so preset values can take effect. */
#left-area ul, .entry-content ul, .et-l--body ul, .et-l--footer ul, .et-l--header ul,
#left-area ol, .entry-content ol, .et-l--body ol, .et-l--footer ol, .et-l--header ol {
  line-height: inherit;
}

/* ==========================================================================
   Text-Modul Anpassungen (Klasse: text-style-basis)
   Standardmäßig zugewiesen bei den Presets Text-Body, Text-BodyLarge, Text-BodySmall.
   Text module adjustments (class: text-style-basis)
   Assigned by default on the Text-Body, Text-BodyLarge, Text-BodySmall presets.
   ========================================================================== */

/* Abstand oberhalb von Überschriften im Fließtext, außer beim jeweils ersten Element.
   Top spacing above headings within body text, except for the first element. */
.text-style-basis h1:not(:first-child),
.text-style-basis h2:not(:first-child),
.text-style-basis h3:not(:first-child),
.text-style-basis h4:not(:first-child),
.text-style-basis h5:not(:first-child),
.text-style-basis h6:not(:first-child) {
    padding-top: 1em;
}

/* Abstand unterhalb des letzten Absatzes eines Typs.
   Spacing below the last paragraph of its type. */
.text-style-basis p:last-of-type {
    padding-bottom: 1em;
}

/* Entfernt den unteren Abstand, wenn das Element tatsächlich das letzte im Textblock ist.
   Removes bottom spacing when the element is genuinely the last one in the text block. */
.text-style-basis p:last-child,
.text-style-basis ul:last-child,
.text-style-basis ol:last-child {
    padding-bottom: 0;
}

/* Link-Darstellung im Fließtext: Underline-Stil, Abstand, weiche Transition.
   Bewusst ohne Farbe – Farbrolle wird projektspezifisch im jeweiligen Preset gesetzt.
   Body-text link style: underline treatment, offset, smooth transition.
   Deliberately no color here – color role is set project-specifically in the preset. */
.text-style-basis a {
    text-decoration: underline;
    text-decoration-thickness: .1em;
    text-underline-offset: .15em;
    transition: all .1s linear;
}
.text-style-basis a:hover {
    text-underline-offset: .3em;
}

/* Blockquotes im Fließtext kursiv darstellen.
   Italicizes blockquotes within body text. */
.text-style-basis blockquote {
    font-style: italic;
}
