/* ============================================================
   GALLERY PAGE — Styles
   ============================================================ */

/* --- Main area --- */
.gallery-main {
  padding: 56px 0 80px;
  background: var(--clr-bg-alt);
}

/* --- CSS Grid Masonry-style layout --- */
.gallery-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  grid-auto-rows: 220px;
  gap: 16px;
}

/* --- Gallery Items --- */
.gallery-item {
  position: relative;
  border-radius: var(--radius-md);
  overflow: hidden;
  cursor: pointer;
  background: #e5e7eb;
  grid-row: span 1;
}
.gallery-item--wide { grid-column: span 2; }
.gallery-item--tall { grid-row: span 2; }

.gallery-item__img {
  width: 100%;
  height: 100%;
  background-size: cover;
  background-position: center;
  transition: transform 0.45s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.gallery-item__overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    to top,
    rgba(0,0,0,0.72) 0%,
    rgba(0,0,0,0.2) 55%,
    transparent 100%
  );
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 16px 18px;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.gallery-item:hover .gallery-item__overlay { opacity: 1; }
.gallery-item:hover .gallery-item__img { transform: scale(1.05); }

.gallery-item__cat {
  display: inline-block;
  background: var(--clr-primary);
  color: white;
  font-size: 0.7rem;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 20px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  margin-bottom: 6px;
  align-self: flex-start;
}

.gallery-item__caption {
  color: white;
  font-size: 0.9rem;
  font-weight: 600;
  line-height: 1.35;
  text-shadow: 0 1px 4px rgba(0,0,0,0.5);
}

/* Hidden items for filter */
.gallery-item.hidden { display: none; }

/* --- Lightbox --- */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 3000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}
.lightbox.open {
  opacity: 1;
  pointer-events: all;
}
.lightbox__overlay {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.9);
  backdrop-filter: blur(8px);
}
.lightbox__content {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 880px;
  background: var(--clr-white);
  border-radius: var(--radius-xl);
  overflow: hidden;
  box-shadow: 0 32px 80px rgba(0,0,0,0.45);
  transform: scale(0.94);
  transition: transform 0.3s ease;
}
.lightbox.open .lightbox__content { transform: scale(1); }

.lightbox__img-wrap {
  width: 100%;
  height: 460px;
  overflow: hidden;
}
.lightbox__img {
  width: 100%;
  height: 100%;
  background-size: cover;
  background-position: center;
  transition: opacity 0.3s ease;
}

.lightbox__info {
  padding: 22px 28px;
}
.lightbox__cat {
  display: inline-block;
  background: var(--clr-blue-light);
  color: var(--clr-primary);
  font-size: 0.72rem;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 20px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 8px;
}
.lightbox__title {
  font-family: var(--font-serif);
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--clr-text);
  margin-bottom: 6px;
}
.lightbox__caption {
  font-size: 0.9rem;
  color: var(--clr-text-muted);
  line-height: 1.55;
}

.lightbox__close,
.lightbox__prev,
.lightbox__next {
  position: absolute;
  z-index: 2;
  background: white;
  border: none;
  cursor: pointer;
  border-radius: 50%;
  width: 42px;
  height: 42px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  color: var(--clr-text);
  box-shadow: var(--shadow-md);
  transition: var(--transition);
}
.lightbox__close:hover,
.lightbox__prev:hover,
.lightbox__next:hover {
  background: var(--clr-primary);
  color: white;
}
.lightbox__close { top: 12px; right: 14px; }
.lightbox__prev { top: 50%; left: -20px; transform: translateY(-50%); }
.lightbox__next { top: 50%; right: -20px; transform: translateY(-50%); }

/* --- Responsive --- */
@media (max-width: 900px) {
  .gallery-grid {
    grid-template-columns: repeat(2, 1fr);
    grid-auto-rows: 200px;
  }
  .gallery-item--wide { grid-column: span 2; }
  .lightbox__img-wrap { height: 320px; }
  .lightbox__prev { left: 8px; }
  .lightbox__next { right: 8px; }
}

@media (max-width: 550px) {
  .gallery-grid {
    grid-template-columns: 1fr;
    grid-auto-rows: 220px;
  }
  .gallery-item--wide { grid-column: span 1; }
  .gallery-item--tall { grid-row: span 1; }
  .gallery-item__overlay { opacity: 1; }
  .lightbox__img-wrap { height: 260px; }
  .lightbox__info { padding: 16px; }
}
