/* ============================================================
   Stenzo Navbar — navbar.css
   All styles are namespaced under .snav__ to avoid collision
   with existing page styles.
   ============================================================ */

/* ── Base navbar ──────────────────────────────────────────── */
.snav {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    background: transparent;
    transition:
        background-color 250ms ease,
        box-shadow 250ms ease,
        backdrop-filter 250ms ease;
}

.snav.is-scrolled {
    background: #ffffff;
    box-shadow: 0 1px 0 rgba(0, 0, 0, 0.08), 0 2px 12px rgba(0, 0, 0, 0.06);
}

/* When a mega-menu is open, ensure full white bg */
.snav.has-open-menu {
    background: #ffffff;
    box-shadow: none;
}

.snav__inner {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 24px;
    height: 62px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

/* ── Logo ─────────────────────────────────────────────────── */
.snav__logo {
    display: flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
    flex-shrink: 0;
}

.snav__logo-mark {
    width: 32px;
    height: 32px;
    background: var(--color-dark, #242426);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.snav__logo-mark svg {
    width: 18px;
    height: 18px;
    color: #ffffff;
}

.snav__logo-text {
    font-size: 17px;
    font-weight: 600;
    color: var(--color-dark, #242426);
    letter-spacing: -0.02em;
}

/* ── Desktop nav links container ──────────────────────────── */
.snav__links {
    display: flex;
    align-items: center;
    gap: 2px;
    flex: 1;
    justify-content: center;
}

/* ── Each nav item wrapper ────────────────────────────────── */
.snav__item {
    position: static;
}

/* ── Trigger button ───────────────────────────────────────── */
.snav__trigger {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 7px 14px;
    border-radius: 100px;
    font-size: 14px;
    font-weight: 500;
    color: rgba(36, 36, 38, 0.8);
    background: transparent;
    border: none;
    cursor: pointer;
    font-family: inherit;
    letter-spacing: -0.01em;
    transition: color 150ms ease, background 150ms ease;
    white-space: nowrap;
}

.snav__trigger:hover,
.snav__item.is-open .snav__trigger {
    color: #242426;
    background: #ebeff5;
}

.snav__trigger:focus-visible {
    outline: 2px solid #242426;
    outline-offset: 2px;
}

.snav__chevron {
    width: 10px;
    height: 6px;
    flex-shrink: 0;
    transition: transform 220ms ease;
}

.snav__item.is-open .snav__chevron {
    transform: rotate(180deg);
}

/* ── Desktop CTA ──────────────────────────────────────────── */
.snav__actions {
    display: flex;
    align-items: center;
    flex-shrink: 0;
}

.snav__cta-primary {
    padding: 9px 20px;
    font-size: 14px;
}

/* ── Backdrop ─────────────────────────────────────────────── */
.snav__backdrop {
    position: fixed;
    top: 62px;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.18);
    z-index: 998;
    opacity: 0;
    pointer-events: none;
    transition: opacity 200ms ease;
}

.snav.has-open-menu .snav__backdrop {
    opacity: 1;
    pointer-events: auto;
}

/* ── Mega Menu Panel ──────────────────────────────────────── */
.snav__mega {
    position: fixed;
    top: 62px;
    left: 0;
    right: 0;
    z-index: 999;
    background: #ffffff;
    border-bottom: 1px solid rgba(0, 0, 0, 0.07);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    /* Animation states */
    opacity: 0;
    transform: translateY(-8px);
    pointer-events: none;
    transition:
        opacity 200ms ease,
        transform 200ms ease;
}

/* Hidden attr is toggled by JS — CSS drives visual state */
.snav__mega:not([hidden]) {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
}

/* Keep [hidden] elements invisible but still animate correctly */
.snav__mega[hidden] {
    display: block !important; /* Override HTML hidden so CSS transition works */
    opacity: 0;
    transform: translateY(-8px);
    pointer-events: none;
}

.snav__mega-inner {
    max-width: 1200px;
    margin: 0 auto;
    padding: 32px 24px 36px;
}

/* ── Mega Menu Header ─────────────────────────────────────── */
.snav__mega-header {
    display: flex;
    align-items: baseline;
    gap: 16px;
    margin-bottom: 24px;
    padding-bottom: 16px;
    border-bottom: 1px solid #ebeff5;
}

.snav__mega-title {
    font-size: 16px;
    font-weight: 600;
    color: #242426;
    letter-spacing: -0.02em;
}

.snav__mega-eyebrow {
    font-size: 11px;
    font-weight: 600;
    color: #9ca3af;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

/* ── Mega Grid Layouts ────────────────────────────────────── */
.snav__mega-grid {
    display: grid;
    gap: 4px;
}

.snav__mega-grid--2 {
    grid-template-columns: repeat(2, 1fr);
    max-width: 700px;
}

.snav__mega-grid--3 {
    grid-template-columns: repeat(3, 1fr);
}

.snav__mega-grid--2col,
.snav__mega-grid--3col {
    display: flex;
    gap: 0;
}

/* ── Column layout for Solutions / Resources ──────────────── */
.snav__mega-col {
    flex: 1;
    padding-right: 32px;
    border-right: 1px solid #ebeff5;
    margin-right: 32px;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.snav__mega-col:last-child {
    border-right: none;
    margin-right: 0;
    padding-right: 0;
}

.snav__mega-col-label {
    font-size: 11px;
    font-weight: 600;
    color: #9ca3af;
    letter-spacing: 0.07em;
    text-transform: uppercase;
    padding: 0 12px 8px;
    display: block;
}

/* ── Mega Menu Items ──────────────────────────────────────── */
.snav__mega-item {
    display: flex;
    flex-direction: column;
    gap: 3px;
    padding: 10px 12px;
    border-radius: 10px;
    text-decoration: none;
    transition: background 150ms ease;
}

.snav__mega-item:hover {
    background: #f5f7fa;
}

.snav__mega-item:focus-visible {
    outline: 2px solid #242426;
    outline-offset: 2px;
}

.snav__mega-item-title {
    font-size: 14px;
    font-weight: 500;
    color: #242426;
    line-height: 1.3;
    letter-spacing: -0.01em;
}

.snav__mega-item-desc {
    font-size: 13px;
    color: #6b7280;
    line-height: 1.45;
}

/* Compact item (no description) */
.snav__mega-item--compact {
    padding: 7px 12px;
}

.snav__mega-item--compact .snav__mega-item-title {
    font-size: 13.5px;
}

/* Featured item (Submit Resume / Talk to Our Team) */
.snav__mega-item--featured {
    margin-top: 12px;
    background: #f8f9fb;
    border: 1px solid #ebeff5;
}

.snav__mega-item--featured:hover {
    background: #f0f3f8;
    border-color: #d9d5dc;
}

.snav__mega-item--featured .snav__mega-item-title {
    font-weight: 600;
}

/* ── Mobile toggle button ─────────────────────────────────── */
.snav__mobile-toggle {
    display: none;
    flex-direction: column;
    gap: 5px;
    padding: 8px;
    border-radius: 8px;
    border: none;
    background: transparent;
    cursor: pointer;
    flex-shrink: 0;
}

.snav__mobile-toggle span {
    display: block;
    width: 22px;
    height: 2px;
    background: #242426;
    border-radius: 2px;
    transition: all 250ms ease;
}

/* ── Mobile Menu overlay ──────────────────────────────────── */
.snav__mobile {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: #ffffff;
    z-index: 1001;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    /* Animation */
    opacity: 0;
    transform: translateX(100%);
    transition: opacity 250ms ease, transform 250ms ease;
}

.snav__mobile[hidden] {
    display: flex !important; /* Keep in flow for transition */
    opacity: 0;
    transform: translateX(100%);
    pointer-events: none;
}

.snav__mobile:not([hidden]) {
    opacity: 1;
    transform: translateX(0);
    pointer-events: auto;
}

.snav__mobile-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 24px;
    border-bottom: 1px solid #ebeff5;
    flex-shrink: 0;
}

.snav__mobile-close {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: #f0f3f8;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    border: none;
    color: #242426;
    flex-shrink: 0;
    transition: background 150ms ease;
}

.snav__mobile-close:hover {
    background: #e2e8f0;
}

/* ── Mobile nav accordion ─────────────────────────────────── */
.snav__mobile-nav {
    flex: 1;
    padding: 12px 24px;
    overflow-y: auto;
}

.snav__mobile-group {
    border-bottom: 1px solid #f0f3f8;
}

.snav__mobile-trigger {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    padding: 16px 0;
    font-size: 17px;
    font-weight: 600;
    color: #242426;
    background: transparent;
    border: none;
    cursor: pointer;
    font-family: inherit;
    text-align: left;
    letter-spacing: -0.01em;
}

.snav__mobile-trigger:focus-visible {
    outline: 2px solid #242426;
    outline-offset: 2px;
    border-radius: 4px;
}

.snav__mobile-trigger .snav__chevron {
    transition: transform 220ms ease;
    flex-shrink: 0;
}

.snav__mobile-group.is-open .snav__mobile-trigger .snav__chevron {
    transform: rotate(180deg);
}

.snav__mobile-sub {
    padding: 0 0 16px 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.snav__mobile-sub[hidden] {
    display: none !important;
}

.snav__mobile-sub-label {
    font-size: 11px;
    font-weight: 600;
    color: #9ca3af;
    letter-spacing: 0.07em;
    text-transform: uppercase;
    padding: 10px 0 4px;
    display: block;
}

.snav__mobile-sublink {
    font-size: 15px;
    font-weight: 400;
    color: #4d4f57;
    padding: 8px 8px;
    border-radius: 8px;
    text-decoration: none;
    transition: background 150ms ease, color 150ms ease;
    display: block;
}

.snav__mobile-sublink:hover {
    background: #f5f7fa;
    color: #242426;
}

/* ── Mobile footer (CTA) ──────────────────────────────────── */
.snav__mobile-footer {
    padding: 20px 24px 32px;
    border-top: 1px solid #ebeff5;
    flex-shrink: 0;
}

/* ── Responsive: show mobile toggle, hide desktop ─────────── */
@media (max-width: 900px) {
    .snav__links,
    .snav__actions {
        display: none;
    }

    .snav__mobile-toggle {
        display: flex;
    }
}

/* ── Prevent body scroll when mobile menu is open ─────────── */
body.snav-mobile-open {
    overflow: hidden;
}

/* ── Dark Theme Overrides ─────────────────────────────────── */
body.theme-dark .snav {
    /* Base transparent state stays transparent, but text turns white */
}

body.theme-dark .snav.is-scrolled {
    background: rgba(53, 54, 59, 0.95);
    box-shadow: 0 1px 0 rgba(255, 255, 255, 0.08), 0 4px 20px rgba(0, 0, 0, 0.15);
    backdrop-filter: blur(8px);
}

body.theme-dark .snav.has-open-menu {
    background: #35363b;
    box-shadow: none;
}

body.theme-dark .snav__logo-text,
body.theme-dark .snav__trigger {
    color: #ffffff;
}

body.theme-dark .snav__logo-mark {
    background: #ffffff;
    color: #242426;
}

body.theme-dark .snav__trigger:hover,
body.theme-dark .snav__item.is-open .snav__trigger {
    color: #ffffff;
    background: rgba(255, 255, 255, 0.1);
}

body.theme-dark .snav__trigger:focus-visible {
    outline: 2px solid #ffffff;
}

body.theme-dark .snav__cta-primary {
    background: #ffffff;
    color: #242426;
    border: 1px solid rgba(0,0,0,0.1);
}

body.theme-dark .snav__mobile-toggle span {
    background: #ffffff;
}

body.theme-dark .snav__mobile {
    background: #35363b;
}

body.theme-dark .snav__mobile-header {
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

body.theme-dark .snav__mobile-close {
    background: rgba(255, 255, 255, 0.1);
    color: #ffffff;
}

body.theme-dark .snav__mobile-close:hover {
    background: rgba(255, 255, 255, 0.2);
}

body.theme-dark .snav__mobile-group {
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

body.theme-dark .snav__mobile-trigger {
    color: #ffffff;
}

body.theme-dark .snav__mobile-sublink {
    color: rgba(255, 255, 255, 0.8);
}

body.theme-dark .snav__mobile-sublink:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #ffffff;
}

/* ── Dark Theme Overrides for Mega Menu ───────────────────── */
body.theme-dark .snav__mega {
    background: #35363b;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
}

body.theme-dark .snav__mega-header {
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

body.theme-dark .snav__mega-title,
body.theme-dark .snav__mega-item-title {
    color: #ffffff;
}

body.theme-dark .snav__mega-eyebrow,
body.theme-dark .snav__mega-col-label,
body.theme-dark .snav__mega-item-desc {
    color: rgba(255, 255, 255, 0.6);
}

body.theme-dark .snav__mega-col {
    border-right-color: rgba(255, 255, 255, 0.1);
}

body.theme-dark .snav__mega-item:hover {
    background: rgba(255, 255, 255, 0.05);
}

body.theme-dark .snav__mega-item:focus-visible {
    outline-color: #ffffff;
}

body.theme-dark .snav__mega-item--featured {
    background: rgba(255, 255, 255, 0.03);
    border-color: rgba(255, 255, 255, 0.1);
}

body.theme-dark .snav__mega-item--featured:hover {
    background: rgba(255, 255, 255, 0.06);
    border-color: rgba(255, 255, 255, 0.15);
}

/* Ensure Logo SVG stroke inverts inside the logo mark */
body.theme-dark .snav__logo-mark svg path {
    stroke: #242426;
}

/* Mobile footer and CTA */
body.theme-dark .snav__mobile-footer {
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

body.theme-dark .snav__mobile-footer .btn {
    background: #ffffff;
    color: #242426;
    border: 1px solid rgba(0, 0, 0, 0.1);
}

body.theme-dark .snav__mobile-footer .btn:hover {
    background: rgba(255, 255, 255, 0.9);
}

/* ── Active State ─────────────────────────────────────────── */
.snav__item.is-active .snav__trigger { color: #242426; background: #ebeff5; }
.snav__mega-item.is-active { background: #f5f7fa; }
.snav__mobile-trigger.is-active { color: #000; }
.snav__mobile-sublink.is-active { background: #f5f7fa; color: #242426; }
body.theme-dark .snav__item.is-active .snav__trigger { color: #ffffff; background: rgba(255, 255, 255, 0.1); }
body.theme-dark .snav__mobile-sublink.is-active { background: rgba(255, 255, 255, 0.1); color: #ffffff; }
