/*!
 * Betreuungsfee – Grav-Theme
 * Eigene Styles; keine externen Abhängigkeiten, keine Google-Fonts (DSGVO-freundlich).
 * Farben & Hero-Höhe werden per Theme-Konfiguration als CSS-Variablen gesetzt (siehe base.html.twig).
 */

/* ---------- Schrift: Inter (OFL-1.1), lokal eingebunden ---------- */
@font-face {
    font-family: "Inter";
    font-style: normal;
    font-weight: 100 900;
    font-display: swap;
    src: url("../fonts/inter-latin-ext-opsz-normal.woff2") format("woff2");
    unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
    font-family: "Inter";
    font-style: normal;
    font-weight: 100 900;
    font-display: swap;
    src: url("../fonts/inter-latin-opsz-normal.woff2") format("woff2");
    unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

/* ---------- Design-Tokens ---------- */
:root {
    --bf-primary: #2e1080;
    --bf-primary-contrast: #fff;
    --bf-heading: #140f23;
    --bf-text: #000;
    --bf-soft: #f1f0f8;
    --bf-card: #ecebf3;
    --bf-white: #fff;
    --bf-border: #000;

    --bf-font: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;

    --bf-container: 1280px;
    --bf-narrow: 672px;
    --bf-pad: clamp(1rem, 5vw, 5rem);
    --bf-section-y: 6rem;
    --bf-gap: 2rem;

    --bf-hero-h: clamp(28rem, 100vh, 52rem);
    --bf-hero-overlay: 0.28;
}

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

html {
    -webkit-text-size-adjust: 100%;
    text-size-adjust: 100%;
    scroll-behavior: smooth;
}
html.bf-no-smooth { scroll-behavior: auto; }
@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
}

body {
    margin: 0;
    font-family: var(--bf-font);
    font-size: 1rem;
    line-height: 1.6;
    color: var(--bf-text);
    background: var(--bf-white);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
}

img { display: block; max-width: 100%; height: auto; }
a { color: inherit; }
:focus-visible { outline: 3px solid var(--bf-primary); outline-offset: 3px; }

.bf-skip {
    position: absolute;
    left: 1rem;
    top: -4rem;
    z-index: 100;
    padding: .75rem 1rem;
    background: var(--bf-primary);
    color: var(--bf-primary-contrast);
    border-radius: 4px;
    transition: top .15s ease;
}
.bf-skip:focus { top: 1rem; }

/* ---------- Layout-Helfer ---------- */
.bf-container {
    width: min(100% - 2 * var(--bf-pad), var(--bf-container));
    margin-inline: auto;
}
.bf-container--text { max-width: 52rem; }
.bf-narrow {
    width: min(100% - 2 * var(--bf-pad), var(--bf-narrow));
    margin-inline: auto;
}

.bf-section { padding-block: var(--bf-section-y); }
.bf-section--soft { background: var(--bf-soft); }
.bf-section[id], .bf-hero[id] { scroll-margin-top: 1rem; }

/* ---------- Typografie ---------- */
.bf-title,
.bf-hero__title,
.bf-service__title,
.bf-tile__title {
    margin: 0;
    color: var(--bf-heading);
}

.bf-title {
    font-size: 2.5rem;           /* 40px */
    line-height: 1.125;
    font-weight: 700;
    letter-spacing: -0.032em;
    margin-bottom: 1rem;
}
.bf-title--center { text-align: center; }
.bf-title--page { margin-bottom: 2rem; }

.bf-lead,
.bf-prose--lead { font-size: 1.125rem; letter-spacing: -0.0065em; }  /* 18px */
.bf-lead { margin: 0; }
.bf-lead--center { text-align: center; }

/* Fließtext-Blöcke: Absatzabstand 2rem wie im Original */
.bf-prose > * { margin-block: 0 2rem; }
.bf-prose > :last-child { margin-bottom: 0; }
.bf-prose a { text-decoration: underline; text-underline-offset: .15em; }
.bf-prose img { margin-block: 0 2rem; }
.bf-prose h2,
.bf-prose h3,
.bf-prose h4 { color: var(--bf-heading); line-height: 1.2; }
.bf-prose ul,
.bf-prose ol { padding-left: 1.25rem; }

/* ---------- Header ---------- */
.bf-header { background: var(--bf-white); }

.bf-header__inner {
    display: flex;
    align-items: center;
    gap: 5.75rem;
    padding: 30px 32px 60px;
}

.bf-logo { display: block; flex: none; text-decoration: none; }
.bf-logo__img { height: 150px; width: auto; max-width: 100%; }
.bf-logo__text {
    display: flex;
    align-items: center;
    min-height: 150px;
    font-size: 2rem;
    font-weight: 600;
    letter-spacing: -0.03em;
    line-height: 1.1;
    color: var(--bf-heading);
}

.bf-nav__list {
    display: flex;
    flex-wrap: wrap;
    gap: .5rem 4rem;
    margin: 0;
    padding: 0;
    list-style: none;
}
.bf-nav__link {
    display: inline-block;
    padding-block: .25rem;
    color: var(--bf-text);
    text-decoration: none;
    font-size: 1rem;
    line-height: 1.6;
    letter-spacing: -0.004em;
}
.bf-nav__link:hover,
.bf-nav__link:focus-visible,
.bf-nav__link.is-active {
    text-decoration: underline;
    text-decoration-thickness: 1px;
    text-underline-offset: .35em;
}

.bf-burger { display: none; }

/* ---------- Hero ---------- */
.bf-hero {
    position: relative;
    isolation: isolate;
    min-height: var(--bf-hero-h);
    color: #fff;
    background: var(--bf-heading);
    overflow: hidden;
}
.bf-hero--plain {
    background: linear-gradient(135deg, #3a2a78 0%, #6c5aa8 55%, #b79bb9 100%);
}
.bf-hero__img {
    position: absolute;
    inset: 0;
    z-index: -2;
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.bf-hero::after {
    content: "";
    position: absolute;
    inset: 0;
    z-index: -1;
    background: rgba(0, 0, 0, var(--bf-hero-overlay));
}
.bf-hero__inner {
    display: flex;
    flex-direction: column;
    padding: 4.25rem 32px 3rem;
}
.bf-hero__title {
    max-width: 51rem;            /* bricht wie im Original nach "Betreuung" um */
    color: #fff;
    font-size: 3.5rem;           /* 56px */
    line-height: 1.125;
    font-weight: 600;
    letter-spacing: -0.023em;
}
.bf-hero__text {
    width: min(100%, 510px);
    margin: 1rem 0 0 auto;
    font-size: 1.375rem;         /* 22px */
    line-height: 1.6;
    letter-spacing: -0.014em;
}
.bf-hero__text > * { margin: 0 0 1rem; }
.bf-hero__text > :last-child { margin-bottom: 0; }

/* ---------- Abschnitts-Kopf ---------- */
.bf-section__head { max-width: var(--bf-narrow); }
.bf-section__head .bf-prose { margin-top: 0; }

/* ---------- Intro + Karte ---------- */
.bf-intro { padding-top: var(--bf-section-y); }
.bf-intro .bf-lead { margin-bottom: 3rem; }

.bf-card {
    position: relative;
    overflow: hidden;
    isolation: isolate;
    padding: 18px;
    background: var(--bf-card);
}
.bf-card__mark {
    position: absolute;
    inset: 0;
    z-index: -1;
    width: 100%;
    height: 100%;
    max-width: none;
    object-fit: cover;
    object-position: 20% 50%;
    opacity: .5;
    pointer-events: none;
    user-select: none;
}
.bf-card__body { position: relative; }
.bf-card__body h2,
.bf-card__body h3 {
    margin: 0 0 2rem;
    font-size: 2.5rem;
    line-height: 1.6;
    font-weight: 400;
    letter-spacing: 0;
    text-align: center;
    color: #000;
}
.bf-card__body p { font-size: 1.125rem; letter-spacing: -0.0065em; }
.bf-card__body p:has(> strong:only-child) { text-align: center; }  /* "Leistungen im Überblick" */
.bf-card__body ul { list-style: none; padding: 0; }
.bf-card__body ul > li { font-size: 1.125rem; letter-spacing: -0.0065em; }
.bf-card__body ul > li + li { margin-top: 2rem; }
.bf-card__body ul > li::before { content: "-"; }

/* ---------- Leistungen (3 Kacheln) ---------- */
.bf-services__grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: var(--bf-gap);
    margin-top: 4rem;
}
.bf-service__img {
    width: 300px;
    max-width: 100%;
    aspect-ratio: 1;
    object-fit: cover;
}
.bf-service__title {
    margin: 1.75rem 0 .75rem;
    font-size: 1.25rem;
    line-height: 1.125;
    font-weight: 700;
    letter-spacing: -0.04em;
}
.bf-service__text { margin: 0; letter-spacing: -0.003em; }

/* ---------- Split-Sektion (Bild + Karten) ---------- */
.bf-split { padding-top: 5rem; }
.bf-split__grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 3rem;
    align-items: start;
    margin-top: 4rem;
}
.bf-split--reverse .bf-split__media { order: 2; }
.bf-split__media { aspect-ratio: 1; overflow: hidden; background: linear-gradient(145deg, #5b4a8f, #c79fb8 60%, #e9d6d0); }
.bf-split__media img { width: 100%; height: 100%; object-fit: cover; }
.bf-split__cards { display: grid; gap: 1.5rem; }
.bf-tile { padding: 1.5rem; background: var(--bf-white); }
.bf-tile__title {
    margin-bottom: .8rem;
    font-size: 1.25rem;
    line-height: 1.2;
    font-weight: 700;
    letter-spacing: -0.04em;
}
.bf-tile__text { margin: 0; letter-spacing: -0.003em; }

/* ---------- Kontakt ---------- */
.bf-contact__grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 3rem;
    align-items: start;
}
.bf-contact__intro { margin-bottom: 1rem; }
.bf-contact__info .bf-prose { margin: 0; }
.bf-contact__info .bf-prose p { margin-bottom: 2rem; }
.bf-contact__form { padding-top: 1.25rem; }

/* ---------- Formular (Grav Form Plugin) ---------- */
.bf-form { margin: 0; }
.bf-field { margin-bottom: 1.25rem; }
.bf-field__label { margin-bottom: .3rem; }
.bf-label {
    display: block;
    font-weight: 500;
    letter-spacing: -0.003em;
}
.bf-label .required { color: inherit; }

.bf-input {
    display: block;
    width: 100%;
    height: 2.75rem;                /* 44px */
    padding: .5rem .75rem;
    font: inherit;
    color: var(--bf-text);
    background: var(--bf-white);
    border: 1px solid var(--bf-border);
    border-radius: 4px;
    appearance: none;
}
textarea.bf-input,
.bf-textarea {
    height: auto;
    min-height: 13.7rem;            /* ~219px */
    resize: vertical;
}
.bf-input:focus { outline: 3px solid var(--bf-primary); outline-offset: 1px; }

/* Felder ohne Label (z. B. Checkbox mit eigenem Text) kein leeres Label-Element rendern */
.bf-field__label:has(> .bf-label:empty) { display: none; }
.bf-label .required,
[data-grav-field="checkbox"] .required { display: none; }   /* wie im Original: keine Sternchen, Pflichtfelder sind per HTML5 "required" markiert */

/* Einwilligungs-Checkbox: Text fließt inline mit der Checkbox, wie im Original */
.bf-field .form-display-wrapper.bf-label { margin-top: .25rem; margin-bottom: .75rem; }
.bf-field [data-grav-field="checkbox"] .form-input-wrapper,
[data-grav-field="checkbox"] .form-input-wrapper {
    padding-left: 16px;
    font-weight: 500;
    line-height: 1.2;
    letter-spacing: -0.003em;
}
[data-grav-field="checkbox"] label { display: inline !important; font-weight: 500; }
[data-grav-field="checkbox"] label a { text-decoration: underline; text-underline-offset: .15em; }
.bf-checkbox {
    display: inline-block;
    width: 20px;
    height: 20px;
    margin: 0 6px 0 0;
    vertical-align: top;
    accent-color: var(--bf-primary);
}

.bf-errors,
.form-errors { margin-top: .35rem; color: #b3261e; font-size: .9rem; }
.bf-errors p, .form-errors p { margin: 0; }

.bf-buttons { margin-top: 1rem; }
.bf-button {
    display: inline-block;
    padding: .875rem 1.625rem;
    font: inherit;
    font-size: 1.125rem;
    font-weight: 500;
    line-height: 1.6;
    letter-spacing: -0.006em;
    color: var(--bf-primary-contrast);
    background: var(--bf-primary);
    border: 0;
    border-radius: 999px;
    cursor: pointer;
    text-decoration: none;
    transition: filter .15s ease, transform .15s ease;
}
.bf-button:hover { filter: brightness(1.15); }
.bf-button:active { transform: translateY(1px); }

/* Hinweis-Meldungen (Grav messages) */
.notices {
    margin: 0 0 1.5rem;
    padding: .75rem 1rem;
    border-left: 4px solid var(--bf-primary);
    background: var(--bf-soft);
}
.notices p { margin: 0; }
.notices.red { border-color: #b3261e; background: #fbeceb; }
.notices.yellow { border-color: #b26a00; background: #fff4e0; }

/* ---------- Footer ---------- */
.bf-footer { padding-block: 2rem; background: var(--bf-soft); font-size: .9rem; }
.bf-footer p { margin: 0; }

/* =========================================================
   Responsive
   ========================================================= */
@media (max-width: 1100px) {
    .bf-header__inner { gap: 3rem; }
    .bf-nav__list { gap: .25rem 2rem; }
}

@media (max-width: 900px) {
    :root { --bf-section-y: 4rem; }

    .bf-header__inner {
        position: relative;
        justify-content: space-between;
        gap: 1rem;
        padding: 1rem;
    }
    .bf-logo__img { height: 84px; }
    .bf-logo__text { min-height: 84px; font-size: 1.5rem; }

    .bf-burger {
        display: inline-flex;
        flex-direction: column;
        justify-content: center;
        gap: 6px;
        width: 48px;
        height: 48px;
        padding: 12px;
        background: transparent;
        border: 0;
        cursor: pointer;
    }
    .bf-burger__bar {
        display: block;
        height: 2px;
        background: var(--bf-heading);
        transition: transform .2s ease, opacity .2s ease;
    }
    .bf-burger[aria-expanded="true"] .bf-burger__bar:nth-child(1) { transform: translateY(8px) rotate(45deg); }
    .bf-burger[aria-expanded="true"] .bf-burger__bar:nth-child(2) { opacity: 0; }
    .bf-burger[aria-expanded="true"] .bf-burger__bar:nth-child(3) { transform: translateY(-8px) rotate(-45deg); }

    .bf-nav {
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        z-index: 20;
        display: none;
        padding: .5rem 1rem 1.25rem;
        background: var(--bf-white);
        border-bottom: 1px solid var(--bf-card);
        box-shadow: 0 12px 24px rgba(20, 15, 35, .08);
    }
    .bf-nav.is-open { display: block; }
    .bf-nav__list { flex-direction: column; gap: 0; }
    .bf-nav__link { display: block; padding: .75rem 0; font-size: 1.125rem; }

    .bf-title { font-size: 2rem; }
    .bf-hero__inner { padding: 2.5rem 1rem 2rem; }
    .bf-hero__title { font-size: 2.25rem; }
    .bf-hero__text { margin-left: 0; font-size: 1.125rem; width: 100%; }

    .bf-card__body h2,
    .bf-card__body h3 { font-size: 1.75rem; line-height: 1.4; }

    .bf-services__grid { grid-template-columns: repeat(2, 1fr); margin-top: 2.5rem; }
    .bf-split__grid,
    .bf-contact__grid { grid-template-columns: 1fr; gap: 2rem; margin-top: 2.5rem; }
    .bf-contact__grid { margin-top: 0; }
    .bf-split--reverse .bf-split__media { order: 0; }
    .bf-contact__form { padding-top: 0; }
}

@media (max-width: 560px) {
    .bf-services__grid { grid-template-columns: 1fr; }
    .bf-service__img { width: 100%; }
    [data-grav-field="checkbox"] .form-input-wrapper { padding-left: 0; }
}

@media print {
    .bf-header, .bf-burger, .bf-contact__form, .bf-footer { display: none; }
    .bf-hero { min-height: 0; color: #000; background: none; }
    .bf-hero__img, .bf-hero::after { display: none; }
    .bf-hero__title { color: #000; }
}
