/* Roboto variable font (Apache 2.0), self-hosted; latin + latin-ext cover Polish. */
@font-face {
    font-family: 'Roboto';
    font-style: normal;
    font-weight: 200 700;
    font-display: swap;
    src: url('../fonts/roboto-latin-ext.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: 'Roboto';
    font-style: normal;
    font-weight: 200 700;
    font-display: swap;
    src: url('../fonts/roboto-latin.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;
}

/* MudBlazor's theme provider injects `html, body * { scrollbar-width: thin }` at runtime, after this file. */
html {
    scrollbar-width: auto !important;
    scrollbar-color: auto !important;
}

.site-main {
    display: flex;
    flex-direction: column;
}

/* Fills the screen below the app bar so the footer starts off-screen; 0.75 = smallest MudBlazor main-content top padding ratio. */
.site-body {
    display: flex;
    flex-direction: column;
    flex: 1 0 auto;
    min-height: calc(100vh - var(--mud-appbar-height) * 0.75);
    min-height: calc(100dvh - var(--mud-appbar-height) * 0.75);
}

.site-footer {
    flex-shrink: 0;
    background: var(--mud-palette-appbar-background);
    color: var(--mud-palette-appbar-text, #fff);
}

.site-footer-content {
    display: grid;
    grid-template-columns: minmax(0, 2fr) minmax(0, 1fr);
    gap: 2rem;
    padding-top: 2rem;
    padding-bottom: 2rem;
}

.site-footer-description {
    overflow-wrap: anywhere;
}

/* An empty paragraph (blank line from Enter) would otherwise collapse to zero height. */
.site-footer-description p:empty::after {
    content: "\00a0";
}

.site-footer-description img {
    max-width: 100%;
    height: auto;
}

.site-footer-description a {
    color: inherit;
    text-decoration: underline;
}

.site-footer-sitemap ul {
    list-style: none;
    margin: 0;
    padding: 0;
}

.site-footer-sitemap li + li {
    margin-top: 0.5rem;
}

.site-footer-copyright {
    background: rgba(0, 0, 0, 0.12);
}

.site-footer-credits {
    display: flex;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 0.75rem 2rem;
    padding-top: 1rem;
    padding-bottom: 1rem;
    overflow-wrap: anywhere;
}

.site-footer-credits .mud-link {
    text-decoration: underline;
}

/* Admin footer editor: the surface reuses .site-footer, so it looks like the published footer. */
.footer-editor-surface {
    border-radius: var(--mud-default-borderradius);
    padding: 1rem;
}

.footer-editor-surface:focus-within {
    outline: 2px solid var(--mud-palette-primary);
    outline-offset: 2px;
}

.footer-editor-surface .ProseMirror {
    min-height: 6rem;
    outline: none;
}

.footer-editor-surface .ProseMirror > :first-child {
    margin-top: 0;
}

.footer-editor-surface .ProseMirror > :last-child {
    margin-bottom: 0;
}

.footer-editor-toolbar {
    border: 1px solid var(--mud-palette-lines-default);
    border-bottom: 0;
    border-radius: var(--mud-default-borderradius) var(--mud-default-borderradius) 0 0;
    min-height: 0;
}

/* Custom page body: shared by the public page and the admin editor, so the preview looks like the result. */
.site-page-content {
    overflow-wrap: anywhere;
    line-height: 1.6;
}

.site-page-content > :first-child {
    margin-top: 0;
}

.site-page-content p {
    margin: 0 0 1rem;
}

.site-page-content p:empty::after {
    content: "\00a0";
}

.site-page-content h2,
.site-page-content h3,
.site-page-content h4 {
    font-weight: 500;
    line-height: 1.3;
    margin: 1.5rem 0 0.75rem;
}

.site-page-content h2 { font-size: 1.75rem; }
.site-page-content h3 { font-size: 1.4rem; }
.site-page-content h4 { font-size: 1.2rem; }

.site-page-content ul,
.site-page-content ol {
    margin: 0 0 1rem;
    padding-left: 1.5rem;
}

.site-page-content li > p {
    margin: 0;
}

.site-page-content a {
    color: var(--mud-palette-primary);
}

.site-page-content img {
    display: block;
    max-width: 100%;
    height: auto;
    margin: 1rem 0;
}

.site-page-content blockquote {
    margin: 1rem 0;
    padding: 0.25rem 1rem;
    border-left: 4px solid var(--mud-palette-primary);
    color: var(--mud-palette-text-secondary);
}

.site-page-content hr {
    border: 0;
    border-top: 1px solid var(--mud-palette-lines-default);
    margin: 1.5rem 0;
}

.site-page-content table {
    border-collapse: collapse;
    margin: 1rem 0;
    max-width: 100%;
}

.site-page-content th,
.site-page-content td {
    border: 1px solid var(--mud-palette-lines-default);
    padding: 0.5rem 0.75rem;
    text-align: left;
    vertical-align: top;
}

.site-page-content th {
    background: var(--mud-palette-background-gray);
    font-weight: 500;
}

.site-page-content td p,
.site-page-content th p {
    margin: 0;
}

/* Admin page editor: the surface is a bordered page body below the toolbar. */
.page-editor-surface {
    border: 1px solid var(--mud-palette-lines-default);
    border-radius: 0 0 var(--mud-default-borderradius) var(--mud-default-borderradius);
}

.page-editor-surface .ProseMirror {
    min-height: 18rem;
}

.page-editor-surface .selectedCell {
    background: color-mix(in srgb, var(--mud-palette-primary) 20%, transparent);
}

.page-editor-surface .ProseMirror-selectednode {
    outline: 2px solid var(--mud-palette-primary);
}

/* Admin home page text editor: bordered like the page editor, but shorter. */
.home-editor-surface {
    border: 1px solid var(--mud-palette-lines-default);
    border-radius: 0 0 var(--mud-default-borderradius) var(--mud-default-borderradius);
}

.home-icon-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(4rem, 1fr));
    gap: 0.5rem;
    justify-items: center;
}

.editor-palette {
    display: grid;
    grid-template-columns: repeat(7, 1.5rem);
    gap: 0.4rem;
    padding: 0.5rem;
}

.editor-swatch {
    width: 1.5rem;
    height: 1.5rem;
    border-radius: 50%;
    border: 1px solid var(--mud-palette-lines-default);
    cursor: pointer;
}

.editor-swatch:focus-visible,
.editor-swatch-none:focus-visible {
    outline: 2px solid var(--mud-palette-primary);
    outline-offset: 2px;
}

.editor-swatch-none {
    grid-column: 1 / -1;
    background: none;
    border: 1px solid var(--mud-palette-lines-default);
    border-radius: var(--mud-default-borderradius);
    color: inherit;
    cursor: pointer;
    padding: 0.25rem 0.5rem;
}

/* Multi-column flow (as in the legacy list) so tall entries don't stretch their row. */
.entry-list {
    column-count: 1;
}

.entry-list-item {
    break-inside: avoid;
}

@media (min-width: 600px) {
    .entry-list {
        column-count: 2;
    }
}

@media (min-width: 960px) {
    .entry-list {
        column-count: 4;
    }
}

@media (max-width: 599px) {
    .site-footer-content {
        grid-template-columns: minmax(0, 1fr);
        gap: 1.5rem;
    }

    .site-footer-description:empty {
        display: none;
    }
}

.page-loading {
    display: flex;
    flex: 1;
    align-items: center;
    justify-content: center;
    min-height: 8rem;
}

/* Spinner behind a cap image: visible only until the (opaque) image has painted over it. */
.k-cap::before {
    content: "";
    position: absolute;
    top: 50%;
    left: 50%;
    width: 1.5rem;
    height: 1.5rem;
    margin: -0.75rem 0 0 -0.75rem;
    box-sizing: border-box;
    border: 3px solid var(--mud-palette-lines-default);
    border-top-color: var(--mud-palette-primary);
    border-radius: 50%;
    animation: k-cap-spin 0.8s linear infinite;
}

.k-cap > img:first-of-type {
    position: relative;
}

@keyframes k-cap-spin {
    to { transform: rotate(360deg); }
}

.admin-card {
    transition: border-color 0.15s, box-shadow 0.15s;
}

.admin-card:hover {
    border-color: var(--mud-palette-primary);
    box-shadow: var(--mud-elevation-4);
}

.valid.modified:not([type=checkbox]) {
    outline: 1px solid #26b050;
}

.invalid {
    outline: 1px solid red;
}

.validation-message {
    color: red;
}

.theme-presets {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(11rem, 1fr));
    gap: 0.75rem;
}

.theme-preset {
    padding: 0.25rem;
    border: 2px solid var(--mud-palette-lines-default);
    border-radius: var(--mud-default-borderradius);
    background: transparent;
    cursor: pointer;
    font: inherit;
}

.theme-preset:focus-visible {
    outline: 2px solid var(--mud-palette-primary);
    outline-offset: 2px;
}

.theme-preset-selected {
    border-color: var(--mud-palette-primary);
}

.theme-preset-bar {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem;
    border-radius: calc(var(--mud-default-borderradius) - 2px);
}

.theme-preset-dot {
    width: 1rem;
    height: 1rem;
    flex-shrink: 0;
    border-radius: 50%;
    border: 2px solid rgba(255, 255, 255, 0.8);
}

#blazor-error-ui {
    color-scheme: light only;
    background: #b32121;
    color: white;
    bottom: 0;
    box-shadow: 0 -1px 2px rgba(0, 0, 0, 0.2);
    box-sizing: border-box;
    display: none;
    left: 0;
    padding: 0.6rem 1.25rem 0.7rem 1.25rem;
    position: fixed;
    width: 100%;
    z-index: 1000;
}

    #blazor-error-ui .reload {
        color: white;
        text-decoration: underline;
        margin-left: 0.5rem;
    }

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

.blazor-error-boundary {
    background: url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iNTYiIGhlaWdodD0iNDkiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiIG92ZXJmbG93PSJoaWRkZW4iPjxkZWZzPjxjbGlwUGF0aCBpZD0iY2xpcDAiPjxyZWN0IHg9IjIzNSIgeT0iNTEiIHdpZHRoPSI1NiIgaGVpZ2h0PSI0OSIvPjwvY2xpcFBhdGg+PC9kZWZzPjxnIGNsaXAtcGF0aD0idXJsKCNjbGlwMCkiIHRyYW5zZm9ybT0idHJhbnNsYXRlKC0yMzUgLTUxKSI+PHBhdGggZD0iTTI2My41MDYgNTFDMjY0LjcxNyA1MSAyNjUuODEzIDUxLjQ4MzcgMjY2LjYwNiA1Mi4yNjU4TDI2Ny4wNTIgNTIuNzk4NyAyNjcuNTM5IDUzLjYyODMgMjkwLjE4NSA5Mi4xODMxIDI5MC41NDUgOTIuNzk1IDI5MC42NTYgOTIuOTk2QzI5MC44NzcgOTMuNTEzIDI5MSA5NC4wODE1IDI5MSA5NC42NzgyIDI5MSA5Ny4wNjUxIDI4OS4wMzggOTkgMjg2LjYxNyA5O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undary-text, "An error has occurred.")
    }

code {
    color: #c02d76;
}

.form-floating > .form-control-plaintext::placeholder, .form-floating > .form-control::placeholder {
    color: var(--bs-secondary-color);
    text-align: end;
}

.form-floating > .form-control-plaintext:focus::placeholder, .form-floating > .form-control:focus::placeholder {
    text-align: start;
}