/* Site header (#topnav) from _SiteHeader.cshtml. It replaces the template navbar from tailwind.min.css: the #topnav
   rules there still position it (fixed to the top) and app.js still adds .nav-sticky on scroll, so the overrides below
   only take over its look. Below 1024px the links move into a drop-down panel run by site-header.js. */

#topnav.site-header {
    --sh-height: 68px;
    --sh-ink: #161c2d;
    --sh-link: #161c2d;
    --sh-link-hover: #4f46e5;
    --sh-accent-text: #4f46e5;
    --sh-hover: rgba(15, 23, 42, .05);
    --sh-glass: rgba(255, 255, 255, .86);
    --sh-solid: #fff;
    --sh-line: rgba(15, 23, 42, .08);
    --sh-shadow: 0 8px 28px rgba(15, 23, 42, .07);
    --sh-cta-bg: rgba(79, 70, 229, .1);
    --sh-cta-hover: rgba(79, 70, 229, .16);
    --sh-cta-text: #4338ca;
    min-height: 0;
    border-bottom: 1px solid transparent;
    background: transparent;
    box-shadow: none;
    transition: background-color .25s ease, border-color .25s ease, box-shadow .25s ease;
}
.dark #topnav.site-header {
    --sh-ink: #f1f5f9;
    --sh-link: #fff;
    --sh-link-hover: #4f46e5;
    --sh-accent-text: #a5b4fc;
    --sh-hover: rgba(148, 163, 184, .1);
    --sh-glass: rgba(15, 23, 42, .84);
    --sh-solid: #0f172a;
    --sh-line: rgba(148, 163, 184, .16);
    --sh-shadow: 0 8px 28px rgba(0, 0, 0, .3);
    --sh-cta-bg: rgba(129, 140, 248, .16);
    --sh-cta-hover: rgba(129, 140, 248, .24);
    --sh-cta-text: #c7d2fe;
    background: transparent;
    box-shadow: none;
}
/* Scrolled, or with the menu open: frosted bar with a hairline, so the page never shows through the links. */
#topnav.site-header.nav-sticky,
#topnav.site-header.is-open,
.dark #topnav.site-header.nav-sticky,
.dark #topnav.site-header.is-open {
    border-bottom-color: var(--sh-line);
    background: var(--sh-glass);
    box-shadow: var(--sh-shadow);
    -webkit-backdrop-filter: saturate(1.6) blur(14px);
    backdrop-filter: saturate(1.6) blur(14px);
}
#topnav.site-header *, #topnav.site-header *::before, #topnav.site-header *::after { box-sizing: border-box; }

.sh-inner { position: relative; z-index: 2; display: flex; align-items: center; gap: 12px; width: min(100%, 1168px); height: var(--sh-height); margin-inline: auto; padding-inline: 16px; }

.sh-logo { display: inline-flex; flex-shrink: 0; align-items: center; margin-right: auto; border-radius: 8px; }
.sh-logo img { width: 72px; height: auto; }

.sh-links { display: flex; margin: 0; padding: 0; list-style: none; }
/* Same lettering as the template menu this header replaced: 13px bold capitals in the page's own font (inherited, as
   on the live site), indigo on hover and for the current page. */
.sh-links a { display: flex; align-items: center; color: var(--sh-link); font-size: 13px; font-weight: 700; line-height: 1.5rem; letter-spacing: 1px; text-decoration: none; text-transform: uppercase; white-space: nowrap; transition: color .15s ease; }
.sh-links a:hover, .sh-links a.active { color: var(--sh-link-hover); }

.sh-actions { display: flex; flex-shrink: 0; align-items: center; gap: 6px; }

/* Dashboard: a soft tint of the site's indigo, so it reads as the way in without shouting. */
.sh-cta { display: inline-flex; align-items: center; height: 36px; padding: 0 16px; border-radius: 10px; color: var(--sh-cta-text); background: var(--sh-cta-bg); font-size: 14px; font-weight: 700; line-height: 1; white-space: nowrap; text-decoration: none; transition: background-color .15s ease, color .15s ease; }
.sh-cta:hover { color: var(--sh-cta-text); background: var(--sh-cta-hover); }

.sh-toggle { display: inline-grid; place-items: center; width: 44px; height: 44px; margin-right: -8px; padding: 0; border: 0; border-radius: 12px; color: var(--sh-ink); background: transparent; cursor: pointer; -webkit-tap-highlight-color: transparent; transition: background-color .15s ease; }
.sh-toggle:hover { background: var(--sh-hover); }
.sh-toggle-lines { position: relative; display: block; width: 20px; height: 12px; }
.sh-toggle-lines span { position: absolute; left: 0; display: block; width: 100%; height: 2px; border-radius: 2px; background: currentColor; transition: top .2s ease .1s, transform .2s ease, opacity .15s ease; }
.sh-toggle-lines span:nth-child(1) { top: 0; }
.sh-toggle-lines span:nth-child(2) { top: 5px; }
.sh-toggle-lines span:nth-child(3) { top: 10px; }
.is-open .sh-toggle-lines span { transition: top .2s ease, transform .2s ease .1s, opacity .15s ease; }
.is-open .sh-toggle-lines span:nth-child(1) { top: 5px; transform: rotate(45deg); }
.is-open .sh-toggle-lines span:nth-child(2) { opacity: 0; }
.is-open .sh-toggle-lines span:nth-child(3) { top: 5px; transform: rotate(-45deg); }

#topnav.site-header :is(.sh-logo, .sh-links a, .sh-cta, .sh-toggle):focus-visible { outline: 3px solid var(--sh-accent-text); outline-offset: 2px; }

/* Sits right after the header in the page (see _SiteHeader.cshtml). */
.sh-scrim { display: none; }

/* ---------- Phones and tablets: the links drop down under the bar */

@media (max-width: 1023.98px) {
    .sh-nav {
        position: absolute; top: 100%; right: 0; left: 0; z-index: 1;
        max-height: calc(100vh - var(--sh-height)); max-height: calc(100dvh - var(--sh-height));
        overflow-y: auto; overscroll-behavior: contain;
        padding: 10px 16px 18px; border-bottom: 1px solid var(--sh-line);
        background: var(--sh-solid); box-shadow: 0 18px 40px rgba(15, 23, 42, .14);
        visibility: hidden; opacity: 0; transform: translateY(-6px);
        transition: opacity .18s ease, transform .18s ease, visibility 0s linear .18s;
    }
    .is-open .sh-nav { visibility: visible; opacity: 1; transform: none; transition: opacity .18s ease, transform .18s ease; }
    .sh-links { flex-direction: column; gap: 2px; width: min(100%, 640px); margin-inline: auto; }
    .sh-links a { min-height: 48px; padding: 0 20px; }

    /* Blurs and dims the page under the open menu, like the support chat overlay; a tap on it closes the menu. */
    .sh-scrim { position: fixed; inset: 0; z-index: 998; display: block; background: rgba(15, 23, 42, .45); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); visibility: hidden; opacity: 0; transition: opacity .2s ease, visibility 0s linear .2s; }
    #topnav.site-header.is-open + .sh-scrim { visibility: visible; opacity: 1; transition: opacity .2s ease; }
    html.sh-menu-open { overflow: hidden; }
}

@media (min-width: 640px) {
    .sh-inner { padding-inline: 24px; }
    .sh-actions { gap: 10px; }
}

/* Very small phones: a narrower button leaves room for the menu toggle. */
@media (max-width: 359.98px) {
    .sh-cta { padding: 0 12px; }
}

/* ---------- Laptops and desktops: one row, links centred between the logo and the button */

@media (min-width: 1024px) {
    #topnav.site-header { --sh-height: 74px; }
    .sh-inner { display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); gap: 20px; }
    .sh-logo { justify-self: start; margin-right: 0; }
    .sh-logo img { width: 80px; }
    .sh-links { align-items: center; gap: 4px; }
    .sh-links a { height: 40px; padding: 0 10px; }
    .sh-actions { justify-self: end; }
    .sh-cta { height: 38px; }
    .sh-toggle { display: none; }
}
@media (min-width: 1200px) {
    /* The template's spacing: 15px padding and 10px margins on each side of every link. */
    .sh-links { gap: 20px; }
    .sh-links a { padding: 0 15px; }
}

@media (prefers-reduced-motion: reduce) {
    #topnav.site-header, #topnav.site-header *, .sh-scrim { transition-duration: .01ms !important; transition-delay: 0s !important; }
}
