/* Feste WagnerHof — Formular, Buffet-Widget und Verwaltungssicht.
 *
 * Mobil zuerst: Die meisten Anmeldungen kommen vom Telefon. Bewusst ohne
 * Framework — ein paar hundert Zeilen reichen und laden sofort. */

:root {
  --grund: #fbf9f5;
  --schrift: #23201c;
  --gedaempft: #6b6459;
  --linie: #ddd6ca;
  --akzent: #7a5c2e;
  --akzent-hell: #f0e7d6;
  --warnung: #a8452a;
  --gruen: #4a6b3a;
  --radius: 8px;
  --karte: #fff;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--grund);
  color: var(--schrift);
  font: 16px/1.55 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

body.widget { background: transparent; }

.seite {
  max-width: 40rem;
  margin: 0 auto;
  padding: 1.5rem 1.1rem 4rem;
}

.widget-inhalt { padding: 0.5rem 0; }

h1 { font-size: 1.6rem; line-height: 1.2; margin: 0 0 0.25rem; }
h2 { font-size: 1.2rem; margin: 2rem 0 0.6rem; }
h3 { font-size: 1rem; margin: 1.2rem 0 0.4rem; }

.kopf { color: var(--gedaempft); margin: 0 0 1.5rem; }

a { color: var(--akzent); overflow-wrap: anywhere; }

/* ------------------------------------------------------------- Formular */

label { display: block; margin: 1rem 0 0.3rem; font-weight: 600; }
.hinweis { font-weight: 400; color: var(--gedaempft); font-size: 0.88rem; }

input[type="text"], input[type="email"], input[type="number"],
input[type="search"], input:not([type]),
textarea, select {
  width: 100%;
  padding: 0.65rem 0.7rem;
  border: 1px solid var(--linie);
  border-radius: var(--radius);
  background: #fff;
  font: inherit;
  color: inherit;
}

input:focus-visible, textarea:focus-visible, select:focus-visible,
button:focus-visible, summary:focus-visible {
  outline: 2px solid var(--akzent);
  outline-offset: 2px;
}

fieldset {
  border: 1px solid var(--linie);
  border-radius: var(--radius);
  padding: 0.9rem 1rem 1rem;
  margin: 1.5rem 0 0;
}

legend { font-weight: 600; padding: 0 0.35rem; }

/* Ankreuzfelder groß genug für Daumen — 44px Mindesthöhe. */
.kasten {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin: 0;
  padding: 0.55rem 0;
  min-height: 44px;
  font-weight: 400;
  cursor: pointer;
}

.kasten input { width: 1.15rem; height: 1.15rem; flex: none; }

.personen { display: flex; gap: 1rem; }
.personen > div { flex: 1; }

button {
  margin-top: 1.75rem;
  padding: 0.8rem 1.4rem;
  border: 0;
  border-radius: var(--radius);
  background: var(--akzent);
  color: #fff;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
  min-height: 44px;
}

button.sekundaer { background: transparent; color: var(--akzent); border: 1px solid var(--linie); }

.bekannt { background: var(--akzent-hell); padding: 0.7rem 0.9rem; border-radius: var(--radius); }

.fehler {
  background: #fdecea;
  border-left: 3px solid var(--warnung);
  color: var(--warnung);
  padding: 0.7rem 0.9rem;
  border-radius: var(--radius);
}

.rueckfrage { background: var(--akzent-hell); padding: 1rem; border-radius: var(--radius); }
.rueckfrage button { margin-top: 0.75rem; margin-right: 0.5rem; }

/* Rückfrage vor dem Löschen: „Abbrechen" als sichere Wahl vorn, das Löschen
 * deutlich als gefährlich abgesetzt. */
.confirm-actions { display: flex; flex-wrap: wrap; gap: 0.5rem; align-items: center; margin-top: 0.75rem; }
.confirm-actions button { margin: 0; }
a.button {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0 1.4rem;
  border: 1px solid var(--linie);
  border-radius: var(--radius);
  color: var(--akzent);
  font-weight: 600;
  text-decoration: none;
}
button.danger { background: var(--warnung); }

.review-actions form { display: inline; }
.review-actions button { margin: 0.25rem 0.25rem 0.25rem 0; }

/* Der Buffet-Hinweis im Formular — die Rückkopplung, wegen der es das Projekt
 * gibt. Deshalb optisch hervorgehoben, nicht als Fußnote. */
.buffet-hinweis {
  margin: 1.5rem 0 0;
  padding: 0.8rem 0.9rem;
  background: #fff;
  border: 1px dashed var(--linie);
  border-radius: var(--radius);
}
.buffet-hinweis p { margin: 0; }

/* „2×" vor einem Gericht, das mehrere Haushalte mitbringen. */
.multiple { color: var(--akzent); font-weight: 600; }

/* Suchfeld über der Gerichtsauswahl. Fügt das Skript in render.rs ein; ohne
   JavaScript ist es gar nicht erst vorhanden und die Liste bleibt offen. */
.dish-search { margin-bottom: 0.75rem; }
.search-empty { margin: 0.6rem 0 0; color: var(--gedaempft); font-size: 0.9rem; }

details { border-top: 1px solid var(--linie); padding: 0.35rem 0; }
details:first-of-type { border-top: 0; }
summary { cursor: pointer; padding: 0.5rem 0; font-weight: 600; min-height: 44px; }
.liste { padding-left: 0.2rem; }

.neues-gericht { margin-top: 1.2rem; border-top: 1px solid var(--linie); padding-top: 0.5rem; }
.new-dish-row + .new-dish-row { margin-top: 1rem; padding-top: 1rem; border-top: 1px dashed var(--linie); }
.weiteres-gericht { margin-top: 1rem; }
.neu-details { margin-top: 0.5rem; }
.kennzeichnung { display: flex; flex-wrap: wrap; gap: 0 1rem; margin-top: 0.5rem; }
.kennzeichnung .kasten { min-height: 40px; }

/* ---------------------------------------------------------- Wurzelseite */

.feste { list-style: none; padding: 0; }
.feste li {
  padding: 0.9rem 1rem;
  margin-bottom: 0.6rem;
  background: #fff;
  border: 1px solid var(--linie);
  border-radius: var(--radius);
}
.feste a { font-weight: 600; text-decoration: none; }
.feste .kopf { display: block; margin: 0.15rem 0 0; font-size: 0.9rem; }

/* --------------------------------------------------------------- Buffet */

.kategorie { margin-bottom: 1.2rem; }
.kategorie ul { margin: 0; padding-left: 1.1rem; }
.kategorie li { margin: 0.2rem 0; }

.anzahl {
  display: inline-block;
  min-width: 1.6rem;
  padding: 0 0.4rem;
  background: var(--akzent-hell);
  border-radius: 999px;
  font-size: 0.85rem;
  text-align: center;
  color: var(--akzent);
}

.leer { color: var(--gedaempft); font-style: italic; margin: 0.2rem 0; }

.marker {
  font-size: 0.8rem;
  color: var(--gedaempft);
  background: var(--akzent-hell);
  padding: 0.1rem 0.4rem;
  border-radius: 999px;
}

.luecke {
  margin-top: 1rem;
  padding: 0.7rem 0.9rem;
  background: #fdecea;
  border-radius: var(--radius);
}

.bestaetigung {
  font-size: 1.1rem;
  padding: 0.9rem 1rem;
  background: #eef3ea;
  border-left: 3px solid var(--gruen);
  border-radius: var(--radius);
}

/* ----------------------------------------------------------- Verwaltung */

.admin-navigation {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem;
  margin: 0 0 1.5rem;
  border-bottom: 1px solid var(--linie);
}

.admin-navigation a {
  padding: 0.5rem 0.65rem;
  color: var(--gedaempft);
  font-size: 0.9rem;
  font-weight: 600;
  text-decoration: none;
}

.admin-navigation a[aria-current="page"] {
  color: var(--schrift);
  border-bottom: 2px solid var(--akzent);
}

.kennzahlen {
  display: flex;
  flex-wrap: wrap;
  gap: 0.7rem;
  margin: 1rem 0 2rem;
}

.kennzahlen > div {
  flex: 1 1 7rem;
  padding: 0.7rem 0.8rem;
  background: #fff;
  border: 1px solid var(--linie);
  border-radius: var(--radius);
  font-size: 0.9rem;
  color: var(--gedaempft);
}

.kennzahlen .zahl {
  display: block;
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--schrift);
}

.kennzahlen .warnung { border-color: var(--warnung); }
.kennzahlen .warnung .zahl { color: var(--warnung); }

table { width: 100%; border-collapse: collapse; font-size: 0.92rem; }
th, td { text-align: left; padding: 0.5rem 0.4rem; border-bottom: 1px solid var(--linie); vertical-align: top; }
th { color: var(--gedaempft); font-size: 0.82rem; text-transform: uppercase; letter-spacing: 0.03em; }

@media (max-width: 30rem) {
  .personen { flex-direction: column; gap: 0; }
  table { font-size: 0.85rem; }
}

@media (prefers-color-scheme: dark) {
  :root {
    --grund: #1c1a17;
    --schrift: #ece7de;
    --gedaempft: #a09889;
    --linie: #3a352e;
    --akzent: #c9a86a;
    --akzent-hell: #2e2820;
    --karte: #26221d;
  }
  input, textarea, select, .kennzahlen > div, .buffet-hinweis, .feste li { background: #26221d; }
  .fehler, .luecke { background: #3a2320; }
  .bestaetigung { background: #23291f; }
}


/* ------------------------------------------------------- Verwaltung breit */

/* Die Verwaltung wird am Rechner benutzt und darf breiter sein als das
 * Gästeformular; Formulare darin bleiben schmal und gut lesbar. */
.page-wide { max-width: 64rem; }
.page-wide form.anmeldung, .page-wide form.invite-form { max-width: 40rem; }

.party-navigation {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem 1rem;
  margin: -0.4rem 0 1.2rem;
  padding: 0 0 0.5rem;
  border-bottom: 1px solid var(--linie);
  font-size: 0.95rem;
}
.party-navigation a { text-decoration: none; padding: 0.35rem 0; }
.party-navigation a[aria-current="page"] {
  font-weight: 700;
  border-bottom: 2px solid var(--akzent);
}

.filter { max-width: 24rem; margin: 0 0 0.8rem; }
.visually-hidden {
  position: absolute; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap;
}
form.inline-form { display: flex; gap: 0.4rem; align-items: center; margin: 0.3rem 0 0; }
form.inline-form select { width: auto; padding: 0.35rem 0.5rem; }
form.inline-form button, button.quiet { padding: 0.35rem 0.7rem; font-size: 0.9rem; }
button.quiet {
  background: transparent; color: var(--akzent);
  border: 1px solid var(--linie);
}
.link-line { margin: 0.15rem 0; }
.link-line code { overflow-wrap: anywhere; font-size: 0.82rem; }
button.copy { padding: 0.15rem 0.6rem; font-size: 0.85rem; }
ul.choice-list {
  list-style: none; margin: 0 0 1rem; padding: 0;
  columns: 2 14rem; column-gap: 1.5rem;
}
ul.choice-list li { break-inside: avoid; }
ul.choice-list .kasten { margin: 0.15rem 0; font-weight: 400; }

/* Tabellen werden unter 40rem zu Karten: Name groß, Angaben darunter mit
 * ihrer Überschrift. Ohne diese Umstellung sprengen Freitextspalten am
 * Telefon die Zeilen. */
@media (max-width: 40rem) {
  table.cards, table.cards tbody, table.cards tr, table.cards td { display: block; }
  table.cards thead {
    position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0);
  }
  table.cards tr {
    background: var(--karte); border: 1px solid var(--linie); border-radius: var(--radius);
    padding: 0.6rem 0.8rem; margin: 0 0 0.7rem;
  }
  table.cards td { border: 0; padding: 0.15rem 0; font-size: 0.95rem; }
  table.cards td:first-child { font-size: 1.05rem; font-weight: 600; }
  table.cards td[data-label]:not(:first-child):not([data-label=""])::before {
    content: attr(data-label) ": "; color: var(--gedaempft); font-size: 0.85rem;
  }
  table.cards td:empty { display: none; }
}
