@import url('https://fonts.googleapis.com/css2?family=Fraunces:opsz,wght@9..144,600;9..144,800&family=Manrope:wght@400;500;600;700&display=swap');

/* ===== SPENDENLAUF THEME ===== */
:root {
  --sp-bg-1: #050b08;
  --sp-bg-2: #0c1a13;
  --sp-bg-3: #13241a;
  --sp-surface: rgba(9, 22, 16, 0.82);
  --sp-surface-strong: rgba(10, 26, 19, 0.94);
  --sp-border: rgba(126, 226, 168, 0.2);
  --sp-text: #ecfff5;
  --sp-muted: #b7d5c6;
  --sp-accent: #7ee2a8;
  --sp-accent-2: #f3d07d;
  --sp-shadow: 0 22px 60px rgba(0, 0, 0, 0.45);
  --sp-radius-lg: 28px;
  --sp-radius-md: 18px;
  --sp-display: "Fraunces", "Times New Roman", serif;
  --sp-body: "Manrope", "Segoe UI", system-ui, sans-serif;
}

body.spendenlauf-page {
  min-height: 100%;
  color: var(--sp-text);
  font-family: var(--sp-body);
  background:
    radial-gradient(1000px 520px at 12% 6%, rgba(126, 226, 168, 0.12), transparent 65%),
    radial-gradient(900px 520px at 82% 10%, rgba(243, 208, 125, 0.12), transparent 70%),
    linear-gradient(180deg, var(--sp-bg-1) 0%, var(--sp-bg-2) 45%, var(--sp-bg-3) 100%);
}

/* ===== NAVBAR (KEEP) ===== */
.spendenlauf-page .site-header {
  position: sticky;
  top: 0;
  z-index: 100;
}

.spendenlauf-page .nav-link.is-current {
  color: #fff;
}

.spendenlauf-page .nav-link.is-current::after {
  width: 100%;
  left: 0;
}

/* ===== HERO VIDEO ===== */
.sp-hero-video {
  position: relative;
  min-height: 100vh;
  display: grid;
  align-items: center;
  overflow: hidden;
  isolation: isolate;
}

.sp-hero-video::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 2;
  background:
    radial-gradient(500px 320px at 20% 12%, rgba(255, 224, 170, 0.12), transparent 70%),
    radial-gradient(600px 420px at 85% 18%, rgba(126, 226, 168, 0.1), transparent 72%);
  pointer-events: none;
}

.sp-hero-video::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -1px;
  height: clamp(120px, 18vh, 200px);
  background:
    linear-gradient(180deg, rgba(5, 11, 8, 0) 0%, rgba(5, 11, 8, 0.7) 40%, rgba(5, 11, 8, 1) 100%);
  clip-path: polygon(0 30%, 100% 0, 100% 100%, 0 100%);
  z-index: 3;
  pointer-events: none;
}

.hero-media {
  position: absolute;
  inset: 0;
  z-index: 1;
}

.hero-media video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: saturate(1.08) contrast(1.05);
  transform: scale(1.05);
  animation: hero-drift 26s ease-in-out infinite alternate;
}

.hero-overlay {
  position: absolute;
  inset: 0;
  z-index: 2;
  background:
    linear-gradient(180deg, rgba(0, 0, 0, 0.2) 0%, rgba(5, 12, 9, 0.75) 70%, rgba(5, 12, 9, 0.95) 100%),
    radial-gradient(80% 60% at 50% 35%, rgba(0, 0, 0, 0.15), rgba(0, 0, 0, 0.7));
  mix-blend-mode: multiply;
}

.hero-content {
  position: relative;
  z-index: 4;
  width: min(720px, 92vw);
  margin-inline: auto;
  padding: clamp(22px, 4vw, 42px);
  border-radius: var(--sp-radius-lg);
  background: linear-gradient(180deg, rgba(7, 18, 13, 0.88), rgba(7, 18, 13, 0.62));
  border: 1px solid rgba(255, 255, 255, 0.12);
  box-shadow: var(--sp-shadow);
  backdrop-filter: blur(14px);
  display: grid;
  gap: 10px;
  text-align: left;
  animation: hero-reveal 0.9s ease-out both;
}

.sp-kicker {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px;
  border-radius: 999px;
  border: 1px solid rgba(126, 226, 168, 0.45);
  background: rgba(8, 23, 16, 0.7);
  color: var(--sp-accent);
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.2em;
}

.hero-content h1 {
  margin: 0;
  font-family: var(--sp-display);
  font-weight: 800;
  font-size: clamp(2.4rem, 5vw, 3.7rem);
  letter-spacing: 0.3px;
}

.sp-intro {
  margin: 0;
  max-width: 60ch;
  color: var(--sp-muted);
  font-size: clamp(1rem, 1.6vw, 1.2rem);
}

/* ===== HERO TO GALLERY TRANSITION ===== */
.sp-gallery {
  position: relative;
  z-index: 5;
  margin-top: -90px;
  padding: clamp(24px, 4vw, 56px);
  border-radius: clamp(20px, 4vw, 36px);
  background: linear-gradient(180deg, rgba(10, 24, 18, 0.96), rgba(10, 24, 18, 0.92));
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: 0 28px 80px rgba(0, 0, 0, 0.55);
}

.sp-gallery::before {
  content: "";
  position: absolute;
  left: 8%;
  right: 8%;
  top: -36px;
  height: 72px;
  border-radius: 999px;
  background: radial-gradient(60% 120% at 50% 50%, rgba(126, 226, 168, 0.18), transparent 70%);
  filter: blur(12px);
  z-index: -1;
}

.sp-gallery.container {
  width: min(1600px, 94vw);
}

.sp-gallery h2 {
  margin: 0 0 6px;
  font-family: var(--sp-display);
  font-size: clamp(1.8rem, 3vw, 2.6rem);
}

.sp-gallery p {
  margin: 0;
  color: var(--sp-muted);
}

/* ===== GALLERY (MASONRY COLUMNS) ===== */
.gallery-grid {
  margin-top: clamp(18px, 2.6vw, 30px);
  column-count: 3;
  column-gap: 8px;
}

.gallery-item {
  position: relative;
  display: inline-block;
  width: 100%;
  break-inside: avoid;
  margin: 0 4px 8px;
  overflow: hidden;
  border-radius: var(--sp-radius-md);
  border: 1px solid rgba(255, 255, 255, 0.06);
  background: rgba(6, 16, 12, 0.95);
  box-shadow: 0 12px 34px rgba(0, 0, 0, 0.35);
  isolation: isolate;
  transform: translateZ(0);
  transition: transform 0.35s ease, box-shadow 0.35s ease, border-color 0.35s ease;
}

.gallery-item img,
.gallery-item video {
  width: 100%;
  height: auto;
  display: block;
  border-radius: inherit;
}

.gallery-item video {
  background: #0a120e;
}

@media (hover: hover) {
  .gallery-item:hover {
    transform: translateY(-6px);
    box-shadow: 0 18px 48px rgba(0, 0, 0, 0.45);
    border-color: rgba(126, 226, 168, 0.35);
  }

  .gallery-item:hover img {
    transform: scale(1.03);
  }
}

.gallery-item img {
  transition: transform 0.5s ease;
}

.gallery-item figcaption {
  display: none;
}

/* ===== STORY BEATS ===== */
.gallery-grid .gallery-item:nth-child(1),
.gallery-grid .gallery-item:nth-child(14),
.gallery-grid .gallery-item:nth-child(32),
.gallery-grid .gallery-item:nth-child(19),
.gallery-grid .gallery-item:nth-child(24),
.gallery-grid .gallery-item:nth-child(2) {
  border-color: rgba(243, 208, 125, 0.45);
  box-shadow: 0 20px 52px rgba(0, 0, 0, 0.5);
}

.gallery-grid .gallery-item:nth-child(1)::before,
.gallery-grid .gallery-item:nth-child(14)::before,
.gallery-grid .gallery-item:nth-child(32)::before,
.gallery-grid .gallery-item:nth-child(19)::before,
.gallery-grid .gallery-item:nth-child(24)::before,
.gallery-grid .gallery-item:nth-child(2)::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(5, 11, 8, 0) 45%, rgba(5, 11, 8, 0.82) 100%);
  z-index: 1;
}

.gallery-grid .gallery-item:nth-child(1)::after,
.gallery-grid .gallery-item:nth-child(14)::after,
.gallery-grid .gallery-item:nth-child(32)::after,
.gallery-grid .gallery-item:nth-child(19)::after,
.gallery-grid .gallery-item:nth-child(24)::after,
.gallery-grid .gallery-item:nth-child(2)::after {
  position: absolute;
  left: 18px;
  right: 18px;
  bottom: 18px;
  z-index: 2;
  font-family: var(--sp-display);
  font-size: clamp(1rem, 2.1vw, 1.35rem);
  line-height: 1.25;
  color: #f8f3e8;
  text-shadow: 0 10px 24px rgba(0, 0, 0, 0.55);
  white-space: pre-line;
  content: "";
}

.gallery-grid .gallery-item:nth-child(1)::after {
  content: "Waldstadion im Sonnenschein.\A Ein Tag, der Gemeinschaft feiert.";
}

.gallery-grid .gallery-item:nth-child(14)::after {
  content: "Laufen, Walken, Anfeuern.\A Jede Begegnung zählt.";
}

.gallery-grid .gallery-item:nth-child(32)::after {
  content: "Gemeinsam 660 Kilometer.\A Schritt für Schritt Solidarität.";
}

.gallery-grid .gallery-item:nth-child(19)::after {
  content: "1.500 Euro Startgelder.\A 1.150 Euro aus Spenden & Verkauf.";
}

/*.gallery-grid .gallery-item:nth-child(24)::after {
  content: "20. April: Übergabe an den Angelman e.V.\A Ein besonderer Moment in Stockstadt.";
}*/

.gallery-grid .gallery-item:nth-child(2)::after {
  content: "Was bleibt: Zusammenhalt,\A Dank und Hoffnung.";
}

/* ===== LIGHTBOX ===== */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 999;
  display: grid;
  align-content: center;
  justify-items: center;
  padding: clamp(14px, 2.8vw, 28px);
  background: rgba(4, 9, 7, 0.92);
  backdrop-filter: blur(8px);
}

.lightbox[hidden] {
  display: none;
}

.lightbox-media-wrap {
  width: min(94vw, 1200px);
  max-height: 85vh;
  display: grid;
  place-items: center;
}

.lightbox-media-wrap img,
.lightbox-media-wrap video {
  max-width: 100%;
  max-height: 85vh;
  width: auto;
  height: auto;
  object-fit: contain;
  border-radius: 14px;
  border: 1px solid rgba(126, 226, 168, 0.25);
  box-shadow: 0 18px 55px rgba(0, 0, 0, 0.55);
  background: #040b08;
}

.lightbox-caption {
  margin-top: 12px;
  text-align: center;
  color: var(--sp-muted);
  font-size: 0.95rem;
}

.lightbox-close,
.lightbox-nav {
  position: absolute;
  border: 1px solid rgba(126, 226, 168, 0.35);
  background: rgba(6, 16, 12, 0.92);
  color: #ecfff5;
  border-radius: 999px;
  cursor: pointer;
  transition: transform 0.2s ease, border-color 0.2s ease, background 0.2s ease;
  display: grid;
  place-items: center;
}

.lightbox-close {
  top: 16px;
  right: 16px;
  width: 42px;
  height: 42px;
  font-size: 1.6rem;
  line-height: 1;
}

.lightbox-nav {
  top: 50%;
  transform: translateY(-50%);
  width: 46px;
  height: 46px;
  font-size: 1.4rem;
  z-index: 2;
}

.lightbox-prev {
  left: clamp(10px, 2vw, 20px);
}

.lightbox-next {
  right: clamp(10px, 2vw, 20px);
}

.lightbox-nav:hover,
.lightbox-close:hover {
  background: rgba(16, 42, 30, 0.92);
  border-color: rgba(126, 226, 168, 0.6);
  transform: translateY(-50%) scale(1.05);
}

.lightbox-close:hover {
  transform: scale(1.05);
}

html.lightbox-open,
body.lightbox-open {
  overflow: hidden;
}

/* ===== ANIMATIONS ===== */
@keyframes hero-drift {
  0% { transform: scale(1.05) translateY(0); }
  100% { transform: scale(1.08) translateY(-8px); }
}

@keyframes hero-reveal {
  0% { opacity: 0; transform: translateY(14px); }
  100% { opacity: 1; transform: translateY(0); }
}

@media (prefers-reduced-motion: reduce) {
  .hero-media video {
    animation: none;
    transform: none;
  }

  .hero-content {
    animation: none;
  }

  .gallery-item,
  .gallery-item img {
    transition: none;
  }
}

/* ===== RESPONSIVE ===== */
@media (max-width: 900px) {
  .hero-content {
    text-align: center;
  }

  .sp-kicker {
    margin-inline: auto;
  }
}

@media (max-width: 720px) {
  .sp-gallery {
    margin-top: -70px;
  }

  .gallery-grid {
    column-count: 2;
    column-gap: 8px;
  }
}

@media (max-width: 520px) {
  .sp-hero-video::after {
    clip-path: polygon(0 45%, 100% 10%, 100% 100%, 0 100%);
  }

  .gallery-grid {
    column-count: 1;
  }
}
