:root {
  --bg: #0f1419;
  --panel: #1a222c;
  --text: #e8eef4;
  --muted: #8b9aab;
  --accent: #3d9cf0;
  --accent-dim: #2a6fa8;
  --border: #2a3542;
  --danger: #e05c5c;
  --ok: #5cbf7a;
  /* Lesefläche für eingebettetes HTML (oft aus hellem UI kopiert) */
  --prose-bg: #f0f4f8;
  --prose-surface: #ffffff;
  --prose-text: #15202b;
  --prose-muted: #4a667a;
  --prose-heading: #0d1218;
  --prose-link: #0a5fbd;
  --prose-border: #c5d0dc;
  --prose-code-bg: #e8eef4;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: system-ui, "Segoe UI", Roboto, Ubuntu, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.55;
  min-height: 100vh;
}

a {
  color: var(--accent);
  text-decoration: none;
}
a:hover {
  text-decoration: underline;
}

/* Öffentliche Seiten (Startseite, Artikel, 404): helles Layout wie Artikel-Lesefläche */
body.layout-public {
  background: var(--prose-bg);
  color: var(--prose-text);
}

body.layout-public a {
  color: var(--prose-link);
}

body.layout-public a:hover {
  color: #084298;
}

body.layout-public .wrap {
  background: var(--prose-surface);
  border: 1px solid var(--prose-border);
  border-radius: 12px;
  padding: 1rem 1.35rem 2.25rem;
  margin: 1rem auto 2rem;
  box-shadow: 0 1px 4px rgba(15, 20, 25, 0.06);
}

body.layout-public header.site {
  border-bottom-color: var(--prose-border);
  margin-bottom: 0.75rem;
  padding-bottom: 0.5rem;
}

body.layout-public header.site .site-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  column-gap: 0.65rem;
  row-gap: 0.35rem;
}

body.layout-public .site-logo-link {
  flex-shrink: 0;
  line-height: 0;
  border-radius: 6px;
  overflow: hidden;
  box-shadow: 0 0 0 1px var(--prose-border);
}

body.layout-public .site-logo {
  width: 36px;
  height: 36px;
  display: block;
  object-fit: contain;
}

body.layout-public .site-lead {
  flex: 1 1 12rem;
  min-width: 0;
}

body.layout-public header.site h1,
body.layout-public header.site h1 a,
body.layout-public header.site .site-title a {
  color: var(--prose-heading);
}

body.layout-public header.site .site-title {
  margin: 0;
  font-size: 1.08rem;
  line-height: 1.2;
  font-weight: 650;
}

body.layout-public header.site .site-title a {
  text-decoration: none;
}

body.layout-public header.site .sub,
body.layout-public header.site .sub a {
  margin: 0.12rem 0 0;
  font-size: 0.75rem;
  line-height: 1.25;
  color: var(--prose-muted);
}

body.layout-public nav.top {
  margin-top: 0;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.45rem 1rem;
  font-size: 0.875rem;
}

@media (min-width: 640px) {
  body.layout-public nav.top {
    margin-left: auto;
  }
}

@media (max-width: 639px) {
  body.layout-public nav.top {
    flex-basis: 100%;
  }
}

body.layout-public ul.news-list li {
  border-bottom-color: var(--prose-border);
}

body.layout-public ul.news-list .meta {
  color: var(--prose-muted);
}

body.layout-public ul.news-list h2 a {
  color: var(--prose-heading);
}

body.layout-public article > .hint {
  color: var(--prose-muted);
}

body.layout-public article > h1 {
  color: var(--prose-heading);
}

body.layout-public .hint {
  color: var(--prose-muted);
}

.wrap {
  max-width: 860px;
  margin: 0 auto;
  padding: 1.25rem 1rem 3rem;
}

header.site {
  border-bottom: 1px solid var(--border);
  margin-bottom: 1.5rem;
  padding-bottom: 1rem;
}
header.site h1 {
  margin: 0 0 0.25rem;
  font-size: 1.35rem;
}
header.site .sub {
  color: var(--muted);
  font-size: 0.9rem;
}

nav.top {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 1.25rem;
  align-items: center;
  margin-top: 0.75rem;
}

.badge {
  display: inline-block;
  font-size: 0.75rem;
  padding: 0.15rem 0.45rem;
  border-radius: 4px;
  background: var(--panel);
  border: 1px solid var(--border);
  color: var(--muted);
}
.badge.published {
  border-color: #2a5c3d;
  color: var(--ok);
}
.badge.pending {
  border-color: #5c4a2a;
  color: #e0b85c;
}
.badge.draft {
  border-color: var(--border);
  color: var(--muted);
}

ul.news-list {
  list-style: none;
  padding: 0;
  margin: 0;
}
ul.news-list li {
  padding: 1rem 0;
  border-bottom: 1px solid var(--border);
}
ul.news-list .meta {
  font-size: 0.85rem;
  color: var(--muted);
  margin-bottom: 0.35rem;
}
ul.news-list h2 {
  margin: 0;
  font-size: 1.15rem;
}

/* Artikel-Inhalt: heller Kartenbereich, damit eingefügtes HTML lesbar bleibt */
.article-body {
  background: var(--prose-surface);
  color: var(--prose-text);
  border: 1px solid var(--prose-border);
  border-radius: 8px;
  padding: 1.25rem 1.5rem;
  margin-top: 1rem;
  box-shadow: 0 1px 0 rgba(15, 20, 25, 0.06);
}

.article-body :where(h1, h2, h3, h4, h5, h6) {
  color: var(--prose-heading);
  font-weight: 650;
  line-height: 1.25;
  margin: 1.1em 0 0.45em;
}

.article-body :where(h1) {
  font-size: 1.65rem;
  margin-top: 0.35em;
}
.article-body :where(h2) {
  font-size: 1.28rem;
}
.article-body :where(h3) {
  font-size: 1.1rem;
}

.article-body :where(p, li, dd, dt, td, th, span, div, label) {
  color: inherit;
}

.article-body :where(strong, b) {
  color: var(--prose-heading);
}

.article-body :where(a) {
  color: var(--prose-link);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.article-body :where(a:hover) {
  color: #084298;
}

.article-body :where(ul, ol) {
  padding-left: 1.35rem;
}

.article-body :where(blockquote) {
  margin: 1rem 0;
  padding: 0.5rem 0 0.5rem 1rem;
  border-left: 4px solid var(--prose-border);
  color: var(--prose-muted);
  background: var(--prose-bg);
  border-radius: 0 6px 6px 0;
}

.article-body :where(table) {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.95rem;
  margin: 1rem 0;
  background: var(--prose-surface);
}

.article-body :where(th, td) {
  border: 1px solid var(--prose-border);
  padding: 0.55rem 0.65rem;
  text-align: left;
  vertical-align: top;
}

.article-body :where(th) {
  background: var(--prose-bg);
  color: var(--prose-heading);
  font-weight: 600;
}

.article-body :where(hr) {
  border: none;
  border-top: 1px solid var(--prose-border);
  margin: 1.25rem 0;
}

.article-body :where(code, kbd) {
  font-family: ui-monospace, Consolas, monospace;
  font-size: 0.88em;
  background: var(--prose-code-bg);
  color: var(--prose-heading);
  padding: 0.12em 0.4em;
  border-radius: 4px;
}

.article-body :where(pre) {
  font-family: ui-monospace, Consolas, monospace;
  font-size: 0.88rem;
  background: #1e293b;
  color: #e2e8f0;
  padding: 1rem 1.1rem;
  border-radius: 8px;
  overflow: auto;
  margin: 1rem 0;
}

.article-body :where(pre code) {
  background: transparent;
  color: inherit;
  padding: 0;
  font-size: inherit;
}

.article-body img {
  max-width: 100%;
  height: auto;
}

.form-grid label {
  display: block;
  font-size: 0.85rem;
  color: var(--muted);
  margin-bottom: 0.25rem;
}
.form-grid input[type="text"],
.form-grid input[type="datetime-local"],
.form-grid select,
.form-grid textarea {
  width: 100%;
  padding: 0.5rem 0.65rem;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: #121920;
  color: var(--text);
  font: inherit;
}
.form-grid textarea {
  min-height: 280px;
  font-family: ui-monospace, Consolas, monospace;
  font-size: 0.9rem;
}
.form-row {
  margin-bottom: 1rem;
}
.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  align-items: center;
  margin-top: 1rem;
}

button,
.btn {
  cursor: pointer;
  border: none;
  border-radius: 6px;
  padding: 0.55rem 1rem;
  font: inherit;
  background: var(--accent);
  color: #fff;
  text-decoration: none;
  display: inline-block;
}
button.secondary,
.btn.secondary {
  background: var(--panel);
  color: var(--text);
  border: 1px solid var(--border);
}
button.danger,
.btn.danger {
  background: var(--danger);
}

.login-box {
  max-width: 400px;
  margin: 3rem auto;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 1.5rem;
}
.login-box .error {
  color: var(--danger);
  font-size: 0.9rem;
  margin-bottom: 0.75rem;
}

table.admin {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}
table.admin th,
table.admin td {
  text-align: left;
  padding: 0.5rem 0.35rem;
  border-bottom: 1px solid var(--border);
}
table.admin th {
  color: var(--muted);
  font-weight: 600;
}

.hint {
  font-size: 0.8rem;
  color: var(--muted);
  margin-top: 0.35rem;
}
