:root {
  --bg: #f4f5f7;
  --card-bg: #ffffff;
  --text: #1c1f23;
  --muted: #6b7280;
  --accent: #c8102e; /* RNRW-Rot als dezenter Akzent */
  --border: #e5e7eb;
  --radius: 10px;
  --shadow: 0 1px 3px rgba(0, 0, 0, 0.08), 0 1px 2px rgba(0, 0, 0, 0.04);
}

* { box-sizing: border-box; }

/* Das hidden-Attribut muss explizite display-Werte (z. B. .login-view: flex,
   .news-grid: grid) überstimmen – sonst bleiben "ausgeblendete" Bereiche sichtbar. */
[hidden] { display: none !important; }

body {
  margin: 0;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  color: var(--text);
  background: var(--bg);
  line-height: 1.5;
}

.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem 1.25rem;
  background: var(--card-bg);
  border-bottom: 3px solid var(--accent);
  position: sticky;
  top: 0;
  z-index: 10;
}

.site-header h1 {
  margin: 0;
  font-size: 1.25rem;
  letter-spacing: 0.02em;
}

.logout-btn {
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 0.4rem 0.8rem;
  cursor: pointer;
  color: var(--muted);
  font-size: 0.85rem;
}
.logout-btn:hover { border-color: var(--accent); color: var(--accent); }

main { max-width: 1200px; margin: 0 auto; padding: 1.5rem 1.25rem 3rem; }

/* Login */
.login-view { display: flex; justify-content: center; padding-top: 3rem; }
.login-form {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 1.75rem;
  width: 100%;
  max-width: 360px;
}
.login-form h2 { margin: 0 0 0.25rem; }
.login-hint { margin: 0 0 1.25rem; color: var(--muted); font-size: 0.9rem; }
.login-form label { display: block; font-size: 0.85rem; margin-bottom: 0.35rem; }
.login-form input {
  width: 100%;
  padding: 0.6rem 0.7rem;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 1rem;
  margin-bottom: 1rem;
}
.login-form input:focus { outline: 2px solid var(--accent); border-color: var(--accent); }
.login-form button {
  width: 100%;
  padding: 0.65rem;
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: 6px;
  font-size: 1rem;
  cursor: pointer;
}
.login-form button:disabled { opacity: 0.6; cursor: progress; }

.error { color: var(--accent); font-size: 0.9rem; margin: 0.75rem 0 0; }
.status { color: var(--muted); }

/* News-Grid */
.news-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1.25rem;
}

.card {
  display: flex;
  flex-direction: column;
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
  text-decoration: none;
  color: inherit;
  transition: transform 0.12s ease, box-shadow 0.12s ease;
}
.card:hover { transform: translateY(-2px); box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1); }

.card-img {
  width: 100%;
  aspect-ratio: 16 / 10;
  object-fit: cover;
  background: #e9eaed;
  display: block;
}

.card-body { padding: 0.9rem 1rem 1.1rem; display: flex; flex-direction: column; gap: 0.4rem; }

.card-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem 0.6rem;
  font-size: 0.75rem;
  color: var(--muted);
}
.card-station { font-weight: 600; color: var(--accent); }

.card-title { margin: 0; font-size: 1.05rem; line-height: 1.3; }

.card-teaser {
  margin: 0;
  font-size: 0.9rem;
  color: #374151;
  display: -webkit-box;
  -webkit-line-clamp: 4;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

@media (max-width: 480px) {
  .news-grid { grid-template-columns: 1fr; }
  .site-header h1 { font-size: 1.05rem; }
}
