/* =============================================================================
   Karriere: Detailansicht einer Stelle und Bewerbungsformulare
   inc/wbg-jobs.php (.wbg-stelle) und inc/wbg-bewerbung.php (.wbg-bewerbung).
   Lädt nur auf Seiten mit [wbg_jobs] oder [wbg_bewerbung]
   (wbg_karriere_seite()). Die Job-Karten der Liste stehen in style.css.
   Formensprache wie die Wohnungsseite (assets/css/wbg-mietobjekt.css):
   Lato, Dunkelgrün, grüne Schräge als Knopf, dunkelgrüner Kasten rechts.
   ============================================================================= */

/* --- Detailansicht auf der Stellenseite ----------------------------------- */

/* Die Stelle teilt sich die Seite mit der Liste. Überschrift und Einleitung
   der Liste gibt inc/wbg-jobs.php gar nicht aus (bricks/element/render); den
   leeren Kopfblock hier noch weg, die Stelle hat ihre eigene h1. */
body.wbg-stelle-detail .wbg-immo-list__header:not(:has(.wbg-stelle)) {
    display: none !important;
}

.wbg-stelle {
    --stelle-gruen: var(--wbg-gruen-dunkel, #19502F);
    --stelle-akzent: var(--wbg-gruen, #009450);
    --stelle-linie: #DDD9D1;
    --stelle-radius: var(--wbg-radius, 10px);
    display: block;
    width: 100%;
    font-family: "Lato", sans-serif;
    color: var(--wbg-text, #4A4949);
}

.wbg-stelle__zurueck {
    margin: 0 0 clamp(16px, 2vw, 24px);
    font-size: var(--wbg-fs-sm, 1rem);
    font-weight: 700;
}

.wbg-stelle__zurueck a {
    color: var(--stelle-akzent);
    text-decoration: none;
}

.wbg-stelle__zurueck a:hover,
.wbg-stelle__zurueck a:focus-visible {
    text-decoration: underline;
    text-underline-offset: 3px;
}

.wbg-stelle__kopf {
    margin: 0 0 clamp(32px, 4vw, 48px);
    padding: 0 0 clamp(24px, 3vw, 36px);
    border-bottom: 1px solid var(--stelle-linie);
}

.wbg-stelle__badges {
    display: flex;
    flex-wrap: wrap;
    gap: 10px 16px;
    margin: 0 0 16px;
}

.wbg-stelle__badges .wbg-tag-slanted {
    margin: 0;
}

.wbg-stelle__titel {
    margin: 0 0 8px;
    font-size: var(--wbg-fs-section-title, 3.125rem);
    font-weight: 700;
    line-height: 1.12;
    color: var(--stelle-gruen);
    text-wrap: balance;
    overflow-wrap: break-word;
    hyphens: auto;
}

.wbg-stelle__ort {
    margin: 0 0 clamp(20px, 2.4vw, 28px);
    font-size: var(--wbg-fs-lead, 1.25rem);
    color: var(--stelle-gruen);
}

.wbg-stelle__aktion {
    margin: 0;
}

/* Knopf: grüne Schräge mit Verlauf wie "Meine wbg App" und der Zurück-Knopf
   der Artikel. Die Schräge liegt im ::before, der Text bleibt gerade. */
.wbg-stelle__cta {
    position: relative;
    z-index: 0;
    isolation: isolate;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 14px 32px;
    font-size: var(--wbg-fs-cta, 1.25rem);
    font-weight: 700;
    line-height: 1;
    color: #FFFFFF !important;
    text-decoration: none !important;
    transition: transform .2s ease, filter .2s ease;
}

.wbg-stelle__cta::before {
    content: "";
    position: absolute;
    inset: 0;
    z-index: -1;
    border-radius: 5px;
    transform: skewX(-17.5deg);
    background: linear-gradient(to right, var(--wbg-gruen, #009450) 73%, var(--wbg-verlauf-ende, var(--wbg-gruen-akzent, #AFCC46)) 100%);
}

.wbg-stelle__cta:hover,
.wbg-stelle__cta:focus-visible {
    filter: brightness(1.05);
    transform: translateY(-1px);
}

.wbg-stelle__cta:focus-visible {
    outline: 2px solid var(--stelle-gruen);
    outline-offset: 5px;
}

/* --- Beschreibung und Kasten ---------------------------------------------- */

.wbg-stelle__spalten {
    display: grid;
    grid-template-columns: minmax(0, 1fr) clamp(300px, 27vw, 380px);
    gap: clamp(28px, 3.5vw, 56px);
    align-items: start;
}

.wbg-stelle__text {
    min-width: 0;
    font-size: var(--wbg-fs-body, 1.25rem);
    line-height: 1.6;
}

.wbg-stelle__einstieg {
    margin: 0 0 clamp(28px, 3.5vw, 44px);
    color: var(--stelle-gruen);
}

.wbg-stelle__einstieg > :first-child,
.wbg-stelle__abschnitt-text > :first-child { margin-top: 0; }
.wbg-stelle__einstieg > :last-child,
.wbg-stelle__abschnitt-text > :last-child { margin-bottom: 0; }

/* Compana setzt manchmal leere Überschriften (<h1> </h1>) in den Text. */
.wbg-stelle__text h1:empty,
.wbg-stelle__text p:empty {
    display: none;
}

.wbg-stelle__abschnitt + .wbg-stelle__abschnitt {
    margin-top: clamp(28px, 3.5vw, 44px);
}

.wbg-stelle__abschnitt-titel {
    margin: 0 0 14px;
    font-size: var(--wbg-fs-h3, 1.375rem);
    font-weight: 700;
    line-height: 1.25;
    color: var(--stelle-gruen);
}

.wbg-stelle__abschnitt-text p {
    margin: 0 0 1em;
}

/* Aufzählungen mit dem schrägen Marker der übrigen Seiten (.wbg-karriere__list). */
.wbg-stelle__text ul {
    list-style: none;
    margin: 0 0 1em;
    padding: 0;
}

.wbg-stelle__text ul > li {
    position: relative;
    margin: 0 0 .45em;
    padding: 0 0 0 1.3em;
}

.wbg-stelle__text ul > li::before {
    content: "";
    position: absolute;
    left: 0;
    top: .57em;
    width: .6em;
    height: .45em;
    background: var(--stelle-akzent);
    border-radius: 2px;
    transform: skewX(-17.5deg);
}

.wbg-stelle__text ol {
    margin: 0 0 1em;
    padding-left: 1.3em;
}

.wbg-stelle__text a {
    color: var(--stelle-gruen);
    text-decoration: underline;
    text-underline-offset: 3px;
}

.wbg-stelle__seite {
    position: sticky;
    top: clamp(24px, 4vw, 56px);
}

.wbg-stelle__box {
    padding: clamp(24px, 2.6vw, 34px);
    border-radius: var(--stelle-radius);
    background: var(--stelle-gruen);
    color: #FFFFFF;
}

.wbg-stelle__box-titel {
    margin: 0 0 18px;
    font-size: var(--wbg-fs-sm, 1rem);
    font-weight: 900;
    letter-spacing: .06em;
    text-transform: uppercase;
    color: #FFFFFF;
}

.wbg-stelle__fakten {
    display: grid;
    gap: 14px;
    margin: 0;
}

.wbg-stelle__fakt {
    display: grid;
    gap: 2px;
}

.wbg-stelle__fakt dt {
    font-size: var(--wbg-fs-xs, .875rem);
    font-weight: 700;
    letter-spacing: .04em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, .85);
}

.wbg-stelle__fakt dd {
    margin: 0;
    font-size: var(--wbg-fs-body, 1.25rem);
    font-weight: 700;
    line-height: 1.3;
}

.wbg-stelle__cta--box {
    display: flex;
    width: 100%;
    margin: clamp(22px, 2.4vw, 30px) 0 0;
}

.wbg-stelle__box .wbg-stelle__cta:focus-visible {
    outline-color: #FFFFFF;
}

/* Kontrastmodus: der Knopf wird dunkelgrün (wbg-kontrast.css) und läge im
   Kasten unsichtbar auf Dunkelgrün; ein weißer Rand hält ihn erkennbar. */
html.wbg-kontrast .wbg-stelle__box .wbg-stelle__cta::before {
    box-shadow: inset 0 0 0 2px #FFFFFF;
}

.wbg-stelle__kontakt {
    display: grid;
    gap: 4px;
    margin: clamp(22px, 2.4vw, 30px) 0 0;
    padding: clamp(16px, 1.8vw, 22px) 0 0;
    border-top: 1px solid rgba(255, 255, 255, .22);
    font-size: var(--wbg-fs-sm, 1rem);
}

.wbg-stelle__kontakt p {
    margin: 0;
}

.wbg-stelle__kontakt-label {
    font-size: var(--wbg-fs-xs, .875rem);
    font-weight: 700;
    letter-spacing: .04em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, .85);
}

.wbg-stelle__kontakt-name {
    font-size: var(--wbg-fs-body, 1.25rem);
    font-weight: 700;
}

.wbg-stelle__kontakt a {
    color: #FFFFFF;
    text-decoration: underline;
    text-underline-offset: 3px;
}

/* --- Bewerbung und weitere Stellen --------------------------------------- */

.wbg-stelle__bewerbung,
.wbg-stelle__weitere {
    margin: clamp(56px, 7vw, 96px) 0 0;
    padding: clamp(40px, 5vw, 64px) 0 0;
    border-top: 1px solid var(--stelle-linie);
}

.wbg-stelle__bewerbung {
    scroll-margin-top: 24px;
}

.wbg-stelle__bereich-titel {
    margin: 0 0 12px;
    font-size: var(--wbg-fs-section-title, 3.125rem);
    font-weight: 700;
    line-height: 1.12;
    color: var(--stelle-gruen);
    text-wrap: balance;
}

.wbg-stelle__bereich-intro {
    max-width: 65ch;
    margin: 0 0 clamp(28px, 3.5vw, 44px);
    font-size: var(--wbg-fs-body, 1.25rem);
    line-height: 1.6;
}

.wbg-stelle__weitere .wbg-karriere__jobs {
    margin-top: clamp(20px, 2.4vw, 28px);
}

/* Mobil: Knopf am unteren Rand, solange weder der Knopf im Kopf noch das
   Formular zu sehen ist (assets/js/wbg-bewerbung.js). */
.wbg-stelle__leiste {
    display: none;
}

/* --- Liste: Hinweis und Link zur ganzen Liste ----------------------------- */

.wbg-jobs__hinweis {
    margin: 0 0 clamp(20px, 2.4vw, 28px);
    padding: 16px 20px;
    border-radius: var(--wbg-radius, 10px);
    background: #EFEDE8;
    font-family: "Lato", sans-serif;
    font-size: var(--wbg-fs-body, 1.25rem);
    font-weight: 700;
    color: var(--wbg-gruen-dunkel, #19502F);
}

.wbg-jobs__empty {
    margin: 0;
    font-family: "Lato", sans-serif;
    font-size: var(--wbg-fs-body, 1.25rem);
}

.wbg-jobs__mehr {
    margin: clamp(18px, 2vw, 26px) 0 0;
    font-family: "Lato", sans-serif;
    font-size: var(--wbg-fs-link, 1.125rem);
    font-weight: 700;
}

.wbg-jobs__mehr a {
    color: var(--wbg-gruen-dunkel, #19502F);
    text-decoration: none;
}

.wbg-jobs__mehr a:hover,
.wbg-jobs__mehr a:focus-visible {
    text-decoration: underline;
    text-underline-offset: 3px;
}

/* --- Bewerbungsformular (Ergänzungen zu .wbg-form in style.css) ----------- */

.wbg-bewerbung__stelle {
    margin: 0 0 clamp(20px, 2.4vw, 28px);
    font-size: var(--wbg-fs-body, 1.25rem);
    color: var(--wbg-gruen-dunkel, #19502F);
}

.wbg-bewerbung__stelle[hidden] {
    display: none;
}

.wbg-bewerbung__unterlagen {
    display: grid;
    gap: 14px;
    grid-column: 1 / -1;
    min-width: 0;
    margin: 0;
    padding: 0;
    border: 0;
}

.wbg-bewerbung__unterlagen > .wbg-form__label {
    margin: 0 0 4px;
    padding: 0;
}

.wbg-bewerbung__unterlagen > .wbg-form__note {
    margin: 0 0 4px;
}

.wbg-form__datei {
    padding: 10px 12px;
    background: #FFFFFF;
    font: inherit;
    font-size: var(--wbg-fs-sm, 1rem);
    cursor: pointer;
}

.wbg-form__datei::file-selector-button {
    margin: 0 14px 0 0;
    padding: 8px 16px;
    border: 0;
    border-radius: 5px;
    background: var(--wbg-gruen-dunkel, #19502F);
    color: #FFFFFF;
    font: inherit;
    font-weight: 700;
    cursor: pointer;
}

.wbg-form__datei:hover::file-selector-button {
    background: var(--wbg-gruen, #009450);
}

.wbg-bewerbung__fortschritt {
    width: 100%;
    height: 6px;
    margin: 16px 0 0;
    border-radius: 3px;
    background: #DDD9D1;
    overflow: hidden;
}

.wbg-bewerbung__fortschritt[hidden] {
    display: none;
}

.wbg-bewerbung__balken {
    display: block;
    width: 0;
    height: 100%;
    background: linear-gradient(90deg, var(--wbg-gruen, #009450), var(--wbg-gruen-akzent, #AFCC46));
    transition: width .2s ease;
}

.wbg-bewerbung__danke {
    padding: clamp(24px, 3vw, 40px);
    border-radius: var(--wbg-radius, 10px);
    background: var(--wbg-form-success-bg, #EEF7F1);
    color: var(--wbg-gruen-dunkel, #19502F);
    font-size: var(--wbg-fs-body, 1.25rem);
    line-height: 1.6;
}

.wbg-bewerbung__danke[hidden] {
    display: none;
}

.wbg-bewerbung__danke:focus {
    outline: none;
}

.wbg-bewerbung__danke-titel {
    margin: 0 0 10px;
    font-size: var(--wbg-fs-h3, 1.375rem);
    font-weight: 700;
    line-height: 1.25;
}

.wbg-bewerbung__danke p {
    margin: 0;
}

.wbg-bewerbung__abgelehnt {
    margin-top: 12px !important;
    color: var(--wbg-form-error, #B3261E);
}

.wbg-bewerbung__abgelehnt[hidden] {
    display: none;
}

/* --- Bis Tablet ---------------------------------------------------------- */

@media (max-width: 1024px) {
    .wbg-stelle__spalten {
        grid-template-columns: minmax(0, 1fr);
    }

    .wbg-stelle__seite {
        position: static;
    }

    /* Die Kopfleiste klebt oben (70 px), sonst liegt sie über dem Ziel. */
    .wbg-stelle__bewerbung {
        scroll-margin-top: 90px;
    }

    .wbg-stelle__leiste:not([hidden]) {
        position: fixed;
        right: 0;
        bottom: 0;
        left: 0;
        z-index: 90;
        display: flex;
        justify-content: center;
        padding: 12px 16px calc(12px + env(safe-area-inset-bottom, 0px));
        background: rgba(255, 255, 255, .96);
        box-shadow: 0 -6px 20px rgba(0, 0, 0, .1);
    }

    .wbg-stelle__leiste .wbg-stelle__cta {
        width: 100%;
        max-width: 420px;
    }

    /* Der schwebende Knopf "nach oben" (style.css, Fuß) läge sonst auf der Leiste. */
    html body.wbg-stelle-leiste-aktiv .is-wbg-top-link-floating {
        bottom: calc(96px + env(safe-area-inset-bottom, 0px)) !important;
    }
}

@media (max-width: 640px) {
    .wbg-stelle__cta {
        width: 100%;
    }

    .wbg-stelle__badges .wbg-tag-slanted {
        white-space: normal;
    }
}

@media (prefers-reduced-motion: reduce) {
    .wbg-stelle__cta,
    .wbg-bewerbung__balken {
        transition: none;
    }
}

@media print {
    .wbg-stelle__aktion,
    .wbg-stelle__cta,
    .wbg-stelle__leiste,
    .wbg-stelle__bewerbung,
    .wbg-stelle__weitere {
        display: none !important;
    }

    .wbg-stelle__spalten {
        grid-template-columns: minmax(0, 1fr);
    }

    .wbg-stelle__box {
        background: #FFFFFF;
        color: #000000;
        border: 1px solid #999999;
    }
}
