/* =========================================================
   1. GRUNDLAYOUT
========================================================= */
html, body {
  height: 100%;
  margin: 0;
  padding: 0;
  font-family: "Helvetica LT Std", Helvetica, Arial, sans-serif;
  font-size: 7.5pt;
  color: #4d4d4d;
  text-align: center;
  background-color: #fff;
  box-sizing: border-box;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* =========================================================
   2. SIDEBAR
========================================================= */
.sidebar {
  position: fixed;
  top: 30px;
  left: 30px;
  text-align: left;
  z-index: 1000;
}

.sidebar ul {
  list-style: none;
  margin: 0;
  padding: 0;
}

.sidebar a {
  text-decoration: none;
  color: #4d4d4d;
  display: block;
  margin-bottom: 2px;
  line-height: 1.2;
  font-size: 7.5pt;
  cursor: pointer;
}

.sidebar a.active {
  font-weight: normal;
}

/* =========================================================
   3. FILTER-KÄSTCHEN
========================================================= */
.filter-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  font-size: 7.5pt;
  color: #4d4d4d;
  border: none;
  background: none;
  padding: 0;
}

.filter-btn::before {
  content: "☐";
  display: inline-block;
  width: 12px;
  height: 12px;
  font-size: 12px;
  line-height: 12px;
  color: #333;
  text-align: center;
  transform: translateX(-4px);
}

.filter-btn.active::before {
  content: "☑";
  color: #000;
  transform: translateX(-4px);
}

/* =========================================================
   4. LOGO
========================================================= */
.logo {
  position: fixed;
  top: 30px;
  right: 30px;
  text-transform: uppercase;
  z-index: 3000;
}

.logo a {
  text-decoration: none;
  color: #4d4d4d;
  display: inline-block;
  cursor: pointer;
}

.logo h1 {
  font-size: 7.5pt;
  font-weight: normal;
  margin: 0;
  line-height: 1.2;
  text-transform: uppercase;
}

/* =========================================================
   5. GALLERY
========================================================= */
:root {
  --item-size: 210px;
  --gap: 50px;
  --min-padding: 120px;
  --max-padding: 140px;
}

.main-content {
  width: 100%;
  padding-top: 100px;
  padding-bottom: 50px;
  padding-left: clamp(var(--min-padding), 8vw, var(--max-padding));
  padding-right: clamp(var(--min-padding), 8vw, var(--max-padding));
  margin: 0 auto;
  box-sizing: border-box;
}

.gallery {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(var(--item-size), 1fr));
  gap: var(--gap);
  justify-content: start;
  align-items: start;
  min-width: calc(var(--item-size) * 3 + var(--gap) * 2);
  will-change: transform, opacity;
}

body.initial-lightbox .gallery {
  display: none;
}

body.gallery-active .gallery {
  display: grid;
}

.gallery-item {
  width: var(--item-size);
  height: var(--item-size);
  display: flex;
  justify-content: center;
  align-items: center;
  flex-shrink: 0;
  overflow: hidden;
  transform: translateZ(0); /* GPU */
  transition: transform 0.3s ease, opacity 0.3s ease;
}

.gallery-item.filtered-out {
  opacity: 0;
  pointer-events: none;
  transform: scale(0.95);
}

/* MEDIA */
.gallery-item img,
.gallery-item video {
  width: var(--item-size);
  height: var(--item-size);
  object-fit: contain;
  cursor: pointer;
  transition: transform 0.3s ease;
}

/* =========================================================
   6. LIGHTBOX
========================================================= */
#lightbox {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  display: none;
  justify-content: center;
  align-items: center;
  background: #fff;
  z-index: 100;
  user-select: none;
  opacity: 0;
  transition: opacity 0.4s ease;
}

#lightbox.active {
  display: flex;
  opacity: 1;
}

#lightbox-img,
#lightbox-video {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  display: block;
  border: none;
  cursor: pointer;
}

#lightbox-caption {
  position: absolute;
  bottom: 40px;
  left: 30px;
  max-width: 50vw;
  color: #4d4d4d;
  font-size: 7.5pt;
  line-height: 1.3;
  text-align: left;
  white-space: pre-line;
  display: none;
}

body:not(.initial-lightbox) #lightbox-caption {
  display: block;
}

/* =========================================================
   7. MOBILE VERSION
========================================================= */
@media screen and (max-width: 768px) {
  html, body {
    overflow: hidden;
    height: 100%;
    margin: 0;
    padding: 0;
  }

  .sidebar, .logo {
    position: fixed;
    z-index: 10001;
  }

  .main-content, .gallery {
    display: none;
  }

  .gallery-item {
    display: block;
    position: absolute;
    left: -9999px;
  }

  .filter-btn, .submenu {
    display: none;
  }

  #lightbox {
    display: flex !important;
    justify-content: center;
    align-items: center;
    width: 100%;
    height: 100%;
    position: fixed;
    top: 0;
    left: 0;
    background: #fff;
    z-index: 10000;
    box-sizing: border-box;
    padding-inline: clamp(4vw, 5%, 8vw);
  }

  #lightbox-wrapper {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    max-height: 100%;
  }

  #lightbox-img {
    max-width: 100%;
    max-height: 80vh;
    object-fit: contain;
    display: block;
    margin: auto;
    will-change: transform, opacity;
  }

  #lightbox-video {
    display: none; /* Mobile Videos deaktiviert */
  }

  #lightbox-caption {
    margin-top: 1vh;
    font-size: clamp(6pt, 2vw, 8pt);
    line-height: 1.3;
    text-align: center;
    color: #4d4d4d;
    max-width: 90%;
  }

  .bottom-text {
    position: fixed;
    bottom: max(2vh, env(safe-area-inset-bottom));
    left: 0;
    width: 100%;
    text-align: left;
    z-index: 10001;
    color: #4d4d4d;
    font-size: clamp(6pt, 2vw, 8pt);
    will-change: transform, opacity;
  }

  .studio-page-content,
  .contact-page-content {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100%;
    padding: 0;
    box-sizing: border-box;
  }

  .studio-page-text-container,
  .contact-page-text-container {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
  }
}

/* =========================================================
   8. STUDIO / CONTACT SEITEN
========================================================= */
.studio-page-content,
.contact-page-content {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 100vh;
  padding: 0;
  box-sizing: border-box;
}

.studio-page-text-container,
.contact-page-text-container {
  display: flex;
  justify-content: center;
  align-items: center;
  width: 100%;
  height: 100vh;
}

.studio-page-text,
.contact-page-text {
  font-size: 7.5pt;
  line-height: 1.6;
  color: #4d4d4d;
  text-align: left;
}

.contact-page-text a {
  color: #4d4d4d;
  text-decoration: none;
  pointer-events: none;
  cursor: default;
}
