/* ============================================================
   Ava-Veda – Main Stylesheet
   ============================================================
   Fonts: Cormorant Garamond (display/headings) & Inter (text)
   ============================================================ */

/* ───────────── Reset & Base ─────────────────────── */
*,
*::before,
*::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  scroll-snap-type: y mandatory;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  font-weight: 400;
  font-size: clamp(1rem, 2.5vw, 1.25rem);
  line-height: 1.6;
  color: #fff;
  background: #1a1a1a;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* ───────────── Menu Button ──────────────────────── */
.menu-btn {
  position: fixed;
  top: 1.25rem;
  left: 1.25rem;
  z-index: 100;
  width: 40px;
  height: 40px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid rgba(255, 255, 255, 0.25);
  border-radius: 8px;
  cursor: pointer;
  padding: 8px;
  transition: background 0.3s ease, transform 0.2s ease;
}

.menu-btn:hover {
  background: rgba(0, 0, 0, 0.55);
}

.menu-btn:active {
  transform: scale(0.95);
}

.menu-btn__line {
  display: block;
  width: 100%;
  height: 2px;
  background: #fff;
  border-radius: 1px;
  transition: transform 0.3s ease, opacity 0.3s ease;
  transform-origin: center;
}

/* Animated X when menu is open */
.menu-btn.is-active .menu-btn__line:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}
.menu-btn.is-active .menu-btn__line:nth-child(2) {
  opacity: 0;
}
.menu-btn.is-active .menu-btn__line:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

/* ───────────── Side Navigation ──────────────────── */
.nav-side {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 99;
  width: min(300px, 80vw);
  height: 100vh;
  height: 100dvh;
  background: rgba(10, 10, 10, 0.95);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  padding: 5.5rem 2rem 2rem;
  transform: translateX(-100%);
  transition: transform 0.4s cubic-bezier(0.22, 1, 0.36, 1);
  overflow-y: auto;
}

.nav-side.is-open {
  transform: translateX(0);
}

.nav-side__list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.nav-side__link {
  display: block;
  font-family: 'Cormorant Garamond', Georgia, serif;
  font-size: clamp(1.5rem, 4vw, 2rem);
  font-weight: 600;
  color: #fff;
  text-decoration: none;
  padding: 0.5rem 0.75rem;
  border-radius: 6px;
  transition: background 0.3s ease, padding-left 0.3s ease;
}

.nav-side__link:hover,
.nav-side__link:focus-visible {
  background: rgba(255, 255, 255, 0.1);
  padding-left: 1.25rem;
}

/* ───────────── Navigation Backdrop ──────────────── */
.nav-backdrop {
  position: fixed;
  inset: 0;
  z-index: 98;
  background: rgba(0, 0, 0, 0.5);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.4s ease;
}

.nav-backdrop.is-visible {
  opacity: 1;
  pointer-events: auto;
}

/* ───────────── Segments (scroll-snap pages) ──────── */
.segment {
  position: relative;
  width: 100%;
  height: 100vh;
  height: 100dvh;
  min-height: 100vh;
  min-height: 100dvh;
  scroll-snap-align: start;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  background-size: cover;
  background-position: center;
  background-attachment: fixed;
}

/* Fallback for mobile browsers that don't support fixed backgrounds */
@supports not (background-attachment: fixed) {
  .segment {
    background-attachment: scroll;
  }
}

/* ───────────── Background images ────────────────── */
.segment--hero  { background-image: url('../images/web/ava-veda.jpg'); }
#musik         { background-image: url('../images/web/musik.jpg'); }
#musiktheater  { background-image: url('../images/web/musiktheater.jpg'); }
#musikvideo    { background-image: url('../images/web/musikvideo.jpg'); }
#kunst         { background-image: url('../images/web/kunst.jpg'); }
#impressum     { background-image: url('../images/web/impressum.jpg'); }

/* ───────────── Overlay ──────────────────────────── */
.segment__overlay {
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background: linear-gradient(
    135deg,
    rgba(0, 0, 0, 0.55) 0%,
    rgba(0, 0, 0, 0.25) 50%,
    rgba(0, 0, 0, 0.55) 100%
  );
}

/* Slightly stronger overlay for the imprint */
.segment--imprint .segment__overlay {
  background: linear-gradient(
    135deg,
    rgba(0, 0, 0, 0.70) 0%,
    rgba(0, 0, 0, 0.40) 50%,
    rgba(0, 0, 0, 0.70) 100%
  );
}

/* ───────────── Content wrapper ──────────────────── */
.segment__content {
  position: relative;
  z-index: 2;
  max-width: min(90vw, 700px);
  text-align: center;
  padding: 1.5rem;
}

/* ───────────── Titles ───────────────────────────── */
.segment__title {
  font-family: 'Cormorant Garamond', Georgia, 'Times New Roman', serif;
  font-weight: 600;
  font-size: clamp(2.5rem, 8vw, 5rem);
  line-height: 1.1;
  margin-bottom: 0.4em;
  letter-spacing: 0.02em;
  text-shadow: 0 2px 12px rgba(0, 0, 0, 0.4);
}

.segment__title--hero {
  font-size: clamp(3.5rem, 12vw, 7rem);
  font-weight: 700;
  margin-bottom: 0.2em;
  letter-spacing: 0.04em;
  word-break: keep-all;
}

/* ───────────── Tagline (hero only) ──────────────── */
.segment__tagline {
  font-family: 'Inter', system-ui, sans-serif;
  font-weight: 400;
  font-size: clamp(1rem, 3vw, 1.5rem);
  letter-spacing: 0.35em;
  text-transform: uppercase;
  opacity: 0.85;
  margin-bottom: 2.5rem;
}

/* ───────────── Body text ────────────────────────── */
.segment__text {
  font-size: clamp(1rem, 2.5vw, 1.3rem);
  line-height: 1.7;
  max-width: 600px;
  margin: 0 auto;
  text-shadow: 0 1px 8px rgba(0, 0, 0, 0.3);
}

.segment__text br {
  display: block;
  content: '';
  margin-top: 0.3em;
}

/* ───────────── Embedded video (YouTube) ──────────── */
.video {
  position: relative;
  width: min(100%, 560px);
  margin: 0 auto 1.5rem;
  aspect-ratio: 16 / 9;
  border-radius: 6px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.25);
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.5);
}

.video iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  border: 0;
}

/* ───────────── Scroll hint (hero) ───────────────── */
.scroll-hint {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  margin-top: 2rem;
  color: #fff;
  text-decoration: none;
  opacity: 0.7;
  transition: opacity 0.3s ease, transform 0.3s ease;
  cursor: pointer;
}

.scroll-hint:hover,
.scroll-hint:focus-visible {
  opacity: 1;
  transform: translateY(4px);
}

.scroll-hint__label {
  font-size: clamp(0.8rem, 1.5vw, 0.95rem);
  letter-spacing: 0.25em;
  text-transform: uppercase;
}

/* ─── Bouncing chevron ─── */
.scroll-hint__chevron {
  display: block;
  width: 24px;
  height: 24px;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: rotate(45deg);
  animation: scrollBounce 2s ease-in-out infinite;
}

@keyframes scrollBounce {
  0%, 100% {
    transform: rotate(45deg) translate(0, 0);
    opacity: 0.5;
  }
  50% {
    transform: rotate(45deg) translate(4px, 4px);
    opacity: 1;
  }
}

/* ───────────── Imprint (Impressum) ──────────────── */
.imprint {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.imprint__address {
  font-style: normal;
  font-size: clamp(0.95rem, 2.2vw, 1.15rem);
  line-height: 1.8;
  text-shadow: 0 1px 6px rgba(0, 0, 0, 0.3);
}

.imprint__address a {
  color: inherit;
  text-decoration: underline;
  text-underline-offset: 2px;
  transition: opacity 0.3s ease;
}

.imprint__address a:hover,
.imprint__address a:focus-visible {
  opacity: 0.75;
}

.imprint__cookie {
  font-size: clamp(0.8rem, 1.8vw, 0.95rem);
  opacity: 0.8;
  padding: 1rem 1.5rem;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 8px;
  display: inline-block;
  align-self: center;
}

/* ───────────── Gallery (horizontal scroll) ──────── */
.segment--kunst {
  flex-direction: column;
  justify-content: flex-start;
  padding-top: 12vh;
  padding-top: 12dvh;
  gap: 1.5rem;
}

.segment--kunst .segment__content {
  flex-shrink: 0;
}

.gallery {
  position: relative;
  z-index: 2;
  width: 100%;
  max-width: 100vw;
  padding: 0 1rem 2rem;
  display: flex;
  gap: 0.75rem;
  overflow-x: auto;
  overflow-y: hidden;
  -webkit-overflow-scrolling: touch;
  scroll-snap-type: x mandatory;
  scroll-padding: 1rem;
  scrollbar-width: thin;
}

.gallery::-webkit-scrollbar {
  height: 4px;
}
.gallery::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.1);
  border-radius: 2px;
}
.gallery::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.3);
  border-radius: 2px;
}

.gallery__item {
  position: relative;
  flex: 0 0 auto;
  width: clamp(195px, 45vw, 270px);
  aspect-ratio: 1;
  overflow: hidden;
  border-radius: 6px;
  border: 4px solid rgba(255, 255, 255, 0.2);
  cursor: pointer;
  opacity: 0;
  transform: scale(0.9);
  transition: opacity 0.4s ease, transform 0.3s ease, box-shadow 0.3s ease,
              border-color 0.3s ease;
  scroll-snap-align: start;
}

.gallery__item.visible {
  opacity: 1;
  transform: scale(1);
}

.gallery__item:hover,
.gallery__item:focus-visible {
  transform: scale(1.05);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
  border-color: rgba(255, 255, 255, 0.5);
  outline: none;
}

.gallery__item:focus-visible {
  outline: 2px solid #fff;
  outline-offset: 2px;
}

.gallery__img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.4s ease;
}

.gallery__item:hover .gallery__img {
  transform: scale(1.1);
}

/* ───────────── Lightbox ─────────────────────────── */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 200;
  background: rgba(0, 0, 0, 0.92);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.lightbox.is-open {
  opacity: 1;
  pointer-events: auto;
}

.lightbox__img {
  display: block;
  max-width: 92vw;
  max-height: 88vh;
  max-height: 88dvh;
  object-fit: contain;
  border-radius: 4px;
  box-shadow: 0 8px 40px rgba(0, 0, 0, 0.6);
}

/* Lightbox close button */
.lightbox__close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  z-index: 3;
  width: 44px;
  height: 44px;
  background: rgba(0, 0, 0, 0.5);
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: 50%;
  color: #fff;
  font-size: 1.5rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.3s ease, transform 0.2s ease;
}

.lightbox__close:hover {
  background: rgba(0, 0, 0, 0.8);
  transform: scale(1.1);
}

/* Lightbox nav buttons */
.lightbox__nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 3;
  width: 48px;
  height: 48px;
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 50%;
  color: #fff;
  font-size: 1.5rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.3s ease, transform 0.2s ease;
}

.lightbox__nav:hover {
  background: rgba(0, 0, 0, 0.7);
  transform: translateY(-50%) scale(1.1);
}

.lightbox__nav--prev {
  left: 1rem;
}

.lightbox__nav--next {
  right: 1rem;
}

/* Lightbox counter */
.lightbox__counter {
  position: absolute;
  bottom: 1.5rem;
  left: 50%;
  transform: translateX(-50%);
  z-index: 3;
  font-size: 0.9rem;
  letter-spacing: 0.1em;
  opacity: 0.7;
  background: rgba(0, 0, 0, 0.5);
  padding: 0.4rem 1rem;
  border-radius: 20px;
  border: 1px solid rgba(255, 255, 255, 0.15);
}

/* ─────────── Fade-in animation ──────────────────── */
.reveal {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.8s ease-out, transform 0.8s ease-out;
}
.reveal.revealed {
  opacity: 1;
  transform: translateY(0);
}

/* ─────────── Responsive ─────────────────────────── */
/* Tablet & larger */
@media (min-width: 768px) {
  .segment__content {
    max-width: min(80vw, 750px);
  }
  .imprint {
    flex-direction: row;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.75rem 2rem;
  }
  .imprint__cookie {
    align-self: auto;
  }
}

/* Landscape phones */
@media (orientation: landscape) and (max-height: 500px) {
  .segment {
    min-height: 100vh;
    min-height: 100dvh;
  }
  .segment__title--hero {
    font-size: clamp(2.5rem, 8vh, 5rem);
  }
  .segment__title {
    font-size: clamp(2rem, 6vh, 3.5rem);
  }
  .segment__text {
    font-size: clamp(0.85rem, 2.5vh, 1.1rem);
  }
  .segment__content {
    padding: 1rem;
  }
  .scroll-hint {
    margin-top: 1rem;
  }
}

/* ─── Portrait orientation: bigger, more legible text ─── */
@media (orientation: portrait) {
  .segment__title--hero {
    font-size: clamp(3.5rem, 14vw, 7rem);
  }
  .segment__title {
    font-size: clamp(2.5rem, 10vw, 5rem);
  }
  .segment__tagline {
    font-size: clamp(1rem, 4vw, 1.5rem);
  }
  .segment__text {
    font-size: clamp(1.05rem, 3.5vw, 1.35rem);
  }
  .scroll-hint__label {
    font-size: clamp(0.85rem, 2.5vw, 0.95rem);
  }
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  .reveal {
    opacity: 1 !important;
    transform: none !important;
  }
}