/* =========================================================================
   GLOBAL-SITE MEGA MENU  (blog_id 1 only)
   Namespaced with .gmega so it never touches .mega-menu--wwd (regional).
   Reuses your existing tokens: --primary-color, --text-color, Inter.

   Layout matched to Frame_1686559053.svg (1440 canvas):
     - Panel: 1280px wide, centered (80px gutters at 1440)  [rect 1280 @ x80]
     - Left rail: 378px, white, right divider          [divider line @ x458.5]
     - Right content starts ~24px after divider              [content @ x483]
     - Inner tabs separated by vertical rules      [x637 / x845 / x1097]
     - Panel height ~522px                                   [rect h=522]
   ========================================================================= */

/* Trigger item — the desktop "What we do" <li>. JS also adds .gmega-trigger
   to it by text match, so this rule applies either way. position:static lets
   the 1280 panel center against the header, not the <li>. */
.desktop-menu .main-nav > li.gmega-trigger,
.desktop-menu li.gmega-trigger {
    position: static;
}

.desktop-menu .gmega-trigger > a {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
}

/* -------------------------------------------------------------------------
   PANEL SHELL — overlay under the sticky header; inner block is centered 1280
   ------------------------------------------------------------------------- */
.gmega {
    position: absolute;
    left: 0;
    right: 0;
    top: 100%;                 /* directly under .header-main */
    z-index: 9998;
    background: transparent;
    opacity: 0;
    visibility: visible;
    transform: translateY(8px);
    transition: opacity .22s ease, transform .22s ease, visibility .22s ease;
    pointer-events: none;
}

.gmega[hidden] { display: none; }

.gmega.is-open {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
    pointer-events: auto;
}

.gmega__inner {
    display: grid;
    grid-template-columns: 378px 1fr;    /* rail 378px per design (x80→x458) */
    /* width: 1280px; */                       /* design panel width */
    max-width: calc(100vw - 10vw);       /* graceful on < 1320px desktops */
    margin: 0 auto;                      /* centered => 80px gutters at 1440 */
    background: #fff;
    border-radius: 0 0 16px 16px;
    box-shadow: 0 24px 48px rgba(0, 0, 0, 0.10);
    overflow: visible;                  /* design height */
    border: 1px solid #E5E7E6;
    border-top: none;
}

/* -------------------------------------------------------------------------
   LEFT RAIL — white, divider on the right, generous padding (design)
   ------------------------------------------------------------------------- */
.gmega__rail {
    background: #fff;
    padding: 25px 0;
    border-right: 1px solid #E5E7E6;     /* the x=458.5 vertical divider */
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.gmega__rail-item {
    all: unset;
    box-sizing: border-box;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    width: 100%;
    padding: 10px 40px;                  /* left pad aligns rail text ~x120 */
    font-family: 'Inter', sans-serif;
    font-size: 16px;
    font-weight: 500;
    line-height: 1.4;
    color: var(--text-color, #062D1F);
    cursor: pointer;
    border-left: 3px solid transparent;
    transition: background .2s ease, color .2s ease, border-color .2s ease;
}

.gmega__rail-item:hover,
.gmega__rail-item:focus-visible {
    background: #F4F8F6;
    color: var(--primary-color, #21A55E);
}

.gmega__rail-item.is-active {
    background: #F4F8F6;
    color: var(--primary-color, #21A55E);
    font-weight: 500;
    border-left-color: var(--primary-color, #21A55E);
}

.gmega__rail-arrow {
    width: 8px;
    height: 8px;
    flex: 0 0 auto;
    border-right: 2px solid currentColor;
    border-bottom: 2px solid currentColor;
    transform: rotate(-45deg);
    opacity: 0;
    transition: opacity .2s ease, transform .2s ease;
}

.gmega__rail-item.is-active .gmega__rail-arrow,
.gmega__rail-item:hover .gmega__rail-arrow {
    opacity: 1;
}

/* Rail section headings (PLATFORM / SERVICES) */
.gmega__rail-section {
    margin: 0;
    padding: 10px 40px;
    font-family: 'Inter', sans-serif;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 1.2px;
    text-transform: uppercase;
    color: var(--primary-color, #21A55E);
    line-height: 1;
}
.gmega__rail-section:not(:first-child) {
    margin-top: 18px;
}

/* -------------------------------------------------------------------------
   RIGHT PANELS  (content begins ~24px past the divider)
   ------------------------------------------------------------------------- */
.gmega__panels {
    position: relative;
    padding: 25px 25px 25px 25px;        /* left 40 → text starts ~x498 */
}

.gmega__panel { display: none; }
.gmega__panel.is-active { display: block; animation: gmegaFade .25s ease; }

@keyframes gmegaFade {
    from { opacity: 0; transform: translateY(4px); }
    to   { opacity: 1; transform: translateY(0); }
}

.gmega__panel-head {
    margin-bottom: 22px;
}

.gmega__panel-title {
    margin: 0 0 6px;
    font-family: 'Inter', sans-serif;
    font-size: 22px;
    font-weight: 700;
    color: var(--text-color, #062D1F);
    line-height: 1.25;
}

.gmega__panel-title {
    display: inline-flex;
    align-items: center;
    gap: 10px;
}

.gmega__panel-title-link {
    display: inline-flex;
    align-items: center;
    color: var(--text-color, #062D1F);
    text-decoration: none;
}

.gmega__panel-desc {
    margin: 0;
    font-size: 14px;
    font-weight: 400;
    color: #676767;
    line-height: 1.5;
    max-width: 78ch;
}

/* -------------------------------------------------------------------------
   INNER TABS  (Cisco Powered Security Services) — separators per design
   Tab dividers sat at x637 / x845 / x1097 in the SVG.
   ------------------------------------------------------------------------- */
.gmega__tabs {
    display: flex;
    flex-wrap: wrap;
    align-items: stretch;
    gap: 0;                              /* separators handled via ::before */
    margin: 8px 0 24px;
    border-bottom: 1px solid #E5E7E6;
}

.gmega__tab {
    all: unset;
    box-sizing: border-box;
    position: relative;
    padding: 12px 28px 16px;
    font-family: 'Inter', sans-serif;
    font-size: 15px;
    font-weight: 500;
    color: #676767;
    cursor: pointer;
    transition: color .2s ease;
    white-space: nowrap;
}

/* vertical separator between tabs (skip the first) */
.gmega__tab + .gmega__tab::before {
    content: "";
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    height: 18px;
    width: 1px;
    background: #E5E7E6;
}

.gmega__tab::after {
    content: "";
    position: absolute;
    left: 28px;
    right: 28px;
    bottom: 0px;
    height: 3px;
    background: var(--primary-color, #21A55E);
    transform: scaleX(0);
    transform-origin: left center;
    transition: transform .25s ease;
}

.gmega__tab:hover { color: var(--text-color, #062D1F); }

.gmega__tab.is-active {
    color: var(--primary-color, #21A55E);
    font-weight: 600;
}
.gmega__tab.is-active::after { transform: scaleX(1); }

.gmega__tabpanel { display: none; }
.gmega__tabpanel.is-active { display: block; animation: gmegaFade .25s ease; }

/* -------------------------------------------------------------------------
   COLUMNS + GROUPS + LINK ITEMS  (matched to design screenshots)
   ------------------------------------------------------------------------- */
.gmega__cols {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 28px 64px;
    align-items: start;
}

/* Fixed 2-column bucket layout (groups stacked within each column) */
.gmega__cols--fixed { align-items: start; }
.gmega__cols--fixed > .gmega__col {
    display: flex;
    flex-direction: column;
    gap: 28px;
}

.gmega__col { min-width: 0; }

.gmega__group { min-width: 0; }

/* Group heading */
.gmega__group-head {margin: 0 0 5px;}

.gmega__group-title {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    position: relative;
    font-family: 'Inter', sans-serif;
    font-size: 16px;
    font-weight: 600;
    color: var(--text-color, #062D1F);
    text-decoration: none;
    line-height: 1.3;
}

/* 'bar' style — green vertical bar to the left (Cisco panels) */
.gmega__group-title--bar {
    padding-left: 12px;
}
.gmega__group-title--bar::before {
    content: "";
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 3px;
    height: 15px;
    background: var(--primary-color, #21A55E);
    border-radius: 2px;
}

.gmega__group-chevron {
    width: 6px;
    height: 6px;
    flex: 0 0 auto;
    border-right: 1.6px solid #9AA3A0;
    border-bottom: 1.6px solid #9AA3A0;
    transform: rotate(-45deg);
    transition: border-color .2s ease, transform .2s ease;
}

a.gmega__group-title:hover { color: var(--primary-color, #21A55E); }
a.gmega__group-title:hover .gmega__group-chevron {
    border-color: var(--primary-color, #21A55E);
}

.gmega__list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.gmega__item { margin: 0; }

.gmega__link {
    display: block;
    text-decoration: none;
    padding: 8px 0 0px 10px;
    color: var(--text-color, #062D1F);
    transition: color .2s ease;
}

.gmega__link-title {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    font-weight: 400;
    line-height: 1.4;
    color: #3A4441;
    transition: color .2s ease, gap .2s ease;
}

.gmega__link-desc {
    display: block;
    margin-top: 2px;
    font-size: 13px;
    font-weight: 400;
    color: #8A8F8C;
    line-height: 1.45;
    max-width: 46ch;
}

/* Per-item chevron (AI SOC, Data & AI, Managed AI, Cisco AI) */
.gmega__link-chevron {
    width: 8px;
    height: 8px;
    flex: 0 0 auto;
    border-right: 1.5px solid #7a7b7b;
    border-bottom: 1.5px solid #7a7b7b;
    transform: rotate(-45deg);
    opacity: 0;
    transition: opacity .2s ease, transform .2s ease, border-color .2s ease;
    margin-left: auto;   /* push chevron to the right edge of the row */
}

/* show chevrons only when the group opts in */
.gmega__list--chevrons .gmega__link-chevron { opacity: .55; }

.gmega__link:hover .gmega__link-chevron {
    opacity: 1;
    border-color: var(--primary-color, #21A55E);
    transform: rotate(-45deg) translate(1px, 1px);
}

/* Bulleted variant (Cisco ISE, Cisco Firewall) — green dot before each item */
.gmega__list--bullets .gmega__link-title::before {
    content: "";
    display: inline-block;
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: var(--primary-color, #21A55E);
    flex: 0 0 auto;
}

.gmega__link:hover .gmega__link-title {
    color: var(--primary-color, #21A55E);
}

/* Chevron rows: let the title span full width so the chevron sits at the end */
.gmega__list--chevrons .gmega__link-title { width: 100%; }

/* -------------------------------------------------------------------------
   RESPONSIVE — hide desktop panel below the drawer breakpoint (matches your
   .desktop-menu { display:none } at 988px). Mobile uses the accordion.
   ------------------------------------------------------------------------- */
@media (max-width: 1320px) {
    /* Panel stays centered; max-width already keeps it inside the viewport. */
    .gmega__inner { grid-template-columns: 340px 1fr; }
}

@media (max-width: 988px) {
    .gmega { display: none !important; }
}

/* =========================================================================
   MOBILE — global mega accordion inside the dark drawer (.mobile-menu-wrapper)
   The list is cloned in by global-menu.js as <ul class="mobile-nav gmega-mobile">.
   It reuses your existing drawer classes (.mobile-menu-item / .submenu-toggle /
   .mobile-submenu) and animation JS; these rules add the gmega-specific polish.
   ========================================================================= */

.gmega-mobile {
    list-style: none;
    margin: 0;                     /* align flush with the WP mobile menu below */
    padding: 0;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
}

/* Collapsed baseline + smooth open (JS sets inline max-height to animate) */
.gmega-mobile .mobile-submenu {
    max-height: 0;
    overflow: hidden;
    transition: max-height .32s ease;
}
.gmega-mobile .mobile-menu-item.open > .mobile-submenu {
    /* JS drives the exact px; this is a safety net if JS is delayed */
    max-height: 2000px;
}

/* Section labels: PLATFORM / SERVICES (now nested under "What we do") */
.gmega-mobile__section {
    list-style: none;
    padding: 16px 16px 6px 32px;
    font-family: 'Inter', sans-serif;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 1.4px;
    text-transform: uppercase;
    color: var(--primary-color, #21A55E);
    line-height: 1;
}
.gmega-mobile__section + .mobile-menu-item { border-top: none; }

/* Category rows (AI SOC, Cisco…) — first level under "What we do" */
.gmega-mobile-sub > .mobile-menu-item {
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}
.gmega-mobile-sub > .mobile-menu-item > .submenu-toggle,
.gmega-mobile-sub > .mobile-menu-item > a {
    padding: 13px 16px 13px 32px;
    font-size: 16px;
    font-weight: 500;
}

/* Deeper levels: groups / Cisco tabs */
.gmega-mobile-sub .mobile-submenu > .mobile-menu-item > .submenu-toggle {
    padding-left: 48px;
    font-size: 15px;
    font-weight: 500;
}
.gmega-mobile-sub .mobile-submenu .mobile-submenu > .mobile-menu-item > .submenu-toggle {
    padding-left: 62px;
    font-size: 14px;
}

/* Group heading rows (Prepare / Cisco ISE / etc.) */
.gmega-mobile__grouphead {
    list-style: none;
    padding: 12px 16px 5px 20px;
    font-family: 'Inter', sans-serif;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: .6px;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.55);
}

/* Leaf links */
li.gmega-mobile__feature a {
    padding: 0px !important;
}
.gmega-mobile-sub .mobile-submenu a {
    display: block;
    padding: 10px 16px 10px 40px;
    font-size: 14px;
    font-weight: 400;
    color: rgba(255, 255, 255, 0.85) !important;
    line-height: 1.4;
}
.gmega-mobile-sub .mobile-submenu a:active,
.gmega-mobile-sub .mobile-submenu a:hover {
    color: #fff !important;
    background: rgba(255, 255, 255, 0.06);
}
.gmega-mobile-sub .mobile-submenu .mobile-submenu a {
    padding-left: 62px;
}

/* Mobile PulseAI — image only (bullets + partners hidden on mobile) */
.gmega-mobile__feature {
    list-style: none;
    padding: 12px 16px 16px 10px;
}
.gmega-mobile__feature-link {
    display: block;
    border-radius: 12px;
    overflow: hidden;
    line-height: 0;
}
.gmega-mobile__feature-img {
    width: 100%;
    height: auto;
    display: block;
    border-radius: 12px;
}
.gmega-mobile__feature-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    aspect-ratio: 16 / 10;
    width: 100%;
    border-radius: 12px;
    background: repeating-linear-gradient(45deg,#0f2f22,#0f2f22 12px,#123726 12px,#123726 24px);
    color: rgba(255,255,255,0.7);
    font-family: 'Inter', sans-serif;
    font-size: 13px;
}

/* Green arrow tint on the gmega toggles */
.gmega-mobile-sub .submenu-toggle .arrow { opacity: .8; }
.gmega-mobile-sub .mobile-menu-item.open > .submenu-toggle .arrow {
    border-color: var(--primary-color, #21A55E);
}

/* Accessibility */
@media (prefers-reduced-motion: reduce) {
    .gmega,
    .gmega__panel,
    .gmega__tabpanel,
    .gmega__tab::after,
    .gmega__link-title,
    .gmega__rail-item {
        transition: none !important;
        animation: none !important;
    }
}

/* -------------------------------------------------------------------------
   FEATURE PANEL  (PulseAI) — image card + bulleted features + partner strip
   ------------------------------------------------------------------------- */
.gmega__feature {
    display: grid;
    grid-template-columns: minmax(0, 300px) minmax(0, 1fr);
    gap: 40px;
    align-items: start;
}

/* Left image card */
.gmega__feature-media { min-width: 0; }

.gmega__feature-imglink {
    display: block;
    border-radius: 14px;
    overflow: hidden;
    line-height: 0;
    text-decoration: none;
}

.gmega__feature-img {
    width: 100%;
    height: auto;
    display: block;
    border-radius: 14px;
    transition: transform .35s ease;
}
a.gmega__feature-imglink:hover .gmega__feature-img { transform: scale(1.02); }

/* Placeholder box when no image is set */
.gmega__feature-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    aspect-ratio: 16 / 10;
    width: 100%;
    border-radius: 14px;
    background: repeating-linear-gradient(
        45deg,
        #0f2f22,
        #0f2f22 12px,
        #123726 12px,
        #123726 24px
    );
    color: rgba(255,255,255,0.7);
    font-family: 'Inter', sans-serif;
    font-size: 13px;
    letter-spacing: .3px;
}

/* Right body */
.gmega__feature-body {
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 20px;
    padding-top: 6px;
}

.gmega__feature-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.gmega__feature-litem {
    display: flex;
    align-items: center;
    gap: 10px;
    font-family: 'Inter', sans-serif;
    font-size: 16px;
    font-weight: 500;
    color: var(--text-color, #062D1F);
    line-height: 1.35;
}
.gmega__feature-litem::before {
    content: "";
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--primary-color, #21A55E);
    flex: 0 0 auto;
}

/* Partner strip */
.gmega__partners {
    display: grid;
    grid-auto-flow: column;
    grid-auto-columns: 1fr;
    gap: 0;
    border-top: 1px solid #E5E7E6;
    padding-top: 18px;
    margin-top: 4px;
}

.gmega__partner {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 0 20px;
    position: relative;
    align-items: center;
}
.gmega__partner + .gmega__partner::before {
    content: "";
    position: absolute;
    left: 0;
    top: 2px;
    bottom: 2px;
    width: 1px;
    background: #E5E7E6;
}
.gmega__partner:first-child { padding-left: 0; }

.gmega__partner-label {
    font-family: 'Inter', sans-serif;
    font-size: 13px;
    font-weight: 400;
    color: #676767;
    line-height: 1.2;
}

.gmega__partner-logo {
    /* height: 20px; */
    width: auto;
    object-fit: contain;
    align-self: center;
}

.gmega__partner-text {
    font-family: 'Inter', sans-serif;
    font-size: 15px;
    font-weight: 600;
    color: var(--text-color, #062D1F);
    line-height: 1.2;
}

/* Feature panel: stack on narrower desktops */
@media (max-width: 1100px) {
    .gmega__feature { grid-template-columns: 1fr; gap: 24px; }
    .gmega__partners { grid-auto-flow: row; grid-auto-columns: auto; gap: 14px; }
    .gmega__partner { padding: 0; }
    .gmega__partner + .gmega__partner::before { display: none; }
}


/* Dropdown caret on the "What we do" trigger (CSS-only, no markup needed) */
/* Force the trigger link to lay the caret out inline (fixes the below-left drop) */
.desktop-menu .gmega-trigger > a {
    display: inline-flex !important;
    align-items: center;
    gap: 6px;
}

/* Rebuild the caret so ONLY two borders show (fixes the solid black diamond) */
.desktop-menu .gmega-trigger > a::after {
    content: "";
    display: inline-block;
    width: 3px !important;
    height: 3px;
    margin-left: 6px;
    border: 0 !important;                 /* wipe any inherited full border */
    border-right: 2px solid currentColor !important;
    border-bottom: 2px solid currentColor !important;
    background: none !important;          /* wipe any inherited fill */
    border-radius: 0 !important;
    transform: translateY(-2px) rotate(45deg);
    transition: transform .25s ease;
    flex: 0 0 auto;
    position: unset;
}
.desktop-menu .gmega-trigger.is-open > a::after {
    transform: translateY(1px) rotate(-135deg);
}