/* Navigation */
.navbar {
    /* Holds the palette button in its top-right corner. */
    position: relative;
    background: linear-gradient(145deg, color-mix(in srgb, var(--accent-2) 7%, var(--surface)) 0%, color-mix(in srgb, var(--accent-2) 5%, var(--surface)) 60%, var(--surface) 100%);
    border-bottom: 1px solid color-mix(in srgb, var(--accent-2) 30%, var(--surface));
    box-shadow: 0 14px 30px color-mix(in srgb, var(--accent) 12%, transparent);
}

/* The header logo's slot — a live widget where the 56px logo used to be.

   The mount element's height IS the trigger's size: the widget reads its box
   and clamps it to 2.5–12rem (WIDGET_TRIGGER_MIN/MAX_SIZE_REM), so the size
   is stated here once, as a host would. Square because the trigger is a
   circle and its helper caption is display:none by default — nothing else
   renders in the mount. Same 56px as the logo it replaced so the brand row
   does not move. flex:none so the row cannot squeeze it on a narrow phone. */
.navbar-widget-mount {
    width: 3.5rem;
    height: 3.5rem;
    flex: none;
}

/* Set by landing-page-tabs.js when this widget could not mount. */
.navbar-widget-mount[hidden] {
    display: none;
}

.navbar .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: clamp(0.75rem, 2vw, 1.5rem) clamp(1rem, 4vw, 2rem);
    flex-wrap: wrap;
    gap: clamp(0.5rem, 2vw, 1.5rem);
}

.navbar-brand h1 {
    font-size: clamp(1rem, 3vw, 1.25rem);
    color: var(--accent-text);
    margin-bottom: 0;
}

.navbar-brand .tagline {
    font-size: clamp(0.75rem, 1.5vw, 0.875rem);
    color: var(--text-faint);
    font-weight: 400;
    margin-bottom: 0;
}

.navbar-code {
    font-family: var(--font-mono);
    color: var(--text-faint);
    white-space: wrap;
    /* One declaration, not two: a clamp() used to sit three lines above this and
       was silently overridden by `smaller` in the same block, so the responsive
       sizing never applied. `smaller` is what has always shipped. */
    font-size: smaller;
}

.navbar-code code {
    /* `color: inherit` finishes the reset the next line starts. Cancelling the
       pinned background of the auth-and-code.css code island WITHOUT cancelling
       its pinned #c62828 ink dropped a fixed red onto the THEMED navbar surface:
       2.84-3.62:1 on all 24 dark themes. Inheriting takes the parent's repaired
       --text-faint, which is also already the look of the sibling .comment. */
    color: inherit;
    background: none;
    /* A breath inside the border: at 0 the box touched the glyphs and read as
       a stray unstyled chip (2026-10-28 review). */
    padding: 0.1em 0.4em;
    border-radius: 0;
    /* The island's border is a pinned #e0e0e0 too, and was the one piece of the
       reset left out: invisible on a light theme, a bright outline on every
       dark one. Kept as a box (that is the light look), but in the theme's own
       border colour. */
    border-color: var(--border);
    /* 600, not `bolder`. `bolder` against the inherited 400 computes to 700,
       and the old Google request only offered 400/500/600 — so font matching
       already fell back to 600 and rendered exactly this. Saying it outright
       means the rule matches what ships, and it no longer depends on which
       weights happen to be available. */
    font-weight: 600;
}

.navbar-code .comment {
    color: var(--text-faint);
    font-weight: lighter;
    font-style: italic;
    font-size: x-small;
}

.docs-link,
.footer-link,
.navbar-home-link {
    color: var(--accent-text);
    text-decoration: none;
    transition: color 0.2s ease, opacity 0.2s ease;
}

.docs-link:hover,
.footer-link:hover,
.navbar-home-link:hover,
.docs-link:focus-visible,
.footer-link:focus-visible,
.navbar-home-link:focus-visible {
    color: var(--accent-strong);
}

/* The ring used to sit in the rule above, so a mouse hover drew it too and the
 * two states were one picture. Focus only — and in --accent-text rather than the
 * raw --accent fill, which is what every other ring on the site uses. See
 * .landing-tab-button in landing-tabs.css. */
.docs-link:focus-visible,
.footer-link:focus-visible,
.navbar-home-link:focus-visible {
    outline: 2px solid var(--accent-text);
    outline-offset: 3px;
}

.navbar-brand-row {
    display: flex;
    align-items: center;
    gap: 12px;
}


/* The reading pages (privacy, terms, /threats/): the brand alone, centred over
   the centred card. Their brand is a <p>, not the <h1> the landing page and the
   404 wear, because there the page title is the <h1>. */
.navbar--center {
    text-align: center;
}

.navbar--center .container,
.navbar--center .navbar-brand-row {
    justify-content: center;
}

.navbar-brand .navbar-title {
    font-size: clamp(1rem, 3vw, 1.25rem);
    font-weight: 700;
    color: var(--accent-text);
    margin-bottom: 0;
}

/* Print: a reading page prints its text. The header and footer are site chrome,
   and their logos are live widgets: a sign-in button is no mark on paper. */
@media print {
    .navbar--center,
    .navbar--center ~ footer {
        display: none;
    }
}

/* The header shield's glow reaches past the screen edge once the brand row
   grows (larger text on a 320px phone: the page scrolled 7px sideways). `clip`,
   not `hidden`: no scroll container, and the glow above and below is untouched;
   only what is already past the viewport's side is cut. Same fix as .dz-bar. */
.navbar {
    overflow-x: clip;
}

/* The palette button, top right of the header (index.html). Icon only; the
   flip-and-fill open state comes from .landing-palette-link in landing-tabs.css. */
.navbar .navbar-palette-toggle {
    position: absolute;
    top: clamp(0.5rem, 1.5vw, 1rem);
    right: clamp(0.75rem, 2vw, 1.5rem);
    z-index: 1;
    min-width: 24px;
    justify-content: center;
    color: var(--accent-text);
    font-size: 1.35rem;
    cursor: pointer;
}

.navbar .navbar-palette-toggle:hover {
    color: var(--text);
}

.navbar .navbar-palette-toggle:focus-visible {
    outline: 2px solid var(--accent-text);
    outline-offset: 3px;
}

.navbar .navbar-palette-toggle:disabled {
    opacity: 0.4;
    cursor: default;
}
