@charset "UTF-8";

/* ===== Fonts ===== */

@font-face {
    font-family: "Gentium";
    src: url("/fonts/Gentium-Regular.woff2") format("woff2");
    font-weight: normal;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: "Gentium";
    src: url("/fonts/Gentium-Italic.woff2") format("woff2");
    font-weight: normal;
    font-style: italic;
    font-display: swap;
}

@font-face {
    font-family: "Gentium";
    src: url("/fonts/Gentium-Bold.woff2") format("woff2");
    font-weight: bold;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: "Gentium";
    src: url("/fonts/Gentium-BoldItalic.woff2") format("woff2");
    font-weight: bold;
    font-style: italic;
    font-display: swap;
}

@font-face {
    font-family: "UnifrakturMaguntia";
    src: url("/fonts/unifrakturmaguntia.woff2") format("woff2");
    font-weight: normal;
    font-style: normal;
    font-display: swap;
}

/* ===== Variablen ===== */

:root {
    --rot: #e00;
    --rot-text: #fff;
    --orange: #e80;
    --orange-text: #000;
    --gelb: #dc0;
    --gelb-text: #000;
    --gruen: #0a0;
    --gruen-text: #000;
    --cyan: #09c;
    --cyan-text: #fff;
    --blau: #22e;
    --blau-text: #fff;
    --indigo: #60c;
    --indigo-text: #fff;
    --violett: #90e;
    --violett-text: #fff;
    --pink: #e08;
    --pink-text: #fff;
}

/* ===== Gemeinsam (Desktop + Mobile) ===== */

* {
    scrollbar-width: none;
}

html {
    font-size: 15px;
}

body {
    font-family: Gentium, Palatino, "Palatino Linotype", Georgia, serif;
    background-color: #fff;
    color: #000;
}

main {
    overflow-y: auto;
}

h1 {
    font-weight: 400;
    margin-top: 4rem;
    margin-bottom: 1.5rem;
    font-size: 3.2rem;
    line-height: 1;
}

h2 {
    font-style: italic;
    font-weight: 400;
    margin-top: 2.1rem;
    margin-bottom: 1.4rem;
    font-size: 2.2rem;
    line-height: 1;
}

h3 {
    font-style: italic;
    font-weight: 400;
    font-size: 1.7rem;
    margin-top: 2rem;
    margin-bottom: 1.4rem;
    line-height: 1;
}

p, dl, ol, ul {
    font-size: 1.4rem;
    line-height: 2rem;
}

p {
    margin-top: 1.4rem;
    margin-bottom: 1.4rem;
}

article {
    padding: 3rem 0;
}

article > h1 {
    position: sticky;
    top: -2px;
    background: #fff;
    padding: 0.5rem 0;
    margin-top: 0;
    z-index: 4;
    text-align: center;
}

article section h2 {
    position: sticky;
    top: calc(4.2rem - 2px);
    background: #fff;
    padding: 0.3rem 0;
    margin-top: 0;
    z-index: 3;
}

article section h3 {
    position: sticky;
    top: calc(7rem - 2px);
    background: #fff;
    padding: 0.2rem 0;
    margin-top: 0;
    z-index: 2;
}

a:link, a:visited {
    color: inherit;
    text-underline-offset: 0.1em;
    text-decoration-thickness: 0.05em;
}

hr {
    display: block;
    height: 1px;
    border: 0;
    border-top: 1px solid #000;
    margin: 1em 0;
    padding: 0;
}

code, pre > code {
    font-family: Consolas, "Liberation Mono", Menlo, Courier, monospace;
    font-size: 1.0rem;
    line-height: 1.42;
}

pre > code {
    font-size: 0.9rem;
    overflow-x: auto;
    display: block;
}

blockquote {
    font-size: 1.4rem;
    font-style: italic;
}

.summary {
    font-size: 1.1rem;
    font-style: italic;
}

/* Navigation: gemeinsam */

header {
    background: #fff;
    overflow: hidden;
}

header nav details {
    font-family: "Gill Sans", "Gill Sans MT", Calibri, "Helvetica Neue", Helvetica, sans-serif;
    font-size: 1.1rem;
    line-height: 1.6;
    display: flex;
}

header nav details summary {
    list-style: none;
    cursor: pointer;
    user-select: none;
    display: flex;
}

header nav details summary::-webkit-details-marker {
    display: none;
}

header nav details summary::marker {
    content: "";
}

.site-title {
    font-family: "UnifrakturMaguntia", serif;
    text-decoration: none;
    color: #000;
    font-weight: bold;
    margin: 0;
    padding: 0;
    display: flex;
    align-items: center;
}

buchstabe:nth-child(9n+1) { color: var(--rot); }
buchstabe:nth-child(9n+2) { color: var(--orange); }
buchstabe:nth-child(9n+3) { color: var(--gelb); }
buchstabe:nth-child(9n+4) { color: var(--gruen); }
buchstabe:nth-child(9n+5) { color: var(--cyan); }
buchstabe:nth-child(9n+6) { color: var(--blau); }
buchstabe:nth-child(9n+7) { color: var(--indigo); }
buchstabe:nth-child(9n+8) { color: var(--violett); }
buchstabe:nth-child(9n)   { color: var(--pink); }

header nav ul {
    list-style: none;
    padding: 0;
    margin: 0;
    font-size: 1.1rem;
    display: flex;
}

header nav li {
    margin: 0;
}

header nav li a {
    display: block;
    padding: 0.4rem 0.8rem;
    border-radius: 0.3rem;
    text-decoration: none;
    font-weight: bold;
    color: #fff;
    text-align: center;
}

header nav li a:hover {
    text-decoration: none;
}

header nav li.alles a { background: #000; }

header nav li:nth-child(2) a { background: var(--rot); color: var(--rot-text); }
header nav li:nth-child(3) a { background: var(--violett); color: var(--violett-text); }
header nav li:nth-child(4) a { background: var(--gelb); color: var(--gelb-text); }
header nav li:nth-child(5) a { background: var(--gruen); color: var(--gruen-text); }
header nav li:nth-child(6) a { background: #000; color: #fff; }

article img {
    width: 100%;
    height: auto;
}

sprache { color: var(--orange); }
wort { color: var(--rot); }
sprachfamilie { color: var(--gelb); }
ort { color: var(--gruen); }

article [id] { scroll-margin-top: 5rem; }

/* Tufte-Stil Fußnoten (per JS aus pandoc-footnotes konvertiert) */

article { position: relative; }

.sidenote-anchor {
    background-color: rgba(255, 220, 0, 0.35);
    cursor: pointer;
    transition: background-color 0.15s;
}

.sidenote-anchor:hover {
    background-color: rgba(255, 220, 0, 0.7);
}

.sidenote {
    position: absolute;
    right: -35%;
    width: 30%;
    font-size: 0.85rem;
    line-height: 1.4;
}

.sidenote figure { margin: 0.5rem 0; }
.sidenote img { width: 100%; height: auto; }

input.margin-toggle:checked + .sidenote { display: none; }

input.margin-toggle { display: none; }

section.footnotes { display: none; }

/* Artikel-Karten */

.card a {
    text-decoration: none;
    color: inherit;
    display: block;
}

.card .titel {
    font-size: 1.4rem;
    display: block;
}

.card .summary {
    display: block;
    margin-top: 0.25rem;
    font-size: 1.1rem;
    font-style: italic;
}

ul.alle-artikel {
    list-style: none;
    padding: 0;
    width: 100%;
    margin: 2rem 0;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 1rem;
}

ul.alle-artikel .card {
    border: 1px solid #000;
    padding: 1rem;
}

ul.alle-artikel .card.gesellschaftskunde { border-color: var(--rot); }
ul.alle-artikel .card.musikkunde { border-color: var(--violett); }
ul.alle-artikel .card.technikkunde { border-color: var(--gelb); }
ul.alle-artikel .card.sprachkunde { border-color: var(--gruen); }

ul.alle-artikel > li.gelesen { opacity: 0.4; }
ul.alle-artikel > li.gelesen:hover { opacity: 1; }

/* Kontaktformular */

.form-meldung {
    display: none;
    font-style: italic;
}

.form-meldung:target {
    display: block;
}

#kontakt-form {
    width: 100%;
    display: grid;
    grid-template-columns: 1fr auto;
    grid-template-rows: auto auto auto;
}

#kontakt-form textarea {
    width: 100%;
    font-family: inherit;
    font-size: 1.2rem;
    padding: 0.8rem;
    border: 1px solid #000;
    background: #fff;
    color: #000;
    resize: vertical;
    grid-row: 1;
    grid-column: 1;
    box-sizing: border-box;
}

#kontakt-form button {
    font-family: "Gill Sans", "Gill Sans MT", Calibri, "Helvetica Neue", Helvetica, sans-serif;
    font-size: 1.1rem;
    padding: 0.5rem;
    border: 1px solid #000;
    border-left: none;
    background: #000;
    color: #fff;
    cursor: pointer;
    grid-row: 1;
    grid-column: 2;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: space-between;
}

#kontakt-form button:hover {
    background: #fff;
    color: #000;
}

#kontakt-form .cf-turnstile {
    grid-column: 1 / -1;
    margin-top: 0.5rem;
}

/* ===== Desktop (> 760px) ===== */

body {
    width: 87.5%;
    margin-left: auto;
    margin-right: auto;
    padding-left: 12.5%;
    max-width: 1400px;
    position: relative;
    overflow: hidden;
    height: 100vh;
}

main {
    height: 100vh;
}

main article {
    max-width: 40rem;
    margin-left: auto;
    margin-right: auto;
}

header {
    position: fixed;
    top: 0;
    left: 0;
    padding: 0;
    height: 100vh;
    z-index: 10;
    display: flex;
    flex-direction: row;
    width: auto;
    max-width: none;
}

header nav {
    flex: 1;
    display: flex;
    flex-direction: row;
    height: 100%;
}

header nav details {
    flex-direction: row;
    height: 100%;
}

header nav details summary {
    align-items: center;
    padding: 0 1rem 0 5px;
}

.site-title {
    font-size: 9vh;
    flex-direction: column;
    justify-content: center;
    height: 100vh;
    line-height: 0.8;
}

header nav ul {
    flex-direction: column;
    justify-content: space-evenly;
    height: 100%;
}

header nav li:nth-child(2) a:hover,
header nav li.aktiv:nth-child(2) a,
header nav li:nth-child(3) a:hover,
header nav li.aktiv:nth-child(3) a,
header nav li:nth-child(4) a:hover,
header nav li.aktiv:nth-child(4) a,
header nav li:nth-child(5) a:hover,
header nav li.aktiv:nth-child(5) a,
header nav li:nth-child(6) a:hover,
header nav li.aktiv:nth-child(6) a { background: #fff; color: #000; }

header nav li.alles a:hover,
header nav li.alles.aktiv a { background: #fff; }

/* ===== Mobile (< 760px) ===== */

@media (max-width: 760px) {
    body {
        width: 84%;
        padding-left: 8%;
        padding-right: 8%;
        display: flex;
        flex-direction: column;
        height: 100dvh;
        overflow: hidden;
        max-width: none;
        position: static;
    }

    main {
        flex: 1;
        max-width: none;
        height: auto;
    }

    header {
        position: static;
        width: 100%;
        height: auto;
        padding: 5px 0;
        flex-shrink: 0;
        flex-direction: column;
    }

    header nav {
        flex-direction: column;
        height: auto;
    }

    header nav details {
        flex-direction: column;
        height: auto;
    }

    header nav details summary {
        padding: 0;
        justify-content: center;
        margin-bottom: 0;
    }

    header nav details[open] summary {
        margin-bottom: 5px;
    }

    .site-title {
        height: auto;
        flex-direction: row;
        justify-content: center;
        font-size: 7.2rem;
    }

    header nav ul {
        flex-direction: row;
        justify-content: space-between;
        height: auto;
    }

    h1 {
        font-size: 2.8rem;
    }

    article > h1 {
        font-size: 2.8rem;
    }

    article section h2 {
        font-size: 1.6rem;
        /* h1 ist auf Mobile kleiner (2.8 + 2·0.5 = 3.8rem statt 4.2rem) */
        top: calc(3.8rem - 2px);
    }

    article section h3 {
        font-size: 1.3rem;
        /* h1 + h2 = 3.8 + (1.6 + 2·0.3) = 6rem statt 7rem */
        top: calc(6rem - 2px);
    }

    header nav li:nth-child(2) a:hover,
    header nav li.aktiv:nth-child(2) a,
    header nav li:nth-child(3) a:hover,
    header nav li.aktiv:nth-child(3) a,
    header nav li:nth-child(4) a:hover,
    header nav li.aktiv:nth-child(4) a,
    header nav li:nth-child(5) a:hover,
    header nav li.aktiv:nth-child(5) a,
    header nav li:nth-child(6) a:hover,
    header nav li.aktiv:nth-child(6) a { background: #fff; color: #000; }

    header nav li.alles a:hover,
    header nav li.alles.aktiv a { background: #fff; }

    article > p,
    article > ul,
    article > ol,
    article > dl,
    article > blockquote,
    article > h2,
    article > h3,
    article > hr,
    pre > code {
        width: 100%;
    }

    /* Tufte-Fußnoten auf Mobile: einklappbar, unter dem Anker */
    .sidenote {
        display: none;
        position: static;
        right: auto;
        width: auto;
    }
    input.margin-toggle:checked + .sidenote {
        display: block;
        margin: 1rem 0;
        padding: 0.75rem 1rem;
        font-size: 0.95rem;
        background: #f4f4f4;
        border-left: 3px solid var(--rot);
    }
}

/* ===== Dark Mode ===== */

@media (prefers-color-scheme: dark) {
    body {
        background-color: #000;
        color: #fff;
    }

    header {
        background: #000;
    }

    .site-title,
    header nav a {
        color: #fff;
    }

    header nav li.alles a { background: #fff; color: #000; }
    header nav li:nth-child(6) a { background: #fff; color: #000; }

    hr,
    .card {
        border-color: #fff;
    }

    article > h1,
    article section h2,
    article section h3 {
        background: #000;
    }

    header nav li:nth-child(2) a:hover,
    header nav li.aktiv:nth-child(2) a,
    header nav li:nth-child(3) a:hover,
    header nav li.aktiv:nth-child(3) a,
    header nav li:nth-child(4) a:hover,
    header nav li.aktiv:nth-child(4) a,
    header nav li:nth-child(5) a:hover,
    header nav li.aktiv:nth-child(5) a,
    header nav li:nth-child(6) a:hover,
    header nav li.aktiv:nth-child(6) a { background: #000; color: #fff; }

    header nav li.alles a:hover,
    header nav li.alles.aktiv a { background: #000; color: #fff; }
}
