/* =====================================================================
   SITE NAV (main header). Markup lives between <!-- SITE-NAV:START --> and
   <!-- SITE-NAV:END --> on every page; behaviour in /js/nav.js.
   Uses only .sn-* classes so the legacy .navbar rules in styles.css and
   v4.css no longer apply. Header height stays 80px so page offsets hold.
   ===================================================================== */
.sn {
    --sn-h: 80px;
    --sn-blue: var(--color-blue, #17609E);
    --sn-blue-dark: var(--color-blue-dark, #124d7e);
    --sn-orange: var(--color-orange, #F26622);
    --sn-orange-dark: var(--color-orange-dark, #d9561b);
    --sn-ink: var(--color-charcoal, #2D3E50);
    --sn-muted: #5b6b7a;
    --sn-tint: #f3f6f9;
    --sn-line: rgba(45, 62, 80, 0.12);
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    height: var(--sn-h);
    background: rgba(255, 255, 255, 0.97);
    border-bottom: 1px solid var(--sn-line);
    font-family: var(--font-body, 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif);
    transition: box-shadow 0.2s ease;
}
/* blur lives on a pseudo-element: backdrop-filter on .sn itself would trap the fixed mobile drawer inside the 80px bar */
.sn::before { content: ''; position: absolute; inset: 0; z-index: -1; -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); }
.sn.is-scrolled { box-shadow: 0 4px 18px rgba(26, 38, 51, 0.08); }
.sn *, .sn *::before, .sn *::after { box-sizing: border-box; }
.sn ul { list-style: none; margin: 0; padding: 0; }
.sn a { text-decoration: none; }

.sn-skip {
    position: absolute;
    left: 16px;
    top: -60px;
    z-index: 2;
    padding: 10px 16px;
    background: var(--sn-blue);
    color: #fff;
    font-weight: 600;
    border-radius: 0 0 8px 8px;
}
.sn-skip:focus { top: 0; }

.sn-inner {
    position: relative;
    height: var(--sn-h);
    width: 100%;
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
}
.sn-logo { flex: 0 0 auto; display: flex; align-items: center; }
.sn-logo img { display: block; height: 54px; width: auto; max-height: 54px; }

.sn-menu { display: flex; align-items: center; gap: 20px; margin-left: auto; }
.sn-list { display: flex; align-items: center; gap: 2px; }
.sn-item { position: relative; }
.sn-item--mega { position: static; }

.sn-trigger {
    appearance: none;
    background: none;
    border: 0;
    margin: 0;
    font: inherit;
    font-size: 0.9375rem;
    font-weight: 500;
    line-height: 1;
    color: var(--sn-ink);
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 12px 11px;
    border-radius: 8px;
    cursor: pointer;
    white-space: nowrap;
    position: relative;
    transition: color 0.15s ease, background-color 0.15s ease;
}
.sn-trigger::after {
    content: '';
    position: absolute;
    left: 11px;
    right: 11px;
    bottom: 4px;
    height: 2px;
    background: var(--sn-blue);
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 0.2s ease;
}
.sn-item.is-current > .sn-trigger::after { transform: scaleX(1); }
.sn-trigger:hover, .sn-item.is-open > .sn-trigger { color: var(--sn-blue); background: var(--sn-tint); }
.sn-chev { width: 14px; height: 14px; flex: 0 0 auto; transition: transform 0.2s ease; }
.sn-item.is-open > .sn-trigger .sn-chev { transform: rotate(180deg); }

.sn a:focus-visible, .sn button:focus-visible {
    outline: 2px solid var(--sn-blue);
    outline-offset: 2px;
    border-radius: 8px;
}

.sn-cta {
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 12px 24px;
    border-radius: 8px;
    background: var(--sn-orange);
    color: #fff;
    font-size: 0.9375rem;
    font-weight: 600;
    line-height: 1;
    transition: background-color 0.15s ease, transform 0.15s ease;
}
.sn-cta:hover { background: var(--sn-orange-dark); color: #fff; }
.sn-cta:focus-visible { outline-color: var(--sn-ink); }
.sn-cta[aria-current="page"] { box-shadow: 0 0 0 2px #fff, 0 0 0 4px var(--sn-orange); }

/* ---------- panels (desktop) ---------- */
.sn-panel {
    position: absolute;
    top: calc(100% + 6px);
    left: 0;
    min-width: 340px;
    background: #fff;
    border: 1px solid var(--sn-line);
    border-radius: 14px;
    box-shadow: 0 18px 48px rgba(26, 38, 51, 0.16);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-6px);
    transition: opacity 0.16s ease, transform 0.16s ease, visibility 0s linear 0.16s;
    z-index: 5;
    max-height: calc(100vh - var(--sn-h) - 20px);
    overflow-y: auto;
}
/* bridges the 6px gap so hover is not lost between trigger and panel */
.sn-panel::before { content: ''; position: absolute; left: 0; right: 0; top: -8px; height: 8px; }
.sn-item.is-open > .sn-panel {
    opacity: 1;
    visibility: visible;
    transform: none;
    transition: opacity 0.16s ease, transform 0.16s ease, visibility 0s;
}
.sn-panel--end { left: auto; right: 0; }
.sn-panel--sm { min-width: 360px; }
.sn-panel--md { min-width: 520px; }
.sn-panel--mega {
    left: 50%;
    right: auto;
    width: min(1120px, calc(100vw - 48px));
    transform: translate(-50%, -6px);
}
.sn-item.is-open > .sn-panel--mega { transform: translate(-50%, 0); }
.sn-panel-in { display: block; }

.sn-panel-body { padding: 20px; display: grid; gap: 8px 20px; }
.sn-panel--mega .sn-panel-body { grid-template-columns: repeat(4, 1fr); padding: 24px 24px 20px; }
.sn-panel--md .sn-panel-body { grid-template-columns: repeat(2, 1fr); }
.sn-panel--sm .sn-panel-body { grid-template-columns: 1fr; }

.sn-group-label {
    display: block;
    margin: 0 0 6px;
    padding: 0 12px 8px;
    border-bottom: 1px solid var(--sn-line);
    font-size: 0.8125rem;
    font-weight: 700;
    color: var(--sn-blue);
}
.sn-group > ul { display: grid; gap: 2px; }

.sn-link {
    display: block;
    padding: 9px 12px;
    border-radius: 8px;
    color: var(--sn-ink);
    transition: background-color 0.12s ease;
}
.sn-link-t { display: block; font-size: 0.9rem; font-weight: 600; line-height: 1.3; }
.sn-link-d { display: block; margin-top: 2px; font-size: 0.8125rem; line-height: 1.4; color: var(--sn-muted); font-weight: 400; }
.sn-link:hover, .sn-link:focus-visible { background: var(--sn-tint); }
.sn-link:hover .sn-link-t { color: var(--sn-blue); }
.sn-link[aria-current="page"] { background: rgba(23, 96, 158, 0.08); }
.sn-link[aria-current="page"] .sn-link-t { color: var(--sn-blue); }
.sn-pill {
    display: inline-block;
    margin-left: 6px;
    padding: 2px 7px;
    border-radius: 999px;
    background: var(--sn-orange);
    color: #fff;
    font-size: 0.6875rem;
    font-weight: 700;
    line-height: 1.2;
    vertical-align: 1px;
}

.sn-feature {
    border-left: 3px solid var(--sn-blue);
    background: var(--sn-tint);
    border-radius: 0 10px 10px 0;
    padding: 12px 14px;
}
.sn-feature:hover { background: #e7eef5; }
.sn-feature .sn-link-t { color: var(--sn-blue); font-size: 0.95rem; }

.sn-panel-foot {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 14px 24px;
    background: var(--sn-tint);
    border-top: 1px solid var(--sn-line);
    border-radius: 0 0 14px 14px;
    font-size: 0.875rem;
    color: var(--sn-muted);
}
.sn-foot-link { font-weight: 600; color: var(--sn-blue); white-space: nowrap; }
.sn-foot-link:hover { color: var(--sn-blue-dark); text-decoration: underline; }
.sn-sep { grid-column: 1 / -1; height: 1px; background: var(--sn-line); margin: 6px 0 2px; }

.sn-toggle { display: none; }

/* ---------- narrow desktop: tighten ---------- */
@media (max-width: 1260px) {
    .sn-trigger { padding: 12px 8px; font-size: 0.9rem; }
    .sn-trigger::after { left: 8px; right: 8px; }
    .sn-cta { padding: 12px 18px; }
}

/* ---------- mobile and tablet drawer ---------- */
@media (max-width: 1100px) {
    .sn-logo img { height: 44px; max-height: 44px; }
    .sn-inner { padding: 0 16px; }
    .sn-toggle {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        width: 48px;
        height: 48px;
        margin-right: -8px;
        padding: 0;
        background: none;
        border: 0;
        border-radius: 10px;
        cursor: pointer;
        color: var(--sn-ink);
    }
    .sn-toggle-box { position: relative; width: 24px; height: 18px; display: block; }
    .sn-toggle-box i {
        position: absolute;
        left: 0;
        width: 24px;
        height: 2px;
        border-radius: 2px;
        background: currentColor;
        transition: transform 0.22s ease, opacity 0.15s ease, top 0.22s ease;
    }
    .sn-toggle-box i:nth-child(1) { top: 0; }
    .sn-toggle-box i:nth-child(2) { top: 8px; }
    .sn-toggle-box i:nth-child(3) { top: 16px; }
    .sn.is-menu-open .sn-toggle-box i:nth-child(1) { top: 8px; transform: rotate(45deg); }
    .sn.is-menu-open .sn-toggle-box i:nth-child(2) { opacity: 0; }
    .sn.is-menu-open .sn-toggle-box i:nth-child(3) { top: 8px; transform: rotate(-45deg); }

    .sn-menu {
        position: fixed;
        top: var(--sn-h);
        left: 0;
        right: 0;
        bottom: 0;
        margin: 0;
        display: flex;
        flex-direction: column;
        align-items: stretch;
        gap: 0;
        background: #fff;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
        overscroll-behavior: contain;
        opacity: 0;
        visibility: hidden;
        transform: translateY(-8px);
        transition: opacity 0.2s ease, transform 0.2s ease, visibility 0s linear 0.2s;
    }
    .sn.is-menu-open .sn-menu { opacity: 1; visibility: visible; transform: none; transition: opacity 0.2s ease, transform 0.2s ease, visibility 0s; }

    .sn-list { display: block; flex: 1 0 auto; padding: 8px 16px 0; }
    .sn-item, .sn-item--mega { position: static; border-bottom: 1px solid var(--sn-line); }
    .sn-trigger {
        width: 100%;
        justify-content: space-between;
        padding: 0 4px;
        min-height: 58px;
        font-size: 1.0625rem;
        font-weight: 600;
        border-radius: 0;
        background: none !important;
    }
    .sn-trigger::after { display: none; }
    .sn-item.is-current > .sn-trigger { color: var(--sn-blue); }
    .sn-chev { width: 20px; height: 20px; }

    .sn-panel, .sn-panel--mega, .sn-panel--end, .sn-panel--md, .sn-panel--sm {
        position: static;
        width: auto;
        min-width: 0;
        left: auto;
        right: auto;
        border: 0;
        border-radius: 0;
        box-shadow: none;
        background: none;
        opacity: 1;
        transform: none;
        display: grid;
        grid-template-rows: 0fr;
        visibility: hidden;
        transition: grid-template-rows 0.25s ease, visibility 0s linear 0.25s;
    }
    .sn-item.is-open > .sn-panel, .sn-item.is-open > .sn-panel--mega {
        transform: none;
        grid-template-rows: 1fr;
        visibility: visible;
        transition: grid-template-rows 0.25s ease, visibility 0s;
    }
    .sn-panel::before { display: none; }
    .sn-panel-in { overflow: hidden; min-height: 0; }
    .sn-panel-body, .sn-panel--mega .sn-panel-body, .sn-panel--md .sn-panel-body, .sn-panel--sm .sn-panel-body {
        grid-template-columns: 1fr;
        padding: 0 0 12px;
        gap: 4px;
    }
    .sn-group-label { border: 0; padding: 14px 8px 4px; margin: 0; font-size: 0.8125rem; }
    .sn-link { padding: 12px 8px; min-height: 48px; }
    .sn-link-t { font-size: 1rem; }
    .sn-link-d { font-size: 0.875rem; }
    .sn-feature { border-radius: 0 10px 10px 0; margin: 4px 0; }
    .sn-panel-foot { background: none; border: 0; padding: 4px 8px 14px; border-radius: 0; flex-direction: column; align-items: flex-start; gap: 4px; }
    .sn-panel-foot span { display: none; }
    .sn-foot-link { display: block; padding: 10px 0; min-height: 44px; }
    .sn-sep { margin: 8px 0; }

    .sn-cta {
        position: sticky;
        bottom: 0;
        margin: 16px 16px 0;
        padding: 18px 24px;
        font-size: 1.0625rem;
        border-radius: 10px;
        box-shadow: 0 -12px 16px -6px #fff, 0 0 0 0 transparent;
    }
    .sn-menu::after { content: ''; flex: 0 0 16px; }
}

html.sn-lock, html.sn-lock body { overflow: hidden; }

@media (prefers-reduced-motion: reduce) {
    .sn *, .sn *::before, .sn *::after { transition-duration: 0.01ms !important; }
}
@media print { .sn { display: none !important; } }
