/* Abgabesystem Schulzeitung – eigenes, schlankes Stylesheet ohne externe Abhängigkeiten (keine CDN-Aufrufe). */

:root {
  --papier: #f6f4ef;
  --flaeche: #ffffff;
  --flaeche-2: #efece5;
  --tinte: #1d2330;
  --leise: #5d6472;
  --linie: #d9d4c9;
  --akzent: #233046;
  --akzent-text: #ffffff;
  --link: #1f5fa8;
  --gefahr: #b42318;
  --fokus: #2f6fd6;
  --rot: #d13b2f;
  --orange: #e57d1c;
  --gelb: #d8b21c;
  --gruen: #2e9a54;
  --ohne: #8a909c;
  --ok-flaeche: #e6f4ea;
  --ok-rand: #9fd2ae;
  --hinweis-flaeche: #fff6dd;
  --hinweis-rand: #ecd08a;
  --fehler-flaeche: #fdebea;
  --fehler-rand: #f0aaa4;
  --schatten: 0 1px 2px rgba(20, 25, 35, .06), 0 2px 8px rgba(20, 25, 35, .05);
  --radius: 8px;
  --schrift: system-ui, -apple-system, "Segoe UI", Roboto, "Noto Sans", Arial, sans-serif;
  --titelschrift: Georgia, "Iowan Old Style", "Palatino Linotype", "Times New Roman", serif;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root {
    --papier: #15181e;
    --flaeche: #1d2129;
    --flaeche-2: #262b35;
    --tinte: #e8e9ec;
    --leise: #a3a9b5;
    --linie: #363c48;
    --akzent: #c9d6ee;
    --akzent-text: #15181e;
    --link: #8cb8f0;
    --gefahr: #ff8a7f;
    --fokus: #8cb8f0;
    --rot: #ef5b4e;
    --orange: #f0953c;
    --gelb: #e6c440;
    --gruen: #4cba70;
    --ohne: #7d8390;
    --ok-flaeche: #1d3326;
    --ok-rand: #2f6b43;
    --hinweis-flaeche: #352d14;
    --hinweis-rand: #6e5a1d;
    --fehler-flaeche: #3a1d1b;
    --fehler-rand: #7a2f29;
    --schatten: 0 1px 2px rgba(0, 0, 0, .3);
    color-scheme: dark;
  }
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; overflow-y: scroll; } /* Scrollbar immer zeigen: kein Springen der Seite */
body {
  margin: 0;
  background: var(--papier);
  color: var(--tinte);
  font: 16px/1.55 var(--schrift);
}
a { color: var(--link); }
a:hover { text-decoration-thickness: 2px; }
h1, h2, h3 { font-family: var(--titelschrift); line-height: 1.2; margin: 1.4em 0 .5em; }
h1 { font-size: 2rem; margin-top: .2em; }
h2 { font-size: 1.35rem; }
code { background: var(--flaeche-2); padding: .1em .35em; border-radius: 4px; font-size: .92em; }
:focus-visible { outline: 3px solid var(--fokus); outline-offset: 2px; }
.leise { color: var(--leise); }
.einleitung { font-size: 1.08rem; max-width: 60ch; }
.hinweis { color: var(--leise); font-size: .94rem; max-width: 75ch; }
mark { background: var(--hinweis-flaeche); color: inherit; outline: 1px solid var(--hinweis-rand); border-radius: 3px; padding: 0 .15em; }

/* ---------- Kopfleiste ---------- */
.kopfleiste {
  display: flex; flex-wrap: wrap; align-items: center; gap: .5rem 1.5rem;
  padding: .7rem clamp(1rem, 3vw, 2rem);
  background: var(--akzent); color: var(--akzent-text);
}
.marke { display: flex; align-items: baseline; gap: .5rem; color: inherit; text-decoration: none; }
.marke-name { font-family: var(--titelschrift); font-size: 1.35rem; font-weight: 700; letter-spacing: .01em; }
.marke-zusatz { font-size: .8rem; text-transform: uppercase; letter-spacing: .12em; opacity: .75; }
.kopfleiste nav { display: flex; flex-wrap: wrap; align-items: center; gap: .2rem; margin-left: auto; }
.kopfleiste nav a, .abmelden button {
  color: inherit; text-decoration: none; padding: .35rem .65rem; border-radius: 6px; font-size: .95rem;
  background: none; border: 0; font: inherit; cursor: pointer;
}
.kopfleiste nav a:hover, .abmelden button:hover { background: rgba(255, 255, 255, .14); }
.kopfleiste nav a[aria-current="page"] { background: rgba(255, 255, 255, .2); font-weight: 600; }
@media (prefers-color-scheme: dark) {
  .kopfleiste nav a:hover, .abmelden button:hover { background: rgba(0, 0, 0, .1); }
  .kopfleiste nav a[aria-current="page"] { background: rgba(0, 0, 0, .14); }
}
.abmelden { margin: 0; }

/* ---------- Rahmen mit Seitenleiste ---------- */
.rahmen { max-width: 1320px; margin: 0 auto; padding: 1.5rem clamp(1rem, 3vw, 2rem) 4rem; }
.rahmen.mit-leiste { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 2rem; align-items: start; }
main { min-width: 0; }
.leiste { position: sticky; top: 1rem; }
@media (max-width: 900px) {
  .rahmen.mit-leiste { grid-template-columns: minmax(0, 1fr); }
  .leiste { position: static; }
}
.schmal { max-width: 460px; margin: 1rem auto; }
.schmal-links { max-width: 460px; }

/* ---------- Fortschritt ---------- */
.stand {
  background: var(--flaeche); border: 1px solid var(--linie); border-radius: var(--radius);
  padding: 1rem 1.1rem; box-shadow: var(--schatten);
}
.stand h2 { margin: 0 0 .25rem; font-size: 1.1rem; }
.stand-schluss { margin: 0 0 .8rem; font-size: .88rem; color: var(--leise); }
.fs { margin: .75rem 0; }
.fs-kopf { display: flex; justify-content: space-between; gap: .5rem; font-size: .93rem; }
.fs-kopf a { color: inherit; text-decoration: none; font-weight: 600; }
.fs-kopf a:hover { text-decoration: underline; }
.fs-offen { font-weight: 600; white-space: nowrap; font-size: .85rem; }
.fs-balken { display: flex; height: 10px; border-radius: 5px; overflow: hidden; background: var(--flaeche-2); margin: .3rem 0 .2rem; }
.fs-fertig { background: var(--fs-farbe); }
.fs-entwurf { background: repeating-linear-gradient(-45deg, var(--fs-farbe) 0 3px, transparent 3px 6px); opacity: .45; }
.fs-info { font-size: .8rem; color: var(--leise); }
.fs-rot { --fs-farbe: var(--rot); }
.fs-orange { --fs-farbe: var(--orange); }
.fs-gelb { --fs-farbe: var(--gelb); }
.fs-gruen { --fs-farbe: var(--gruen); }
.fs-ohne { --fs-farbe: var(--ohne); }
.fs .fs-offen { color: var(--fs-farbe); }
.fs-gelb .fs-offen { color: color-mix(in srgb, var(--gelb) 70%, var(--tinte)); }
.fs-gesamt { padding-bottom: .7rem; border-bottom: 1px solid var(--linie); }
.fs-gesamt .fs-balken { height: 14px; border-radius: 7px; }
.fs-legende { font-size: .78rem; color: var(--leise); margin: .8rem 0 0; display: flex; align-items: center; gap: .35rem; }
.fs-muster { display: inline-block; width: 14px; height: 8px; border-radius: 2px; --fs-farbe: var(--ohne); }
.fs-muster-fertig { background: var(--fs-farbe); }
.fs-muster-entwurf { background: repeating-linear-gradient(-45deg, var(--fs-farbe) 0 3px, transparent 3px 6px); opacity: .6; margin-left: .6rem; }

/* ---------- Meldungen ---------- */
.meldung { border: 1px solid; border-radius: var(--radius); padding: .7rem 1rem; margin: 0 0 1rem; }
.meldung p, .meldung ul { margin: 0; }
.meldung ul { padding-left: 1.2rem; }
.meldung-ok { background: var(--ok-flaeche); border-color: var(--ok-rand); }
.meldung-hinweis { background: var(--hinweis-flaeche); border-color: var(--hinweis-rand); }
.meldung-fehler { background: var(--fehler-flaeche); border-color: var(--fehler-rand); }
.link-kopie { display: flex; gap: .5rem; margin-top: .6rem; }
.link-kopie input { flex: 1; min-width: 0; font-family: ui-monospace, monospace; font-size: .85rem; }

/* ---------- Formulare ---------- */
label { display: block; font-weight: 600; font-size: .93rem; margin: 0 0 .9rem; }
input:not([type]), input[type=text], input[type=email], input[type=password], input[type=number], input[type=url], input[type=date], select, textarea {
  display: block; width: 100%; margin-top: .3rem;
  font: inherit; font-size: 1rem; font-weight: 400; color: var(--tinte);
  background: var(--flaeche); border: 1px solid var(--linie); border-radius: 6px; padding: .5rem .7rem;
}
/* Einzeilige Felder und Auswahllisten überall gleich hoch */
input:not([type]), input[type=text], input[type=email], input[type=password], input[type=number], input[type=url], input[type=date], select {
  height: 2.75rem;
}
textarea { resize: vertical; line-height: 1.6; }
#text { min-height: 22rem; font-size: 1.02rem; }
input:focus, select:focus, textarea:focus { border-color: var(--fokus); }
.formular { max-width: 820px; }
.reihe { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 0 1rem; }
.reihe-unten { align-items: end; }
.reihe-unten .knopf { margin-bottom: .9rem; }
label.kurz { max-width: 360px; }
label.haken { display: flex; gap: .6rem; align-items: flex-start; font-weight: 400; }
label.haken input { margin-top: .3rem; width: 1.1rem; height: 1.1rem; flex: none; }
label.haken.klein { margin: 0; align-items: center; }
label.haken.klein input { margin-top: 0; }
.zahl-eingabe { max-width: 7rem; }

.knopf {
  display: inline-flex; align-items: center; justify-content: center; gap: .4rem;
  font: inherit; font-weight: 600; font-size: .95rem; text-decoration: none; cursor: pointer;
  color: var(--tinte); background: var(--flaeche); border: 1px solid var(--linie);
  border-radius: 6px; padding: .55rem 1rem; box-shadow: var(--schatten);
}
.knopf:hover { border-color: var(--leise); }
.knopf.haupt { background: var(--akzent); color: var(--akzent-text); border-color: var(--akzent); }
.knopf.haupt:hover { filter: brightness(1.12); }
.knopf.gefahr { color: var(--gefahr); }
.knopf.klein { padding: .3rem .65rem; font-size: .85rem; box-shadow: none; }
.knopf:disabled { opacity: .5; cursor: not-allowed; }
.aktionen { display: flex; flex-wrap: wrap; align-items: center; gap: .6rem; margin: 1rem 0; }
form.loeschen { margin-top: 3rem; padding-top: 1rem; border-top: 1px solid var(--linie); }

/* ---------- Editor ---------- */
.editor { max-width: 860px; }
.ki-feld {
  background: var(--flaeche); border: 1px solid var(--linie); border-radius: var(--radius);
  padding: .2rem 1rem; margin: 0 0 1.2rem;
}
.ki-feld summary { cursor: pointer; font-weight: 600; padding: .6rem 0; }
.ki-feld[open] { padding-bottom: .4rem; }
.ki-feld.laeuft summary::after { content: " – Entwurf wird geschrieben …"; font-weight: 400; color: var(--leise); }
.zaehler { font-size: .88rem; color: var(--leise); margin: -.5rem 0 1rem; }
.wiederherstellen { display: flex; gap: .5rem; align-items: center; padding: .35rem .6rem; font-size: .85rem; }
.wiederherstellen p { flex: 1; min-width: 0; }
.wiederherstellen .knopf { flex: none; }
@media (max-width: 560px) { .wiederherstellen { flex-wrap: wrap; } }
.korrektur-zeile { display: flex; flex-wrap: wrap; align-items: center; gap: .6rem; margin: -.4rem 0 1rem; }
.korrektur-zeile .zaehler { margin: 0 auto 0 0; }
.korrektur-info { font-size: .88rem; margin: -.4rem 0 1rem; }
.korrektur-info ul { margin: .3rem 0 0; padding-left: 1.2rem; color: var(--leise); }

/* ---------- Bilder ---------- */
.bilder-bereich { max-width: 860px; margin-top: 2.5rem; }
.ablage {
  display: flex; flex-wrap: wrap; align-items: center; gap: 1rem;
  border: 2px dashed var(--linie); border-radius: var(--radius); padding: 1.2rem; background: var(--flaeche);
}
.ablage.drueber { border-color: var(--fokus); background: var(--flaeche-2); }
.ablage input[type=file] { position: absolute; width: 1px; height: 1px; opacity: 0; }
.ablage label { margin: 0; }
.hochladen-liste { list-style: none; padding: 0; margin: .8rem 0; }
.hochladen-liste li { font-size: .9rem; margin: .3rem 0; display: flex; gap: .6rem; align-items: center; }
.hochladen-liste progress { width: 140px; }
.hochladen-liste .fehler { color: var(--gefahr); }
.bildliste { list-style: none; padding: 0; margin: 1rem 0; display: grid; gap: 1rem; }
.bild {
  display: grid; grid-template-columns: 180px minmax(0, 1fr); gap: 1rem;
  background: var(--flaeche); border: 1px solid var(--linie); border-radius: var(--radius); padding: .8rem;
}
.bild-vorschau {
  display: flex; align-items: center; justify-content: center; background: var(--flaeche-2);
  border-radius: 6px; min-height: 120px; overflow: hidden; text-decoration: none;
}
.bild-vorschau img { display: block; width: 100%; height: 100%; max-height: 220px; object-fit: contain; }
.dateityp { font-weight: 700; color: var(--leise); letter-spacing: .08em; }
.bild-info { font-size: .82rem; color: var(--leise); margin-bottom: .5rem; word-break: break-word; }
.bild label { margin-bottom: .5rem; font-size: .88rem; }
.bild-aktionen { display: flex; justify-content: space-between; align-items: center; gap: .6rem; }
.bild-status { font-size: .82rem; color: var(--leise); }
.bild-text { margin: 0 0 .3rem; }
.bild-quelle { margin: 0; font-size: .85rem; color: var(--leise); }
.warnung { color: var(--gefahr); font-weight: 600; }
@media (max-width: 560px) { .bild { grid-template-columns: 1fr; } }

/* ---------- Tabellen ---------- */
.tabelle-rahmen { overflow-x: auto; background: var(--flaeche); border: 1px solid var(--linie); border-radius: var(--radius); }
.tabelle { width: 100%; border-collapse: collapse; font-size: .93rem; }
.tabelle th, .tabelle td { text-align: left; padding: .55rem .75rem; border-bottom: 1px solid var(--linie); vertical-align: top; }
.tabelle thead th { font-size: .8rem; text-transform: uppercase; letter-spacing: .05em; color: var(--leise); background: var(--flaeche-2); }
.tabelle tbody tr:last-child td, .tabelle tbody tr:last-child th { border-bottom: 0; }
.tabelle .zahl { text-align: right; white-space: nowrap; }
.tabelle .knoepfe { white-space: nowrap; text-align: right; }
.tabelle .knoepfe a { margin-left: .6rem; }
.tabelle tr.archiviert { opacity: .6; }
.tabelle.ziele { max-width: 480px; background: var(--flaeche); border: 1px solid var(--linie); }
.tabelle.pruefung { max-width: 720px; background: var(--flaeche); border: 1px solid var(--linie); }
.tabelle.pruefung th { width: 11rem; }
.ampel { display: inline-block; width: .65rem; height: .65rem; border-radius: 50%; margin-right: .5rem; }
.ampel.ok { background: var(--gruen); }
.ampel.nein { background: var(--rot); }

.marke-status { display: inline-block; font-size: .75rem; font-weight: 700; padding: .1rem .5rem; border-radius: 999px; white-space: nowrap; }
.marke-status.fertig { background: var(--ok-flaeche); color: var(--gruen); border: 1px solid var(--ok-rand); }
.marke-status.entwurf { background: var(--hinweis-flaeche); color: color-mix(in srgb, var(--orange) 75%, var(--tinte)); border: 1px solid var(--hinweis-rand); }
.marke-status.admin { background: var(--flaeche-2); border: 1px solid var(--linie); }
.marke-status.gesperrt { background: var(--fehler-flaeche); color: var(--gefahr); border: 1px solid var(--fehler-rand); }
.marke-ki { display: inline-block; font-size: .7rem; font-weight: 700; padding: 0 .4rem; border-radius: 4px; border: 1px solid var(--linie); color: var(--leise); vertical-align: middle; }

/* ---------- Adminseiten ---------- */
.filter { display: flex; flex-wrap: wrap; gap: 0 1rem; }
.filter label { min-width: 200px; }
.export-kasten {
  display: flex; flex-wrap: wrap; align-items: center; gap: .5rem;
  background: var(--flaeche); border: 1px solid var(--linie); border-radius: var(--radius); padding: .7rem 1rem; font-size: .93rem;
}
.rubrik-block h2 { display: flex; align-items: baseline; gap: .7rem; flex-wrap: wrap; }
.rubrik-block h2 .leise { font-family: var(--schrift); font-size: .85rem; font-weight: 400; }
.rubrik-liste { display: grid; gap: .6rem; }
.rubrik-zeile {
  display: grid; grid-template-columns: 2rem 13rem minmax(0, 1fr) auto;
  gap: .4rem .8rem; align-items: end;
  background: var(--flaeche); border: 1px solid var(--linie); border-radius: var(--radius); padding: .7rem .9rem;
}
.rubrik-zeile label { margin: 0; font-size: .8rem; }
.zeilen-mitte { height: 2.75rem; display: flex; align-items: center; gap: .6rem; white-space: nowrap; }
.zeilen-mitte .leise { font-size: .82rem; }
.verschieben { display: flex; flex-direction: column; gap: 2px; height: 2.75rem; }
.verschieben button {
  flex: 1; width: 2rem; padding: 0; font-size: .7rem; line-height: 1; cursor: pointer;
  color: var(--leise); background: var(--flaeche-2); border: 1px solid var(--linie); border-radius: 4px;
}
.verschieben button:hover:not(:disabled) { color: var(--tinte); border-color: var(--leise); }
.verschieben button:disabled { opacity: .35; cursor: default; }
.rubrik-neu { display: grid; grid-template-columns: 13rem minmax(0, 1fr) auto; gap: .4rem .8rem; align-items: end; max-width: none; }
.rubrik-neu label { margin: 0; }
@media (max-width: 1100px) {
  .rubrik-zeile { grid-template-columns: auto 1fr; }
  .rubrik-zeile .beschreibung, .rubrik-zeile .zeilen-mitte { grid-column: 2; }
  .rubrik-neu { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 560px) { .rubrik-neu { grid-template-columns: 1fr; } }
.personen { display: grid; gap: .5rem; }
.person { background: var(--flaeche); border: 1px solid var(--linie); border-radius: var(--radius); padding: .1rem 1rem; }
.person summary { cursor: pointer; padding: .6rem 0; display: flex; flex-wrap: wrap; gap: .3rem .7rem; align-items: center; }
.person.inaktiv summary strong { text-decoration: line-through; }
.person-formular { padding-bottom: .4rem; max-width: none; }
.daten { display: grid; grid-template-columns: max-content 1fr; gap: .3rem 1.2rem; }
.daten dt { font-weight: 600; }
.daten dd { margin: 0; }

/* ---------- Leseansicht ---------- */
.lesen { background: var(--flaeche); border: 1px solid var(--linie); border-radius: var(--radius); padding: clamp(1rem, 4vw, 2.5rem); max-width: 820px; box-shadow: var(--schatten); }
.lesen-kopf { font-size: .85rem; color: var(--leise); text-transform: uppercase; letter-spacing: .06em; margin: 0; display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; }
.lesen h1 { font-size: clamp(1.7rem, 4vw, 2.4rem); margin: .4rem 0 .3rem; }
.lesen-autor { color: var(--leise); font-size: .92rem; margin: 0 0 1.5rem; }
.lesen-text { font-family: var(--titelschrift); font-size: 1.1rem; line-height: 1.7; max-width: 68ch; }
.lesen-text p { margin: 0 0 1em; }
.lesen-bilder .bild { grid-template-columns: 260px minmax(0, 1fr); }
.lesen-bilder .bild-vorschau img { max-height: 320px; }
@media (max-width: 560px) { .lesen-bilder .bild { grid-template-columns: 1fr; } }
.rubrik-neu .knopf { height: 2.75rem; }

/* Spalten der Artikeltabellen in allen Rubriken gleich breit */
.artikel-tabelle { table-layout: fixed; }
.artikel-tabelle th:nth-child(1) { width: 25%; }
.artikel-tabelle th:nth-child(2) { width: 16%; }
.artikel-tabelle th:nth-child(3) { width: 11%; }
.artikel-tabelle th:nth-child(4) { width: 9%; }
.artikel-tabelle th:nth-child(5) { width: 8%; }
.artikel-tabelle th:nth-child(6) { width: 18%; }
.artikel-tabelle th:nth-child(7) { width: 13%; }
.artikel-tabelle td:nth-child(6) { white-space: nowrap; }
.artikel-tabelle td:first-child { overflow-wrap: anywhere; }
.tabelle.ziele td { vertical-align: middle; }
.tabelle.ziele td input { margin-top: 0; }

/* CSV-Import */
.beispiel { background: var(--flaeche); border: 1px solid var(--linie); border-radius: 6px; padding: .6rem .9rem; font-size: .88rem; max-width: 420px; overflow-x: auto; }
.csv-uebersprungen td { color: var(--leise); }
.csv-vorschau td:nth-child(4) { white-space: nowrap; }
input[type=file] { font: inherit; font-size: .9rem; color: var(--leise); width: 24rem; max-width: 100%; }
input[type=file]::file-selector-button {
  font: inherit; font-weight: 600; font-size: .95rem; color: var(--tinte); cursor: pointer;
  background: var(--flaeche); border: 1px solid var(--linie); border-radius: 6px;
  padding: .55rem 1rem; margin-right: .8rem; box-shadow: var(--schatten);
}
input[type=file]::file-selector-button:hover { border-color: var(--leise); }

/* Symbolknöpfe (Speichern ✓ / Löschen ✕) */
.symbol-knopf {
  width: 2.75rem; height: 2.75rem; display: inline-flex; align-items: center; justify-content: center;
  font-size: 1.3rem; font-weight: 700; line-height: 1; cursor: pointer;
  background: var(--flaeche); border: 1px solid var(--linie); border-radius: 6px;
}
.symbol-knopf.speichern { color: var(--gruen); }
.symbol-knopf.loeschen { color: var(--rot); }
.symbol-knopf.speichern:hover { background: var(--ok-flaeche); border-color: var(--ok-rand); }
.symbol-knopf.loeschen:hover { background: var(--fehler-flaeche); border-color: var(--fehler-rand); }
