/*
 * die schmiede: KI-Hinweis (Hausstandard Muster A).
 * Pill im Header hinter dem Logo, Hinweisblock im Footer vor der schwarzen Leiste.
 * Alle Klassen tragen das Präfix ds-ki-. Gehört zu mu-plugins/ds-ki-hinweis.php.
 * Werte aus der Website: DM Sans, Text #000, Footer #B6B6B6 (Rot #d10418 seit 19.11.2026 abends durch Schwarz ersetzt),
 * Footer-Titel 20px/34px fett, Footer-Text 16px/27.2px.
 */

/* Nur für Screenreader */
.ds-ki-sr {
    position: absolute;
    width: 1px;
    height: 1px;
    margin: -1px;
    padding: 0;
    border: 0;
    clip-path: inset(50%);
    overflow: hidden;
    white-space: nowrap;
}

/* ------------------------------------------------------------
   Pill im Header
   Sie steht im Logo-Container direkt rechts neben dem Logo, auf dessen
   Mittellinie. Der Logo-Container wird dafür zur Flex-Zeile; der Logo-Link
   wird Block mit Zeilenhöhe 0, damit der Container exakt so hoch bleibt
   wie das Logo-Bild. Die Pill ragt bei schmalen Fenstern über die Spalte
   hinaus in den leeren Teil der Menüspalte (overflow sichtbar), die Menüzeile
   selbst wird dadurch nicht breiter.
   ------------------------------------------------------------ */

.wpbf-logo:has(> a.ds-ki-pill),
.wpbf-mobile-logo:has(> a.ds-ki-pill) {
    display: flex;
    align-items: center;
}

.wpbf-logo:has(> a.ds-ki-pill) > a:not(.ds-ki-pill):first-of-type,
.wpbf-mobile-logo:has(> a.ds-ki-pill) > a:not(.ds-ki-pill):first-of-type {
    display: block;
    flex: 0 0 auto;
    line-height: 0;
}

a.ds-ki-pill[data-ds-ki-pill] {
    position: relative;
    display: inline-flex;
    flex: 0 0 auto;
    align-items: center;
    gap: 6px;
    box-sizing: border-box;
    margin: 0 0 0 20px;
    padding: 4px 12px 4px 9px;
    border: 1px solid rgba(0, 0, 0, 0.35);
    border-radius: 999px;
    background-color: #fff;
    color: #000;
    font-family: "DM Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
    font-size: 14px;
    font-style: normal;
    font-weight: 500;
    line-height: 1.2;
    letter-spacing: normal;
    text-decoration: none;
    text-transform: none;
    white-space: nowrap;
    transition: color 0.2s, border-color 0.2s;
}

/* Tipp-Ziel mindestens 44 px hoch, ohne die sichtbare Pill zu vergrößern */
a.ds-ki-pill[data-ds-ki-pill]::after {
    content: "";
    position: absolute;
    top: 50%;
    right: -4px;
    left: -4px;
    height: 44px;
    transform: translateY(-50%);
}

.ds-ki-pill__icon {
    display: block;
    flex: 0 0 auto;
    width: 14px;
    height: 14px;
}

a.ds-ki-pill[data-ds-ki-pill]:hover,
a.ds-ki-pill[data-ds-ki-pill]:focus-visible {
    border-color: #000;
    color: #000;
}

a.ds-ki-pill[data-ds-ki-pill]:focus-visible {
    outline: 2px solid #000;
    outline-offset: 2px;
}

/* Desktop 1025 bis 1299 px: Im Customizer-CSS ist die Logo-Spalte hier
   schmaler (16 %), das Menü beginnt bei 1025 px schon rund 100 px hinter
   dem Logo. Die Pill rückt näher an das Logo und wird kompakter, unter
   1100 px ohne Icon und mit 11 px Schrift. Seit dem Mega-Menü (Pfeil an
   „LEISTUNGEN“, 19.11.2026) ist das Menü rund 23 px breiter; Abstand zum
   ersten Menüpunkt bei 1025 px so wieder mindestens 24 px wie zwischen den
   Menüpunkten. */
@media (min-width: 1025px) and (max-width: 1299px) {
    .wpbf-logo a.ds-ki-pill[data-ds-ki-pill] {
        gap: 4px;
        margin-left: 10px;
        padding: 3px 8px 3px 6px;
        font-size: 12px;
    }

    .wpbf-logo .ds-ki-pill__icon {
        width: 12px;
        height: 12px;
    }
}

@media (min-width: 1025px) and (max-width: 1099px) {
    .wpbf-logo a.ds-ki-pill[data-ds-ki-pill] {
        margin-left: 4px;
        padding: 2px 6px;
        font-size: 11px;
    }

    .wpbf-logo .ds-ki-pill__icon {
        display: none;
    }
}

/* Ersatz: Logo-Hooks haben nicht gegriffen (etwa ein anderer Header).
   Die Pill steht dann fixiert links unten, damit der Hinweis nie fehlt. */
a.ds-ki-pill[data-ds-ki-pill].ds-ki-pill--fallback {
    position: fixed;
    bottom: 12px;
    left: 12px;
    z-index: 998;
    margin: 0;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.18);
}

/* ------------------------------------------------------------
   Hinweisblock im Footer, zwischen Spaltenzeile und schwarzer Leiste.
   Gleicher Grauton und gleiche Textkante wie die Footer-Zeilen
   (Zeilenrand 2 % plus 13 px Modulabstand, Inhalt bis 1662 px).
   ------------------------------------------------------------ */

section.ds-ki-hinweis {
    box-sizing: border-box;
    margin: 0;
    padding: 0 calc(2% + 13px);
    background-color: #b6b6b6;
    color: #000;
    font-family: "DM Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
    font-size: 16px;
    line-height: 1.7;
    outline: none;
    scroll-margin-top: 120px;
}

.ds-ki-hinweis__innen {
    box-sizing: border-box;
    max-width: 1636px;
    margin: 0 auto;
    padding: 28px 0 36px;
    border-top: 1px solid rgba(0, 0, 0, 0.2);
    border-radius: 2px;
    outline: 2px solid transparent;
    outline-offset: 6px;
    transition: outline-color 0.3s ease;
}

.ds-ki-hinweis .ds-ki-hinweis__titel {
    margin: 0 0 6px;
    padding: 0;
    color: #000;
    font-family: inherit;
    font-size: 20px;
    font-weight: 700;
    line-height: 34px;
    letter-spacing: normal;
    text-transform: none;
}

.ds-ki-hinweis .ds-ki-hinweis__text {
    max-width: 900px;
    margin: 0 0 8px;
    color: inherit;
    font-size: inherit;
    line-height: inherit;
}

.ds-ki-hinweis .ds-ki-hinweis__text:last-child {
    margin-bottom: 0;
}

.ds-ki-hinweis a {
    color: #000;
    text-decoration: underline;
    text-decoration-thickness: 1px;
    text-underline-offset: 3px;
}

.ds-ki-hinweis a:hover,
.ds-ki-hinweis a:focus-visible {
    text-decoration-thickness: 2px;
}

.ds-ki-hinweis a:focus-visible {
    outline: 2px solid #000;
    outline-offset: 2px;
}

.ds-ki-hinweis__link {
    white-space: nowrap;
}

/* Hervorhebung nach Klick auf die Pill (Klasse per JS), beim Ankersprung
   ohne JS (:target) und solange der Block den Fokus hat */
.ds-ki-hinweis:target .ds-ki-hinweis__innen,
.ds-ki-hinweis:focus-visible .ds-ki-hinweis__innen,
.ds-ki-hinweis.is-highlight .ds-ki-hinweis__innen {
    outline-color: #000;
}

/* Ersatz: Der Block steht außerhalb des Footers am Seitenende */
section.ds-ki-hinweis.ds-ki-hinweis--frei .ds-ki-hinweis__innen {
    border-top: 0;
}

@media (max-width: 768px) {
    section.ds-ki-hinweis {
        font-size: 15px;
    }

    .ds-ki-hinweis__innen {
        padding: 24px 0 28px;
    }

    .ds-ki-hinweis .ds-ki-hinweis__titel {
        font-size: 18px;
        line-height: 28px;
    }
}

@media (prefers-reduced-motion: reduce) {
    a.ds-ki-pill[data-ds-ki-pill],
    .ds-ki-hinweis__innen {
        transition: none;
    }
}

@media print {
    a.ds-ki-pill[data-ds-ki-pill] {
        display: none;
    }
}
