/*
 * Small-screen corrections that apply on top of the other frontend stylesheets.
 * Loaded last (see includes/styles.blade.php), so plain selectors win without !important
 * unless the original rule is inline or already !important.
 */

/* The highlighted service is drawn in the theme's primary colour, which is a mid grey that
   disappears on the black services panel at every width. */
.rightsideofServices .servicesNameContainer .activee,
.servicesNameContainer .serviceName a.activee {
    color: #ffffff;
    font-weight: 700;
}

@media (max-width: 767.98px) {
    /* style.css justifies every paragraph; in a phone-width column that leaves rivers of
       white space between words (hero copy, About us, service descriptions). */
    p,
    .pageinfo,
    .form-control {
        text-align: start !important;
    }

    /* The footer logo is white artwork on a transparent PNG. The old mobile rule put a white
       box behind it (hiding everything but the flag mark) and let the inline height:100%
       stretch it into a square. */
    .footer-logo-col .footer-logo-img-wrapper {
        width: 60% !important;
        height: auto !important;
        min-height: 0 !important;
        margin-top: 1rem !important;
    }
    .footer-logo-col .footer-logo-img-wrapper img {
        background-color: transparent !important;
        object-fit: contain !important;
        height: auto !important;
        max-height: 90px;
    }

    /* Footer contact line: keep the number readable on the dark band. */
    .footer-logo-col .thumb-content a,
    .footer-logo-col .thumb-content span {
        color: #e6e6e6;
    }
}

/* ---------------------------------------------------------------------------------------
   Mobile navigation (below the navbar's lg breakpoint): the collapsed menu becomes a panel
   that slides in from the right over a dimmed page, instead of pushing the page down, and
   the Projects menu is an accordion with full-height rows.
   --------------------------------------------------------------------------------------- */
@media (max-width: 991.98px) {
    .navbar-collapse {
        position: fixed;
        top: 0;
        right: 0;
        bottom: 0;
        width: min(88vw, 380px);
        background: #ffffff;
        z-index: 1060;
        overflow-y: auto;
        overflow-x: hidden;
        -webkit-overflow-scrolling: touch;
        padding: 68px 18px 32px 16px;
        box-shadow: -8px 0 24px rgba(0, 0, 0, .18);
        transform: translateX(105%);
        transition: transform .28s ease;
        display: block !important;   /* Bootstrap's collapse hides it; the transform does that here */
        height: auto !important;
    }
    .navbar-collapse.show {
        transform: translateX(0);
    }
    .navbar-collapse.collapsing {
        transition: transform .28s ease;
    }

    .mnav-backdrop {
        position: fixed;
        inset: 0;
        background: rgba(0, 0, 0, .45);
        z-index: 1055;
        opacity: 0;
        pointer-events: none;
        transition: opacity .28s ease;
    }
    body.mnav-open .mnav-backdrop {
        opacity: 1;
        pointer-events: auto;
    }
    body.mnav-open {
        overflow: hidden;
    }

    .mnav-close {
        position: absolute;
        top: 14px;
        right: 14px;
        width: 42px;
        height: 42px;
        border: 0;
        border-radius: 50%;
        background: #f1f1f1;
        color: #111;
        font-size: 26px;
        line-height: 1;
        display: flex;
        align-items: center;
        justify-content: center;
    }

    /* Top-level rows (Projects, Developers, Multimedia, More) */
    .navbar-collapse .navbar-nav > .nav-item {
        margin: 0 !important;
        border-bottom: 1px solid #ececec;
    }
    .navbar-collapse .navbar-nav {
        width: 100%;
    }
    .navbar-collapse .navbar-nav > .nav-item > .nav-link {
        padding: 14px 10px 14px 6px;
        font-size: 17px;
        font-weight: 600;
        color: #111;
        justify-content: space-between;
    }
    .navbar-collapse .navbar-nav > .nav-item > .nav-link svg {
        transition: transform .2s ease;
    }
    .navbar-collapse .navbar-nav > .nav-item > .nav-link[aria-expanded="true"] svg {
        transform: rotate(180deg);
    }
    .navbar-collapse .navbar-nav .dropdown-menu {
        position: static;
        float: none;
        width: 100%;
        margin: 0 0 8px;
        padding: 0 0 0 4px;
        border: 0;
        box-shadow: none;
        background: transparent;
    }
    .navbar-collapse .navbar-nav .dropdown-menu .dropdown-item {
        padding: 11px 10px;
        white-space: normal;
    }

    /* Projects accordion */
    .mnav-list,
    .mnav-sub {
        list-style: none;
        margin: 0;
        padding: 0;
    }
    .mnav-row {
        display: flex;
        align-items: center;
        min-height: 48px;
        border-bottom: 1px solid #f0f0f0;
    }
    .mnav-row > a {
        flex: 1 1 auto;
        padding: 12px 10px;
        color: #111;
        font-size: 16px;
        text-decoration: none;
    }
    .mnav-toggle {
        flex: 0 0 48px;
        height: 48px;
        border: 0;
        background: transparent;
        display: flex;
        align-items: center;
        justify-content: center;
        color: #111;
    }
    .mnav-toggle svg {
        transform: rotate(90deg);   /* the symbol points right; closed = pointing down */
        transition: transform .2s ease;
    }
    .mnav-item.mnav-open > .mnav-row > .mnav-toggle svg {
        transform: rotate(-90deg);
    }
    .mnav-item.mnav-open > .mnav-row > a {
        font-weight: 700;
    }
    .mnav-sub {
        display: none;
        margin-left: 10px;
        padding-left: 10px;
        border-left: 2px solid #e6e6e6;
    }
    .mnav-item.mnav-open > .mnav-sub {
        display: block;
    }
    .mnav-link {
        display: block;
        padding: 11px 10px;
        font-size: 15px;
        color: #333;
        text-decoration: none;
        border-bottom: 1px solid #f4f4f4;
    }
    .mnav-more {
        font-weight: 700;
        color: #111;
    }

    /* Developers list inside the panel */
    .navbar-collapse .developers-scrollable {
        max-height: 50vh;
    }
    .navbar-collapse .developers-scrollable li a {
        padding: 10px 10px;
    }
}
