/* ==========================================================================
   THREE SOLUTIONS — Global Styles
   Reset, Base-Typography, Container, Dot-Pattern
   ========================================================================== */

/* ---- Reset ---------------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html {
    font-size: 16px;
    scroll-behavior: smooth;
    -webkit-text-size-adjust: 100%;
}

body {
    font-family: var(--font-primary);
    font-size: var(--font-size-base);
    line-height: var(--line-height-normal);
    color: var(--color-text);
    background-color: var(--color-off-white);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
    -webkit-font-feature-settings: "kern" 1;
    font-feature-settings: "kern" 1;
}

img, video, svg { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
ul, ol { list-style: none; }
button { font-family: inherit; cursor: pointer; border: none; background: none; }
input, textarea, select { font-family: inherit; }

/* ---- Container ----------------------------------------------------------- */
.container {
    width: 100%;
    max-width: var(--container-max);
    margin-inline: auto;
    padding-inline: var(--container-pad);
}

/* ---- Typography ---------------------------------------------------------- */
h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-primary);
    font-weight: var(--font-weight-semibold);
    line-height: var(--line-height-tight);
    color: var(--color-text);
}

h1 { font-size: var(--font-size-hero); font-weight: var(--font-weight-bold); }
h2 { font-size: var(--font-size-3xl); }
h3 { font-size: var(--font-size-2xl); }
h4 { font-size: var(--font-size-xl); }
h5, h6 { font-size: var(--font-size-lg); }

/*
 * ── Heading rhythm ────────────────────────────────────────────────────────
 * Typografisches Prinzip: mehr Abstand ÜBER einer Überschrift (trennt vom
 * vorherigen Inhalt) als darunter (Überschrift gehört zu dem, was folgt).
 *
 * Layer 1 — Global: kleiner bottom-margin damit jede Überschrift etwas Luft
 *           zum nachfolgenden Text hat, unabhängig vom Kontext.
 * Layer 2 — Fließtext (.prose / .post-content): großzügiger top-margin für
 *           klare visuelle Zäsur beim Abschnittsstart.
 * Layer 3 — Komponenten: margin zurücksetzen wo flexbox/grid gap greift.
 */

/* Layer 1: Globaler Atem unter allen Überschriften */
h2          { margin-bottom: 0.45em; }  /* ~16px bei 36px Schriftgröße */
h3          { margin-bottom: 0.4em; }   /* ~11px bei 28px */
h4, h5, h6  { margin-bottom: 0.35em; } /* ~8px  bei 22px */

/* Layer 2: Voller Rhythmus in Fließtext-Bereichen */
.prose h2,
.post-content h2 {
    margin-top:    var(--space-2xl);  /* 64px — starke visuelle Zäsur */
    margin-bottom: var(--space-md);   /* 16px — nah am folgenden Text */
}
.prose h3,
.post-content h3 {
    margin-top:    var(--space-xl);   /* 40px */
    margin-bottom: 0.45em;
}
.prose h4,
.post-content h4 {
    margin-top:    var(--space-lg);   /* 24px */
    margin-bottom: 0.4em;
}

/* Erstes Element im Block braucht keinen top-margin — Section-Padding reicht */
.prose > :first-child,
.post-content > :first-child { margin-top: 0; }

/* Layer 3: Komponenten — margin unterdrücken wo gap/padding den Abstand regelt */
.blog-card__title,
.glossar-card__title,
.blog-card h2, .blog-card h3,
.glossar-card h2, .glossar-card h3,
.sidebar-cta h2, .sidebar-cta h3,
.author-box h2, .author-box h3,
.term-definition-box h2, .term-definition-box h3,
.related-service-card h2, .related-service-card h3,
.post-hero h1,
.hero-content h1 {
    margin-block: 0;
}

/* .section-intro: nur top-margin (vom eyebrow), kein extra bottom
   — .section-intro__sub hat eigenen margin-top */
.section-intro h2 {
    margin-top:    var(--space-sm);
    margin-bottom: 0;
}

p { line-height: var(--line-height-loose); color: var(--color-text-muted); }
p + p { margin-top: var(--space-md); }

strong { font-weight: var(--font-weight-semibold); color: inherit; }

code, pre {
    font-family: var(--font-mono);
    font-size: var(--font-size-sm);
    background: var(--color-gray-100);
    border-radius: var(--radius-sm);
}
code { padding: 2px 6px; }
pre { padding: var(--space-md); overflow-x: auto; }

/* ---- Focus styles (BFSG / WCAG 2.2) -------------------------------------- */
:focus-visible {
    outline: 2px solid var(--color-cyan);
    outline-offset: 3px;
    border-radius: 2px;
}

/* ---- Selection ----------------------------------------------------------- */
::selection { background: var(--color-navy-light); color: var(--color-text); }

/* ---- Scrollbar (optional subtle styling) --------------------------------- */
::-webkit-scrollbar { width: 8px; }
::-webkit-scrollbar-track { background: var(--color-gray-100); }
::-webkit-scrollbar-thumb { background: var(--color-gray-200); border-radius: var(--radius-full); }

/* ---- CI Accent Bar ------------------------------------------------------- */
.ci-accent-bar {
    width: 100%;
    height: 4px;
    background: var(--gradient-ci);
    flex-shrink: 0;
}

/* ---- Dot Pattern --------------------------------------------------------- */
.dot-pattern {
    background-image: radial-gradient(circle, rgba(255,255,255,.12) 1px, transparent 1px);
    background-size: 28px 28px;
}

/* ---- Section Wrapper ----------------------------------------------------- */
.section-wrapper {
    padding-block: var(--space-3xl);
}

/* ---- Eyebrow / Section Intro --------------------------------------------- */
.section-intro {
    text-align: center;
    max-width: 640px;
    margin-inline: auto;
    margin-bottom: var(--space-2xl);
}

.section-intro h2 { margin-top: var(--space-sm); }

.section-intro__sub {
    margin-top: var(--space-md);
    font-size: var(--font-size-base);
    color: var(--color-text-muted);
    line-height: var(--line-height-relaxed);
    max-width: 680px;
    margin-inline: auto;
}
.section-intro__sub a {
    color: var(--color-cyan);
    text-decoration: none;
}
.section-intro__sub a:hover { text-decoration: underline; }

/* ---- Prose — optimale Lesbarkeitsbreite für Fließtext -------------------- */
/*
 * Maximal ~68 Zeichen pro Zeile (Bringhurst: 60–75 ch).
 * Verhindert zu lange Zeilen, die das Auge beim Zeilenumbruch verliert.
 */
.prose {
    max-width: 68ch;
}

.prose p,
.prose li {
    line-height: var(--line-height-loose);
    color: var(--color-text-muted);
}

.prose p + p {
    margin-top: var(--space-lg);  /* 24px statt 16px — Absätze bekommen mehr Luft */
}

/* Listen im Fließtext */
.prose ul,
.prose ol {
    margin-top: var(--space-md);
    margin-bottom: var(--space-md);
    padding-left: 1.4em;
}
.prose li + li {
    margin-top: 0.4em;
}

/* ---- Highlight Term — visueller Keyword-Anker im Fließtext --------------- */
/*
 * Subtile Cyan-Unterstreichung für max. 2–3 Schlüsselbegriffe pro Seite.
 * Kein Link — rein visueller Lese-Anker.
 */
.highlight-term {
    text-decoration: underline;
    text-decoration-color: var(--color-cyan);
    text-decoration-thickness: 2px;
    text-underline-offset: 4px;
    font-weight: var(--font-weight-semibold);
}

/* ---- Stat Display — dreigliedrige Statistik-Darstellung ------------------ */
/*
 * Zahl / Beschreibung / Zeitraum getrennt: zuerst Zahl, dann Bedeutung.
 * Kognitiv effizienter als alles in einer Zeile.
 */
.stat-display {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.stat-display__value {
    font-size: var(--font-size-3xl);
    font-weight: var(--font-weight-bold);
    color: var(--color-cyan);
    line-height: 1;
    letter-spacing: -0.04em;
}

.stat-display__label {
    font-size: var(--font-size-sm);
    font-weight: var(--font-weight-semibold);
    color: var(--color-text);
    line-height: 1.3;
}

.stat-display__sub {
    font-size: 11px;
    color: var(--color-text-muted);
    line-height: 1.3;
}

/* ---- Skip Link (Accessibility) ------------------------------------------- */
.skip-link {
    position: absolute;
    top: -100px;
    left: var(--space-md);
    background: var(--color-cyan);
    color: var(--color-white);
    padding: var(--space-sm) var(--space-md);
    border-radius: var(--radius-sm);
    font-weight: var(--font-weight-semibold);
    z-index: 9999;
    transition: top .2s;
}
.skip-link:focus { top: var(--space-md); }

/* ---- WordPress alignment classes ----------------------------------------- */
.alignleft  { float: left;  margin-right: var(--space-lg); margin-bottom: var(--space-sm); }
.alignright { float: right; margin-left:  var(--space-lg); margin-bottom: var(--space-sm); }
.aligncenter { display: block; margin-inline: auto; }
.alignwide  { width: 100%; }
.alignfull  { width: 100vw; margin-left: calc(50% - 50vw); }

/* ---- Responsive: Mobile (<= 480px) --------------------------------------- */
@media (max-width: 480px) {
    :root { --space-3xl: 64px; }
    h1 { font-size: clamp(2rem, 8vw, 2.75rem); }
    h2 { font-size: var(--font-size-2xl); }
}

/* ---- Responsive: Tablet (481–900px) -------------------------------------- */
@media (min-width: 481px) and (max-width: 900px) {
    :root { --space-3xl: 80px; }
}
