/* Aethos-Wiki — dunkles Leder-Chrome, Artikel auf Pergament. */
* { box-sizing: border-box; }

:root {
  --leder: #1d1712;
  --holz: #292018;
  --holz-hell: #382c20;
  --pergament: #efe4c8;
  --pergament-rand: #d9c9a3;
  --tinte: #2e2417;
  --hell: #e8dcc0;
  --gedimmt: #a4937a;
  --gruen: #7bbf4e;
  --gruen-dunkel: #4e8a2e;
  --gold: #d4a017;
  --rot: #c94f38;
}

html, body {
  margin: 0;
  min-height: 100%;
  background: var(--leder);
  color: var(--hell);
  font: 15px/1.55 system-ui, -apple-system, "Segoe UI", sans-serif;
}

/* ============ Kopf ============ */
.kopf {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: .7rem 1.2rem;
  background: var(--holz);
  border-bottom: 2px solid #120d09;
  position: sticky;
  top: 0;
  z-index: 5;
}
.marke {
  font-size: 1.15rem;
  font-weight: 700;
  letter-spacing: .04em;
  color: var(--hell);
  text-decoration: none;
  white-space: nowrap;
}
.stern { color: var(--gold); }
#suche {
  flex: 1;
  max-width: 26rem;
  padding: .45rem .8rem;
  border: 1px solid #4a3a29;
  border-radius: 4px;
  background: var(--leder);
  color: var(--hell);
}
#suche:focus { outline: 2px solid var(--gruen-dunkel); }
.benutzer { margin-left: auto; display: flex; align-items: center; gap: .6rem; }
.benutzer .name { color: var(--gold); font-weight: 600; }

.ansicht { max-width: 62rem; margin: 0 auto; padding: 1.5rem 1.2rem 4rem; }

/* ============ Knoepfe & Links ============ */
button, .knopf {
  font: inherit;
  padding: .45rem .9rem;
  border: 1px solid #171310;
  border-radius: 4px;
  background: var(--holz-hell);
  color: var(--hell);
  cursor: pointer;
  text-decoration: none;
  display: inline-block;
}
button:hover, .knopf:hover { background: #46372a; }
button:focus-visible, a:focus-visible, input:focus-visible, textarea:focus-visible, select:focus-visible {
  outline: 2px solid var(--gruen);
  outline-offset: 1px;
}
button.primaer { background: var(--gruen-dunkel); border-color: #2e5c1a; font-weight: 600; }
button.primaer:hover { background: #5aa036; }
button.gefahr { background: #6e2a1c; }
button.gefahr:hover { background: #8a3423; }
a { color: var(--gruen); }

/* ============ Artikelliste ============ */
.listenkopf { display: flex; align-items: baseline; gap: 1rem; margin-bottom: 1rem; }
.listenkopf h1 { margin: 0; font-size: 1.4rem; }
.listenkopf .zaehler { color: var(--gedimmt); }
.listenkopf .neu { margin-left: auto; }
ul.artikel-liste { list-style: none; margin: 0; padding: 0; }
ul.artikel-liste li {
  display: flex;
  align-items: baseline;
  gap: .7rem;
  padding: .55rem .8rem;
  border-bottom: 1px solid #2c231a;
}
ul.artikel-liste li:hover { background: var(--holz); }
ul.artikel-liste .titel { font-weight: 600; }
ul.artikel-liste .slug { color: var(--gedimmt); font-size: .85rem; }
.badge {
  font-size: .72rem;
  padding: .1rem .45rem;
  border-radius: 3px;
  background: var(--holz-hell);
  color: var(--gedimmt);
}
.badge.generiert { color: var(--gold); border: 1px solid #6e5410; }
.badge.schreibbar { color: var(--gruen); }
.leer { color: var(--gedimmt); padding: 2rem 0; text-align: center; }

/* ============ Artikel (Pergament) ============ */
.artikelkopf { display: flex; align-items: center; gap: .6rem; margin-bottom: .8rem; flex-wrap: wrap; }
.artikelkopf .stand { color: var(--gedimmt); font-size: .85rem; margin-right: auto; }
.pergament {
  background: var(--pergament);
  color: var(--tinte);
  border: 1px solid var(--pergament-rand);
  border-radius: 3px;
  box-shadow: 0 3px 14px rgba(0, 0, 0, .5);
  padding: 2.2rem 2.6rem;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1.03rem;
}
.pergament h1, .pergament h2 {
  font-family: inherit;
  line-height: 1.25;
  margin: 1.1em 0 .45em;
  border-bottom: 1px solid #cbb98f;
  padding-bottom: .2em;
}
.pergament h1:first-child { margin-top: 0; }
.pergament p { margin: .5em 0; }
.pergament ul { margin: .5em 0; padding-left: 1.4em; }
.pergament hr.seite { border: 0; border-top: 2px dashed #cbb98f; margin: 1.4em 0; }
.pergament a { color: #1b5e9e; }
.pergament a.wikilink.tot { color: var(--rot); text-decoration: underline dotted; }

/* ============ Buch-Vorschau ============ */
.buch-halter { display: flex; flex-direction: column; align-items: center; gap: .5rem; position: relative; }
.buch-halter canvas { image-rendering: pixelated; max-width: 100%; }
.buch-nav { display: flex; align-items: center; gap: 1rem; }
.buch-nav .seite { color: var(--gedimmt); min-width: 8rem; text-align: center; }
.buch-fallback {
  background: var(--pergament);
  color: var(--tinte);
  font-family: monospace;
  padding: 1.5rem;
  white-space: pre-wrap;
  min-height: 14rem;
  width: 22rem;
}
.hinweis { color: var(--gedimmt); font-size: .85rem; text-align: center; }

/* ============ Login ============ */
.login-karte {
  max-width: 24rem;
  margin: 3rem auto;
  background: var(--holz);
  border: 1px solid #171310;
  border-radius: 6px;
  padding: 1.6rem;
}
.login-karte h1 { margin-top: 0; font-size: 1.2rem; }
.login-karte ol { color: var(--gedimmt); padding-left: 1.2rem; }
.login-karte code { color: var(--gold); }
.login-karte input {
  width: 100%;
  font-size: 1.6rem;
  letter-spacing: .35em;
  text-align: center;
  padding: .4rem;
  margin: .8rem 0;
  background: var(--leder);
  color: var(--hell);
  border: 1px solid #4a3a29;
  border-radius: 4px;
}
.fehler { color: var(--rot); }
.gruen { color: var(--gruen); }

/* ============ Editor ============ */
.editor { display: grid; grid-template-columns: 1fr 1fr; gap: 1.2rem; align-items: start; }
.editor-links { display: flex; flex-direction: column; gap: .6rem; }
.editor-felder { display: flex; gap: .6rem; }
.editor-felder input {
  flex: 1;
  padding: .45rem .6rem;
  background: var(--leder);
  color: var(--hell);
  border: 1px solid #4a3a29;
  border-radius: 4px;
}
.werkzeuge { display: flex; gap: .35rem; flex-wrap: wrap; }
.werkzeuge button { padding: .3rem .6rem; font-size: .85rem; }
.werkzeuge select { background: var(--holz-hell); color: var(--hell); border: 1px solid #171310; border-radius: 4px; }
#editor-text {
  width: 100%;
  min-height: 26rem;
  resize: vertical;
  font: .95rem/1.5 ui-monospace, "Cascadia Code", Consolas, monospace;
  background: #14100c;
  color: var(--hell);
  border: 1px solid #4a3a29;
  border-radius: 4px;
  padding: .8rem;
}
.warnungen { color: var(--gold); font-size: .85rem; }
.warnungen li { margin: .15rem 0; }
.editor-rechts { position: sticky; top: 4.5rem; }
.tabs { display: flex; gap: .4rem; margin-bottom: .6rem; }
.tabs button.aktiv { background: var(--gruen-dunkel); }
.acl {
  margin-top: 1rem;
  background: var(--holz);
  border: 1px solid #171310;
  border-radius: 6px;
  padding: 1rem;
}
.acl h2 { margin: 0 0 .6rem; font-size: 1rem; }
.acl .zeile { display: flex; gap: .5rem; align-items: center; margin: .4rem 0; flex-wrap: wrap; }
.acl input { flex: 1; min-width: 8rem; padding: .35rem .5rem; background: var(--leder); color: var(--hell); border: 1px solid #4a3a29; border-radius: 4px; }
.acl .person { background: var(--holz-hell); padding: .15rem .5rem; border-radius: 3px; font-size: .85rem; }
.acl .person button { border: 0; background: none; color: var(--rot); padding: 0 .2rem; cursor: pointer; }
.aktionen { display: flex; gap: .6rem; margin-top: 1rem; align-items: center; }
.aktionen .status { color: var(--gedimmt); font-size: .85rem; }

.dialog-hinter {
  position: fixed; inset: 0; background: rgba(0,0,0,.6);
  display: flex; align-items: center; justify-content: center; z-index: 10;
}
.dialog {
  background: var(--holz); border: 1px solid #171310; border-radius: 6px;
  max-width: 30rem; padding: 1.4rem;
}

@media (max-width: 900px) {
  .editor { grid-template-columns: 1fr; }
  .editor-rechts { position: static; }
  .pergament { padding: 1.4rem 1.2rem; }
  .kopf { flex-wrap: wrap; }
}
@media (prefers-reduced-motion: no-preference) {
  ul.artikel-liste li, button, .knopf { transition: background .15s; }
}
