/* Shared by the public site (with site.css) and the admin (with admin.css): fonts, design tokens and the site header. */

/* Source Sans 3 (SIL OFL 1.1), self-hosted, see fonts/SourceSans3-LICENSE.txt */
@font-face {
    font-family: "Source Sans 3";
    font-style: normal;
    font-display: swap;
    font-weight: 200 900;
    src: url(../fonts/source-sans-3-latin-ext-wght-normal.woff2) format("woff2-variations");
    unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
    font-family: "Source Sans 3";
    font-style: normal;
    font-display: swap;
    font-weight: 200 900;
    src: url(../fonts/source-sans-3-latin-wght-normal.woff2) format("woff2-variations");
    unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
/* Arial scaled to Source Sans 3's metrics, so text does not jump when the webfont arrives. */
@font-face {
    font-family: "Source Sans 3 Fallback";
    src: local("Arial");
    size-adjust: 92.25%;
    ascent-override: 110.6%;
    descent-override: 43.4%;
    line-gap-override: 0%;
}

:root {
    /* Brand: the navy of the SMFF logo plate and the yellow of its wings. */
    --navy: #254264;
    --navy-deep: #1a3150;
    --navy-ink: #14263d;
    --yellow: #f2c230;
    --sky: #e8eef5;

    --text: #1b2533;
    --muted: #556171;
    --line: #d9dfe6;
    --bg: #f4f6f8;
    --surface: #fff;
    --link: #1d5594;
    --link-hover: #12406f;

    --ok-fg: #17603a;
    --ok-bg: #e3f2e8;
    --closed-fg: #5a4300;
    --closed-bg: #fbefc8;
    --me-fg: #1d4a7a;
    --me-bg: #e1ebf7;

    --radius: 10px;
    --shadow-sm: 0 1px 2px rgba(20, 38, 61, .06), 0 2px 6px rgba(20, 38, 61, .06);
    --shadow-md: 0 4px 10px rgba(20, 38, 61, .08), 0 12px 28px rgba(20, 38, 61, .10);

    --wrap: 75rem;
    /* Text column width for news, articles and pages (672 px). Uploaded images are scaled to fit it,
       so keep ContentFileRules.ContentWidth in sync (a unit test checks this). */
    --measure: 42rem;

    --font: "Source Sans 3", "Source Sans 3 Fallback", "Segoe UI", system-ui, -apple-system, Roboto, sans-serif;
}

/* Always reserve the scrollbar's space so the layout doesn't shift between short and long pages. */
html { scrollbar-gutter: stable; }

.wrap { width: 100%; max-width: var(--wrap); margin-inline: auto; padding-inline: clamp(1rem, 3vw, 2rem); }

.site-header { background: var(--navy); color: #fff; font-family: var(--font); font-size: 1.125rem; line-height: 1.6; }
.header-bar { display: flex; align-items: center; justify-content: space-between; gap: 1rem; min-height: 4.75rem; }
.brand { display: flex; align-items: center; gap: .85rem; color: #fff; text-decoration: none; }
.brand:hover { color: #fff; }
/* The SMFF badge is itself a navy plate; the shadow lifts it off the navy header. */
.brand img { width: 46px; height: auto; flex: none; filter: drop-shadow(0 2px 3px rgb(5 15 30 / .55)); }
.brand-name { font-size: 1.6rem; font-weight: 700; letter-spacing: .015em; line-height: 1; }
.site-header :focus-visible { outline-color: var(--yellow); }

.header-actions { display: flex; align-items: center; gap: .5rem; }
.icon { width: 1.25rem; height: 1.25rem; flex: none; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; }

.login-link, .account summary, .menu-toggle {
    display: inline-flex; align-items: center; gap: .5rem;
    min-height: 2.75rem; padding: .4rem .9rem;
    border: 1px solid rgba(255, 255, 255, .35); border-radius: 999px;
    background: transparent; color: #fff; font: inherit; font-weight: 600; font-size: 1rem;
    text-decoration: none; cursor: pointer; white-space: nowrap;
}
.login-link:hover, .account summary:hover, .menu-toggle:hover { background: rgba(255, 255, 255, .1); color: #fff; text-decoration: none; }

.account { position: relative; }
.account summary { list-style: none; }
.account summary::-webkit-details-marker { display: none; }
.account-name { max-width: 14rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.account-panel {
    position: absolute; right: 0; top: calc(100% + .5rem); z-index: 5;
    min-width: 16rem; padding: 1rem;
    background: var(--surface); color: var(--text); border-radius: var(--radius); box-shadow: var(--shadow-md);
}
.account-who { margin: 0 0 .5rem; color: var(--muted); font-size: 1rem; }
.account-panel ul { list-style: none; margin: 0 0 .75rem; padding: 0; }
.account-panel li a { display: block; padding: .5rem 0; font-weight: 600; color: var(--link); }
.account-panel :focus-visible { outline-color: var(--link); }
.account-panel form { margin: 0; }
.account-panel .button-quiet {
    display: inline-flex; align-items: center; justify-content: center; width: 100%;
    min-height: 2.75rem; padding: .5rem 1.2rem; font: inherit; font-weight: 600;
    border: 0; border-radius: 6px; background: var(--bg); color: var(--navy-ink); cursor: pointer;
}
.account-panel .button-quiet:hover { background: var(--sky); color: var(--navy-ink); }

.menu-toggle { display: none; }

@media (max-width: 860px) {
    .header-bar { min-height: 4rem; }
    .brand img { width: 38px; }
    .brand-name { font-size: 1.3rem; }
    .menu-toggle { display: inline-flex; }
}

@media (max-width: 480px) {
    .header-bar { gap: .5rem; }
    .brand { gap: .6rem; min-width: 0; }
    .brand img { width: 32px; }
    .brand-name { font-size: 1.1rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
    .header-actions { flex: none; }
    .login-link { display: none; }
    .account summary, .menu-toggle { padding: .4rem .75rem; }
    .account-name { display: none; }
    .account-panel { right: -4.5rem; }
}
