/*
 * Shared width system for the public Clinikio pages.
 *
 * The public pages use two base templates, one of which gets its container
 * rules from Bootstrap and the other from the legacy public-page stylesheet.
 * Keeping the breakpoints here makes the header, page content and footer use
 * the same horizontal alignment in both shells.
 */
.container,
.homepage-footer-content {
    width: 100%;
    margin-right: auto;
    margin-left: auto;
    box-sizing: border-box;
}

@media (min-width: 576px) {
    .container,
    .homepage-footer-content {
        max-width: 540px;
    }
}

@media (min-width: 768px) {
    .container,
    .homepage-footer-content {
        max-width: 720px;
    }
}

@media (min-width: 992px) {
    .container,
    .homepage-footer-content {
        max-width: 960px;
    }
}

@media (min-width: 1200px) {
    .container,
    .homepage-footer-content {
        max-width: 1245px;
    }
}

@media (min-width: 1400px) {
    .container,
    .homepage-footer-content {
        max-width: 1320px;
    }
}

/* Prevent long labels and flexible children from forcing a wider shell. */
.homepage-header .navbar-collapse,
.homepage-header .navbar-nav,
.homepage-header .d-flex,
.homepage-footer-top,
.homepage-footer-bottom {
    min-width: 0;
}

.homepage-header .navbar-nav,
.homepage-header .d-flex {
    flex-wrap: wrap;
}

/* Keep the full navigation from becoming wider than the 960px tablet grid. */
@media (max-width: 1199.98px) {
    .header {
        position: relative;
    }

    .header .navbar-collapse {
        position: absolute;
        top: 100%;
        right: 0;
        left: 0;
        z-index: 1000;
        padding: 1rem;
        background: #fff;
        box-shadow: 0 4px 10px rgba(0, 0, 0, .08);
    }

    .header .navbar-collapse .navbar-nav {
        margin-bottom: 1rem;
    }

    .header .navbar-collapse .d-flex {
        flex-direction: column;
        align-items: stretch;
        gap: .5rem;
    }

    .header .navbar-collapse .d-flex > a {
        width: 100%;
        margin-right: 0 !important;
        margin-left: 0 !important;
        text-align: center;
    }

    .header .navbar-collapse .navbar-nav {
        margin-right: 0 !important;
    }
}

/* The alternate homepage shell uses a plain .header class. Keep its
   visible navigation edges aligned with the footer as well. */
@media (min-width: 1200px) {
    .header:not(.homepage-header) .container {
        max-width: 1275px;
    }
}

@media (min-width: 1400px) {
    .header:not(.homepage-header) .container {
        max-width: 1350px;
    }
}

/* The mobile provider section follows the core-features cards directly. */
@media (max-width: 991.98px) {
    .expert-specialists {
        margin-top: 0;
    }
}

@media (max-width: 991px) {
    .homepage-footer-content {
        padding-right: 0;
        padding-left: 0;
    }
}
