/*
 * The only hand-written global stylesheet in the application.
 *
 * Component styling belongs in that component's .razor.css; everything visual is expressed
 * with Fluent UI components and design tokens. What is left here is document-level setup
 * and the framework's own error banner, neither of which belongs to any one component.
 */

/* ---- Panel Hub's typeface ----------------------------------------------------------------
 *
 * Poppins, self-hosted rather than pulled from a font CDN: the mobile head has to render the
 * same as the browser head with no network at all. Only the weights Fluent's tokens ask for
 * (regular 400, medium 500, semibold 600, bold 700) and only the Latin subsets, which is what
 * keeps all eight files under 60 KB together. Poppins is licensed under the SIL Open Font
 * License 1.1.
 */

@font-face {
    font-family: 'Poppins';
    font-style: normal;
    font-weight: 400;
    font-display: swap;
    src: url(fonts/poppins-latin-400.woff2) format('woff2');
    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;
}

@font-face {
    font-family: 'Poppins';
    font-style: normal;
    font-weight: 400;
    font-display: swap;
    src: url(fonts/poppins-latin-ext-400.woff2) format('woff2');
    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-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

@font-face {
    font-family: 'Poppins';
    font-style: normal;
    font-weight: 500;
    font-display: swap;
    src: url(fonts/poppins-latin-500.woff2) format('woff2');
    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;
}

@font-face {
    font-family: 'Poppins';
    font-style: normal;
    font-weight: 500;
    font-display: swap;
    src: url(fonts/poppins-latin-ext-500.woff2) format('woff2');
    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-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

@font-face {
    font-family: 'Poppins';
    font-style: normal;
    font-weight: 600;
    font-display: swap;
    src: url(fonts/poppins-latin-600.woff2) format('woff2');
    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;
}

@font-face {
    font-family: 'Poppins';
    font-style: normal;
    font-weight: 600;
    font-display: swap;
    src: url(fonts/poppins-latin-ext-600.woff2) format('woff2');
    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-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

@font-face {
    font-family: 'Poppins';
    font-style: normal;
    font-weight: 700;
    font-display: swap;
    src: url(fonts/poppins-latin-700.woff2) format('woff2');
    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;
}

@font-face {
    font-family: 'Poppins';
    font-style: normal;
    font-weight: 700;
    font-display: swap;
    src: url(fonts/poppins-latin-ext-700.woff2) format('woff2');
    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-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

/* The typeface reaches Fluent as design tokens, so every component picks it up — including
 * the web components, which read the custom property through their shadow root.
 *
 * Fluent writes its own token values into an adopted stylesheet whose selector is `html`, and
 * an adopted stylesheet is cascaded after this file. `:root` is a pseudo-class, so it outranks
 * `html` on specificity and this wins anyway — which is what makes the font survive a
 * light/dark switch, where Fluent rebuilds every token from scratch.
 *
 * The brand colour is not set here: it reaches Fluent as `data-theme-color` on each head's
 * <body>, read before Blazor starts, and the whole brand ramp is generated from it. Both
 * values are also written down in Shared/Constants/PanelHubTheme.cs.
 */
:root {
    --fontFamilyBase: 'Poppins', 'Segoe UI', 'Segoe UI Web (West European)', -apple-system, BlinkMacSystemFont, Roboto, 'Helvetica Neue', sans-serif;
    --fontFamilyNumeric: 'Poppins', 'Segoe UI', 'Segoe UI Web (West European)', -apple-system, BlinkMacSystemFont, Roboto, 'Helvetica Neue', sans-serif;
}

html,
body {
    height: 100%;
    margin: 0;
}

/* The shell owns the viewport and scrolls its content area, so the document itself never
   scrolls sideways. */
body {
    overflow-x: hidden;
    background: var(--colorNeutralBackground3);
}

/* Suppresses the FocusOnNavigate outline box on page headings. */
h1:focus,
h1:focus-visible {
    outline: none;
}

/* Framework error banner — hidden until Blazor sets display:block on it. Without this it
   sits in the page flow and pushes the layout past the viewport. */
#blazor-error-ui {
    display: none;
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 1000;
    padding: 0.6rem 1.25rem 0.7rem;
    background: #ffffe0;
    color: #000;
    box-shadow: 0 -1px 2px rgba(0, 0, 0, .2);
}

#blazor-error-ui .dismiss {
    cursor: pointer;
    position: absolute;
    right: 0.75rem;
    top: 0.5rem;
}

/* Blazor error boundary (framework requirement, not application styling). */
.blazor-error-boundary {
    background: #b32121;
    padding: 1rem;
    color: white;
}

.blazor-error-boundary::after {
    content: "An error has occurred.";
}
