:root {
  color-scheme: light;
  --bg: #f6f2ea;
  --panel: rgba(255, 253, 248, 0.9);
  --panel-strong: rgba(240, 229, 208, 0.9);
  --surface: rgba(255, 255, 255, 0.9);
  --topbar: rgba(255, 253, 248, 0.96);
  --hero-start: rgba(248, 233, 208, 0.9);
  --hero-end: rgba(253, 246, 239, 0.9);
  --media-bg: #eee;
  --ink: #1d1d1d;
  --muted: #5c554d;
  --brand: #b51d1d;
  --brand-dark: #7f1313;
  --line: rgba(29, 29, 29, 0.12);
  --shadow: 0 12px 28px rgba(0, 0, 0, 0.09);
  --button-blue-light: #57a8f5;
  --button-blue: #1681df;
  --button-blue-dark: #0863b5;
  --button-blue-edge: #064b91;
}

@media (prefers-color-scheme: dark) {
  :root {
    color-scheme: dark;
    --bg: #17191d;
    --panel: rgba(32, 35, 41, 0.96);
    --panel-strong: #383137;
    --surface: #282c33;
    --topbar: rgba(32, 35, 41, 0.97);
    --hero-start: #382d27;
    --hero-end: #2c292c;
    --media-bg: #111318;
    --ink: #f2f3f5;
    --muted: #c2c6ce;
    --brand: #ff8585;
    --brand-dark: #ffaaaa;
    --line: rgba(255, 255, 255, 0.18);
    --shadow: 0 12px 28px rgba(0, 0, 0, 0.35);
  }

  body {
    background-image: none;
  }
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: Arial, Helvetica, sans-serif;
  background-color: var(--bg);
  background-image: url("Bilder/Allgemein/Konfetti3.png");
  background-position: center center;
  background-repeat: no-repeat;
  background-size: cover;
  background-attachment: fixed;
  color: var(--ink);
  line-height: 1.6;
}

a {
  color: var(--brand-dark);
  text-decoration: none;
}

a:hover { text-decoration: underline; }

img, video {
  max-width: 100%;
  display: block;
}

.site-shell {
  max-width: 1200px;
  margin: 0 auto;
  padding: 18px 16px 60px;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 40;
  background: var(--topbar);
  backdrop-filter: blur(4px);
  border-bottom: 1px solid var(--line);
}

.topbar-inner {
  position: relative;
  max-width: 1200px;
  margin: 0 auto;
  min-height: 99px;
  padding: 12px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.brand {
  position: absolute;
  left: 76px;
  right: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  max-width: none;
}

.brand img {
  width: auto;
  height: 68px;
  max-width: 40%;
  object-fit: contain;
}

.brand-name {
  color: var(--ink);
  font-size: clamp(0.8rem, 2vw, 1.25rem);
  font-weight: 700;
  line-height: 1.15;
}

.hamburger {
  position: relative;
  z-index: 31;
  border: 1px solid var(--button-blue-edge);
  border-radius: 10px;
  font-size: 1.8rem;
  width: 48px;
  height: 48px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.48) 0%, rgba(255, 255, 255, 0.12) 47%, rgba(255, 255, 255, 0) 49%),
    linear-gradient(180deg, var(--button-blue-light) 0%, var(--button-blue) 54%, var(--button-blue-dark) 100%);
  color: #fff;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.65),
    inset 0 -2px 0 rgba(0, 35, 80, 0.28),
    0 4px 0 var(--button-blue-edge),
    0 6px 10px rgba(0, 0, 0, 0.2);
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease, filter 0.15s ease;
}

.hamburger:hover,
.download-button:hover {
  filter: brightness(1.06);
  transform: translateY(-1px);
}

.hamburger:active,
.download-button:active {
  transform: translateY(3px);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.55),
    inset 0 -1px 0 rgba(0, 35, 80, 0.25),
    0 1px 0 var(--button-blue-edge),
    0 2px 4px rgba(0, 0, 0, 0.18);
}

.hamburger:focus-visible,
.download-button:focus-visible {
  outline: 3px solid #fff;
  outline-offset: 3px;
}

.nav-panel {
  position: fixed;
  inset: 100px auto 0 0;
  width: min(84vw, 280px);
  background: var(--panel);
  border-right: 1px solid var(--line);
  box-shadow: var(--shadow);
  padding: 20px 16px;
  transform: translateX(-105%);
  transition: transform 0.2s ease;
  z-index: 30;
}

.nav-panel.open {
  transform: translateX(0);
}

.nav-links {
  list-style: none;
  margin: 0;
  padding: 0;
}

.nav-links li + li {
  margin-top: 8px;
}

.nav-links a {
  display: block;
  padding: 12px 14px;
  border-radius: 10px;
  color: var(--ink);
}

.nav-links a:hover {
  background: var(--panel-strong);
  text-decoration: none;
}

.page {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 18px;
  box-shadow: var(--shadow);
  padding: 28px 22px;
}

.hero {
  background: linear-gradient(135deg, var(--hero-start) 0%, var(--hero-end) 100%);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 24px 20px;
  margin-bottom: 20px;
}

.hero h1, .page h1 {
  margin-top: 0;
  margin-bottom: 12px;
  font-size: clamp(1.8rem, 3vw, 2.7rem);
}

.hero p {
  margin: 0;
  color: var(--muted);
}

.grid {
  display: grid;
  gap: 18px;
}

.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 18px;
}

.card h2, .card h3 {
  margin-top: 0;
}

.year-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
  margin-bottom: 22px;
}

.year-select {
  padding: 10px 14px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
  color: var(--ink);
  font-size: 1rem;
}

.year-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 18px;
}

.year-overview-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 10px;
  margin: 18px 0 0;
  padding: 0;
  list-style: none;
}

.year-overview-list a {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-height: 68px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
}

.year-overview-list a:hover {
  background: var(--panel-strong);
  text-decoration: none;
}

.year-overview-back {
  margin: 0 0 16px;
}

.section-block {
  border-top: 1px solid var(--line);
  padding-top: 20px;
  margin-top: 18px;
}

.section-block:first-of-type {
  border-top: none;
  margin-top: 0;
}

.media-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 18px;
  margin-top: 18px;
}

.media-list-fit-viewport {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.media-item {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 12px;
  overflow: hidden;
}

.media-item.image-media-item {
  background: transparent;
  border: 0;
  overflow: visible;
}

.media-item img,
.media-item video,
.media-item iframe {
  width: 100%;
  height: auto;
  max-height: 260px;
  object-fit: cover;
  background: var(--media-bg);
}

.media-item img {
  cursor: zoom-in;
}

.media-item.image-media-item img {
  background: transparent;
}

.media-item img.content-image {
  max-height: none;
  object-fit: contain;
  background: transparent;
}

.verein-page .media-item img.content-image {
  width: 50%;
  margin-inline: auto;
}

.media-list-fit-viewport .media-item img,
.media-list-fit-viewport .media-item video {
  width: 100%;
  height: min(75vh, 720px);
  max-height: calc(100vh - 160px);
  object-fit: contain;
}

.content-error {
  color: var(--brand-dark);
  font-weight: 700;
}

.download-list {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.download-item {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 8px;
  max-width: 100%;
}

.download-preview {
  width: 180px;
  max-width: 100%;
  height: 120px;
  padding: 6px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
  object-fit: contain;
}

.download-button {
  display: inline-block;
  max-width: 100%;
  padding: 10px 14px;
  border: 1px solid var(--button-blue-edge);
  border-radius: 10px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.48) 0%, rgba(255, 255, 255, 0.12) 47%, rgba(255, 255, 255, 0) 49%),
    linear-gradient(180deg, var(--button-blue-light) 0%, var(--button-blue) 54%, var(--button-blue-dark) 100%);
  color: #fff;
  overflow-wrap: anywhere;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.65),
    inset 0 -2px 0 rgba(0, 35, 80, 0.28),
    0 4px 0 var(--button-blue-edge),
    0 6px 10px rgba(0, 0, 0, 0.2);
  transition: transform 0.15s ease, box-shadow 0.15s ease, filter 0.15s ease;
}

.download-button:hover {
  color: #fff;
  text-decoration: none;
}

.image-lightbox {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2vh 2vw;
  background: rgba(0, 0, 0, 0.88);
  cursor: zoom-out;
}

.image-lightbox-image {
  display: block;
  width: auto;
  height: auto;
  max-width: 96vw;
  max-height: 96vh;
  object-fit: contain;
  background: transparent;
  cursor: zoom-out;
}

body.image-lightbox-open {
  overflow: hidden;
}

.media-item .caption {
  padding: 10px 12px;
  color: var(--muted);
  font-size: 0.95rem;
}

.text-content {
  white-space: pre-line;
  color: var(--ink);
}

.muted {
  color: var(--muted);
}

@media (max-width: 640px) {
  .topbar-inner {
    padding: 10px 12px;
  }

  .brand {
    left: 72px;
    right: 12px;
    gap: 7px;
  }

  .brand img {
    height: 64px;
  }

  .nav-panel {
    top: 100px;
  }

  .page {
    padding: 18px 14px;
  }

  .section-block {
    padding-top: 14px;
  }
}
