/*
 * Local override for rules that also live in header-mega-menu-overrides.css
 * on the shared CDN (IAPP_CDN). The CDN copy lags behind the Laravel repo's
 * public/css/header-mega-menu-overrides.css until someone re-syncs that
 * bucket, so this file mirrors the new "Industries" mega menu rules (and
 * the "Hire Team" / engage-mega-menu grid tweaks that shipped alongside it)
 * and is enqueued after the CDN stylesheet.
 * Safe to delete once the CDN copy is confirmed to include these rules.
 */

/* Engage/Hire Team menu: shrink the menu box itself to fit its column
   content (overrides the full-container-width rule on the CDN), but never
   exceed the viewport. Centered under the navbar via left:50% +
   translateX(-50%). */
@media (min-width: 992px) {
    .dropdown-mega .mega-content.engage-mega-menu {
        left: 50% !important;
        right: auto !important;
        transform: translateX(-50%) !important;
        width: max-content !important;
        min-width: 0 !important;
        max-width: 94vw !important;
        max-height: 80vh !important;
        overflow-y: auto !important;
        overflow-x: hidden !important;
        padding-right: 8px;
        scrollbar-gutter: stable;
        scrollbar-width: thin;
        scrollbar-color: rgba(255, 255, 255, 0.25) transparent;
    }

    /* Explicit always-on scrollbar (not just the OS overlay one, which some
       platforms only reveal mid-scroll) so it's visually obvious this menu
       is scrollable even in a static view. Same treatment as the Services
       mega menu's internal list in service-mega-menu-local-fixes.css. */
    .dropdown-mega .mega-content.engage-mega-menu::-webkit-scrollbar {
        width: 6px;
    }

    .dropdown-mega .mega-content.engage-mega-menu::-webkit-scrollbar-track {
        background: transparent;
    }

    .dropdown-mega .mega-content.engage-mega-menu::-webkit-scrollbar-thumb {
        background-color: rgba(255, 255, 255, 0.25);
        border-radius: 10px;
    }

    .dropdown-mega .mega-content.engage-mega-menu::-webkit-scrollbar-thumb:hover {
        background-color: rgba(255, 255, 255, 0.4);
    }
}

/* Hire Team mega menu grid. `max-content` tracks never shrink below their
   intrinsic width, so a fixed 4-column layout overflowed the viewport on
   medium desktop widths. Instead the column count steps down as the
   viewport narrows, and labels are allowed to wrap onto a second line
   rather than forcing the column (and the whole menu) wider than the
   screen. */
.dropdown-mega .mega-content.engage-mega-menu .menu-group {
    display: grid !important;
    grid-template-columns: repeat(2, minmax(160px, 1fr));
    column-gap: 24px;
    row-gap: 14px;
    justify-content: center;
    align-items: start;
}

@media (min-width: 1200px) {
    .dropdown-mega .mega-content.engage-mega-menu .menu-group {
        grid-template-columns: repeat(3, minmax(160px, max-content));
        column-gap: 32px;
    }
}

@media (min-width: 1500px) {
    .dropdown-mega .mega-content.engage-mega-menu .menu-group {
        grid-template-columns: repeat(4, max-content);
        column-gap: 40px;
        row-gap: 18px;
    }
}

.dropdown-mega .mega-content.engage-mega-menu .menu-item {
    width: auto !important;
    margin-bottom: 0 !important;
    max-width: 100%;
}

.dropdown-mega .mega-content.engage-mega-menu .menu-item .nav-link {
    white-space: normal !important;
}

@media (min-width: 1500px) {
    .dropdown-mega .mega-content.engage-mega-menu .menu-item .nav-link {
        white-space: nowrap !important;
    }
}

/* ============================================================
   Industries mega menu: a 5-column main grid + divider + a
   narrower 2-column "On-Demand" group, plus a bottom banner CTA.
   Deliberately its own BEM-style `.industries-mega__*` classes
   (not `.menu-group`/`.menu-item`) so none of the rules above or
   below for the other mega menus can leak into it, and vice versa.
   ============================================================ */
@media (min-width: 992px) {
    .dropdown-mega .mega-content.industries-mega-menu {
        left: 50% !important;
        right: auto !important;
        transform: translateX(-50%) !important;
        width: max-content !important;
        min-width: 0 !important;
        max-width: 92vw !important;
        padding: 28px 32px 24px !important;
    }
}

.industries-mega__layout {
    display: flex;
    align-items: stretch;
    gap: 28px;
}

.industries-mega__main {
    flex: 1 1 auto;
    min-width: 0;
}

.industries-mega__grid {
    display: grid;
    grid-template-columns: repeat(5, minmax(120px, 1fr));
    column-gap: 20px;
    row-gap: 2px;
}

.industries-mega__grid--ondemand {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.industries-mega__divider {
    flex: 0 0 1px;
    align-self: stretch;
    background: rgba(255, 255, 255, 0.14);
}

.industries-mega__ondemand {
    flex: 0 0 280px;
}

.industries-mega__ondemand-label {
    display: block;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.55);
    text-decoration: underline;
    text-underline-offset: 4px;
    margin-bottom: 12px;
}

.industries-mega__item .nav-link.menu-link {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 8px;
    border-radius: 12px;
    font-size: 14.5px;
    line-height: 1.3;
    background: transparent;
    border: 0;
    width: 100%;
    text-align: left;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.industries-mega__item .nav-link.menu-link:hover {
    background-color: rgba(0, 0, 0, 0.3) !important;
}

.industries-mega__item .nav-link.menu-link i {
    font-size: 17px;
    color: #01d8ff;
    flex-shrink: 0;
    width: 20px;
    text-align: center;
}

.industries-mega__banner {
    margin-top: 22px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    padding: 16px 22px;
    border-radius: 16px;
    background: linear-gradient(135deg, rgba(20, 49, 207, 0.35) 0%, rgba(0, 204, 255, 0.18) 100%);
    border: 1px solid rgba(255, 255, 255, 0.14);
}

.industries-mega__banner-text {
    display: flex;
    align-items: center;
    gap: 10px;
    color: #ffffff;
    font-size: 14px;
    line-height: 1.4;
}

.industries-mega__banner-text i {
    color: #01d8ff;
    font-size: 18px;
    flex-shrink: 0;
}

.industries-mega__banner-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
    background: linear-gradient(135deg, #0066ff 0%, #00ccff 100%) !important;
    color: #ffffff !important;
    font-weight: 600;
    font-size: 14px;
    padding: 10px 20px;
    border-radius: 30px;
    border: 0;
    white-space: nowrap;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.industries-mega__banner-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 8px 20px rgba(0, 102, 255, 0.35);
}

@media (max-width: 991px) {
    /* Industries mega menu: stack main grid, divider and on-demand group
       into one vertical column; drop the divider line (no side-by-side
       columns left for it to separate) and cap the popup's own height
       like the other mobile mega menus. */
    .dropdown-mega .mega-content.industries-mega-menu {
        max-height: 75vh;
        overflow-y: auto;
    }

    .industries-mega__layout {
        flex-direction: column;
        gap: 4px;
    }

    .industries-mega__grid,
    .industries-mega__grid--ondemand {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        row-gap: 0;
    }

    .industries-mega__divider {
        display: none;
    }

    .industries-mega__ondemand {
        flex-basis: auto;
        margin-top: 10px;
        padding-top: 14px;
        border-top: 1px solid rgba(255, 255, 255, 0.12);
    }

    .industries-mega__item .nav-link.menu-link {
        font-size: 13.5px;
        padding: 8px 6px;
    }

    .industries-mega__banner {
        flex-direction: column;
        align-items: stretch;
        text-align: center;
        margin-top: 16px;
        padding: 14px 16px;
    }

    .industries-mega__banner-text {
        justify-content: center;
    }

    .industries-mega__banner-btn {
        justify-content: center;
    }
}
