/*
 * Offene Portalseite (eigene Adresse, ohne Hub-Rahmen): Akten fuer Dritte.
 * Schlicht und hell, auf dem Handy zuerst. Eigene Datei, weil die CSP keine
 * <style>-Bloecke erlaubt.
 */

:root {
    --grund: #f6f7fb;
    --flaeche: #ffffff;
    --text: #1e293b;
    --leise: #64748b;
    --rand: #e2e8f0;
    --akzent: #1e293b;
    --link: #1d4ed8;
    --fehler: #b91c1c;
    --fehler-grund: #fef2f2;
    --erfolg: #166534;
    --erfolg-grund: #f0fdf4;
}

* { box-sizing: border-box; }

body {
    margin: 0;
    background: var(--grund);
    color: var(--text);
    font: 16px/1.6 -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Arial, sans-serif;
}

a { color: var(--link); }

.kopf {
    background: var(--akzent);
    color: #fff;
    padding: 12px 16px;
    display: flex;
    gap: 8px 16px;
    align-items: center;
    flex-wrap: wrap;
}
.kopf .marke { font-weight: 600; font-size: 17px; margin-right: auto; }
.sprachen { display: flex; gap: 4px; flex-wrap: wrap; }
.sprachen a {
    color: #fff;
    opacity: .75;
    text-decoration: none;
    font-size: 14px;
    padding: 4px 8px;
    border-radius: 6px;
}
.sprachen a:hover { opacity: 1; }
.sprachen a.aktiv { opacity: 1; background: rgba(255, 255, 255, .16); font-weight: 600; }
.abmelden { margin: 0; }

.inhalt { max-width: 860px; margin: 0 auto; padding: 20px 16px 48px; }

.karte {
    background: var(--flaeche);
    border: 1px solid var(--rand);
    border-radius: 12px;
    padding: 20px;
    margin: 0 0 16px;
}
.karte.schmal { max-width: 520px; margin: 32px auto; }

h1 { font-size: 22px; margin: 0 0 10px; line-height: 1.3; }
h2 { font-size: 18px; margin: 0 0 12px; }
h3 { font-size: 16px; margin: 20px 0 8px; }
.gruss { margin: 4px 0 16px; }
.leise { color: var(--leise); font-size: 14px; }
.leer { color: var(--leise); margin: 0; }
.hinweis { color: var(--leise); font-size: 13px; margin: 24px 0 0; }
.zurueck { margin: 0 0 12px; }

.meldung { border-radius: 8px; padding: 10px 12px; margin: 0 0 16px; }
.meldung.fehler { background: var(--fehler-grund); color: var(--fehler); border: 1px solid #fecaca; }
.meldung.erfolg { background: var(--erfolg-grund); color: var(--erfolg); border: 1px solid #bbf7d0; }

.formular label { display: block; font-weight: 600; margin: 14px 0 6px; }
.formular input[type="email"],
.formular input[type="text"] {
    width: 100%;
    max-width: 420px;
    padding: 10px 12px;
    border: 1px solid var(--rand);
    border-radius: 8px;
    font: inherit;
    background: var(--flaeche);
    color: var(--text);
}
.formular input[type="file"] { max-width: 100%; font: inherit; }
.code-form input[type="text"] { font-size: 24px; letter-spacing: .3em; max-width: 220px; }
.knopfleiste { margin-top: 16px; display: flex; gap: 10px; flex-wrap: wrap; }
.nachfassen { margin-top: 12px; }

.knopf {
    display: inline-block;
    padding: 9px 16px;
    border: 1px solid var(--rand);
    border-radius: 8px;
    background: var(--flaeche);
    color: var(--text);
    font: inherit;
    cursor: pointer;
}
.knopf.haupt { background: var(--akzent); border-color: var(--akzent); color: #fff; font-weight: 600; }
.knopf.schlicht { border-color: transparent; background: transparent; padding-left: 0; padding-right: 0; color: var(--link); }
.knopf.schlicht.hell { color: #fff; opacity: .85; padding: 4px 8px; font-size: 14px; }

.liste { list-style: none; margin: 0; padding: 0; }
.liste li {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 4px 12px;
    flex-wrap: wrap;
    padding: 10px 0;
    border-top: 1px solid var(--rand);
}
.liste li:first-child { border-top: 0; padding-top: 0; }
.liste a { overflow-wrap: anywhere; }

/* Gerenderte Notizen */
.text { overflow-wrap: break-word; }
.text > :first-child { margin-top: 0; }
.text h1 { font-size: 21px; }
.text h2 { font-size: 18px; margin-top: 24px; }
.text h3 { font-size: 16px; }
.text table { border-collapse: collapse; display: block; overflow-x: auto; max-width: 100%; margin: 12px 0; }
.text th, .text td { border: 1px solid var(--rand); padding: 6px 10px; text-align: left; vertical-align: top; }
.text th { background: var(--grund); }
.text blockquote { margin: 12px 0; padding: 4px 14px; border-left: 3px solid var(--rand); color: var(--leise); }
.text code { background: var(--grund); padding: 1px 5px; border-radius: 4px; font-size: 14px; }
.text pre { background: var(--grund); padding: 12px; border-radius: 8px; overflow-x: auto; }
.text img { max-width: 100%; }

/* Zeitleiste: eine Liste mit Linie und Punkten. Die eigene Ueberschrift der
   Notiz entfaellt, die Karte hat schon eine. */
.zeitleiste > h1:first-child { display: none; }
.zeitleiste > h1:first-child + * { margin-top: 0; }
.zeitleiste ul { list-style: none; padding-left: 0; margin: 0; }
.zeitleiste ul > li {
    position: relative;
    padding: 0 0 14px 22px;
    border-left: 2px solid var(--rand);
    margin-left: 6px;
}
.zeitleiste ul > li:last-child { border-left-color: transparent; }
.zeitleiste ul > li::before {
    content: '';
    position: absolute;
    left: -7px;
    top: 6px;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: var(--flaeche);
    border: 2px solid var(--akzent);
}

/* Obsidian-Callouts (CalloutRenderer) */
.callout { border: 1px solid var(--rand); border-left: 4px solid var(--link); border-radius: 8px; padding: 10px 14px; margin: 12px 0; background: var(--grund); }
.callout-titel { font-weight: 600; display: flex; gap: 6px; }
.callout-warnung, .callout-frage { border-left-color: #d97706; }
.callout-fehler { border-left-color: var(--fehler); }
.callout-erfolg, .callout-tipp { border-left-color: var(--erfolg); }
.callout-zitat { border-left-color: var(--leise); }

@media (prefers-color-scheme: dark) {
    :root {
        --grund: #0f141c;
        --flaeche: #171d27;
        --text: #e5e9f0;
        --leise: #94a3b8;
        --rand: #2a3240;
        --akzent: #0b1220;
        --link: #93b4fd;
        --fehler: #fca5a5;
        --fehler-grund: #2a1515;
        --erfolg: #86efac;
        --erfolg-grund: #11251a;
    }
    .meldung.fehler { border-color: #5b2020; }
    .meldung.erfolg { border-color: #1d4a2c; }
}
