/*
 * Styles for the Zentrum image gallery. These rules are adapted from
 * the provided HTML example. They define the responsive grid and
 * lightbox with minimal adjustments for integration into PrestaShop.
 */

:root {
  --gap: 12px;
  --radius: 14px;
  --shadow: 0 6px 20px rgba(0, 0, 0, 0.12);
  --overlay: rgba(0, 0, 0, 0.9);
  --accent: #06b6d4;
}

* {
  box-sizing: border-box;
}

/* Container for the gallery */
.wrap {
  max-width: 1200px;
  margin: 48px auto;
  padding: 0 16px;
}

.title {
  font-size: clamp(20px, 2.4vw, 28px);
  font-weight: 700;
  margin: 0 0 14px;
}

.subtitle {
  opacity: 0.75;
  margin: 0 0 22px;
}

/* === GRID === */
.gallery {
  display: grid;
  gap: var(--gap);
  grid-template-columns: repeat(2, 1fr);
}

@media (min-width: 640px) {
  .gallery {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (min-width: 1024px) {
  .gallery {
    grid-template-columns: repeat(4, 1fr);
  }
}

.tile {
  position: relative;
  overflow: hidden;
  border-radius: var(--radius);
  background: #0f1720;
  display: block;
}

.tile img {
  display: block;
  width: 100%;
  height: auto;
  object-fit: cover;
  aspect-ratio: 4 / 3;
  filter: saturate(1.02);
}

.tile::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(0, 0, 0, 0) 40%, rgba(0, 0, 0, 0.35));
  opacity: 0;
  transition: opacity 0.25s ease;
}

.tile:hover::after {
  opacity: 1;
}

.tile .zoom {
  position: absolute;
  right: 10px;
  bottom: 10px;
  background: rgba(15, 23, 32, 0.65);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 255, 255, 0.08);
  padding: 6px 10px;
  border-radius: 999px;
  font-size: 12px;
  opacity: 0;
  transform: translateY(6px);
  transition: all 0.25s ease;
  color: #ffffff;
}

.tile:hover .zoom {
  opacity: 1;
  transform: none;
}

/* === LIGHTBOX === */
.lightbox {
  position: fixed;
  inset: 0;
  display: none;
  place-items: center;
  background: var(--overlay);
  z-index: 9999;
}

.lightbox.open {
  display: grid;
}

.lb-img-wrap {
  position: relative;
  max-width: min(96vw, 1400px);
  max-height: 86vh;
}

.lb-img {
  display: block;
  max-width: 100%;
  max-height: 86vh;
  border-radius: 16px;
  box-shadow: var(--shadow);
}

.lb-caption {
  margin-top: 10px;
  text-align: center;
  opacity: 0.85;
  font-size: 14px;
  color: #e5e7eb;
}

.lb-close,
.lb-nav {
  position: absolute;
  inset: auto;
}

.lb-close {
  top: -42px;
  right: 0;
}

.lb-btn {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.16);
  color: #fff;
  border-radius: 12px;
  padding: 10px 14px;
  font-weight: 600;
  cursor: pointer;
}

.lb-btn:hover {
  background: rgba(255, 255, 255, 0.14);
}

.lb-nav {
  top: 50%;
  transform: translateY(-50%);
  display: flex;
  justify-content: space-between;
  gap: 10px;
  width: 100%;
}

.lb-prev,
.lb-next {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
}

.lb-prev {
  left: -56px;
}

.lb-next {
  right: -56px;
}

@media (max-width: 700px) {
  .lb-prev {
    left: 8px;
  }
  .lb-next {
    right: 8px;
  }
  .lb-close {
    top: 8px;
  }
}

/* Focus ring */
.lb-btn:focus {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* Subtle entrance animation */
.open .lb-img {
  animation: pop 0.22s ease;
}

@keyframes pop {
  from {
    transform: scale(0.985);
    opacity: 0.7;
  }
  to {
    transform: none;
    opacity: 1;
  }
}