/* =====================================================================
   App header (tools/navbar.py): logo on the left, page links on the right.
   Colours and font come from assets/theme.css (.nma-header tokens).
   Sizes are in px because the header sits outside the .nma-modern pages
   and app.css shrinks rem (html{font-size:62%}).
   ===================================================================== */

/* style.css gives body an 8px top margin, which shows as a strip above the header */
body:has(.nma-header) {
    margin-top: 0;
}

.nma-header {
    position: relative; /* scrolls away with the page */
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 8px 24px;
    padding: 3px clamp(16px, 3vw, 40px); /* bar height = logo + 6px */
    font-family: var(--font-ui);
    background: #eef2f6; /* light grey-blue (warm off-white alternative: #f4f1ec) */
    border-bottom: 1px solid #dde4ec;
    box-shadow: 0 1px 3px rgba(29, 43, 58, 0.05);
}

/* ---------- logo ---------- */

/* the logo link: global link rules add padding and line spacing around the image */
.nma-header > a {
    display: block;
    padding: 0;
    margin: 0;
    line-height: 0;
}

.nma-header .nma-header-logo {
    display: block;
    border-radius: 50%;
}

.nma-header .nma-header-logo-img {
    display: block;
    height: clamp(80px, 8vw, 116px);
    width: auto;
}

/* the shine animation (style.css) was tinted for the old beige header */
.nma-header .namstudio-logo::after {
    background: linear-gradient(
        135deg,
        rgba(255, 255, 255, 0) 45%,
        rgba(255, 255, 255, 0.85) 50%,
        rgba(255, 255, 255, 0) 55%
    );
}

/* ---------- page links ---------- */

.nma-header .nma-header-nav {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 4px;
    margin: 0;
    padding: 4px;
    background: var(--c-surface);
    border: 1px solid var(--c-border);
    border-radius: 999px;
}

.nma-header .nma-header-link {
    display: inline-block;
    padding: 9px 20px;
    font-family: var(--font-ui);
    font-size: 17px;
    font-weight: 500;
    line-height: 1.3;
    letter-spacing: normal;
    color: var(--c-ink-muted);
    text-decoration: none;
    border-radius: 999px;
    transition: background 0.15s ease, color 0.15s ease;
}

.nma-header .nma-header-link:hover,
.nma-header .nma-header-link:focus-visible {
    color: var(--c-primary-dark);
    background: var(--c-primary-soft);
}

.nma-header .nma-header-link.active {
    color: #fff;
    background: var(--c-primary);
    box-shadow: 0 1px 2px rgba(21, 107, 108, 0.3);
}

.nma-header .nma-header-link.active:hover {
    color: #fff;
    background: var(--c-primary-dark);
}

/* ---------- browser warning (shown by assets/browser-warning.js) ---------- */

.nma-header .browser-warning {
    flex: 1 1 320px;
    max-width: 640px;
    margin: 0 auto;
    padding: 8px 14px;
    font-size: 14px;
    line-height: 1.45;
    text-align: center;
    color: var(--c-ink);
    background: var(--c-accent-soft);
    border: 1px solid var(--c-accent);
    border-radius: var(--radius-md);
}

/* ---------- small screens ---------- */

@media (max-width: 640px) {
    .nma-header {
        justify-content: center;
    }

    .nma-header .nma-header-link {
        padding: 7px 13px;
        font-size: 16px;
    }
}

/* NMA-KIT page: NMAstudio's logo (link to Home) and the NMA-KIT logo on its right (an image only),
   at the same height */
.nma-header .nma-header-logos {
    display: flex;
    align-items: center;
    gap: clamp(10px, 1.2vw, 18px);
    line-height: 0;
}

.nma-header .nma-header-logos > a {
    display: block;
    line-height: 0;
}

.nma-header .nma-header-kit-logo {
    height: clamp(70px, 7vw, 100px);
    width: auto;
}

/* NMAstudio's logo on every page but Home (larger there): the same size everywhere, and next to the
   NMA-KIT logo it looks the same height (that image has some empty margin) */
.nma-header .nma-header-logo-img.is-compact {
    height: clamp(60px, 6vw, 86px);
    width: auto;
}

.nma-header .nma-header-kit-logo {
    display: block;
    cursor: default;
    pointer-events: none;
    user-select: none;
}
