/* ==========================================================================
   BetaBe Events - Home
   ========================================================================== */

/* --- Hero: ein Bildschirm ------------------------------------------------ */
/* Beim Laden steht nur die Marke mittig auf dem Video. Beim ersten Scroll
   (.is-scrolled, gesetzt in js/home.js) blendet sie aus und der eigentliche
   Hero-Inhalt faehrt von unten ein - alles auf demselben Screen. */
.hero {
  position: relative;
  min-height: 100vh;
  min-height: 100dvh;
  /* laeuft hinter dem (transparenten) Header durch, damit die Marke
     wirklich in der Bildschirmmitte sitzt */
  margin-top: calc(-1 * var(--header-h));
  overflow: hidden;
  isolation: isolate;
}

/* --- Hintergrund (Video/Poster + Farbschleier) --------------------------- */
.hero__bg { position: absolute; inset: 0; z-index: -2; }

.hero__bg img,
.hero__video {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.hero__bg img[hidden],
.hero__video[hidden] { display: none; }

/* CSS-Platzhalter, solange kein Hero-Medium da ist (und als Toenung darueber) */
.hero__glow {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(70% 60% at 15% 12%, rgba(37, 99, 235, 0.45), transparent 62%),
    radial-gradient(60% 55% at 85% 20%, rgba(59, 130, 246, 0.38), transparent 60%),
    radial-gradient(55% 50% at 60% 95%, rgba(147, 197, 253, 0.20), transparent 65%);
  animation: heroDrift 18s ease-in-out infinite alternate;
}

.hero__overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    to bottom,
    rgba(0, 0, 0, 0.55) 0%,
    rgba(0, 0, 0, 0.35) 40%,
    rgba(0, 0, 0, 0.92) 88%,
    var(--color-bg) 100%
  );
}

@keyframes heroDrift {
  from { transform: translate3d(-2%, -1%, 0) scale(1.02); }
  to   { transform: translate3d(2%, 2%, 0) scale(1.08); }
}

/* Sobald Video oder Poster stehen: Farbschleier zurueck, Abdunklung hoch,
   damit das Bild durchkommt und der Text trotzdem lesbar bleibt. */
.hero.has-media .hero__glow { opacity: 0.42; }
.hero.has-media .hero__overlay {
  background: linear-gradient(
    to bottom,
    rgba(0, 0, 0, 0.72) 0%,
    rgba(0, 0, 0, 0.48) 35%,
    rgba(0, 0, 0, 0.80) 80%,
    var(--color-bg) 100%
  );
}

/* --- Marke, mittig auf dem Video ----------------------------------------- */
.hero__lockup {
  position: absolute;
  inset: 0;
  z-index: 1;
  display: grid;
  place-items: center;
  padding: 24px;
  pointer-events: none;
  transition: transform 0.8s var(--ease);
  will-change: transform;
}

/* Nach dem ersten Scroll schwebt die Marke nach oben und wird kleiner -
   sie bleibt sichtbar, macht aber Platz fuer den Hero-Text darunter. */
.js .hero.is-scrolled .hero__lockup {
  transform: translateY(-21vh) scale(0.52);
}

.brand-lockup {
  display: flex;
  align-items: center;
  gap: clamp(14px, 2.6vw, 32px);
}

.brand-lockup__mark {
  height: clamp(84px, 15vw, 180px);
  width: auto;
  filter: drop-shadow(0 6px 30px rgba(0, 0, 0, 0.5));
}

.brand-lockup__name {
  display: grid;
  font-family: var(--font-head);
  font-size: clamp(2.5rem, 8.5vw, 5.25rem);
  font-weight: 800;
  line-height: 0.96;
  letter-spacing: -0.035em;
  color: var(--color-text);
  text-shadow: 0 2px 26px rgba(0, 0, 0, 0.5);
}

.brand-lockup__accent { color: var(--color-accent); }

/* Auch auf schmalen Handys bleibt die Marke nebeneinander - nur kleiner */
@media (max-width: 400px) {
  .brand-lockup { gap: 12px; }
  .brand-lockup__mark { height: 74px; }
  .brand-lockup__name { font-size: 2.2rem; }
}

/* --- Hero-Inhalt, erscheint beim ersten Scroll --------------------------- */
.hero__content {
  position: absolute;
  left: 0;
  right: 0;
  bottom: clamp(4.5rem, 11vh, 7.5rem);
  z-index: 2;
}

/* Versteckt wird nur mit aktivem JS - ohne JS ist alles sofort da. */
.js .hero__content {
  opacity: 0;
  transform: translateY(38px);
  transition: opacity 0.65s var(--ease), transform 0.65s var(--ease);
  pointer-events: none;
}
.js .hero.is-scrolled .hero__content {
  opacity: 1;
  transform: none;
  pointer-events: auto;
}

.hero__content h1 {
  margin-bottom: 1.1rem;
  text-wrap: balance;
  text-shadow: 0 2px 24px rgba(0, 0, 0, 0.45);
}

.hero__lead {
  font-size: clamp(1.05rem, 2.2vw, 1.25rem);
  color: var(--color-text);
  opacity: 0.85;
  max-width: 44ch;
  margin-bottom: 2rem;
  text-shadow: 0 1px 14px rgba(0, 0, 0, 0.5);
}

.hero__actions { display: flex; flex-wrap: wrap; gap: 12px; }
.hero__actions .btn { flex: 1 1 auto; }

@media (min-width: 600px) {
  .hero__actions .btn { flex: 0 0 auto; }
}

/* --- Scroll-Hinweis ------------------------------------------------------ */
.hero__scroll {
  position: absolute;
  left: 50%;
  bottom: clamp(20px, 4vh, 40px);
  transform: translateX(-50%);
  width: 26px;
  height: 42px;
  border: 1px solid var(--color-border-strong);
  border-radius: 999px;
  z-index: 1;
  transition: opacity 0.4s var(--ease);
}
.hero__scroll span {
  position: absolute;
  left: 50%;
  top: 8px;
  width: 3px;
  height: 7px;
  margin-left: -1.5px;
  border-radius: 2px;
  background: var(--color-accent-3);
  animation: scrollHint 1.8s ease-in-out infinite;
}
/* hat seinen Zweck erfuellt, sobald gescrollt wurde */
.js .hero.is-scrolled .hero__scroll { opacity: 0; }

@keyframes scrollHint {
  0%, 100% { transform: translateY(0); opacity: 1; }
  60% { transform: translateY(12px); opacity: 0.2; }
}

@media (prefers-reduced-motion: reduce) {
  .js .hero__lockup,
  .js .hero__content,
  .js .hero__scroll { transition: none; }
}

/* --- Über uns ------------------------------------------------------------ */
.about {
  display: grid;
  gap: 2.5rem;
  grid-template-columns: 1fr;
  align-items: center;
}

.about__text p { margin-top: 1rem; max-width: 52ch; }
.about__text .btn { margin-top: 1.75rem; }

/* Drei Fotos leicht schief uebereinander, wie hingelegte Polaroids.
   Die Bilder kommen aus "impressions" in data/events.json. */
.about__collage {
  position: relative;
  aspect-ratio: 1 / 1;
  width: 100%;
  max-width: 460px;
  margin-inline: auto;
}
.about__collage:empty { display: none; }

.about__collage img {
  position: absolute;
  object-fit: cover;
  border-radius: var(--radius-md);
  border: 3px solid rgba(240, 244, 255, 0.92);
  box-shadow: 0 18px 44px rgba(0, 0, 0, 0.55);
  transition: transform 0.45s var(--ease);
}

.about__collage img:nth-child(1) { width: 52%; aspect-ratio: 3/4; top: 0;      left: 2%;  transform: rotate(-7deg); }
.about__collage img:nth-child(2) { width: 50%; aspect-ratio: 3/4; top: 14%;    right: 0;  transform: rotate(6deg);  }
.about__collage img:nth-child(3) { width: 48%; aspect-ratio: 4/3; bottom: 2%;  left: 22%; transform: rotate(-2deg); }

/* Beim Drueberfahren richten sich die Bilder leicht auf */
.about__collage:hover img:nth-child(1) { transform: rotate(-4deg) scale(1.03); }
.about__collage:hover img:nth-child(2) { transform: rotate(3deg) scale(1.03); }
.about__collage:hover img:nth-child(3) { transform: rotate(-1deg) scale(1.03); }

@media (prefers-reduced-motion: reduce) {
  .about__collage img { transition: none; }
  .about__collage:hover img { transform: none; }
}

@media (min-width: 1025px) {
  .about { grid-template-columns: 1.05fr 0.95fr; gap: 4rem; }
  .about__collage { max-width: 100%; }
}

/* --- Impressionen-Teaser -------------------------------------------------- */
/* Liegt im HTML ausserhalb von .wrap und laeuft daher von Rand zu Rand,
   ohne mit 100vw zu rechnen (das wuerde die Scrollbar mitzaehlen). */
.teaser-grid {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(2, 1fr);
  padding-inline: 12px;
}

.teaser-grid .media {
  border-radius: var(--radius-md);
  aspect-ratio: 4 / 5;
}
.teaser-grid a.media { cursor: pointer; }
.teaser-grid a.media:hover img { transform: scale(1.06); }

/* Bei 5 Bildern in 2 Spalten steht das letzte sonst allein */
.teaser-grid > :last-child:nth-child(odd) { grid-column: span 2; }
.teaser-grid > :last-child:nth-child(odd).media { aspect-ratio: 16 / 9; }

@media (min-width: 600px) {
  .teaser-grid { grid-template-columns: repeat(3, 1fr); gap: 14px; }
  .teaser-grid > :last-child:nth-child(odd) { grid-column: auto; }
  .teaser-grid > :last-child:nth-child(odd).media { aspect-ratio: 4 / 5; }
}

@media (min-width: 1025px) {
  .teaser-grid {
    grid-template-columns: repeat(5, 1fr);
    gap: 16px;
    padding-inline: 20px;
  }
}
