/* =====================================================================
   VisualityX shell — new multi-level nav, language toggle, mobile groups.
   Layers on top of the existing header.css (bundled in home.min.css).
   Brand tokens: --color-primary #ED2939, --bg-dark #0F0F1A.
   ===================================================================== */

/* Skip link (a11y) — hidden with the clip technique, NOT `left:-9999px`.
   In RTL, `left:-9999px` overflows past the (right-hand) end edge and adds
   ~9000px of phantom page width, which scrolls all content off-screen on
   mobile (blank white page). The clip pattern never affects layout width. */
.vx-skip-link {
    position: absolute;
    width: 1px;
    height: 1px;
    margin: -1px;
    padding: 0;
    border: 0;
    overflow: hidden;
    clip: rect(0 0 0 0);
    clip-path: inset(50%);
    white-space: nowrap;
    z-index: 2000;
    background: var(--color-primary, #ED2939);
    color: #fff;
    font: 600 .9rem/1 var(--font-body, sans-serif);
}
.vx-skip-link:focus {
    width: auto;
    height: auto;
    margin: 0;
    padding: .6rem 1rem;
    inset-inline-start: 0;
    top: 0;
    overflow: visible;
    clip: auto;
    clip-path: none;
    border-radius: 0 0 8px 0;
}

/* ---- Desktop nav layout ---- */
.vx-nav { display: flex; align-items: center; gap: 1.75rem; }
.vx-nav-item { position: relative; display: inline-flex; align-items: center; }

.vx-nav-trigger {
    display: inline-flex;
    align-items: center;
    gap: .35rem;
    background: none;
    border: none;
    cursor: pointer;
    font: inherit;
    /* NB: do NOT set `color: inherit` here — on a <button> that pulls the dark
       body color instead of the white .nav-link color. Let .nav-link (which
       this element also carries) drive the color so it stays white on the
       transparent hero header and flips dark via .header-scrolled .nav-link. */
    padding: 0;
}
.vx-caret { width: 14px; height: 14px; transition: transform var(--duration, .3s) var(--ease, ease); }
.vx-nav-item.is-open .vx-caret { transform: rotate(180deg); }

/* ---- Dropdown + mega panels ---- */
.vx-dropdown,
.vx-mega {
    position: absolute;
    top: calc(100% + 14px);
    inset-inline-start: 0;
    background: #14141f;
    border: 1px solid rgba(255, 255, 255, .08);
    border-radius: var(--radius, 12px);
    box-shadow: 0 18px 50px rgba(0, 0, 0, .45);
    padding: .6rem;
    opacity: 0;
    visibility: hidden;
    transform: translateY(8px);
    transition: opacity .22s var(--ease, ease), transform .22s var(--ease, ease), visibility .22s;
    z-index: 1200;
}
.vx-nav-item:hover > .vx-dropdown,
.vx-nav-item:hover > .vx-mega,
.vx-nav-item.is-open > .vx-dropdown,
.vx-nav-item.is-open > .vx-mega {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.vx-dropdown { min-width: 240px; display: flex; flex-direction: column; }
.vx-dropdown-link {
    display: block;
    padding: .7rem .9rem;
    border-radius: var(--radius-sm, 8px);
    color: rgba(255, 255, 255, .82);
    text-decoration: none;
    font-weight: 500;
    transition: background var(--duration, .3s), color var(--duration, .3s);
    white-space: nowrap;
}
.vx-dropdown-link:hover { background: rgba(255, 255, 255, .06); color: #fff; }

/* Mega (Solutions) — image cards: thumbnail + name + descriptor */
.vx-mega {
    width: 640px;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: .12rem;
}
.vx-mega-link {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: .7rem;
    padding: .5rem .6rem;
    border-radius: var(--radius-sm, 8px);
    text-decoration: none;
    transition: background var(--duration, .3s);
}
.vx-mega-link:hover { background: rgba(255, 255, 255, .06); }
.vx-mega-thumb {
    position: relative;
    flex: 0 0 auto;
    width: 66px;
    height: 48px;
    border-radius: 8px;
    overflow: hidden;
    background: color-mix(in srgb, var(--ico, #888) 26%, #1b1b27);
}
.vx-mega-thumb img {
    position: relative;
    z-index: 1;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform .45s var(--ease, ease);
}
.vx-mega-link:hover .vx-mega-thumb img { transform: scale(1.08); }
.vx-mega-ico {
    position: absolute;
    inset: 0;
    z-index: 0;                       /* sits behind the photo; shows if photo hidden/missing */
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--ico, #fff);
}
.vx-mega-ico svg { width: 22px; height: 22px; }
.vx-mega-text { display: flex; flex-direction: column; gap: .12rem; min-width: 0; }
.vx-mega-name {
    display: flex;
    align-items: center;
    gap: .5rem;
    color: #fff;
    font-weight: 700;
    font-family: var(--font-heading, sans-serif);
    letter-spacing: .2px;
}
.vx-mega-desc {
    color: rgba(255, 255, 255, .55);
    font-size: .78rem;
    line-height: 1.35;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}
.vx-mega-link.is-flagship { background: rgba(var(--color-primary-rgb, 237,41,57), .10); }
.vx-mega-link.is-flagship:hover { background: rgba(var(--color-primary-rgb, 237,41,57), .18); }
.vx-mega-badge {
    font-family: var(--font-body, sans-serif);
    font-size: .6rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .8px;
    color: #fff;
    background: var(--color-primary, #ED2939);
    padding: .12rem .4rem;
    border-radius: 999px;
}

/* Tight desktop (small laptops / tablets): drop the photos to accent icons,
   single column, so the panel never crowds the viewport. */
@media (min-width: 768px) and (max-width: 1060px) {
    .vx-mega { width: 340px; grid-template-columns: 1fr; }
    .vx-mega-thumb { width: 34px; height: 34px; border-radius: 7px; }
    .vx-mega-thumb img { display: none; }      /* reveal the icon beneath */
    .vx-mega-ico svg { width: 18px; height: 18px; }
    .vx-mega-desc { -webkit-line-clamp: 1; }
}

/* Mobile overlay: solution name preceded by its accent icon chip */
.vx-msol { display: flex; align-items: center; gap: .7rem; }
.vx-msol-ico {
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    border-radius: 8px;
    color: var(--ico, #fff);
    background: color-mix(in srgb, var(--ico, #888) 18%, transparent);
}
.vx-msol-ico svg { width: 17px; height: 17px; }

/* ---- Header actions (lang toggle + CTA) ---- */
.vx-header-actions { display: flex; align-items: center; gap: .85rem; }
.vx-lang-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 42px;
    height: 36px;
    padding: 0 .7rem;
    border: 1px solid rgba(255, 255, 255, .22);
    border-radius: 999px;
    /* White on the transparent hero header (matches .nav-link); flips dark on scroll. */
    color: var(--text-light, #fff);
    text-decoration: none;
    font-weight: 600;
    font-size: .85rem;
    transition: color var(--duration,.3s), border-color var(--duration, .3s), background var(--duration, .3s);
}
.vx-lang-toggle:hover { border-color: var(--color-primary, #ED2939); background: rgba(var(--color-primary-rgb,237,41,57), .12); }

/* Scrolled (solid) header: lang toggle goes dark like the nav links. */
.header-scrolled .vx-lang-toggle {
    color: var(--text-dark, #1A1A1A);
    border-color: rgba(0, 0, 0, .18);
}
.header-scrolled .vx-lang-toggle:hover { color: var(--color-primary, #ED2939); border-color: var(--color-primary, #ED2939); }

/* Header that has scrolled (solid) — keep dropdowns readable.
   The base header.css toggles a scrolled state; panels are dark regardless. */

/* ---- Mobile nav groups ---- */
.vx-mobile-nav .vx-mobile-group {
    display: flex;
    flex-direction: column;
    gap: .25rem;
    width: 100%;
    max-width: 320px;
    margin-bottom: 1.25rem;
}
.vx-mobile-heading {
    text-transform: uppercase;
    letter-spacing: 1.5px;
    font-size: .7rem;
    font-weight: 700;
    color: var(--color-primary, #ED2939);
    margin-bottom: .35rem;
}
.vx-mobile-lang { margin-top: .5rem; opacity: .85; }

/* Match header.css's 768px breakpoint so there's no gap where neither the
   desktop nav nor the hamburger shows. Below 768: hamburger + overlay.
   768+: desktop nav + header actions. */
@media (max-width: 767px) {
    .vx-nav, .vx-header-actions { display: none; }
}
@media (min-width: 768px) {
    .vx-mobile-nav { display: none; }
}
