:root {
  --paper: #f7f4ee;
  --ink: #1a1a17;
  --ink-soft: #4a473f;
  --rule: #1a1a17;
  --accent: #a02b2b;
  --accent-soft: #c96a4f;
  --card-bg: #ffffff;
  --pill-bg: #eae5d8;
  --pill-active: #1a1a17;
  --shadow: 0 1px 3px rgba(0,0,0,0.08);
  /* Bewusst nur bereits vorinstallierte Systemschriften — keine externen
     Font-Ladevorgänge (z.B. Google Fonts), siehe Datenschutzerklärung. */
  --serif: Georgia, 'Times New Roman', 'Liberation Serif', serif;
  --body-serif: Georgia, 'Times New Roman', 'Liberation Serif', serif;
  --sans: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  line-height: 1.5;
}

/* ---------- Masthead ---------- */
.masthead {
  border-bottom: 4px double var(--rule);
  padding: 18px 20px 0;
  background: var(--paper);
  position: sticky;
  top: 0;
  z-index: 10;
}

.masthead-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-family: var(--sans);
  font-size: 0.78rem;
  color: var(--ink-soft);
  border-bottom: 1px solid var(--rule);
  padding-bottom: 8px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.lang-switch { display: flex; gap: 4px; }
.lang-btn {
  border: 1px solid var(--ink);
  background: transparent;
  color: var(--ink);
  font-family: var(--sans);
  font-weight: 600;
  font-size: 0.72rem;
  padding: 3px 8px;
  cursor: pointer;
  border-radius: 2px;
}
.lang-btn.active, .lang-btn:hover { background: var(--ink); color: var(--paper); }

.masthead-title {
  font-family: var(--serif);
  font-weight: 900;
  font-size: clamp(2.4rem, 7vw, 4rem);
  text-align: center;
  margin: 10px 0 0;
  letter-spacing: -0.01em;
}
.masthead-title .daily { color: var(--accent); font-style: italic; font-weight: 700; }

.masthead-sub {
  text-align: center;
  font-family: var(--body-serif);
  font-style: italic;
  color: var(--ink-soft);
  margin: 4px 0 14px;
  font-size: 0.95rem;
}

.main-nav {
  display: flex;
  justify-content: center;
  gap: 0;
  border-top: 2px solid var(--rule);
  flex-wrap: wrap;
}
.nav-btn {
  background: none;
  border: none;
  border-right: 1px solid var(--rule);
  padding: 12px 20px;
  font-family: var(--sans);
  font-weight: 700;
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  cursor: pointer;
  color: var(--ink-soft);
}
.nav-btn:last-child { border-right: none; }
.nav-btn.active { color: var(--accent); background: var(--pill-bg); }
.nav-btn:hover { color: var(--accent); }

/* ---------- Main / tabs ---------- */
main { max-width: 1180px; margin: 0 auto; padding: 24px 20px 60px; }
.tab-panel { display: none; }
.tab-panel.active { display: block; animation: fadeIn 0.25s ease; }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

.section-bar {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 10px;
  border-bottom: 3px solid var(--rule);
  padding-bottom: 8px;
  margin-bottom: 14px;
}
.section-bar h2 {
  font-family: var(--serif);
  font-size: 1.9rem;
  margin: 0;
}
.section-intro {
  font-family: var(--body-serif);
  color: var(--ink-soft);
  margin: 0 0 16px;
  max-width: 70ch;
}
.week-badge {
  font-family: var(--sans);
  font-size: 0.78rem;
  font-weight: 700;
  background: var(--accent);
  color: #fff;
  padding: 4px 10px;
  border-radius: 20px;
}

.refresh-btn, .pill {
  cursor: pointer;
  font-family: var(--sans);
  font-weight: 600;
  border-radius: 20px;
  border: 1px solid var(--ink);
  background: var(--card-bg);
  padding: 6px 14px;
  font-size: 0.82rem;
}
.refresh-btn:hover, .pill:hover { background: var(--pill-bg); }
.pill.active { background: var(--pill-active); color: #fff; }

.category-pills { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 6px; }
.last-updated { font-size: 0.78rem; color: var(--ink-soft); margin: 4px 0 16px; }

/* ---------- Feed cards ---------- */
.feed-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(270px, 1fr));
  gap: 20px;
}
.loading, .empty-hint, .error-msg {
  font-family: var(--body-serif);
  font-style: italic;
  color: var(--ink-soft);
  grid-column: 1 / -1;
  padding: 30px 0;
  text-align: center;
}
.error-msg { color: var(--accent); }

.article-card {
  background: var(--card-bg);
  border: 1px solid #ddd6c4;
  box-shadow: var(--shadow);
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.article-card .card-cat {
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-weight: 700;
  color: var(--accent);
}
.article-card h3 {
  font-family: var(--serif);
  font-size: 1.15rem;
  margin: 0;
  line-height: 1.28;
}
.article-card h3 a { color: var(--ink); text-decoration: none; }
.article-card h3 a:hover { text-decoration: underline; }
.article-card .card-meta {
  font-size: 0.75rem;
  color: var(--ink-soft);
  margin-top: auto;
  padding-top: 6px;
  border-top: 1px solid #eee7d5;
}

/* ---------- AI tools ---------- */
.weekly-picks {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 20px;
  margin-bottom: 24px;
}
.weekly-card {
  background: linear-gradient(135deg, #1a1a17, #33302a);
  color: #f7f4ee;
  padding: 20px;
  border-radius: 4px;
}
.weekly-card .wk-level {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--accent-soft);
  font-weight: 700;
}
.weekly-card h3 { font-family: var(--serif); margin: 6px 0; font-size: 1.3rem; }
.weekly-card p { font-family: var(--body-serif); opacity: 0.92; margin: 0 0 12px; }
.weekly-card a.video-link {
  color: #fff;
  font-weight: 600;
  font-size: 0.85rem;
  text-decoration: underline;
}

.tip-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 18px;
}
.tip-card {
  background: var(--card-bg);
  border: 1px solid #ddd6c4;
  box-shadow: var(--shadow);
  padding: 16px;
}
.tip-card .tip-tool { font-weight: 700; font-size: 0.78rem; color: var(--accent); text-transform: uppercase; }
.tip-card h4 { font-family: var(--serif); margin: 6px 0; font-size: 1.05rem; }
.tip-card p { font-size: 0.9rem; color: var(--ink-soft); margin: 0 0 10px; }
.tip-card .tip-actions { display: flex; gap: 12px; font-size: 0.8rem; flex-wrap: wrap; }
.tip-card .tip-actions a { color: var(--ink); font-weight: 600; }
.tip-card .level-badge {
  display: inline-block;
  font-size: 0.68rem;
  border-radius: 10px;
  padding: 2px 8px;
  margin-left: 8px;
  font-weight: 700;
}
.level-badge.beginner { background: #d7ead9; color: #1f5c2c; }
.level-badge.advanced { background: #f3d9c4; color: #8a4a12; }

/* ---------- Security updates (BSI-Stil) ---------- */
.severity-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 4px 0 18px;
}
.sev-badge {
  display: inline-block;
  font-family: var(--sans);
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  padding: 3px 10px;
  border-radius: 3px;
  color: #fff;
}
.sev-badge.sev-critical { background: #7a0d0d; }
.sev-badge.sev-high     { background: #a02b2b; }
.sev-badge.sev-medium   { background: #c97a1e; }
.sev-badge.sev-low      { background: #4c7a3a; }
.sev-badge.sev-unknown  { background: #6b6858; }

.security-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.security-row {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  background: var(--card-bg);
  border: 1px solid #ddd6c4;
  border-left-width: 6px;
  border-left-style: solid;
  padding: 12px 16px;
  box-shadow: var(--shadow);
}
.security-row.sev-critical { border-left-color: #7a0d0d; }
.security-row.sev-high     { border-left-color: #a02b2b; }
.security-row.sev-medium   { border-left-color: #c97a1e; }
.security-row.sev-low      { border-left-color: #4c7a3a; }
.security-row.sev-unknown  { border-left-color: #6b6858; }

.security-row .sev-badge { flex-shrink: 0; margin-top: 2px; }
.security-main { flex: 1; min-width: 0; }
.security-main h3 { font-family: var(--serif); font-size: 1.05rem; margin: 0 0 4px; line-height: 1.3; }
.security-main h3 a { color: var(--ink); text-decoration: none; }
.security-main h3 a:hover { text-decoration: underline; }
.security-affected { font-size: 0.82rem; color: var(--ink-soft); margin-bottom: 4px; }
.os-tag {
  display: inline-block;
  font-weight: 700;
  text-transform: uppercase;
  font-size: 0.68rem;
  letter-spacing: 0.03em;
}

/* ---------- Forum ---------- */
.forum-layout {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 20px;
}
@media (max-width: 720px) { .forum-layout { grid-template-columns: 1fr; } }

.thread-list { display: flex; flex-direction: column; gap: 8px; }
.thread-item {
  text-align: left;
  background: var(--card-bg);
  border: 1px solid #ddd6c4;
  padding: 10px 12px;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  gap: 2px;
  font-family: var(--sans);
}
.thread-item.active { border-color: var(--accent); background: #fdf1ea; }
.thread-item .thread-title { font-weight: 700; font-size: 0.9rem; }
.thread-item .thread-meta { font-size: 0.72rem; color: var(--ink-soft); }

.thread-view {
  background: var(--card-bg);
  border: 1px solid #ddd6c4;
  padding: 20px;
  min-height: 240px;
}
.thread-view h3 { font-family: var(--serif); margin-top: 0; }
.thread-view .thread-desc { color: var(--ink-soft); font-size: 0.9rem; margin-bottom: 16px; }
.comment { border-top: 1px solid #eee7d5; padding: 10px 0; }
.comment .c-author { font-weight: 700; font-size: 0.85rem; }
.comment .c-text { font-size: 0.9rem; margin: 4px 0 0; }
.comment-form { margin-top: 18px; display: flex; flex-direction: column; gap: 8px; }
.comment-form input, .comment-form textarea {
  font-family: var(--sans);
  padding: 8px 10px;
  border: 1px solid #ccc;
  border-radius: 3px;
  font-size: 0.9rem;
}
.comment-form button {
  align-self: flex-start;
  background: var(--accent);
  color: #fff;
  border: none;
  padding: 8px 18px;
  border-radius: 3px;
  font-weight: 700;
  cursor: pointer;
}
.empty-hint { padding: 60px 0; }

/* Honeypot: für Bots "sichtbar" im DOM, für Menschen unsichtbar (nicht display:none,
   damit einfache Bots es trotzdem ausfüllen) */
.hp-field {
  position: absolute !important;
  left: -9999px !important;
  width: 1px; height: 1px;
  opacity: 0;
}

.form-status { font-size: 0.8rem; color: var(--accent); }

/* ---------- Footer ---------- */
.site-footer {
  border-top: 3px double var(--rule);
  text-align: center;
  padding: 20px;
  font-size: 0.78rem;
  color: var(--ink-soft);
}
.footer-links { margin-top: 4px; letter-spacing: 0.02em; }
.footer-legal { margin-top: 10px; }
.footer-legal a { color: var(--ink-soft); text-decoration: underline; }
.footer-legal a:hover { color: var(--accent); }

.source-note { font-size: 0.75rem; color: var(--ink-soft); margin-top: 18px; font-style: italic; }

/* ---------- Witze ---------- */
.joke-of-day {
  background: linear-gradient(135deg, #1a1a17, #33302a);
  color: #f7f4ee;
  padding: 22px 24px;
  border-radius: 4px;
  margin-bottom: 24px;
}
.joke-of-day-label {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--accent-soft);
  font-weight: 700;
  margin-bottom: 8px;
}
.joke-of-day .joke-setup {
  font-family: var(--body-serif);
  font-size: 1.15rem;
  margin: 0 0 6px;
}
.joke-of-day .joke-punchline {
  font-family: var(--body-serif);
  font-style: italic;
  font-weight: 700;
  color: var(--accent-soft);
  margin: 0;
}

.joke-cat-overview {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 12px;
  margin-bottom: 24px;
}
.joke-cat-card {
  cursor: pointer;
  font-family: var(--sans);
  background: var(--card-bg);
  border: 1px solid #ddd6c4;
  box-shadow: var(--shadow);
  border-radius: 4px;
  padding: 14px 10px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  text-align: center;
}
.joke-cat-card:hover { background: var(--pill-bg); }
.joke-cat-card.active { background: var(--pill-active); color: #fff; border-color: var(--pill-active); }
.joke-cat-icon { font-size: 1.6rem; }
.joke-cat-name { font-weight: 700; font-size: 0.82rem; }
.joke-cat-count {
  font-size: 0.7rem;
  color: var(--ink-soft);
}
.joke-cat-card.active .joke-cat-count { color: #ddd6c4; }

.joke-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(270px, 1fr));
  gap: 18px;
}
.joke-card {
  background: var(--card-bg);
  border: 1px solid #ddd6c4;
  box-shadow: var(--shadow);
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.joke-card-cat {
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-weight: 700;
  color: var(--accent);
}
.joke-card .joke-setup {
  font-family: var(--body-serif);
  margin: 0;
}
.joke-card .joke-punchline {
  font-family: var(--body-serif);
  font-style: italic;
  font-weight: 700;
  color: var(--accent);
  margin: 0;
}
.joke-card .joke-punchline.hidden { display: none; }
.joke-reveal-btn {
  align-self: flex-start;
  cursor: pointer;
  font-family: var(--sans);
  font-weight: 600;
  border-radius: 20px;
  border: 1px solid var(--ink);
  background: transparent;
  padding: 5px 12px;
  font-size: 0.78rem;
}
.joke-reveal-btn:hover { background: var(--pill-bg); }
