/* ==========================================================================
   Gulf Publications — Responsive Styles & Mobile Navigation
   --------------------------------------------------------------------------
   This file holds EVERY @media query for the site, plus the mobile
   slide-out drawer navigation. Load it immediately AFTER style.css:

       <link rel="stylesheet" href="assets/css/style.css" />
       <link rel="stylesheet" href="assets/css/responsive.css" />

   style.css keeps the base styles, colours, design tokens, components and
   desktop layouts. Desktop rendering is the exact union of style.css +
   this file and is unchanged from the original single-stylesheet build —
   the min-width blocks that shape the desktop grid were simply relocated
   here so every media query lives in one place.
   ========================================================================== */


/* ==========================================================================
   MOBILE SLIDE-OUT DRAWER NAVIGATION
   --------------------------------------------------------------------------
   Base rules (loaded at every width). The drawer only becomes a fixed,
   sliding panel below the `navbar-expand-lg` breakpoint (< 992px); at and
   above 992px `.gp-nav-drawer` is just the ordinary Bootstrap
   `.navbar-collapse` and none of these rules apply.
   ========================================================================== */

/* The in-drawer header (duplicate logo + close button) never shows on desktop */
.gp-drawer-head {
    display: none;
}

/* Full-screen dimmer behind the open drawer.
   Lives inside <nav class="gp-navbar"> so it shares the navbar stacking
   context and always paints above the page but below the drawer panel.
   The visible state and the body scroll-lock are defined ONLY inside the
   < 992px block below, so a stale `.gp-drawer-open` / `.gp-nav-open` /
   `--show` class left on the DOM can never affect the desktop layout. */
.gp-nav-backdrop {
    position: fixed;
    inset: 0;
    z-index: 1040;
    background-color: rgba(6, 20, 15, 0.5);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

@media (prefers-reduced-motion: reduce) {

    .gp-navbar .navbar-collapse.gp-nav-drawer,
    .gp-nav-backdrop {
        transition: none;
    }
}


/* ==========================================================================
   DESKTOP GRID  (min-width)  — relocated verbatim from style.css
   ========================================================================== */

/* Stats bar — vertical dividers between the 4 columns on desktop */
@media (min-width: 992px) {
    .gp-stats [class*="col-"] .gp-stat {
        /* border-right: 1px solid var(--divider); */
    }

    .gp-stats [class*="col-"]:last-child .gp-stat {
        border-right: 0;
    }
}

/* Services stats bar (.gp-stats--compact) — 4-up divider before every
   column except the first */
@media (min-width: 992px) {
    .gp-stats--compact [class*="col-"] .gp-stat {
        border-left: 1px solid rgba(10, 67, 49, .14);
    }

    .gp-stats--compact [class*="col-"]:first-child .gp-stat {
        border-left: 0;
    }
}

/* Services stats bar — 2-up on tablet: keep one divider between the pair,
   rows split by the shared .gp-stats rule already in place */
@media (min-width: 576px) and (max-width: 991.98px) {
    .gp-stats--compact [class*="col-"]:nth-child(even) .gp-stat {
        border-left: 1px solid rgba(10, 67, 49, .14);
    }
}

/* Global header — "Services" dropdown: reveal on hover for pointer devices,
   no gap between trigger and menu */
@media (min-width: 992px) {
    .gp-dropdown:hover .gp-dropdown-menu {
        display: block;
    }

    .gp-dropdown .gp-dropdown-menu {
        margin-top: 0;
    }

    .gp-dropdown:hover .dropdown-toggle::after {
        transform: rotate(180deg);
    }
}


/* ==========================================================================
   RESPONSIVE — TABLET / MOBILE NAV  ( < 992px )
   ========================================================================== */
@media (max-width: 991.98px) {
    :root {
        --nav-h: 66px;
    }

    /* dimmer + body scroll-lock — active only at drawer widths */
    .gp-nav-backdrop.gp-nav-backdrop--show {
        opacity: 1;
        visibility: visible;
    }

    body.gp-nav-open {
        overflow: hidden;
    }

    /* ----------------------------------------------------------------------
       Slide-out drawer panel
       Replaces the old top-dropdown collapsed menu. The panel is a fixed,
       full-height sheet that slides in from the right; `.gp-drawer-open`
       (toggled by main.js) brings it on-screen.
       ---------------------------------------------------------------------- */
    .gp-navbar .navbar-collapse.gp-nav-drawer {
        display: flex;
        flex-direction: column;
        align-items: stretch;
        position: fixed;
        top: 0;
        right: 0;
        bottom: 0;
        width: min(320px, 84vw);
        height: 100%;
        margin: 0;
        padding: 0 0 24px;
        background-color: #FFFFFF;
        border-left: 1px solid #EDF1F5;
        box-shadow: -14px 0 44px rgba(16, 42, 33, 0.18);
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
        overscroll-behavior: contain;
        visibility: hidden;
        transform: translateX(100%);
        /* slide out first, THEN hide — so the panel is instantly visible &
           focusable the moment it opens, but the close animation still plays */
        transition: transform 0.32s cubic-bezier(0.4, 0, 0.2, 1), visibility 0s linear 0.32s;
        z-index: 1045;
    }

    .gp-navbar .navbar-collapse.gp-nav-drawer.gp-drawer-open {
        visibility: visible;
        transform: translateX(0);
        transition: transform 0.32s cubic-bezier(0.4, 0, 0.2, 1), visibility 0s;
    }

    /* drawer header: duplicate brand + close (X) button */
    .gp-drawer-head {
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 12px;
        padding: 14px 14px 14px 20px;
        border-bottom: 1px solid #EDF1F5;
    }

    .gp-drawer-head .gp-brand {
        font-size: 1.15rem;
    }

    .gp-drawer-close {
        flex: none;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        width: 40px;
        height: 40px;
        padding: 0;
        border: 0;
        border-radius: 8px;
        background-color: transparent;
        color: var(--text-muted);
        font-size: 1.75rem;
        line-height: 1;
        cursor: pointer;
        transition: background-color 0.15s ease, color 0.15s ease;
    }

    .gp-drawer-close:hover,
    .gp-drawer-close:focus-visible {
        background-color: var(--bg-light-blue);
        color: var(--primary-green);
    }

    /* nav list inside the drawer */
    .gp-nav-drawer .gp-nav-links {
        width: 100%;
        padding: 12px 8px 4px;
        text-align: left;
    }

    .gp-nav-drawer .gp-nav-links .nav-link {
        padding: 12px 14px;
        border-radius: 8px;
        font-size: 1rem;
    }

    .gp-nav-drawer .gp-nav-links .nav-link:hover,
    .gp-nav-drawer .gp-nav-links .nav-link:focus-visible {
        background-color: var(--bg-light-blue);
    }

    .gp-nav-drawer .gp-nav-links .nav-link.active {
        background-color: var(--bg-light-blue);
    }

    /* "Services" caret flips while its submenu is open */
    .gp-nav-drawer .gp-nav-links .dropdown-toggle.show::after {
        transform: rotate(180deg);
    }

    /* "Services" submenu, indented inside the drawer */
    .gp-nav-drawer .gp-dropdown-menu {
        border: 0;
        box-shadow: none;
        min-width: 0;
        padding: 2px 0 6px 12px;
        text-align: left;
    }

    .gp-nav-drawer .gp-dropdown-menu .dropdown-item {
        padding: 10px 12px;
        border-radius: 8px;
        white-space: normal;
    }

    /* CTA buttons inside the drawer */
    .gp-nav-drawer .gp-nav-actions {
        width: 100%;
        padding: 14px 16px 0;
        margin-top: 6px;
        border-top: 1px solid #EDF1F5;
    }

    .gp-nav-actions .btn {
        width: 100%;
    }

    /* active-link underline is a desktop-only treatment */
    .gp-nav-links .nav-link.active::after {
        display: none;
    }

    .gp-nav-links .nav-link.active {
        background-image: none;
    }

    /* ---- hero / stats (relocated verbatim from style.css) ---- */
    .gp-hero {
        padding: 72px 0 76px;
    }

    .gp-stats {
        padding: 40px 0 24px;
    }

    .gp-stat {
        padding: 16px;
    }

    /* 2-col grid below lg: divide the second row from the first */
    .gp-stats [class*="col-"]:nth-child(n+3) .gp-stat {
        border-top: 1px solid var(--divider);
        padding-top: 24px;
    }

    /* ---- per-page tablet rules (relocated verbatim from style.css) ---- */
    .gp-hero-media {
        margin-top: 32px;
        max-width: 540px;
        margin-left: auto;
        margin-right: auto;
    }

    .gp-legacy-inner {
        padding: 40px 28px;
    }

    .gp-legacy-grid {
        margin-top: 32px;
    }

    .gp-form-card {
        margin-top: 40px;
    }
}


/* ==========================================================================
   RESPONSIVE — MOBILE  ( < 768px )  — relocated verbatim from style.css
   ========================================================================== */
@media (max-width: 767.98px) {
    :root {
        --section-py: 60px;
    }

    .gp-hero {
        padding: 56px 0 60px;
        text-align: center;
    }

    .gp-hero-text {
        margin-left: auto;
        margin-right: auto;
    }

    .gp-hero .d-flex {
        align-items: center;
    }

    .gp-hero-title {
        font-size: 2.1rem;
    }

    .gp-stat-number {
        font-size: 1.9rem;
    }

    .gp-section-head {
        margin-bottom: 36px;
        text-align: center;
    }

    .gp-service-card,
    .gp-step {
        padding: 26px 22px;
    }

    .gp-step-num {
        font-size: 3rem;
    }

    .gp-footer {
        padding: 48px 0 24px;
        text-align: center;
    }

    .gp-footer .offset-lg-1 {
        margin-left: 0;
    }

    .gp-footer-list {
        margin-bottom: 8px;
    }

    /* per-page mobile rules */
    .gp-head-row {
        margin-bottom: 28px;
    }

    .gp-head-row .btn {
        width: 100%;
    }
}


/* ==========================================================================
   RESPONSIVE — SMALL MOBILE  ( < 576px )  — relocated verbatim from style.css
   ========================================================================== */
@media (max-width: 575.98px) {

    .gp-hero .btn,
    .gp-hero .d-flex .btn {
        width: 100%;
    }

    .gp-cta-dark .btn {
        width: 100%;
        justify-content: center;
    }

    .gp-legacy-grid {
        grid-template-columns: 1fr;
    }

    .gp-contact-card {
        padding: 28px 22px;
    }

    .gp-leader-grid {
        grid-template-columns: 1fr;
    }

    .gp-ty-box {
        padding: 42px 26px;
    }
}
