/* Mobile-specific layout overrides */

/* Contact section mobile layout */
@media (max-width: 767px) {
    .row-contact-info {
        display: flex;
        flex-direction: column;
    }
    
    /* Make contact info appear first on mobile */
    .col-contact-info:nth-child(2) {
        order: 1;
        border-left: none;
        border-top: 1px solid #cacaca;
        margin-bottom: 3rem;
    }
    
    /* Make contact form appear second on mobile */
    .col-contact-info:nth-child(1) {
        order: 2;
        border-top: 1px solid #cacaca;
        padding-top: 3rem;
    }
    
    /* Remove the first-child border override on mobile since order changes */
    .col-contact-info:first-child {
        border-top: 1px solid #cacaca;
        padding-top: 3rem;
    }
}

/* Mobile landscape orientation fixes - only for actual mobile devices */
@media screen and (max-width: 767px) and (orientation: landscape) {
    /* Ensure mobile navigation stays mobile in landscape on phones */
    .navbar-toggle {
        display: block !important;
    }
    
    .navbar-nav {
        display: none !important;
    }
    
    /* Adjust spacing for landscape on mobile */
    .section {
        padding-top: 4rem;
        padding-bottom: 3rem;
    }
    
    /* Compact navbar for landscape on mobile */
    .navbar {
        height: 4.5rem !important;
        padding-top: 1.2rem !important;
    }
    
    .wrapper {
        padding-top: 4.5rem !important;
    }
    
    /* Adjust brand image for landscape on mobile */
    .brand img {
        height: 2.8rem !important;
    }
}

/* Tablet portrait mode - mobile layout */
@media screen and (max-width: 1023px) and (orientation: portrait) {
    .navbar-toggle {
        display: block !important;
    }
    
    .navbar-nav {
        display: none !important;
    }
}

/* Small landscape devices (phones in landscape) */
@media screen and (max-width: 926px) and (orientation: landscape) and (max-height: 500px) {
    .navbar-toggle {
        display: block !important;
    }
    
    .navbar-nav {
        display: none !important;
    }
}

/* Prevent zoom on double-tap for actual mobile devices */
@media (max-width: 767px) {
    * {
        touch-action: manipulation;
    }
}

/* What We Do section mobile padding */
@media (max-width: 767px) {
    /* Add extra padding to the what we do section container */
    .section-4 .boxed {
        padding-top: 1.5rem;
        padding-bottom: 1rem;
    }
    
    /* Add space between title and items */
    .section-4 .intro {
        padding-top: 1.5rem;
    }
    
    /* Add space between title and news grid */
    .section-4 .news-grid {
        margin-top: 3rem;
        margin-bottom: 1.5rem;
    }
    
    /* Additional spacing for the title itself */
    .section-4 .title-uppercase {
        margin-bottom: 1.5rem;
    }
}

/* Thinner scrollbars on mobile only (keeps desktop as-is) */
@media (max-width: 767px) {
    /* Firefox */
    html {
        scrollbar-width: thin; /* reduces thickness */
    }

    /* WebKit-based browsers (Chrome, Edge, Safari macOS/Android) */
    ::-webkit-scrollbar {
        width: 0.4rem;  /* vertical scrollbar thickness */
        height: 0.4rem; /* horizontal scrollbar thickness */
    }
}
