/* Redaktions-App — Admin-Stil (Task 11).
 *
 * Kein Webfont: reine System-Schriftart, damit die Seite auch auf schwachem
 * Mobilfunk sofort da ist — die Redaktion arbeitet laut Vorgabe auch vom
 * Handy aus. Farben/Formsprache sind an DESIGN.md angelehnt (warme
 * Neutraltöne, Koralle-Akzent #E56A5B), aber bewusst reduziert: dies ist ein
 * internes Werkzeug, keine Schaufensterseite.
 *
 * Diese Datei deckt NUR Klassen/Elemente ab, die cms/lib/html.mjs und die
 * Routen unter cms/routen/ tatsächlich rendern (per grep geprüft, s. Bericht
 * zu Task 11) — kein erfundenes Markup.
 */

:root {
  --bg: #faf7f5;
  --surface: #ffffff;
  --ink: #2b2523;
  --ink-muted: #6b6058;
  --line: #e6ddd7;
  --accent: #e56a5b;
  --accent-ink: #c14f3f;
  --gruen-bg: #e7f4ea;
  --gruen-rand: #b8dcc0;
  --gruen-text: #1f5c34;
  --rot-bg: #fbebe9;
  --rot-rand: #eac2bc;
  --rot-text: #a3352a;
  --radius: 4px;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family:
    -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  font-size: 1rem;
  line-height: 1.5;
}

h1,
h2,
h3,
h4 {
  color: var(--ink);
  line-height: 1.25;
  margin: 0 0 0.75rem;
}

h1 {
  font-size: 1.5rem;
}

h2 {
  font-size: 1.2rem;
  margin-top: 1.5rem;
}

h3 {
  font-size: 1.05rem;
  margin-top: 1.25rem;
}

h4 {
  font-size: 1rem;
  margin-top: 1rem;
}

p {
  margin: 0 0 1rem;
}

ul,
ol {
  padding-left: 1.25rem;
}

a {
  color: var(--accent-ink);
  text-decoration: underline;
  text-underline-offset: 0.15em;
}

a:hover {
  color: var(--accent);
}

:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 2px;
  border-radius: 2px;
}

/* ---- Kopfzeile (lib/html.mjs: seite()) ------------------------------------ */

header.kopfzeile {
  background: var(--surface);
  border-bottom: 1px solid var(--line);
  padding: 0.5rem 1rem;
}

/* Eine Leiste statt gestapelter Blöcke: Name links, Navigation daneben,
   Freigabe-Hinweis und Abmelden rechts. Gleiche Breite wie der Inhalt,
   damit Kopf und Seite bündig stehen. */
.kopfzeile__inner {
  max-width: 46rem;
  margin: 0 auto;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.4rem 1rem;
}

.app-name {
  margin: 0;
  font-weight: 700;
  font-size: 0.95rem;
  color: var(--ink-muted);
}

.kopfzeile__inner .status-freigabe {
  margin-left: auto;
}

nav.nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.2rem 1.25rem;
  margin: 0;
}

nav.nav a {
  display: inline-block;
  color: var(--ink);
  text-decoration: none;
  padding: 0.5rem 0;
  font-weight: 700;
}

nav.nav a:hover {
  color: var(--accent-ink);
}

.status-freigabe {
  margin: 0;
}

.status-freigabe a {
  display: inline-block;
  background: var(--accent);
  color: #fff;
  padding: 0.4rem 0.85rem;
  border-radius: var(--radius);
  text-decoration: none;
  font-weight: 700;
  font-size: 0.9rem;
}

.status-freigabe a:hover {
  background: var(--accent-ink);
  color: #fff;
}

.abmelden-formular {
  margin: 0;
  display: inline-block;
}

.abmelden-knopf {
  background: none;
  border: 1px solid var(--line);
  color: var(--ink-muted);
  min-height: 40px;
  padding: 0.4rem 0.9rem;
  border-radius: var(--radius);
  cursor: pointer;
  font: inherit;
  font-size: 0.85rem;
}

.abmelden-knopf:hover {
  border-color: var(--ink-muted);
  color: var(--ink);
}

/* ---- Hauptbereich ---------------------------------------------------------- */

main {
  max-width: 46rem;
  margin: 0 auto;
  padding: 1.25rem 1rem 4rem;
}

/* ---- Meldungen (lib/html.mjs, routen/*.mjs) ------------------------------- */

.meldung {
  background: var(--gruen-bg);
  border: 1px solid var(--gruen-rand);
  color: var(--gruen-text);
  padding: 0.75rem 1rem;
  border-radius: var(--radius);
  margin: 0 0 1.25rem;
}

.warnung {
  background: var(--rot-bg);
  border: 1px solid var(--rot-rand);
  color: var(--rot-text);
  padding: 0.75rem 1rem;
  border-radius: var(--radius);
  margin: 0 0 1.25rem;
}

.fehlerliste {
  background: var(--rot-bg);
  border: 1px solid var(--rot-rand);
  color: var(--rot-text);
  padding: 0.75rem 1rem 0.75rem 1.75rem;
  border-radius: var(--radius);
  margin: 0 0 1rem;
  list-style: disc;
}

.fehlerliste li {
  margin: 0.15rem 0;
}

.hinweis {
  color: var(--ink-muted);
  font-size: 0.9rem;
}

/* ---- Formulare (überall) ---------------------------------------------------
 * Formulare tragen die Klasse "formular", teils mit Modifikator
 * ("formular--termin", "formular--loeschen", "formular--vorhaben") — die
 * Modifikatoren beeinflussen hier nur den Abstand zwischen den Formularen
 * innerhalb einer Liste, nicht die Feldgestaltung selbst.
 */

form.formular {
  margin: 0 0 1.5rem;
}

.feld {
  margin: 0 0 1rem;
}

label {
  display: block;
  font-weight: 700;
  margin-bottom: 0.3rem;
}

input[type='text'],
input[type='date'],
input[type='time'],
input[type='password'],
textarea {
  display: block;
  width: 100%;
  max-width: 100%;
  min-height: 44px;
  padding: 0.55rem 0.7rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--ink);
  font: inherit;
  margin: 0 0 0.75rem;
}

textarea {
  min-height: 6rem;
  resize: vertical;
}

input:focus-visible,
textarea:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 1px;
  border-color: var(--accent);
}

input[readonly] {
  background: var(--bg);
  color: var(--ink-muted);
}

.vorschau-link-feld {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.85rem;
}

fieldset {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1rem;
  margin: 0 0 1rem;
  min-width: 0;
}

legend {
  font-weight: 700;
  padding: 0 0.4rem;
}

/* ---- Buttons ---------------------------------------------------------------
 * Standard-Button/".knopf-primaer" = primäre Aktion, koralle gefüllt.
 * ".warnung-knopf" = destruktive Aktion (löschen/verwerfen) — bewusst NICHT
 * koralle-gefüllt, sondern als roter Umriss, damit sie sich von den primären
 * Aktionen klar unterscheidet (s. Task-Vorgabe) und tritt sowohl auf
 * <button> als auch auf <a> auf (Freigabe: "Alles verwerfen"-Link).
 */

button,
.knopf-primaer,
a.warnung-knopf {
  display: inline-block;
  min-height: 44px;
  padding: 0.6rem 1.2rem;
  border-radius: var(--radius);
  font: inherit;
  font-weight: 700;
  cursor: pointer;
  text-decoration: none;
  text-align: center;
  background: var(--accent);
  border: 1px solid var(--accent);
  color: #fff;
  margin: 0.25rem 0;
}

button:hover,
.knopf-primaer:hover {
  background: var(--accent-ink);
  border-color: var(--accent-ink);
  color: #fff;
}

/* Zerstörende Aktionen bleiben Umriss statt Fläche — sie sollen nie so
   einladend aussehen wie „Jetzt veröffentlichen". Der Selektor muss die
   Element-Spezifität der Basisregel oben erreichen, sonst gewinnt deren
   Koralle-Fläche. */
button.warnung-knopf,
a.warnung-knopf {
  background: transparent;
  border: 1px solid var(--rot-text);
  color: var(--rot-text);
}

button.warnung-knopf:hover,
a.warnung-knopf:hover {
  background: var(--rot-bg);
  color: var(--rot-text);
}

.abmelden-knopf:hover {
  background: none;
}

/* ---- Listen (Termine/Vorhaben/Commits) ------------------------------------ */

.termine-liste,
.vorhaben-liste {
  list-style: none;
  margin: 0 0 1.5rem;
  padding: 0;
}

.termin-eintrag,
.vorhaben-eintrag {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1rem;
  margin-bottom: 1rem;
  background: var(--surface);
}

.termin-eintrag .formular--loeschen,
.vorhaben-eintrag .formular--loeschen {
  margin: 0;
}

.commit-liste {
  list-style: none;
  margin: 0 0 1.5rem;
  padding: 0;
}

.commit-liste li {
  padding: 0.5rem 0;
  border-bottom: 1px solid var(--line);
}

.commit-liste .datum {
  color: var(--ink-muted);
  font-variant-numeric: tabular-nums;
  margin-right: 0.25rem;
}

.badge-automatisch {
  display: inline-block;
  font-size: 0.75rem;
  color: var(--ink-muted);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 0.05rem 0.4rem;
  margin-left: 0.35rem;
}

.anzahl {
  color: var(--ink-muted);
  font-weight: 400;
  font-size: 0.85em;
}

.themen-gruppe {
  border-top: 1px solid var(--line);
  padding-top: 1.5rem;
  margin-top: 1.5rem;
}

.themen-gruppe:first-of-type {
  border-top: none;
  padding-top: 0;
  margin-top: 0;
}

.vorschau-link {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1rem;
  margin: 0 0 1.5rem;
}

/* ---- Etwas mehr Luft ab Tablet-Breite -------------------------------------- */

@media (min-width: 640px) {
  main {
    padding-inline: 1.5rem;
  }
}
