/* === Reset === */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

/* === Variablen === */
:root {
  --footer-height: 80px;
}

/* === Viewport scrollt + Snap === */
html, body {
  height: auto;
  min-height: 100svh;
  background: transparent;
  font-family: 'Anni6', sans-serif;
  color: black;
  overflow-x: hidden;
  overflow-y: auto;
  scroll-snap-type: y proximity;
  -webkit-overflow-scrolling: touch;
}

/* === p5 Canvas: echter Hintergrund === */
canvas {
  position: fixed !important;
  top: 0;
  left: 0;
  width: 100vw !important;
  height: 100vh !important;
  z-index: -1;
  pointer-events: none;
}

/* === Overlay (UI & Posts) === */
.overlay {
  position: relative;
  width: 100%;
  display: flex;
  flex-direction: column;
  min-height: 100svh;
  z-index: 1;
}

/* === Countdown Header === */
header {
  position: fixed;
  top: 0;
  right: 0;
  padding: 12px 16px;
  background: transparent;
  z-index: 20;
  font-size: 1rem;
}

/* === Posts-Bereich === */
main#postContainer {
  flex: 1;
  padding: 80px 16px 100px 16px;
  scroll-padding-top: 80px;
  scroll-padding-bottom: 100px;
  min-height: calc(100svh - 80px - 100px);
}

/* === Einzelner Post === */
.post {
  scroll-snap-align: start;
  max-width: 90vw;
  margin: 0 auto 40px;
  background: transparent;
  padding: 16px;
  border-radius: 12px;
  transition: all 0.3s ease;
}

/* === Optionaler Text-Hintergrund auf Info-Seite === */
/*
.post p {
  background: rgba(255, 255, 255, 0.8);
  padding: 1em;
  border-radius: 12px;
}
*/

.post h2 {
  font-size: 1rem;
  font-weight: bold;
  margin-bottom: 8px;
}

.post p {
  font-size: 1rem;
  line-height: 1.4;
}

.post .expandable {
  max-height: 240px;
  overflow: hidden;
  position: relative;
}

.post.expanded .expandable {
  max-height: none;
}

.expand-trigger {
  display: inline-block;
  font-weight: bold;
  cursor: pointer;
  margin-top: 8px;
  animation: colorCycle 6s infinite;
}

/* === Footer Icons === */
footer {
  position: fixed;
  bottom: 0;
  left: 0;
  width: 100%;
  display: flex;
  justify-content: space-around;
  align-items: center;
  padding: 1em;
  background: transparent;
  z-index: 40;
  pointer-events: auto;
}

footer .icon {
  flex: 1;
  text-align: center;
}

button.icon,
a.icon {
  background: transparent;
  border: none;
  padding: 0.5em;
  cursor: pointer;
  pointer-events: auto;
}

button.icon img,
a.icon img {
  width: 24px;
  height: 24px;
  display: block;
  margin: 0 auto;
}

/* === Media / Video Overlay === */
.media-overlay {
  position: fixed;
  inset: 0;
  background: transparent;
  display: none;
  justify-content: center;
  align-items: center;
  z-index: 30;
  padding-bottom: var(--footer-height);
}

.media-overlay.active {
  display: flex;
}

.media-overlay img,
.media-overlay video {
  max-width: 100%;
  max-height: calc(100% - var(--footer-height));
}

/* === Close-Button im Overlay === */
.media-overlay .close-btn {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 44px;
  height: 44px;
  padding: 10px;
  border: none;
  background: transparent;
  cursor: pointer;
  z-index: 40;
}

.media-overlay .close-btn:focus-visible {
  outline: 2px solid rgba(0, 0, 0, 0.4);
  outline-offset: 2px;
}

.media-overlay .close-btn img {
  width: 20px;
  height: 20px;
  display: block;
}

/* === Farbwechsel für Labels === */
@keyframes colorCycle {
  0%   { color: deeppink; }
  25%  { color: aqua; }
  50%  { color: mediumspringgreen; }
  75%  { color: darkorange; }
  100% { color: skyblue; }
}

a,
.expand-trigger,
.media-trigger {
  font-weight: bold;
  animation: colorCycle 6s infinite;
  cursor: pointer;
}

/* === Responsive === */
@media (min-width: 600px) {
  .post {
    max-width: 500px;
  }
}
