/* Regional News — modern, schlank, blau/weiß */

:root {
  --c-primary:        #1f4ea8;
  --c-primary-dark:   #163a82;
  --c-primary-light:  #e9f0fc;
  --c-bg:             #f6f8fb;
  --c-card:           #ffffff;
  --c-text:           #1a2332;
  --c-text-muted:     #5a6577;
  --c-border:         #dde3ed;
  --c-success-bg:     #e6f4ec;
  --c-success-fg:     #1f6b3a;
  --c-error-bg:       #fdecec;
  --c-error-fg:       #8a1e1e;
  --c-warn-bg:        #fff4e0;
  --c-warn-fg:        #7a4d00;
  --radius:           10px;
  --radius-sm:        6px;
  --shadow-sm:        0 1px 3px rgba(20, 30, 60, 0.06);
  --shadow-md:        0 8px 24px rgba(20, 30, 60, 0.08);
  --max-width:        780px;
  --font:             -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
                      "Helvetica Neue", Arial, sans-serif;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--font);
  background: var(--c-bg);
  color: var(--c-text);
  font-size: 16px;
  line-height: 1.6;
}
a { color: var(--c-primary); }
a:hover { color: var(--c-primary-dark); }

.visually-hidden {
  position: absolute !important;
  width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0;
}

/* === LOGIN === */
.login-body {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  background: linear-gradient(135deg, var(--c-primary) 0%, var(--c-primary-dark) 100%);
  padding: 24px;
}
.login-card {
  background: var(--c-card);
  max-width: 420px;
  width: 100%;
  margin: auto;
  padding: 40px 32px 32px;
  border-radius: var(--radius);
  box-shadow: var(--shadow-md);
}
.brand {
  margin: 0 0 6px;
  font-size: 28px;
  font-weight: 700;
  color: var(--c-primary);
  letter-spacing: -0.01em;
}
.subtitle {
  margin: 0 0 28px;
  color: var(--c-text-muted);
  font-size: 15px;
}
.login-card form { display: flex; flex-direction: column; gap: 4px; }
.login-card label {
  font-size: 13px;
  font-weight: 600;
  color: var(--c-text);
  margin-top: 14px;
}
.login-card input[type=email],
.login-card input[type=password],
.login-card input[type=text],
.admin-wrap input[type=email],
.admin-wrap input[type=text] {
  padding: 11px 13px;
  border: 1px solid var(--c-border);
  border-radius: var(--radius-sm);
  font-size: 15px;
  font-family: inherit;
  background: #fff;
  width: 100%;
  transition: border-color .15s, box-shadow .15s;
}
.login-card input:focus,
.admin-wrap input:focus,
.admin-wrap select:focus,
.date-picker select:focus {
  outline: none;
  border-color: var(--c-primary);
  box-shadow: 0 0 0 3px rgba(31, 78, 168, 0.15);
}
.checkbox {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 16px !important;
  font-weight: 400 !important;
  font-size: 14px !important;
  color: var(--c-text-muted) !important;
}
.checkbox input { margin: 0; }
.btn-primary, .btn-secondary, .btn-danger {
  margin-top: 22px;
  padding: 12px 18px;
  border: 0;
  border-radius: var(--radius-sm);
  font-size: 15px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: background-color .15s, transform .05s;
}
.btn-primary {
  background: var(--c-primary);
  color: #fff;
}
.btn-primary:hover { background: var(--c-primary-dark); }
.btn-primary:active { transform: translateY(1px); }
.btn-secondary {
  background: var(--c-primary-light);
  color: var(--c-primary-dark);
  margin-top: 6px;
  padding: 8px 14px;
  font-size: 14px;
}
.btn-secondary:hover { background: #d6e3f8; }
.btn-danger {
  background: #fff;
  color: var(--c-error-fg);
  border: 1px solid #f1c1c1;
  margin-top: 0;
  padding: 6px 12px;
  font-size: 13px;
}
.btn-danger:hover { background: var(--c-error-bg); }

.hint {
  margin-top: 22px;
  font-size: 13px;
  color: var(--c-text-muted);
  text-align: center;
}
.login-footer {
  text-align: center;
  color: rgba(255,255,255,0.7);
  font-size: 13px;
  padding: 16px;
}

.alert {
  padding: 11px 14px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  margin-bottom: 16px;
}
.alert-error   { background: var(--c-error-bg); color: var(--c-error-fg); }
.alert-success { background: var(--c-success-bg); color: var(--c-success-fg); }

/* === TOPBAR === */
.topbar {
  background: #fff;
  border-bottom: 1px solid var(--c-border);
  box-shadow: var(--shadow-sm);
  position: sticky;
  top: 0;
  z-index: 10;
}
.topbar-inner {
  max-width: 1080px;
  margin: 0 auto;
  padding: 12px 20px;
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}
.brand-link {
  font-weight: 700;
  font-size: 18px;
  color: var(--c-primary);
  text-decoration: none;
  letter-spacing: -0.01em;
}
.date-picker { flex: 1; min-width: 200px; }
.date-picker select {
  width: 100%;
  max-width: 320px;
  padding: 8px 12px;
  font-size: 14px;
  font-family: inherit;
  border: 1px solid var(--c-border);
  border-radius: var(--radius-sm);
  background: #fff;
  color: var(--c-text);
}
.topbar-nav {
  display: flex;
  align-items: center;
  gap: 14px;
  font-size: 14px;
}
.topbar-nav .nav-link {
  text-decoration: none;
  color: var(--c-primary);
  font-weight: 500;
}
.topbar-nav .nav-link.logout {
  background: var(--c-primary-light);
  padding: 6px 12px;
  border-radius: var(--radius-sm);
}
.topbar-nav .nav-link.logout:hover { background: #d6e3f8; }
.user-email { color: var(--c-text-muted); font-size: 13px; }

/* === NEWS BODY === */
.news-main { padding: 28px 20px 60px; }
.news-wrap {
  max-width: var(--max-width);
  margin: 0 auto;
}
.day-header { margin-bottom: 30px; }
.day-greeting {
  margin: 0;
  color: var(--c-text-muted);
  font-size: 15px;
}
.day-title {
  margin: 4px 0 0;
  font-size: 32px;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--c-text);
}

.toc {
  background: #fff;
  border: 1px solid var(--c-border);
  border-radius: var(--radius);
  padding: 14px 20px;
  margin-bottom: 28px;
  font-size: 14px;
}
.toc strong {
  display: block;
  color: var(--c-text-muted);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 6px;
}
.toc ul { margin: 0; padding: 0; list-style: none; }
.toc li { margin: 4px 0; }
.toc a { text-decoration: none; }
.toc a:hover { text-decoration: underline; }

.news-section {
  background: #fff;
  border: 1px solid var(--c-border);
  border-radius: var(--radius);
  padding: 24px 28px;
  margin-bottom: 22px;
  box-shadow: var(--shadow-sm);
  scroll-margin-top: 80px;
}
.news-section h2 {
  margin: 0 0 18px;
  font-size: 22px;
  font-weight: 700;
  color: var(--c-primary-dark);
  border-bottom: 2px solid var(--c-primary-light);
  padding-bottom: 10px;
}

/* warn-section for ⚠ Unbestätigt */
.news-section:has(h2:first-child:where(:not(:empty))) {
  /* handled by content */
}

/* Markdown body styling */
.md-body { font-size: 15.5px; line-height: 1.7; }
.md-body h1, .md-body h2, .md-body h3 {
  margin-top: 1.4em;
  margin-bottom: 0.5em;
  line-height: 1.3;
  color: var(--c-text);
}
.md-body h1 { font-size: 22px; }
.md-body h2 { font-size: 19px; color: var(--c-primary-dark); }
.md-body h3 { font-size: 17px; }
.md-body h4 { font-size: 15px; margin-top: 1.2em; margin-bottom: 0.3em; }
.md-body p  { margin: 0 0 0.9em; }
.md-body ul, .md-body ol { padding-left: 22px; margin: 0 0 0.9em; }
.md-body li { margin: 0.25em 0; }
.md-body blockquote {
  margin: 1em 0;
  padding: 8px 16px;
  border-left: 4px solid var(--c-primary-light);
  background: #f6f8fb;
  color: var(--c-text-muted);
}
.md-body hr {
  border: 0;
  border-top: 1px solid var(--c-border);
  margin: 1.6em 0;
}
.md-body code {
  background: var(--c-primary-light);
  padding: 1px 6px;
  border-radius: 4px;
  font-size: 0.9em;
}
.md-body pre {
  background: #f0f3f8;
  padding: 14px 16px;
  border-radius: var(--radius-sm);
  overflow-x: auto;
  font-size: 14px;
}
.md-body pre code { background: none; padding: 0; }
.md-body a { color: var(--c-primary); }
.md-body strong { color: var(--c-text); }
.md-body table {
  width: 100%;
  border-collapse: collapse;
  margin: 1em 0;
  font-size: 14px;
}
.md-body th, .md-body td {
  border: 1px solid var(--c-border);
  padding: 8px 12px;
  text-align: left;
}
.md-body th { background: var(--c-primary-light); }

/* Highlight the "Unbestätigt" section */
#sec-07 {
  border-left: 4px solid #e0a516;
  background: #fffdf7;
}
#sec-07 h2 { color: #7a4d00; border-bottom-color: #f3dca2; }

/* === Quellen-Chip pro Story === */
.story-source {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px 12px;
  margin: 14px 0 22px;
  padding: 10px 14px;
  border: 1px solid var(--c-border);
  border-left: 3px solid var(--c-primary);
  border-radius: var(--radius-sm);
  background: #fafbfd;
  font-size: 13.5px;
  color: var(--c-text-muted);
  line-height: 1.4;
}
.story-source .src-icon {
  font-size: 16px;
  flex-shrink: 0;
}
.story-source .src-meta {
  flex: 1;
  min-width: 0;
}
.story-source .src-name {
  font-weight: 600;
  color: var(--c-text);
}
.story-source .src-author,
.story-source .src-date,
.story-source .src-tel {
  color: var(--c-text-muted);
}
.story-source .src-link {
  flex-shrink: 0;
  text-decoration: none;
  font-weight: 500;
  color: var(--c-primary);
  padding: 4px 10px;
  border-radius: 4px;
  background: var(--c-primary-light);
  transition: background-color .15s;
  font-size: 13px;
  white-space: nowrap;
}
.story-source .src-link:hover {
  background: #d6e3f8;
  color: var(--c-primary-dark);
}

@media (max-width: 500px) {
  .story-source {
    font-size: 13px;
    padding: 10px 12px;
  }
  .story-source .src-link {
    width: 100%;
    text-align: center;
    margin-top: 4px;
  }
}

.extras {
  margin-top: 30px;
  padding-top: 20px;
  border-top: 1px dashed var(--c-border);
}
.extras details {
  background: #fff;
  border: 1px solid var(--c-border);
  border-radius: var(--radius);
  padding: 14px 20px;
  margin-bottom: 12px;
}
.extras summary {
  cursor: pointer;
  font-weight: 600;
  color: var(--c-text-muted);
  font-size: 14px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.extras .md-body { margin-top: 16px; font-size: 14px; }

.empty-state {
  background: #fff;
  border: 1px dashed var(--c-border);
  border-radius: var(--radius);
  padding: 40px;
  text-align: center;
  color: var(--c-text-muted);
}

.site-footer {
  text-align: center;
  padding: 20px;
  color: var(--c-text-muted);
  font-size: 13px;
  border-top: 1px solid var(--c-border);
  background: #fff;
}

/* === ADMIN === */
.admin-wrap h1 {
  margin: 0 0 20px;
  font-size: 28px;
}
.admin-card {
  background: #fff;
  border: 1px solid var(--c-border);
  border-radius: var(--radius);
  padding: 22px 26px;
  margin-bottom: 22px;
  box-shadow: var(--shadow-sm);
}
.admin-card h2 {
  margin: 0 0 16px;
  font-size: 18px;
  color: var(--c-primary-dark);
}
.admin-card form { display: flex; flex-direction: column; gap: 4px; }
.admin-card label {
  font-size: 13px;
  font-weight: 600;
  margin-top: 10px;
}
.user-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}
.user-table th, .user-table td {
  padding: 10px 8px;
  text-align: left;
  border-bottom: 1px solid var(--c-border);
}
.user-table th {
  font-weight: 600;
  color: var(--c-text-muted);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.user-table .actions { display: flex; flex-direction: column; gap: 8px; }
.user-table details summary {
  cursor: pointer;
  font-size: 13px;
  color: var(--c-primary);
}
.inline-form {
  display: flex !important;
  flex-direction: row !important;
  gap: 8px;
  margin-top: 6px;
  flex-wrap: wrap;
}
.inline-form input[type=text] { flex: 1; min-width: 180px; }
.inline-form button { margin: 0 !important; }

/* === MOBILE === */
@media (max-width: 640px) {
  .topbar-inner { gap: 10px; }
  .brand-link { font-size: 16px; }
  .date-picker { order: 3; flex-basis: 100%; }
  .day-title { font-size: 26px; }
  .news-section { padding: 18px 18px; }
  .news-section h2 { font-size: 19px; }
  .login-card { padding: 32px 22px 28px; }
  .user-table { font-size: 13px; }
  .user-table th:nth-child(4),
  .user-table td:nth-child(4) { display: none; }
}
