/* Responsive text + overflow fixes */

.hero-text--mobile {
    display: none;
}

#header-carousel .title h5 {
    display: none;
}

#header-carousel .hero__title,
#header-carousel .hero__subtitle,
#header-carousel .hero__badge,
#header-carousel .hero__badge span,
#header-carousel .hero__title span,
#header-carousel .hero__subtitle span,
.navbar .nav-link,
.navbar .dropdown-item,
.badge {
    overflow-wrap: break-word;
    word-break: normal;
    hyphens: auto;
}

#header-carousel .hero__title,
#header-carousel .hero__title span,
#header-carousel .hero__badge,
#header-carousel .hero__badge span {
    hyphens: none;
}

#header-carousel .hero__title {
    margin-inline: auto;
    margin-top: 0;
    max-width: 30ch;
}

#header-carousel .hero__subtitle {
    margin-inline: auto;
    max-width: 62ch;
}

#header-carousel .hero__badge {
    max-width: min(92vw, 58ch);
    white-space: normal;
    line-height: 1.35;
    text-align: left;
    hyphens: none;
}

#header-carousel .hero__badge i {
    flex: 0 0 auto;
}

span.visually-hidden {
    max-width: 1px !important;
    white-space: normal !important;
    word-break: break-all !important;
    overflow-wrap: anywhere !important;
}

@media (max-width: 991.98px) {
    .navbar .navbar-toggler {
        min-width: 44px;
        min-height: 44px;
        padding: 0.5rem;
        display: inline-flex;
        align-items: center;
        justify-content: center;
    }

    .navbar .navbar-collapse {
        overflow-x: hidden;
    }
}

@media (max-width: 576px) {
    h1 {
        font-size: clamp(28px, 6vw, 64px);
        line-height: 1.05;
    }

    h2 {
        font-size: clamp(20px, 4.5vw, 40px);
        line-height: 1.1;
    }

    p {
        font-size: clamp(14px, 3.5vw, 18px);
        line-height: 1.5;
    }

    #header-carousel .carousel-caption {
        padding-inline: 16px;
    }

    #header-carousel .hero__title {
        max-width: 24ch;
        letter-spacing: 0.02em;
    }

    #header-carousel .hero__subtitle {
        max-width: 28ch;
        margin-bottom: 1.1rem !important;
        text-wrap: balance;
    }

    #header-carousel .hero__badge {
        max-width: 30ch;
        padding: 0.45rem 0.75rem !important;
        font-size: clamp(12px, 3.5vw, 14px);
        margin-bottom: 0.9rem !important;
    }

    #header-carousel .hero__badge i {
        margin-top: 0.15rem;
    }

    .navbar .navbar-nav .nav-link,
    .navbar .dropdown-item {
        text-transform: none;
        letter-spacing: 0.01em;
        line-height: 1.35;
    }

    .page-header .display-4,
    .text-uppercase {
        letter-spacing: 0.02em;
    }

    .page-header .display-4 {
        text-transform: none !important;
    }

    .list-group-item {
        white-space: normal;
        overflow-wrap: anywhere;
        word-break: break-word;
        hyphens: auto;
    }

    .title .title-left,
    .title .title-center,
    .title .title-right {
        text-align: left;
    }

    .title .title-left h5,
    .title .title-center h5,
    .title .title-right h5 {
        display: block;
        width: 100%;
        margin-bottom: 0.4rem;
        font-size: 0.78rem;
        letter-spacing: 0.08em;
        text-align: left;
    }

    .title .title-left h5::after,
    .title .title-center h5::before,
    .title .title-center h5::after,
    .title .title-right h5::before {
        display: none;
        content: none;
    }

    .container-fluid.py-5 .row.g-5 {
        --bs-gutter-x: 1.5rem;
    }

    .col-lg-8 .bg-dark.rounded .d-flex.align-items-center.mb-3 {
        flex-wrap: wrap;
        align-items: flex-start !important;
        gap: 0.65rem;
    }

    .col-lg-8 .bg-dark.rounded .d-flex.align-items-center.mb-3 > img,
    .col-lg-8 .bg-dark.rounded .d-flex.align-items-center.mb-3 > .btn {
        margin-right: 0 !important;
    }

    .col-lg-8 .bg-dark.rounded .d-flex.align-items-center.mb-3 > div:last-child {
        min-width: 0;
        flex: 1 1 100%;
        width: 100%;
    }

    .col-lg-8 .bg-dark.rounded h3,
    .col-lg-8 .bg-dark.rounded .text-uppercase,
    .col-lg-8 .bg-dark.rounded .text-primary.small,
    .col-lg-8 .bg-dark.rounded p,
    .col-lg-8 .bg-dark.rounded li {
        overflow-wrap: anywhere;
        word-break: break-word;
        hyphens: auto;
    }

    .col-lg-8 .bg-dark.rounded h3.text-uppercase,
    .col-lg-8 .bg-dark.rounded .text-primary.small.text-uppercase {
        text-transform: none !important;
        letter-spacing: 0.01em;
    }

}

@media (max-width: 767.98px) {
    #header-carousel .carousel-item {
        min-height: 720px;
    }

    #header-carousel .carousel-caption {
        justify-content: flex-start !important;
        gap: 0.7rem;
        padding-top: calc(var(--nav-height) + 2.1rem) !important;
        padding-bottom: 1.2rem;
    }

    #header-carousel .carousel-caption .display-1,
    #header-carousel .carousel-caption .display-2 {
        font-size: clamp(30px, 8.2vw, 52px);
        line-height: 1.04;
    }

    #header-carousel .hero__title {
        max-width: 15.5ch;
        letter-spacing: 0.01em;
    }

    #header-carousel .hero__subtitle {
        max-width: 23ch;
        margin-bottom: 0.8rem !important;
    }

    #header-carousel .hero__badge {
        max-width: 26ch;
        margin-bottom: 0.7rem !important;
    }

    #header-carousel .carousel-caption .d-flex.flex-column.flex-sm-row > .btn:nth-child(n + 2) {
        display: none;
    }

    .hero-text--desktop {
        display: none !important;
    }

    .hero-text--mobile {
        display: inline !important;
    }

    #header-carousel .hero__subtitle .hero-text--mobile {
        display: block !important;
    }
}

@media (min-width: 768px) {
    .hero-text--mobile {
        display: none !important;
    }

    .hero-text--desktop {
        display: inline !important;
    }
}
