/* app/assets/stylesheets/immo/gallery.css */

#immo-page .galerie {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 8px;
}

#immo-page .galerie__item {
  position: relative;
  aspect-ratio: 4 / 3;
  overflow: hidden;
  border-radius: 8px;
  cursor: zoom-in;
  background: var(--sand);
}

#immo-page .galerie__item:first-child {
  grid-column: span 2;
  grid-row: span 2;
}

#immo-page .galerie__item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform .4s ease;
}

#immo-page .galerie__item:hover img { transform: scale(1.05); }

/* ── Lightbox ── */
#immo-page .lightbox {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.92);
  z-index: 9999;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

#immo-page .lightbox.is-open { display: flex; }

#immo-page .lightbox__img {
  max-width: 90vw;
  max-height: 90vh;
  object-fit: contain;
  border-radius: 4px;
  box-shadow: 0 24px 80px rgba(0,0,0,.6);
}

#immo-page .lightbox__close {
  position: fixed;
  top: 20px; right: 24px;
  background: none;
  border: none;
  color: rgba(255,255,255,.7);
  font-size: 2rem;
  cursor: pointer;
  line-height: 1;
  transition: color .2s;
}

#immo-page .lightbox__close:hover { color: #fff; }

#immo-page .lightbox__nav {
  position: fixed;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(255,255,255,.1);
  border: none;
  color: #fff;
  font-size: 1.5rem;
  width: 48px; height: 64px;
  cursor: pointer;
  border-radius: 4px;
  transition: background .2s;
  display: flex;
  align-items: center;
  justify-content: center;
}

#immo-page .lightbox__nav:hover { background: rgba(255,255,255,.2); }
#immo-page .lightbox__nav--prev { left: 12px; }
#immo-page .lightbox__nav--next { right: 12px; }

#immo-page .lightbox__counter {
  position: fixed;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  font-size: .8rem;
  color: rgba(255,255,255,.45);
  letter-spacing: .1em;
}

/* ── Responsive ── */
@media (max-width: 600px) {
  #immo-page .galerie {
    grid-template-columns: repeat(2, 1fr);
  }
  #immo-page .galerie__item:first-child {
    grid-column: span 2;
    grid-row: span 1;
  }
}
