/* ==========================================================
   styling for referenzen.html (Referenzen)
   ========================================================== */

/* Hero — mirrors the leistungen hero so the pages feel consistent */
.ref-hero {
  max-width: 1200px;
  padding-block: 4rem 2rem;
}

.eyebrow {
  margin-bottom: 0.8rem;
  color: var(--secondary);
  font-size: 0.8rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.ref-hero h1 {
  margin-bottom: 1rem;
  color: var(--tertiary);
  font-size: 3.7vw;
  line-height: 1.05;
}

.ref-hero p {
  max-width: 820px;
  color: rgba(15, 23, 42, 0.72);
  font-size: 1.15vw;
  line-height: 1.65;
}

/* Project sections */
.ref-project {
  padding-block: 1.5rem 3.5rem;
}

.ref-project h2 {
  color: var(--tertiary);
  font-size: 2vw;
  line-height: 1.1;
  margin-bottom: 0.6rem;
}

.ref-project-desc {
  max-width: 820px;
  margin-bottom: 1.75rem;
  color: rgba(15, 23, 42, 0.72);
  font-size: 1.05vw;
  line-height: 1.6;
}

/* Masonry gallery — fluid column count, no card chrome */
.ref-gallery {
  columns: 280px;
  column-gap: 1rem;
}

.ref-gallery figure {
  break-inside: avoid;
  margin: 0 0 1rem;
}

.ref-gallery img {
  width: 100%;
  height: auto;
  display: block;
  border-radius: var(--radius);
  cursor: zoom-in;
  transition:
    transform 0.2s ease,
    filter 0.2s ease;
}

.ref-gallery img:hover {
  transform: translateY(-2px);
  filter: brightness(1.04);
}

.ref-gallery figcaption {
  padding: 0.4rem 0.15rem 0;
  color: var(--tertiary);
  font-size: 0.85rem;
  line-height: 1.35;
}

/* Lightbox overlay */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  padding: 2rem;
  background: rgba(0, 0, 0, 0.9);
  opacity: 0;
  visibility: hidden;
  transition:
    opacity 0.2s ease,
    visibility 0.2s ease;
}

.lightbox.open {
  opacity: 1;
  visibility: visible;
}

.lightbox img {
  max-width: 100%;
  max-height: 82vh;
  width: auto;
  height: auto;
  border-radius: var(--radius);
  box-shadow: 0 1.2rem 3rem rgba(0, 0, 0, 0.5);
}

.lightbox-caption {
  color: #fff;
  font-size: 0.95rem;
  text-align: center;
  max-width: 60ch;
}

.lightbox-close {
  position: absolute;
  top: 1.1rem;
  right: 1.3rem;
  width: 2.8rem;
  height: 2.8rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: none;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  font-size: 1.6rem;
  line-height: 1;
  cursor: pointer;
  transition: background-color 0.2s ease;
}

.lightbox-close:hover {
  background: rgba(255, 255, 255, 0.25);
}

/* Prev / next navigation */
.lightbox-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 3rem;
  height: 3rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: none;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  font-size: 2rem;
  line-height: 1;
  cursor: pointer;
  transition: background-color 0.2s ease;
}

.lightbox-nav:hover {
  background: rgba(255, 255, 255, 0.25);
}

.lightbox-prev {
  left: 1.3rem;
}

.lightbox-next {
  right: 1.3rem;
}

/* Lock scroll behind the lightbox */
body.lightbox-open {
  overflow: hidden;
}

/* ==========================================================
   Phone bis 480px
   ========================================================== */
@media (max-width: 480px) {
  .ref-hero {
    padding-block: 2.5rem 1.5rem;
  }

  .ref-hero h1 {
    font-size: 2.4rem;
  }

  .ref-hero p {
    font-size: 1rem;
  }

  .ref-project h2 {
    font-size: 1.6rem;
  }

  .ref-project-desc {
    font-size: 1rem;
  }

  .ref-gallery {
    columns: 160px;
    column-gap: 0.6rem;
  }

  .ref-gallery figure {
    margin-bottom: 0.6rem;
  }

  .lightbox-nav {
    width: 2.6rem;
    height: 2.6rem;
    font-size: 1.7rem;
  }

  .lightbox-prev {
    left: 0.5rem;
  }

  .lightbox-next {
    right: 0.5rem;
  }
}

/* ==========================================================
   Tablet (481px – 1024px)
   ========================================================== */
@media (min-width: 481px) and (max-width: 1024px) {
  .ref-hero h1 {
    font-size: 2.6rem;
  }

  .ref-hero p {
    font-size: 1.05rem;
  }

  .ref-project h2 {
    font-size: 1.6rem;
  }

  .ref-project-desc {
    font-size: 1rem;
  }
}
