/*
 * Two-column body text (.text-2-col, content elements "Text + Gallery"):
 * - paragraphs and lists stay in one column instead of breaking mid-sentence
 * - headings inside the text are small bold lead-ins (like the FAQ questions)
 *   and stay with the following paragraph
 * - left aligned, justified text left large gaps in the narrow columns
 * - one column on phones
 */
.text-2-col {
    text-align: left;
}

.text-2-col > p,
.text-2-col > ul,
.text-2-col > ol {
    break-inside: avoid;
}

.text-2-col > h2,
.text-2-col > h3,
.text-2-col > h4 {
    font-size: 1rem;
    font-weight: 700;
    line-height: 1.5;
    margin: 0 0 0.25rem;
    break-after: avoid;
    break-inside: avoid;
}

.text-2-col > * + h2,
.text-2-col > * + h3,
.text-2-col > * + h4 {
    margin-top: 1.25rem;
}

@media (max-width: 767.98px) {
    .text-2-col {
        column-count: 1;
    }
}

/* Text + Gallery without images: no empty gallery row (it only added white space) */
.gallery:not(:has(img)) {
    display: none;
}

/* Text mit Zusatzinfos (haass/text-infos): info cards share the look of the info box */
.text-infos__card,
.text-box {
    background-color: #fff;
    border-radius: 0.75rem;
    box-shadow: 0 0.275rem 1.25rem rgba(11, 15, 25, 0.05), 0 0.25rem 0.5625rem rgba(11, 15, 25, 0.03);
}

.text-infos__card {
    padding: 1.75rem;
}

.text-infos__icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 3rem;
    height: 3rem;
    border-radius: 0.5rem;
    background-color: var(--si-primary, #bcd233);
    color: #fff;
    font-size: 1.5rem;
}

.text-infos__info > p:last-child {
    margin-bottom: 0;
}

/*
 * Vertical rhythm: every content section uses the same padding. Two sections in a row
 * share the same background, so the second one only adds a small top padding instead
 * of doubling the gap.
 */
.haass-section {
    padding-block: clamp(3rem, 5vw, 4.5rem);
}

.haass-section + .haass-section {
    padding-top: clamp(0.5rem, 1.5vw, 1.5rem);
}

/* Medium-length texts: one column with a comfortable line length (~75 characters) */
.text-1-col {
    max-width: 48rem;
}

.text-1-col > :last-child,
.text-2-col > :last-child,
.text-box__body > :last-child {
    margin-bottom: 0;
}

.text-1-col > h2,
.text-1-col > h3,
.text-1-col > h4 {
    font-size: 1rem;
    font-weight: 700;
    line-height: 1.5;
    margin: 1.25rem 0 0.25rem;
}

/* Short texts without images: info box, headline left, text right */
.text-box {
    padding: clamp(1.5rem, 4vw, 3rem);
}

.text-box__body {
    font-size: 1.0625rem;
}

/* Phone numbers never break in the middle */
a[href^="tel:"] {
    white-space: nowrap;
}

/* Headlines are never hyphenated (only running text is) */
h1, h2, h3, h4, h5, h6, .h1, .h2, .h3, .h4, .h5, .h6 {
    hyphens: manual;
    overflow-wrap: break-word;
}

@media (max-width: 767.98px) {
    /* Intro text on the home page: lead size, but not oversized on phones */
    .zm-1000 .fs-xl {
        font-size: 1.125rem !important;
    }

    /* Manual line breaks in headlines are meant for wide screens only */
    h1 br, h2 br {
        display: none;
    }

    /* Team: two photos per row on phones */
    [id^="c"] .card-body .fs-lg {
        font-size: 1rem !important;
    }
}
