/* Dimitriou responsive fixes — load AFTER the existing stylesheets. */
@media (max-width: 991px) {
    /* Reserve space for the menu button instead of wrapping it below the logo. */
    #header .navbar {
        flex-wrap: nowrap;
        column-gap: 12px;
    }

    #header .navbar > .navbar-brand {
        flex: 1 1 auto;
        min-width: 0;
        max-width: calc(100% - 58px);
        margin-right: 0;
    }

    #header .navbar-brand > img.mobile-logo {
        width: 100%;
        max-width: 360px;
        height: auto !important;
    }

    #header .navbar > .dm-burger {
        flex: 0 0 46px;
        margin-left: auto;
    }

    /* Keep every drawer level inside its available width. */
    #header .navbar .dm-nav {
        align-self: stretch;
        width: 100%;
        min-width: 0;
        max-width: 100%;
        min-height: 0;
        padding-left: 0;
        padding-right: 0;
        overflow-x: hidden;
        overflow-y: auto;
    }

    #header .dm-nav > .nav-item {
        width: 100%;
        min-width: 0;
        max-width: 100%;
    }

    /* Bootstrap's arrow margin also offset the full-width hover underline. */
    #header .dm-nav > .nav-item > .nav-link::after {
        margin-left: 0;
        border: 0;
    }

    #header .dm-nav > .dropdown > .dropdown-menu {
        /* Ignore the legacy hover rule on touch-sized layouts. */
        display: none;
        position: static !important;
        width: 100%;
        min-width: 0;
        max-width: 100%;
        transform: none !important;
    }

    #header .dm-nav > .dropdown.show > .dropdown-menu {
        display: block;
    }

    #header .dm-nav .dropdown-item {
        box-sizing: border-box;
        white-space: normal;
        overflow-wrap: anywhere;
        word-break: normal;
    }

    #header .dm-nav .dm-submenu {
        min-width: 0;
        max-width: 100%;
    }

    #header .dm-nav .dm-submenu > .dropdown-item {
        flex: 1 1 0;
        min-width: 0;
        max-width: calc(100% - 54px);
    }

    #header .dm-nav .dm-sub-toggle {
        flex: 0 0 44px;
    }

    #header .dm-nav .dm-submenu-menu {
        min-width: 0;
        max-width: calc(100% - 56px);
    }

    #header .dm-nav .dm-submenu-menu .dm-submenu-menu {
        max-width: calc(100% - 26px);
    }

    #header .dm-drawer-head > a {
        flex: 1 1 auto;
        min-width: 0;
        max-width: calc(100% - 54px);
    }

    #header .dm-drawer-head img {
        max-width: 100%;
        height: auto;
    }

    #header .dm-close {
        flex: 0 0 42px;
    }
}

@media (max-width: 767px) {
    /* Very long medical terms may wrap instead of being cut off. */
    #page-title .page-title > h1,
    #page-title .page-title > h2,
    .sp-content h1,
    .sp-content h2,
    .sp-content h3 {
        overflow-wrap: anywhere;
        word-break: normal;
    }

    .c-form-color input[type="text"],
    .c-form-color input[type="email"],
    .c-form-color input[type="tel"],
    .c-form-color textarea {
        font-size: 16px !important;
        line-height: 1.5;
        min-height: 44px;
    }

    .c-form-color textarea {
        min-height: 140px;
    }
}

@media (max-width: 359px) {
    /* Keep long medical terms readable before resorting to word wrapping. */
    #page-title .page-title > h1,
    #page-title .page-title > h2,
    #page-title .page-title .sp-title {
        font-size: 22px !important;
    }

    .sp-content .sp-content-title {
        font-size: 24px;
        line-height: 1.25;
    }
}
