/* gallery.css
   Split from the previous shared stylesheet to match the PriLink Digital CSS structure. */

.gallery-grid {
  display: grid;
  gap: 18px;
}

.gallery-preview {
  grid-template-columns: 1.15fr 0.85fr 0.85fr;
  grid-auto-rows: 220px;
}

.gallery-full {
  grid-template-columns: repeat(3, 1fr);
  grid-auto-rows: 260px;
}

.gallery-item {
  position: relative;
  margin: 0;
  overflow: hidden;
  border-radius: 8px;
  background: white;
  box-shadow: var(--shadow);
  cursor: zoom-in;
  transition: transform 180ms ease, box-shadow 180ms ease;
}

.gallery-item-large {
  grid-column: span 2;
  grid-row: span 2;
}

.gallery-item::after {
  content: "View photo";
  position: absolute;
  left: 16px;
  bottom: 16px;
  z-index: 1;
  padding: 8px 12px;
  color: white;
  background: rgba(16, 24, 32, 0.72);
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 800;
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 180ms ease, transform 180ms ease;
  pointer-events: none;
}

.gallery-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 220ms ease;
}

.gallery-item:hover {
  transform: translateY(-4px);
  box-shadow: 0 24px 50px rgba(16, 24, 32, 0.18);
}

.gallery-item:hover img {
  transform: scale(1.04);
}

.gallery-item:hover::after {
  opacity: 1;
  transform: translateY(0);
}

.gallery-actions {
  margin-top: 24px;
}

.lightbox {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: grid;
  place-items: center;
  padding: 28px;
  background: rgba(16, 24, 32, 0.88);
  opacity: 0;
  pointer-events: none;
  touch-action: none;
  transition: opacity 180ms ease;
}

.lightbox.open {
  opacity: 1;
  pointer-events: auto;
}

.lightbox img {
  max-width: min(1100px, calc(100vw - 64px));
  max-height: calc(100vh - 120px);
  border-radius: 8px;
  box-shadow: 0 28px 60px rgba(0, 0, 0, 0.42);
}

.lightbox-close {
  position: absolute;
  top: 18px;
  right: 18px;
}

.lightbox-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
}

.lightbox-prev {
  left: 18px;
}

.lightbox-next {
  right: 18px;
}

.lightbox-close,
.lightbox-nav {
  display: grid;
  place-items: center;
  width: 54px;
  height: 54px;
  padding: 0;
  border: 0;
  border-radius: 999px;
  color: white;
  background: rgba(16, 24, 32, 0.86);
  border: 2px solid rgba(255, 255, 255, 0.78);
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.42);
  font: inherit;
  font-size: 1.6rem;
  cursor: pointer;
}

.lightbox-close:hover,
.lightbox-nav:hover {
  background: rgba(16, 24, 32, 0.96);
  border-color: white;
}

.lightbox-nav {
  font-size: 1rem;
}

.lightbox-nav svg {
  width: 32px;
  height: 32px;
  stroke: currentColor;
  stroke-width: 3.2;
  stroke-linecap: round;
  stroke-linejoin: round;
  fill: none;
  pointer-events: none;
}
