/* ==========================================================================
   GEN Z REGELT · Spenden-Transparenz (spenden.css)
   Nur Tokens aus tokens.css. Mobile first (ab 375 px).
   CD: #212121 · ein Orange (#FF7302) · Weiß · kantig · Lexend.
   ========================================================================== */

/* Lexend lokal (kein CDN). Dateien siehe fonts/README.md; bis dahin greift der Systemfallback. */
@font-face { font-family: 'Lexend'; src: local('Lexend'), local('Lexend Regular'); font-weight: 400; font-display: swap; }
@font-face { font-family: 'Lexend'; src: local('Lexend Bold'); font-weight: 700; font-display: swap; }
@font-face { font-family: 'Lexend'; src: local('Lexend ExtraBold'); font-weight: 800; font-display: swap; }
@font-face { font-family: 'Lexend'; src: local('Lexend Black'); font-weight: 900; font-display: swap; }

.sp-page {
  --sp-bar-h: 64px;
  --sp-step: 44px;
  margin: 0;
  background: var(--ds-color-bg-canvas);
  color: var(--ds-color-text-primary);
  font-family: var(--ds-font-primary);
  font-size: var(--ds-text-size);
  line-height: var(--ds-text-line);
  -webkit-text-size-adjust: 100%;
}

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

.sp-container {
  width: 100%;
  max-width: 1120px;
  margin-inline: auto;
  padding-inline: var(--ds-space-md);
  box-sizing: border-box;
}

.sp-muted { color: var(--ds-color-text-muted); }
.sp-strong { color: var(--ds-color-text-primary); font-weight: 700; }

/* ---------- Header ---------- */
.sp-header {
  position: sticky;
  top: 0;
  z-index: 10;
  background: var(--ds-color-bg-canvas);
  border-bottom: 1px solid var(--ds-color-border-subtle);
}
.sp-header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--ds-space-md);
  min-height: 60px;
}
.sp-header__actions { display: flex; align-items: center; gap: var(--ds-space-sm); }
@media (max-width: 479px) { .sp-brand__title { display: none; } }
.sp-brand { display: inline-flex; align-items: center; gap: var(--ds-space-sm); color: inherit; text-decoration: none; }
.sp-brand__logo { display: block; }
.sp-brand__title { font-weight: 900; text-transform: uppercase; white-space: nowrap; }

/* ---------- Buttons ---------- */
.sp-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: var(--ds-space-xs) var(--ds-space-lg);
  border-radius: var(--ds-radius-pill);
  font-family: var(--ds-font-primary);
  font-weight: 800;
  text-decoration: none;
  text-transform: uppercase;
  border: 2px solid transparent;
  cursor: pointer;
  transition: background-color 0.2s ease, color 0.2s ease, border-color 0.2s ease, transform 0.2s ease;
}
.sp-btn[hidden] { display: none; }
.sp-btn--small { white-space: nowrap; min-height: 40px; padding-inline: var(--ds-space-md); font-size: var(--ds-label-size); line-height: var(--ds-label-line); }
.sp-btn--large { min-height: 56px; padding-inline: var(--ds-space-xl); }
.sp-btn--primary { background: var(--ds-color-accent); color: var(--ds-color-text-on-accent); }
.sp-btn--primary:hover { background: var(--ds-color-accent-hover); transform: translateY(-2px); }
.sp-btn--ghost { color: var(--ds-color-text-primary); border-color: var(--ds-color-border-strong); }
.sp-btn--ghost:hover { border-color: var(--ds-color-accent); color: var(--ds-color-accent); }
.sp-btn:focus-visible, .sp-brand:focus-visible, .sp-footer a:focus-visible { outline: none; box-shadow: var(--ds-shadow-focus); }

/* ---------- Hero ---------- */
.sp-hero { padding-block: var(--ds-space-2xl) var(--ds-space-xl); text-align: center; }
.sp-hero__title { margin: 0 auto var(--ds-space-lg); max-width: 16ch; text-wrap: balance; }
.sp-hero__lead { margin: 0 auto; max-width: 58ch; color: var(--ds-color-text-secondary); }

/* ---------- Panel (Pool, Mitmachen) ---------- */
.sp-panel {
  background: var(--ds-color-bg-elevated);
  border: 1px solid var(--ds-color-border-subtle);
  border-radius: var(--ds-radius-lg);
  padding: var(--ds-space-lg) var(--ds-space-md);
}

/* ---------- Pool-Strahl ---------- */
.sp-pool { margin-block-end: calc(var(--ds-space-2xl) * 1.5); }
.sp-scale { display: flex; justify-content: space-between; gap: var(--ds-space-md); margin-block: var(--ds-space-md) var(--ds-space-xs); }
.sp-beam {
  display: flex;
  gap: 3px;
  height: var(--sp-bar-h);
  padding: 3px;
  box-sizing: border-box;
  background: var(--ds-color-bg-subtle);
  border: 1px solid var(--ds-color-border-subtle);
  border-radius: var(--ds-radius-md);
  overflow: hidden;
  animation: sp-reveal 1.4s cubic-bezier(0.22, 1, 0.36, 1) both;
}
.sp-seg {
  box-sizing: border-box;
  flex: 0 1 auto; /* Segmente schrumpfen anteilig, damit die Fugen in 100 % passen */
  min-width: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  padding-inline: var(--ds-space-2xs);
  overflow: hidden;
  background: var(--ds-color-accent);
  color: var(--ds-color-text-on-accent);
  border-radius: var(--ds-radius-sm);
  text-align: center;
  line-height: 1.15;
  transition: background-color 0.2s ease;
}
.sp-seg:hover { background: var(--ds-color-accent-hover); }
.sp-seg__name { font-weight: 800; font-size: var(--ds-label-size); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.sp-seg__sum { font-size: var(--ds-label-size); white-space: nowrap; overflow: hidden; max-width: 100%; opacity: 0.8; }
.sp-seg--rest {
  background: transparent;
  border: 1px dashed var(--ds-color-border-strong);
  color: var(--ds-color-text-muted);
}
.sp-seg--rest:hover { background: transparent; }

@keyframes sp-reveal {
  from { clip-path: inset(0 100% 0 0); }
  to { clip-path: inset(0 0 0 0); }
}

.sp-legend {
  display: flex;
  flex-wrap: wrap;
  gap: var(--ds-space-xs) var(--ds-space-md);
  list-style: none;
  margin: var(--ds-space-sm) 0 0;
  padding: 0;
}
.sp-legend li { display: inline-flex; align-items: center; gap: var(--ds-space-xs); font-size: var(--ds-label-size); line-height: var(--ds-label-line); color: var(--ds-color-text-secondary); }
.sp-legend__dot { width: 10px; height: 10px; border-radius: var(--ds-radius-sm); background: var(--ds-color-accent); }
.sp-legend__dot--rest { background: transparent; border: 1px dashed var(--ds-color-border-strong); box-sizing: border-box; }

/* ---------- Gesamtsumme ---------- */
.sp-total {
  margin-top: var(--ds-space-xl);
  padding-top: var(--ds-space-xl);
  border-top: 1px solid var(--ds-color-border-subtle);
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--ds-space-sm);
}
.sp-total p { margin: 0; }
.sp-count { display: inline-block; text-align: center; font-variant-numeric: tabular-nums; }
.sp-total__value { font-variant-numeric: tabular-nums; font-size: clamp(2.5rem, 9vw, 4rem); line-height: 1.05; font-weight: 900; }
.sp-pill {
  display: inline-flex;
  align-items: center;
  gap: var(--ds-space-xs);
  padding: var(--ds-space-xs) var(--ds-space-md);
  border: 1px solid var(--ds-color-border-strong);
  border-radius: var(--ds-radius-md);
  background: var(--ds-color-bg-subtle);
  font-weight: 700;
  text-align: left;
}
.sp-pill__dot {
  flex: none;
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--ds-color-accent);
  animation: sp-pulse 2s ease-in-out infinite;
}
@keyframes sp-pulse { 50% { opacity: 0.3; } }
.sp-total .sp-btn { margin-top: var(--ds-space-md); }
.sp-note { max-width: 52ch; font-size: 0.875rem; line-height: 1.5; color: var(--ds-color-text-muted); }

/* ---------- Städte ---------- */
.sp-cities { margin-block-end: calc(var(--ds-space-2xl) * 1.5); }
.sp-cities .ds-h2 { margin: 0; }
.sp-cities__note { margin: var(--ds-space-sm) 0 0; max-width: var(--ds-reading-max); }
.sp-grid { display: grid; gap: var(--ds-space-md); margin-top: var(--ds-space-xl); }

.sp-city {
  background: var(--ds-color-bg-elevated);
  border: 1px solid var(--ds-color-border-subtle);
  border-radius: var(--ds-radius-lg);
  padding: var(--ds-space-lg) var(--ds-space-md) var(--ds-space-sm);
  transition: border-color 0.2s ease;
}
.sp-city:hover { border-color: var(--ds-color-accent-border); }
.sp-city__head { display: flex; justify-content: space-between; align-items: baseline; gap: var(--ds-space-md); margin-bottom: var(--ds-space-sm); }
.sp-city__name { margin: 0; font-size: var(--ds-h4-size); line-height: var(--ds-h4-line); font-weight: 800; }
.sp-city__sum { color: var(--ds-color-accent); font-size: var(--ds-h4-size); line-height: var(--ds-h4-line); font-weight: 900; white-space: nowrap; }
.sp-city__flag { color: var(--ds-color-text-muted); font-weight: 400; }

.sp-city__ig { display: flex; align-items: baseline; gap: var(--ds-space-xs); margin: 0 0 var(--ds-space-sm); }
.sp-city__ig-label { color: var(--ds-color-text-muted); }
.sp-city__ig-link { color: var(--ds-color-text-primary); font-weight: 700; text-decoration: underline; text-decoration-color: var(--ds-color-accent); text-underline-offset: 3px; overflow-wrap: anywhere; }
.sp-city__ig-link:hover { color: var(--ds-color-accent); }
.sp-city__ig-link:focus-visible { outline: none; box-shadow: var(--ds-shadow-focus); }
.sp-city__ig-todo { color: var(--ds-color-text-muted); }

.sp-items { list-style: none; margin: 0; padding: 0; }
.sp-item {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--ds-space-xs) var(--ds-space-md);
  padding-block: var(--ds-space-sm);
  border-top: 1px solid var(--ds-color-border-subtle);
}
.sp-item__label { flex: 1 1 9rem; min-width: 0; overflow-wrap: anywhere; }
.sp-item__meta { display: inline-flex; align-items: center; gap: var(--ds-space-sm); margin-left: auto; white-space: nowrap; }
.sp-item__cost { color: var(--ds-color-text-secondary); }

.sp-vote {
  display: inline-flex;
  align-items: center;
  gap: var(--ds-space-2xs);
  padding: var(--ds-space-2xs) var(--ds-space-xs);
  border-radius: var(--ds-radius-sm);
  border: 1px solid var(--ds-color-accent-border);
  background: var(--ds-color-accent-soft);
  color: var(--ds-color-accent);
  font-size: var(--ds-label-size);
  line-height: var(--ds-label-line);
  font-weight: 700;
}
.sp-vote--low { border-color: var(--ds-color-border-strong); background: transparent; color: var(--ds-color-text-muted); }
.sp-vote svg { width: 12px; height: 12px; flex: none; }
.sp-empty { margin: 0; padding-bottom: var(--ds-space-md); color: var(--ds-color-text-muted); }

/* ---------- Ablauf ---------- */
.sp-flow { margin-block-end: calc(var(--ds-space-2xl) * 1.5); }
.sp-flow .ds-h2 { margin: 0; }
.sp-flow__lead { margin: var(--ds-space-sm) 0 0; max-width: var(--ds-reading-max); }
.sp-timeline { list-style: none; margin: var(--ds-space-xl) 0 0; padding: 0; }
.sp-step { position: relative; display: flex; gap: var(--ds-space-md); padding-bottom: var(--ds-space-xl); }
.sp-step:last-child { padding-bottom: 0; }
.sp-step:not(:last-child)::before {
  content: '';
  position: absolute;
  left: calc(var(--sp-step) / 2 - 1px);
  top: var(--sp-step);
  bottom: 0;
  width: 2px;
  background: var(--ds-color-border-strong);
}
.sp-step__no {
  flex: none;
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: var(--sp-step);
  height: var(--sp-step);
  border-radius: 50%;
  background: var(--ds-color-accent);
  color: var(--ds-color-text-on-accent);
  font-weight: 900;
  font-size: var(--ds-h4-size);
}
.sp-step h3 { margin: var(--ds-space-2xs) 0 var(--ds-space-2xs); }
.sp-step p { margin: 0; max-width: 56ch; }

/* ---------- Mitmachen ---------- */
.sp-join { display: grid; gap: var(--ds-space-xl); margin-block-end: calc(var(--ds-space-2xl) * 1.5); align-items: center; }
.sp-join__copy .ds-h2 { margin: 0 0 var(--ds-space-md); }
.sp-join__text { margin: 0; max-width: var(--ds-reading-max); color: var(--ds-color-text-secondary); }
.sp-join__panel { display: flex; flex-direction: column; gap: var(--ds-space-md); }
.sp-join__panel h3, .sp-join__panel p { margin: 0; }
.sp-checklist { margin: 0; padding: 0; list-style: none; }
.sp-checklist li { display: flex; align-items: center; gap: var(--ds-space-sm); padding-block: var(--ds-space-xs); border-top: 1px solid var(--ds-color-border-subtle); font-weight: 700; }
.sp-checklist li::before { content: ''; flex: none; width: 8px; height: 8px; border-radius: 50%; background: var(--ds-color-accent); }
.sp-join__panel .sp-btn { align-self: stretch; }

.sp-notice { padding: var(--ds-space-md); border: 1px solid var(--ds-color-accent-border); background: var(--ds-color-accent-soft); border-radius: var(--ds-radius-md); }
.sp-notice[hidden] { display: none; }

/* ---------- Footer ---------- */
.sp-footer { border-top: 1px solid var(--ds-color-border-subtle); padding-block: var(--ds-space-lg); }
.sp-footer__inner { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: var(--ds-space-md); }
.sp-footer__links { display: flex; flex-wrap: wrap; gap: var(--ds-space-md); }
.sp-footer__links a { color: var(--ds-color-text-muted); text-decoration: none; }
.sp-footer__links a:hover { color: var(--ds-color-text-primary); }

/* ---------- Mobil: Segment-Beschriftung entfällt, Legende übernimmt ---------- */
@media (max-width: 767px) {
  .sp-seg__name, .sp-seg__sum { display: none; }
  .sp-pill { flex-wrap: wrap; }
}

/* ---------- Ab Tablet ---------- */
@media (min-width: 768px) {
  .sp-page { --sp-bar-h: 88px; }
  .sp-container { padding-inline: var(--ds-space-xl); }
  .sp-hero { padding-block: calc(var(--ds-space-2xl) * 1.75) var(--ds-space-2xl); }
  .sp-panel { padding: var(--ds-space-2xl) var(--ds-space-xl); }
  .sp-legend { display: none; } /* Beschriftung steckt im Strahl */
  .sp-grid { grid-template-columns: 1fr 1fr; }
  .sp-city { padding: var(--ds-space-lg) var(--ds-space-lg) var(--ds-space-sm); }
  .sp-flow { display: grid; grid-template-columns: 1fr 1.1fr; gap: calc(var(--ds-space-2xl) * 1.5); align-items: start; }
  .sp-flow__head { position: sticky; top: calc(60px + var(--ds-space-xl)); }
  .sp-timeline { margin-top: 0; }
  .sp-join { grid-template-columns: 1fr 1fr; gap: calc(var(--ds-space-2xl) * 1.5); }
  .sp-join__panel { padding: var(--ds-space-xl); }
}

@media (prefers-reduced-motion: reduce) {
  .sp-beam, .sp-pill__dot { animation: none; }
  .sp-btn, .sp-seg, .sp-city { transition: none; }
  .sp-btn--primary:hover { transform: none; }
}

/* Header-Button: kurzer Text auf dem Handy, langer ab Tablet */
.sp-short { display: inline; }
.sp-long { display: none; }
@media (min-width: 768px) {
  .sp-short { display: none; }
  .sp-long { display: inline; }
}

/* Pulsierender Ring um den Beitritts-Button (nur transform/opacity, läuft ohne Layout-Arbeit) */
.sp-btn--pulse { position: relative; }
.sp-btn--pulse::after {
  content: '';
  position: absolute;
  inset: -2px;
  border: 2px solid var(--ds-color-accent);
  border-radius: inherit;
  opacity: 0;
  pointer-events: none;
  animation: sp-ring 2.2s cubic-bezier(0.22, 1, 0.36, 1) infinite;
}
@keyframes sp-ring {
  0% { transform: scale(1); opacity: 0.75; }
  70%, 100% { transform: scale(1.16, 1.5); opacity: 0; }
}
@media (prefers-reduced-motion: reduce) {
  .sp-btn--pulse::after { animation: none; }
}

/* ---------- Aufklappbare Mittel-Liste (ab 4 Einträgen) ---------- */
.sp-more { margin: 0 0 var(--ds-space-sm); }
.sp-more__summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--ds-space-md);
  min-height: 44px;
  padding: var(--ds-space-xs) var(--ds-space-sm);
  border: 1px solid var(--ds-color-border-strong);
  border-radius: var(--ds-radius-md);
  font-weight: 700;
  cursor: pointer;
  list-style: none;
  transition: border-color 0.2s ease;
}
.sp-more__summary::-webkit-details-marker { display: none; }
.sp-more__summary:hover { border-color: var(--ds-color-accent); }
.sp-more__summary:focus-visible { outline: none; box-shadow: var(--ds-shadow-focus); }
.sp-more__summary::after {
  content: '';
  flex: none;
  width: 8px;
  height: 8px;
  margin-top: -4px;
  border-right: 2px solid var(--ds-color-accent);
  border-bottom: 2px solid var(--ds-color-accent);
  transform: rotate(45deg);
  transition: transform 0.2s ease, margin 0.2s ease;
}
.sp-more[open] .sp-more__summary::after { transform: rotate(-135deg); margin-top: 4px; }
.sp-more .sp-items { margin-top: var(--ds-space-2xs); }

/* ---------- Unterstützende Organisationen ---------- */
.sp-supporters { margin-block-end: calc(var(--ds-space-2xl) * 1.5); }
.sp-supporters[hidden] { display: none; }
.sp-supporters .ds-h2 { margin: 0; }
.sp-supporters__lead { margin: var(--ds-space-sm) 0 0; max-width: var(--ds-reading-max); }
.sp-supporters__list {
  list-style: none;
  margin: var(--ds-space-xl) 0 0;
  padding: 0;
  display: grid;
  gap: var(--ds-space-sm);
  grid-template-columns: repeat(auto-fill, minmax(15rem, 1fr));
}
.sp-supporter {
  display: flex;
  flex-direction: column;
  gap: var(--ds-space-2xs);
  padding: var(--ds-space-md);
  background: var(--ds-color-bg-elevated);
  border: 1px solid var(--ds-color-border-subtle);
  border-radius: var(--ds-radius-lg);
}
.sp-supporter__name { font-weight: 800; overflow-wrap: anywhere; }
.sp-supporter__name--link {
  color: var(--ds-color-text-primary);
  text-decoration: underline;
  text-decoration-color: var(--ds-color-accent);
  text-underline-offset: 3px;
}
.sp-supporter__name--link:hover { color: var(--ds-color-accent); }
.sp-supporter__name--link:focus-visible { outline: none; box-shadow: var(--ds-shadow-focus); }
.sp-supporter__note { color: var(--ds-color-text-muted); }
.sp-supporter__amount { color: var(--ds-color-accent); font-weight: 900; font-variant-numeric: tabular-nums; font-size: 1.25rem; }

@media (prefers-reduced-motion: reduce) {
  .sp-more__summary, .sp-more__summary::after { transition: none; }
}

/* ---------- Hintergrund-Logo (fix im Viewport, scrollt nicht mit dem Inhalt) ---------- */
.sp-page::before {
  content: '';
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background: url('/logo/genz-regelt-hintergrund.png') center / min(92vmin, 960px) no-repeat;
  /* Dunkle Bildfläche wird per Luminanz-Maske ausgeblendet, nur Orange und Weiß bleiben sichtbar */
  -webkit-mask: url('/logo/genz-regelt-hintergrund.png') center / min(92vmin, 960px) no-repeat;
  mask: url('/logo/genz-regelt-hintergrund.png') center / min(92vmin, 960px) no-repeat;
  -webkit-mask-mode: luminance;
  mask-mode: luminance;
  opacity: 0.07;
}
@media print { .sp-page::before { display: none; } }
.sp-btn__arrow { margin-inline-end: 0.5em; }
