@import "./calihub-tokens.css";

/* Schriften lokal aus wwwroot/fonts statt von Google Fonts: Beim Nachladen von
   fonts.googleapis.com ginge die IP-Adresse jedes Besuchers an Google, und dafür
   bräuchte es eine Einwilligung (siehe Datenschutzerklärung). Die Dateien sind
   die variablen woff2-Schnitte von Google Fonts (SIL Open Font License), nur
   Latin und Latin Extended – mehr Schriftsysteme nutzt die App nicht. Eine
   Datei deckt dabei alle Gewichte ab, deshalb der Bereich in font-weight. */
@font-face {
    font-family: 'Montserrat';
    font-style: normal;
    font-weight: 500 700;
    font-display: swap;
    src: url('../fonts/montserrat-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: 'Montserrat';
    font-style: normal;
    font-weight: 500 700;
    font-display: swap;
    src: url('../fonts/montserrat-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;
}

@font-face {
    font-family: 'Source Sans 3';
    font-style: normal;
    font-weight: 400 500;
    font-display: swap;
    src: url('../fonts/source-sans-3-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: 'Source Sans 3';
    font-style: normal;
    font-weight: 400 500;
    font-display: swap;
    src: url('../fonts/source-sans-3-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;
}


body {
    font-family: var(--calids-type-body), system-ui, Arial, sans-serif;
    color: var(--color-text-body);
    margin: 0;
}

/* Formularelemente erben font-family nicht: das Browser-Stylesheet setzt ihnen
   eine eigene Schrift, und ein direkt gesetzter Wert schlägt jede Vererbung —
   auch ein !important auf body. Deshalb hier einmal zentral statt pro Seite.
   Bewusst nur font-family (nicht die font-Kurzform), damit Größe und Gewicht
   der Steuerelemente unverändert bleiben. Mud-Komponenten sind davon nicht
   betroffen, deren Klassenregeln gewinnen gegen diese Element-Selektoren; die
   laufen über MudTheme.Typography (Theme/CaliTheme.cs). */
input, button, textarea, select, optgroup {
    font-family: inherit;
}

/* Grundverhalten für Knöpfe. Die Seiten sind darauf gebaut: Ein <button> ist
   zunächst eine unsichtbare Hülle (kein Rahmen, kein Hintergrund, kein
   Innenabstand), zentriert seinen Inhalt, erbt die Textfarbe und lässt sich
   nicht markieren – Kacheln, Chips, Tabs, Schalter und Listenzeilen setzen nur
   noch, was sie anders wollen. Bis Oktober 2026 kam das unbemerkt aus
   MudBlazors globalem Reset; seit mudblazor-scope.css erreicht der nur noch
   MudBlazor-Komponenten, deshalb steht es jetzt hier als unsere Vorgabe.
   Bewusst nicht übernommen: MudBlazors outline: 0. Ohne Fokusrahmen sieht bei
   Tastaturbedienung niemand, wo er ist; der Browser zeigt ihn nur dann
   (:focus-visible), nicht beim Klicken. */
button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    position: relative;
    vertical-align: middle;
    margin: 0;
    padding: 0;
    border: 0;
    border-radius: 0;
    background-color: transparent;
    color: inherit;
    text-decoration: none;
    cursor: pointer;
    user-select: none;
}

/* Der Neu-laden-Link der Fehlerleiste in unserer Linkfarbe. Eigens nötig, weil
   mudblazor-scope.css MudBlazors spezifischere Regel dafür (#blazor-error-ui
   .reload) per revert zurücknimmt – und revert verwirft dabei auch das
   schwächere a { color } weiter unten. */
#blazor-error-ui .reload {
    color: var(--calids-color-primary-600);
}

/* Layout-Wurzel als Flex-Spalte: Seiten können damit die Resthöhe unter dem
   Header belegen (z. B. fixierter Kopfbereich + intern scrollende Liste im
   Vergleich). Für normale Seiten ändert sich nichts (flex-grow 0 = Blockfluss). */
#app {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* Icons werden lokal aus wwwroot/icons geladen (keine Google-Icon-Font mehr).
   Die SVG wird als Maske gelegt und mit currentColor gefüllt, damit die
   bestehenden Regeln in den Seiten-Stylesheets weiter greifen: `font-size`
   bestimmt über 1em die Kantenlänge, `color` die Icon-Farbe.
   Das Markup dazu erzeugt die Icon-Komponente (Components/Icon.razor). */
.material-icons {
    display: inline-block;
    flex: none;
    width: 1em;
    height: 1em;
    vertical-align: -0.15em;
    background-color: currentColor;
    -webkit-mask: var(--calids-icon-url) no-repeat center / contain;
    mask: var(--calids-icon-url) no-repeat center / contain;
}

h1, h2, h3, h4, h5, h6 {
    font-family: var(--calids-type-heading), sans-serif;
    color: var(--color-text-headings);
}

h1 {
    color: var(--color-text-headings);
    font-family: var(--calids-type-heading);
    font-size: var(--calids-fontsize-h1);
    font-style: normal;
    font-weight: 700;
    line-height: var(--calids-line-height-h1);
}

a {
    color: var(--calids-color-primary-600);
}

    a:hover {
        color: var(--calids-color-primary-700);
    }


#blazor-error-ui {
    color-scheme: light only;
    background: lightyellow;
    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 .dismiss {
        cursor: pointer;
        position: absolute;
        right: 0.75rem;
        top: 0.5rem;
    }

.blazor-error-boundary {
    background: url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iNTYiIGhlaWdodD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4N0wyNjEuNzk1IDg0LjAxNjEgMjY1LjM4IDg0LjAxNjEgMjY3LjgyMSA2OS43NDc1QzI2Ny44NiA2OS43MzA5IDI2Ny44NzkgNjkuNTg3NyAyNjcuODc5IDY5LjMxNzkgMjY3Ljg3OSA2Ny4xMTgyIDI2Ni40NDggNjYuMDE4MyAyNjMuNTg2IDY2LjAxODNaTTI2My41NzYgODYuMDU0N0MyNjEuMDQ5IDg2LjA1NDcgMjU5Ljc4NiA4Ny4zMDA1IDI1OS43ODYgODkuNzkyMSAyNTkuNzg2IDkyLjI4MzcgMjYxLjA0OSA5My41Mjk1IDI2My41NzYgOTMuNTI5NSAyNjYuMTE2IDkzLjUyOTUgMjY3LjM4NyA5Mi4yODM3IDI2Ny4zODcgODkuNzkyMSAyNjcuMzg3IDg3LjMwMDUgMjY2LjExNiA4Ni4wNTQ3IDI2My41NzYgODYuMDU0N1oiIGZpbGw9IiNGRkU1MDAiIGZpbGwtcnVsZT0iZXZlbm9kZCIvPjwvZz48L3N2Zz4=) no-repeat 1rem/1.8rem, #b32121;
    padding: 1rem 1rem 1rem 3.7rem;
    color: white;
}

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

.loading-progress {
    position: absolute;
    display: block;
    width: 8rem;
    height: 8rem;
    inset: 20vh 0 auto 0;
    margin: 0 auto 0 auto;
}

    .loading-progress circle {
        fill: none;
        stroke: #e0e0e0;
        stroke-width: 0.6rem;
        transform-origin: 50% 50%;
        transform: rotate(-90deg);
    }

        .loading-progress circle:last-child {
            stroke: #1b6ec2;
            stroke-dasharray: calc(3.141 * var(--blazor-load-percentage, 0%) * 0.8), 500%;
            transition: stroke-dasharray 0.05s ease-in-out;
        }

.loading-progress-text {
    position: absolute;
    text-align: center;
    font-weight: bold;
    inset: calc(20vh + 3.25rem) 0 auto 0.2rem;
}

    .loading-progress-text:after {
        content: var(--blazor-load-percentage-text, "Loading");
    }

/* Zwischenzustände des AuthorizeRouteView (Prüfung läuft / falsche Rolle). */
.access-denied {
    max-width: 640px;
    margin: 0 auto;
    padding: 48px 24px;
    text-align: center;
}

    .access-denied h1 {
        margin: 0 0 8px;
        font-size: 22px;
    }

    .access-denied p {
        margin: 0 0 16px;
        font-size: 14px;
        color: #5a6b76;
    }


.titel-small {
    color: var(--calihub-v1-sys-light-headings, var(--color-text-headings, #102A43));
    /* calihub v1/title/small */
    font-family: var(--calids-type-heading, Montserrat);
    font-size: var(--font-title-title-small-size, 20px);
    font-style: normal;
    font-weight: 500;
    line-height: var(--font-title-title-small-line-height, 28px); /* 140% */
}


/*Mud Zeug*/

/* Gilt für die übrigen Mud-Komponenten mit Button-Charakter (Dialog-Aktionen,
   Datepicker). Die Buttons der Anwendung selbst sind CaliButton und davon
   nicht betroffen. */
.mud-button {
    text-transform: none;
    box-shadow: none;
}
