/* Site-wide fixes on top of the Webflow export (loaded after the Webflow CSS). */

/* ---- Utilities ---- */
.bg-sr-only {
  position: absolute !important;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
/* Programmatic focus targets (step questions) need no ring; real controls keep theirs. */
[tabindex="-1"]:focus { outline: none; }

/* ---- One h1 per page: two-line hero headings are one h1 with two lines ---- */
.bg-h1-group { margin: 0; font-size: inherit; line-height: inherit; font-weight: inherit; letter-spacing: inherit; }
.bg-h1-group > .clip { display: block; }
.bg-h1-group .xxl-heading { display: block; }

/* ---- 404: the hero subtitle sat under the fixed navbar (now on this page too) ---- */
._404-hero { padding-top: 120px; }
@media screen and (max-width: 767px) { ._404-hero { padding-top: 89px; } }

/* ---- Legal pages (Impressum, Datenschutz, Cookies) on tablet/phone ----
   The side menu keeps its desktop grid column 3 when the grid collapses to one column,
   which creates extra implicit columns and a page wider than the screen.
   (!important: the Webflow placement rules use #w-node ids.) */
@media screen and (max-width: 991px) {
  .project-description-wrapper > .l-description,
  .project-description-wrapper > .project-features { grid-column: 1 / -1 !important; }
}
.w-richtext, .body-display, .l-rich-text { overflow-wrap: break-word; }
@media screen and (max-width: 991px) {
  .l-description, .stacked-description, .stacked-description > * { min-width: 0; }
  .w-richtext, .body-display { overflow-wrap: anywhere; hyphens: auto; }
}

/* ---- Custom checkboxes / radios: native control hidden (Webflow default), visible focus ring ---- */
.w-checkbox > input[type="checkbox"],
.w-radio > input[type="radio"] { opacity: 0; }
label.w-checkbox:has(input:focus-visible) .w-checkbox-input,
label.w-radio:has(input:focus-visible) .w-radio-input {
  outline: 3px solid #090b19;
  outline-offset: 3px;
}
label.f-radio-btn-field:has(input:focus-visible) .f-radio-btn,
label.f-radio-btn-field-2:has(input:focus-visible) .f-radio-btn-2 {
  outline: 3px solid #090b19;
  outline-offset: 2px;
}

/* ---- Contact form ---- */
.bg-req { color: #b00020; font-weight: 700; }
.bg-req-note { margin: 0; font-size: 14px; color: #4b5060; }
.bg-field-error {
  margin: 6px 0 0;
  color: #b00020;
  font-size: 15px;
  font-weight: 600;
  line-height: 1.35;
}
.bg-field-error::before { content: "⚠ "; }
.bg-invalid > .f-input-field,
.f-input-field[aria-invalid="true"] { outline: 2px solid #b00020; outline-offset: 0; }
.bg-invalid.is-f-checkbox-row,
.f-input-wrapper.bg-invalid:has(input[type="checkbox"]),
.f-form-radio-wrapper.bg-invalid { outline: 2px solid #b00020; outline-offset: 4px; }
.f-input-field:focus-visible { outline: 3px solid #090b19; outline-offset: 0; }
.f-input-field[aria-invalid="true"]:focus-visible { outline-color: #b00020; }
.f-form-button:focus-visible,
.f-form-back-button:focus-visible,
.f-cancel-btn:focus-visible { outline: 3px solid #97c93d; outline-offset: 3px; }
.f-form-progress-wrapper .div-block { align-items: center; }
.bg-step-count { letter-spacing: 1px; text-transform: none; }
@media screen and (min-width: 992px) {
  /* Desktop: the progress row sits on the step photo. */
  .f-form-progress-wrapper .bg-step-count { color: #fff; text-shadow: 0 1px 3px rgba(0, 0, 0, 0.8); }
}

/* Phones/tablets (<=991px): function only.
   - No step photos: the <img loading="lazy"> is display:none, so it is never fetched; the step
     heading (h1) stays for screen readers only.
   - "zurück" / "weiter" sit in a bar fixed to the bottom edge (safe area aware), the progress row
     right above it. The bar never moves between steps; the form keeps enough bottom padding and
     scroll-padding so no field, error text or the last field ends up under the bar.
   - bg-multistep.js lifts bar + progress above an on-screen keyboard (visualViewport) and hides
     the progress row while the keyboard is open (html.bg-kb-open). */
@media screen and (max-width: 991px) {
  :root { --bg-bar-h: 68px; --bg-prog-h: 46px; --bg-kb: 0px; }
  html:has(form[data-form="multistep"]) {
    scroll-padding-bottom: calc(var(--bg-bar-h) + var(--bg-prog-h) + 16px + env(safe-area-inset-bottom));
  }
  .f-form-steps-item.is---7 {
    flex-direction: column;
    justify-content: flex-start;
    align-items: stretch;
    min-height: 0;
    padding-bottom: 0;
  }
  .f-form-steps-item.is---7 > .f-form-img-wrap {
    position: absolute !important;
    width: 1px !important; height: 1px !important; min-height: 0 !important;
    padding: 0 !important; margin: -1px !important;
    overflow: hidden !important; clip: rect(0 0 0 0) !important; white-space: nowrap !important; border: 0 !important;
  }
  .f-form-img-wrap .f-form-step-img { display: none !important; }
  .f-form-section.full { min-height: 0; align-items: flex-start; }
  .f-form-parent.is--form-img-right, .f-form.is--form { justify-content: flex-start; }
  /* The inline (identity) transform + preserve-3d from the Webflow interactions would make the fixed bar
     relative to the step instead of the screen. */
  .f-steps-wrap { width: 100%; transform: none !important; transform-style: flat !important; }
  form[data-form="multistep"] {
    padding-bottom: calc(var(--bg-bar-h) + var(--bg-prog-h) + 24px + env(safe-area-inset-bottom));
  }
  form[data-form="multistep"] .f-form-button-wrapper {
    position: fixed;
    left: 0; right: 0; bottom: 0;
    z-index: 50;
    margin: 0;
    width: auto;
    min-height: 0;
    height: calc(var(--bg-bar-h) + env(safe-area-inset-bottom));
    padding: 10px 16px calc(10px + env(safe-area-inset-bottom));
    display: flex;
    flex-direction: row;
    flex-wrap: nowrap;
    align-items: center;
    justify-content: flex-end;
    gap: 12px;
    box-sizing: border-box;
    background: #fff;
    box-shadow: 0 -1px 0 rgba(9, 11, 25, 0.12);
    transform: translateY(calc(-1 * var(--bg-kb)));
  }
  /* Fixed widths, so "weiter" / "Ok" / "Nachricht abschicken" have the same box on every step. */
  form[data-form="multistep"] .f-form-button-wrapper > .f-form-back-button { flex: 0 0 104px; width: 104px; margin: 0 auto 0 0; }
  form[data-form="multistep"] .f-form-button-wrapper > .f-form-button { flex: 0 0 calc(100% - 116px); width: calc(100% - 116px); margin: 0; }
  form[data-form="multistep"] .f-form-button-wrapper > .f-form-back-button,
  form[data-form="multistep"] .f-form-button-wrapper > .f-form-button {
    height: 48px; min-height: 0; padding-left: 8px; padding-right: 8px; box-sizing: border-box;
    display: inline-flex; align-items: center; justify-content: center; white-space: nowrap; text-align: center;
  }
  form[data-form="multistep"] .is-f-checkbox-row { flex-wrap: wrap; }
  form[data-form="multistep"] .f-press-enter-text { display: none; }
  .f-form-steps-wrap { display: block; }
  .f-form-steps-wrap > .f-form-progress-wrapper {
    position: fixed;
    left: 0; right: 0; top: auto; bottom: calc(var(--bg-bar-h) + env(safe-area-inset-bottom));
    z-index: 50;
    width: auto;
    height: var(--bg-prog-h);
    margin: 0;
    padding: 6px 16px 0;
    box-sizing: border-box;
    background: #fff;
    transform: translateY(calc(-1 * var(--bg-kb)));
  }
  .f-form-progress-wrapper .f-style_block-item.is--progress { width: 100%; margin: 0; padding: 0; }
  html.bg-kb-open .f-form-steps-wrap > .f-form-progress-wrapper { display: none; }
}
@media screen and (min-width: 992px) {
  .f-form-img-wrap .f-heading { margin: 0; }
}

/* ---- Search results ---- */
.bg-search-status { margin: 0 0 16px; font-weight: 600; color: #090b19; }
.bg-search-status:empty { display: none; }
.bg-search-results[hidden] { display: none; }
.bg-search-results .search-results-link { display: block; }
.bg-search-title { margin: 0 0 6px; font-size: 1.35em; line-height: 1.25; }
.bg-search-url { font-size: 14px; color: #4b5060; margin-bottom: 10px; word-break: break-all; }
.bg-search-snippet { margin: 0; color: #3d4252; }
.bg-search-results mark { background: #e3f1c7; color: inherit; padding: 0 2px; }
.search-results-link:focus-visible { outline: 3px solid #090b19; outline-offset: -3px; }

/* ---- Contrast (WCAG AA) ----
   Grey text (#6e7488) reached only 4.29:1 on the light blue panels (#f3f6fc): .rotate-text,
   .subtitle.small.grey, body text. #646a7d gives 4.97:1 there and 5.39:1 on white.
   Brand green links (#97c93d, 1.8:1) inside running text get a darker green (5.2:1). */
:root { --body-display: #646a7d; }
.rotate-text { color: var(--body-display); }
.body-display a:not(.w-button), .w-richtext a:not(.w-button), .l-rich-text a:not(.w-button) { color: #467312; }

/* Links inside the contact form text (green on light blue was 1.9:1). */
.f-steps-input p a { color: #467312; text-decoration: underline; }

/* Job application form: floating labels are real <label>s now; keep the old look. */
.field-wrap > label.floating-label { font-weight: inherit; margin-bottom: 0; }
.button_next:focus-visible, .button_previous:focus-visible, .button_submit:focus-visible { outline: 3px solid #090b19; outline-offset: 3px; }

/* ---- Cookiehub banner (bubble theme) on phones ----
   Cookiehub's own CSS sets .ch2-dialog-actions{width:100%!important} at <=600px, which beats its
   left/right:40px for the bubble theme; the button row then starts at 40px and is a full viewport wide. */
@media (max-width: 600px) {
  .ch2-theme-bubble .ch2-dialog .ch2-dialog-actions { width: auto !important; }
}
