/* =============================================
   Responsive / Mobile styles
   Applies on top of style.css
   ============================================= */

/* Hamburger hidden on desktop */
.nav-toggle {
    display: none;
}

/* Fluid wrapper on medium screens */
@media (max-width: 1140px) {
    .wrapper {
        width: 100%;
        padding: 0 20px;
        box-sizing: border-box;
    }
}

/* ---- Mobile breakpoint ---- */
@media (max-width: 768px) {

    /* --- Header & Navigation --- */
    #header .wrapper {
        padding: 10px 15px;
        position: relative;
    }

    #header .logo {
        margin: 12px 0 10px 0;
    }

    #header .logo img {
        max-width: 180px;
        height: auto;
    }

    /* Hamburger button */
    .nav-toggle {
        display: block;
        float: right;
        background: none;
        border: none;
        color: #214d74;
        font-size: 30px;
        cursor: pointer;
        margin-top: 15px;
        padding: 4px 8px;
        line-height: 1;
    }

    /* Nav hidden by default, shown when .open added by JS */
    .mainnav {
        display: none;
        float: none;
        clear: both;
        width: 100%;
        margin-top: 0;
        background: #fff;
        border-top: 2px solid #214d74;
        padding-bottom: 8px;
    }

    .mainnav.open {
        display: block;
    }

    .mainnav li {
        float: none;
        display: block;
        margin-left: 0;
        padding: 10px 15px;
        border-bottom: 1px solid #e8edf1;
        font-size: 17px;
    }

    .mainnav li.first {
        margin-left: 0;
    }

    .mainnav li:hover,
    .mainnav li.sel {
        background: #e8f0f8;
    }

    /* --- Hero slider --- */
    #home_slider {
        height: 220px;
    }

    /* Slide text overlay */
    #featured li p {
        font-size: 15px;
        line-height: 20px;
        width: auto;
        height: auto;
        top: 20px;
        padding: 15px 20px;
        background: rgba(0, 0, 0, 0.45);
        margin: 0 15px;
        text-shadow: none;
    }

    /* Slide nav dots — inherit the bottom:18px from modern.css, just ensure centred */
    #slide_nav {
        top: auto;
        bottom: 10px;
        left: 50%;
        transform: translateX(-50%);
    }

    /* --- Content area ---
       Desktop: slider is pos-abs 500px tall, header ~80px → 140px top padding leaves ~60px of slider visible above content.
       Mobile:  slider is 220px tall, header ~60px → 90px pushes content just below the header with a sliver of slider showing. */
    #team_featured {
        padding: 90px 0 20px 0;
    }

    /* --- Tables: stack all cells vertically --- */
    .team-content table,
    .team-content tbody,
    .team-content tr,
    .team-content td {
        display: block;
        width: 100% !important;
        box-sizing: border-box;
    }

    /* Bio photo: center and cap width */
    .team-block .bioimg {
        display: block;
        margin: 0 auto 15px auto;
        width: 160px !important;
    }

    /* About Us two-column text table */
    #home_featured .wrapper table,
    #home_featured .wrapper tbody,
    #home_featured .wrapper tr,
    #home_featured .wrapper td {
        display: block;
        width: 100% !important;
        box-sizing: border-box;
    }

    /* --- Contact page --- */
    #img_map {
        width: 100%;
        height: auto;
        padding: 10px 0 0 0;
    }

    p.contact_text {
        font-size: 17px;
        line-height: 26px;
        margin-top: 15px;
    }

    /* --- Home featured text --- */
    .box_title {
        font-size: 20px;
    }

    .box, .box.wide {
        float: none;
        width: 100%;
        padding: 0;
    }

    /* IIGCC logo: let it float within the text naturally */
    #home_featured img[src*="iigcc"] {
        width: 70px !important;
    }

    /* --- Press page --- */
    .prquotes .video {
        width: 100%;
        max-width: 400px;
        box-sizing: border-box;
        margin: 10px auto;
    }

    /* --- Footer --- */
    .footnav {
        margin: 0;
    }

    .footnav li {
        float: none;
        display: block;
        padding: 4px 10px;
    }

    .footnav li:before {
        content: none;
    }

    .copyright {
        font-size: 11px;
        padding: 10px;
    }

    /* --- Popup / disclaimer --- */
    .popup {
        width: 95vw;
        height: 85vh;
        background: #fff;
        border: 2px solid #214d74;
        border-radius: 4px;
        left: 2.5vw;
        top: 5vh;
        overflow: hidden;
    }

    .popup-wrapper {
        padding: 20px 15px 15px 15px;
    }

    #scrollbar1 {
        width: 100%;
        margin: 10px 0;
    }

    #scrollbar1 .viewport {
        width: 100%;
        height: 55vh;
        /* Override tinyscrollbar's overflow:hidden so native scroll works on touch */
        overflow-y: auto !important;
        -webkit-overflow-scrolling: touch;
    }

    /* Hide the custom scrollbar chrome on mobile — native scroll takes over */
    #scrollbar1 .scrollbar {
        display: none;
    }

    .accept {
        position: static;
        display: block;
        margin: 12px auto 0;
        text-align: center;
        color: #214d74;
        font-size: 16px;
        background: #214d74;
        color: white;
        padding: 10px 20px;
        border-radius: 4px;
        cursor: pointer;
        width: fit-content;
    }

    .popup h1 {
        font-size: 20px;
    }

    .popup h3 {
        font-size: 16px;
        margin-top: 12px;
    }

    .popup p {
        font-size: 14px;
        line-height: 20px;
    }
}

/* Very small phones */
@media (max-width: 400px) {
    #home_featured .wrapper,
    .team-content {
        padding: 0 5px;
    }

    .team-block p.title {
        font-size: 22px;
    }

    .team-block p.title2 {
        font-size: 17px;
    }

    .team-block p.text {
        font-size: 15px;
    }
}
