/* Shared page headings. Existing literals, translations and heading tags stay intact. */
#page h2.text-center.portal-page-title {
    box-sizing: border-box;
    width: auto;
    max-width: 960px;
    margin: 36px auto 24px;
    padding: 0 15px;
    color: #003c70;
    font-size: clamp(26px, calc(2vw + 8px), 32px);
    font-weight: 650;
    line-height: 1.3;
    letter-spacing: -.02em;
    text-align: center;
    text-wrap: balance;
    white-space: normal;
}

/* Override the legacy h2 strong rule without altering translated markup. */
#page h2.text-center.portal-page-title strong {
    font-weight: inherit;
}

#page h2.text-center.portal-page-title::after {
    content: "";
    display: block;
    width: 44px;
    height: 3px;
    margin: 18px auto 0;
    border-radius: 3px;
    background: #fa7636;
}

/* Only the recommendations heading: other section and cover headings are unchanged. */
#page h1.section-title.portal-recommendations-title {
    box-sizing: border-box;
    width: auto;
    max-width: 1140px;
    margin: 28px auto;
    padding: 0 15px;
    color: #003c70;
    font-size: 24px;
    font-weight: 600;
    line-height: 1.4;
    letter-spacing: -.01em;
    text-align: center;
    text-wrap: balance;
    white-space: normal;
}

/* Emergency wrapping for an exceptionally long translated word, never ellipsis.
   Keep the portal's font fallbacks and script-specific line heights/spacing. */
#page .portal-page-title,
#page .portal-page-title *,
#page .portal-recommendations-title,
#page .portal-recommendations-title * {
    overflow-wrap: anywhere !important;
}

#page .portal-page-title span.portal-whole-word,
#page .portal-recommendations-title span.portal-whole-word {
    white-space: normal !important;
}

@media (max-width: 767px) {
    #page h2.text-center.portal-page-title {
        margin-top: 28px;
        padding-inline: 0;
        font-size: 26px;
        line-height: 1.35;
    }

    #page h1.section-title.portal-recommendations-title {
        margin-top: 26px;
        margin-bottom: 24px;
        padding-inline: 0;
        font-size: 22px;
    }
}
