:root {
  --color-bg: #fdfaf5;
  --color-text: #2c2a26;
  --color-accent: #e07a3f;
  --color-accent-dark: #c9622a;
  --color-muted: #6b6459;
  --color-border: #e7e0d4;
  --color-card: #ffffff;
  --radius: 12px;
}

* { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
}

html {
  max-width: 100%;
  overflow-x: hidden; /* Sicherheitsnetz - eigentliche Fixes sind unten, siehe CLAUDE.md */
  /* NICHT auf body setzen: overflow-x auf body bricht position:sticky (bekannter CSS-Fallstrick) */
}

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

img, svg, video {
  max-width: 100%;
  height: auto;
}

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

header.site-header .brand {
  font-weight: 700;
  font-size: 1.05rem;
  color: var(--color-text);
  text-decoration: none;
}

nav.site-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem 1.25rem;
}

nav.site-nav a {
  color: var(--color-muted);
  text-decoration: none;
  font-size: 0.95rem;
  white-space: nowrap;
}

nav.site-nav a:hover,
nav.site-nav a.active {
  color: var(--color-accent-dark);
}

.nav-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 36px;
  height: 32px;
  background: none;
  border: none;
  padding: 0.3rem;
  cursor: pointer;
}

.nav-toggle:hover {
  background: none;
}

.nav-toggle span {
  display: block;
  width: 100%;
  height: 2px;
  background: var(--color-text);
  border-radius: 2px;
  transition: transform 0.2s ease, opacity 0.2s ease;
}

.nav-toggle.open span:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}

.nav-toggle.open span:nth-child(2) {
  opacity: 0;
}

.nav-toggle.open span:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

@media (max-width: 640px) {
  .nav-toggle {
    display: flex;
  }

  nav.site-nav {
    display: none;
    flex-direction: column;
    width: 100%;
    gap: 0.75rem;
    padding-top: 0.75rem;
  }

  nav.site-nav.open {
    display: flex;
  }

  nav.site-nav a {
    font-size: 1rem;
    padding: 0.4rem 0;
  }
}

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

section.section {
  scroll-margin-top: 4.5rem; /* Höhe des sticky Headers, damit Anker nicht verdeckt werden */
}

section.section + section.section {
  margin-top: 2rem;
}

@media (max-width: 480px) {
  main {
    padding: 2rem 1rem;
  }

  .card {
    padding: 1.25rem;
  }

  h1 {
    font-size: 1.6rem;
  }
}

.card {
  background: var(--color-card);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: 2rem;
  overflow-wrap: anywhere; /* lange Wörter/URLs dürfen nicht die Seite sprengen */
}

h1 {
  margin-top: 0;
  font-size: 2rem;
}

h2 {
  font-size: 1.4rem;
  margin-top: 2rem;
  margin-bottom: 0.5rem;
}

h3 {
  font-size: 1.1rem;
  margin-top: 1.25rem;
  margin-bottom: 0.4rem;
}

.ext-link::after {
  content: " ↗";
  font-size: 0.85em;
}

.muted {
  color: var(--color-muted);
}

form.stack {
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
  margin-top: 1.25rem;
}

label {
  font-size: 0.9rem;
  font-weight: 600;
  margin-bottom: 0.3rem;
  display: block;
}

input, textarea {
  width: 100%;
  padding: 0.6rem 0.75rem;
  border: 1px solid var(--color-border);
  border-radius: 8px;
  font-size: 1rem;
  font-family: inherit;
}

textarea { resize: vertical; min-height: 120px; }

button {
  background: var(--color-accent);
  color: #fff;
  border: none;
  padding: 0.7rem 1.4rem;
  border-radius: 8px;
  font-size: 1rem;
  cursor: pointer;
  align-self: flex-start;
}

button:hover { background: var(--color-accent-dark); }

button:disabled {
  background: var(--color-border);
  color: var(--color-muted);
  cursor: not-allowed;
}

button:disabled:hover {
  background: var(--color-border);
}

.btn {
  display: inline-block;
  background: var(--color-accent);
  color: #fff;
  padding: 0.7rem 1.4rem;
  border-radius: 8px;
  font-size: 1rem;
  text-decoration: none;
  cursor: pointer;
  margin-top: 0.5rem;
}

.btn:hover {
  background: var(--color-accent-dark);
}

.show-more {
  display: block;
  border: none;
  margin: 1.25rem auto 0;
}

.msg {
  margin-top: 0.75rem;
  font-size: 0.9rem;
}

.msg.ok { color: #2b7a3f; }
.msg.err { color: #b3261e; }

.honeypot-field {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.table-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  margin-top: 1rem;
}

table {
  width: 100%;
  min-width: 520px; /* Tabelle darf innerhalb von .table-wrap eigenständig scrollen statt die Seite zu sprengen */
  border-collapse: collapse;
}

th, td {
  text-align: left;
  padding: 0.6rem 0.5rem;
  border-bottom: 1px solid var(--color-border);
  font-size: 0.9rem;
  vertical-align: top;
  overflow-wrap: anywhere;
}

th { color: var(--color-muted); font-weight: 600; white-space: nowrap; }

tr.unread td { font-weight: 600; }

.pill {
  display: inline-block;
  background: var(--color-accent);
  color: #fff;
  font-size: 0.75rem;
  padding: 0.1rem 0.5rem;
  border-radius: 999px;
}

.row-actions button {
  padding: 0.3rem 0.7rem;
  font-size: 0.8rem;
  margin-right: 0.4rem;
}

.row-actions button.secondary {
  background: transparent;
  color: var(--color-muted);
  border: 1px solid var(--color-border);
}

.board-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 1rem;
  margin-top: 1rem;
}

.board-member {
  padding: 1rem;
  border: 1px solid var(--color-border);
  border-radius: 8px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 0.15rem;
}

.avatar {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: var(--color-accent);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 1.05rem;
  margin-bottom: 0.5rem;
  flex-shrink: 0;
}

/* Für spätere echte Fotos: <img class="avatar" src="..."> statt Initialen-Div,
   object-fit sorgt dafür, dass auch Nicht-Quadrat-Fotos rund zugeschnitten werden. */
img.avatar {
  object-fit: cover;
}

.board-name {
  font-weight: 600;
}

.timeline {
  margin-top: 1rem;
}

.timeline-item {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  padding: 0.85rem 0;
  border-bottom: 1px solid var(--color-border);
}

.timeline-thumb {
  flex: 0 0 56px;
  width: 56px;
  height: 56px;
  border-radius: 8px;
  object-fit: cover;
  background: var(--color-border);
}

.timeline-item:last-child {
  border-bottom: none;
}

.timeline-content {
  flex: 1;
  min-width: 0;
}

.timeline-date {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--color-accent-dark);
  margin-bottom: 0.15rem;
}

.timeline-title {
  font-weight: 600;
  margin-bottom: 0.25rem;
}

.timeline-vertical {
  display: none;
  position: relative;
  margin-top: 1.5rem;
}

.timeline-vertical::before {
  content: '';
  position: absolute;
  left: 50%;
  top: 0.5rem;
  bottom: 0.5rem;
  width: 2px;
  background: var(--color-border);
  transform: translateX(-50%);
}

.tl-row {
  position: relative;
  margin-bottom: 2rem;
}

.tl-row:last-child {
  margin-bottom: 0;
}

.tl-dot {
  position: absolute;
  top: 0.35rem;
  left: 50%;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--color-accent);
  border: 3px solid var(--color-bg);
  transform: translateX(-50%);
  z-index: 1;
}

.tl-card {
  width: calc(50% - 2rem);
  background: var(--color-card);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: 1rem;
}

.tl-left .tl-card {
  margin-right: auto;
}

.tl-right .tl-card {
  margin-left: auto;
}

.tl-image {
  display: block;
  width: 100%;
  height: 110px;
  object-fit: cover;
  border-radius: calc(var(--radius) - 4px);
  margin-bottom: 0.6rem;
  background: var(--color-border);
}

.tl-date {
  font-weight: 600;
  color: var(--color-accent-dark);
  font-size: 0.85rem;
  margin-bottom: 0.2rem;
}

.tl-title {
  font-weight: 600;
  margin-bottom: 0.35rem;
}

@media (min-width: 641px) {
  .timeline-vertical {
    display: block;
  }

  #milestones-list .timeline {
    display: none;
  }
}

.news-list {
  margin-top: 1rem;
}

.news-item {
  padding: 1rem 0;
  border-bottom: 1px solid var(--color-border);
}

.news-item:last-child {
  border-bottom: none;
}

.news-date {
  font-size: 0.8rem;
  margin-bottom: 0.25rem;
}

.news-title {
  font-weight: 600;
  margin-bottom: 0.25rem;
}

footer.site-footer {
  text-align: center;
  color: var(--color-muted);
  font-size: 0.85rem;
  padding: 2rem 1rem;
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.5rem 1.25rem;
  margin-bottom: 0.75rem;
}

.link-button {
  background: none;
  border: none;
  padding: 0;
  color: var(--color-muted);
  font: inherit;
  font-size: 0.85rem;
  text-decoration: underline;
  cursor: pointer;
}

.link-button:hover {
  background: none;
  color: var(--color-accent-dark);
}

/* ── Impressum/Datenschutz-Modal ─────────────────────────────────────────── */
.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(44, 42, 38, 0.55);
  align-items: center;
  justify-content: center;
  padding: 1rem;
  z-index: 1000;
}

.modal-overlay.open {
  display: flex;
}

.modal {
  position: relative;
  background: var(--color-card);
  border-radius: var(--radius);
  width: 100%;
  max-width: 600px;
  max-height: 85vh;
  overflow-y: auto;
  padding: 2rem;
}

.modal-close {
  position: absolute;
  top: 0.5rem;
  right: 0.75rem;
  background: none;
  border: none;
  font-size: 1.75rem;
  line-height: 1;
  color: var(--color-muted);
  cursor: pointer;
  padding: 0.25rem 0.5rem;
}

.modal-close:hover {
  background: none;
  color: var(--color-accent-dark);
}

/* ── "Jetzt spenden"-CTA: fixiert, Desktop/Tablet rechter Rand, Mobile unten rechts ── */
@keyframes donate-pulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.035); }
}

.donate-cta {
  position: fixed;
  bottom: 2rem;
  right: 0;
  z-index: 500;
  display: inline-block;
  background: var(--color-accent);
  color: #fff;
  text-decoration: none;
  font-weight: 600;
  font-size: 0.95rem;
  padding: 0.9rem 1.1rem;
  border-radius: 8px 0 0 8px;
  box-shadow: 0 2px 10px rgba(44, 42, 38, 0.25);
  transition: background 0.2s ease, padding 0.2s ease;
  animation: donate-pulse 3.2s ease-in-out infinite;
  transform-origin: right center;
}

.donate-cta:hover {
  background: var(--color-accent-dark);
  padding-right: 1.4rem;
  animation-play-state: paused;
}

@media (max-width: 640px) {
  .donate-cta {
    bottom: 1rem;
    right: 1rem;
    border-radius: 999px;
    padding: 0.6rem 1rem;
    font-size: 0.8rem;
    box-shadow: 0 2px 8px rgba(44, 42, 38, 0.3);
    animation: none;
  }
}
