/* =================================================================
   Responsive & mobile-friendly overrides (applied site-wide)
   ================================================================= */

html, body {
    overflow-x: hidden;
}

img {
    max-width: 100%;
    height: auto;
}

iframe {
    max-width: 100%;
    border: 0;
}
.responsive-iframe {
    width: 100%;
    height: 450px;
    aspect-ratio: 4 / 3;
}
@media (max-width: 767px) {
    .responsive-iframe {
        height: 300px;
    }
}

/* -- Top info bar: avoid clipping/overflow of the hospital name -- */
ul.top_agile_w3l_info_icons {
    word-wrap: break-word;
}
ul.top_agile_w3l_info_icons li {
    overflow-wrap: break-word;
    line-height: 1.5;
}

/* -- Logo: keep sensible size on small screens -- */
.site-logo img {
    width: auto;
    height: auto;
    max-width: 130px;
}
.site-logo {
    display: inline-block;
}

/* -- Nav menu: neutralize inline float:left on mobile -- */
@media (max-width: 767px) {
    #m_nav_list {
        float: none !important;
        width: 100%;
        margin: 0.8em 0 0;
    }
    .m_nav_item {
        display: block;
        margin: 0.3em 0;
    }
    .m_nav_item a {
        display: block;
        font-size: 13px !important;
        padding: 0.5em 0;
        letter-spacing: 0.5px;
    }
    .navbar-header {
        min-height: 60px;
    }
    .navbar-header .navbar-toggle {
        position: absolute;
        right: 15px;
        top: 12px;
        z-index: 10;
    }
    .navbar-header h1 {
        margin: 0;
    }
    .site-logo img {
        max-width: 100px;
    }
}

/* -- Notice strip -- */
.notice-section {
    word-wrap: break-word;
}

/* -- Modal: make bodies scrollable on small screens -- */
.modal-dialog {
    width: auto;
    max-width: 850px;
    margin: 30px 15px;
}
.modal-body {
    max-height: 75vh;
    overflow-y: auto;
}
@media (min-width: 768px) {
    .modal-dialog {
        width: 90%;
        margin: 30px auto;
    }
}
@media (min-width: 1200px) {
    .modal-dialog {
        width: 850px;
    }
}
@media (max-width: 767px) {
    .modal-dialog {
        margin: 10px;
    }
    .modal-body {
        max-height: 70vh;
        overflow-y: auto;
    }
}

/* -- Static banner -- */
.static-banner {
    overflow: hidden;
}

/* -- Tables: wrap in horizontal scroll when inside panels -- */
@media (max-width: 767px) {
    .table-responsive {
        width: 100%;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
}

/* -- Footer grids stack nicely -- */
@media (max-width: 767px) {
    .w3agile_footer_grid {
        margin-bottom: 1.5em;
    }
    .agileits_w3layouts_copy_right, .w3_agile_copy_right {
        text-align: center;
        float: none;
        margin-top: 0.8em;
    }
}

/* -- Login panel uses less vertical padding on phones -- */
@media (max-width: 480px) {
    .panel-body {
        padding: 10px;
    }
}