/* =============================================
   GALLERY.CSS – Photo gallery with lightbox
   ============================================= */

.gallery {
  background-color: var(--color-surface);
}

.gallery__header {
  text-align: center;
  margin-bottom: 52px;
}

/* ---- Grid ---- */
.gallery__grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  grid-template-rows: auto auto;
  gap: 16px;
}

/* Larger first item */
.gallery__item:first-child {
  grid-column: span 2;
}

.gallery__item {
  position: relative;
  overflow: hidden;
  border-radius: var(--radius-medium);
  cursor: pointer;
  box-shadow: var(--shadow-card);
  aspect-ratio: 1 / 1;
  background-color: #ede3da; /* skeleton colour */
}

.gallery__item:first-child {
  aspect-ratio: 16 / 9;
}

.gallery__item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform var(--transition-slow);
  display: block;
}

.gallery__item:hover img {
  transform: scale(1.07);
}

/* Hover overlay */
.gallery__item-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    to bottom,
    transparent 40%,
    rgba(45, 27, 16, 0.65) 100%
  );
  opacity: 0;
  transition: opacity var(--transition-normal);
  display: flex;
  align-items: flex-end;
  padding: 20px;
}

.gallery__item:hover .gallery__item-overlay {
  opacity: 1;
}

.gallery__item-icon {
  width: 42px;
  height: 42px;
  background-color: rgba(255, 255, 255, 0.18);
  border: 1.5px solid rgba(255, 255, 255, 0.45);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--color-white);
  font-size: 0.85rem;
  margin-left: auto;
  transition: background-color var(--transition-fast);
}

.gallery__item:hover .gallery__item-icon {
  background-color: rgba(255,255,255,0.30);
}

/* ---- Lightbox ---- */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.lightbox[hidden] {
  display: none;
}

.lightbox__backdrop {
  position: fixed;
  inset: 0;
  background-color: rgba(25, 14, 8, 0.92);
  z-index: 1999;
  cursor: pointer;
  display: none; /* Alleen zichtbaar wanneer lightbox open is */
}

.lightbox__backdrop.is-open {
  display: block;
}

.lightbox__image-wrap {
  position: relative;
  z-index: 2001;
  max-width: 90vw;
  max-height: 88vh;
  border-radius: var(--radius-medium);
  overflow: hidden;
  box-shadow: 0 30px 80px rgba(0,0,0,0.5);
}

.lightbox__img {
  display: block;
  max-width: 90vw;
  max-height: 88vh;
  width: auto;
  height: auto;
  object-fit: contain;
  border-radius: var(--radius-medium);
}

.lightbox__close {
  position: fixed;
  top: 20px;
  right: 24px;
  z-index: 2002;
  width: 44px;
  height: 44px;
  background-color: rgba(255,255,255,0.12);
  border: 1.5px solid rgba(255,255,255,0.25);
  border-radius: 50%;
  color: var(--color-white);
  font-size: 1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background-color var(--transition-fast);
  cursor: pointer;
}

.lightbox__close:hover {
  background-color: rgba(255,255,255,0.22);
}

.lightbox__prev,
.lightbox__next {
  position: fixed;
  top: 50%;
  transform: translateY(-50%);
  z-index: 2002;
  width: 50px;
  height: 50px;
  background-color: rgba(255,255,255,0.10);
  border: 1.5px solid rgba(255,255,255,0.22);
  border-radius: 50%;
  color: var(--color-white);
  font-size: 1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background-color var(--transition-fast);
  cursor: pointer;
}

.lightbox__prev { left: 20px; }
.lightbox__next { right: 20px; }

.lightbox__prev:hover,
.lightbox__next:hover {
  background-color: rgba(255,255,255,0.20);
}
