/* ============================================
   GALLERY PAGE STYLES
   ============================================ */

.gallery-header {
  padding-top: var(--space-xl);
  padding-bottom: var(--space-lg);
  border-bottom: 1px solid var(--color-border);
  margin-bottom: var(--space-xl);
}

.gallery-header__title {
  margin-top: 0.25rem;
}

/* ---- GRID ---- */
.gallery-grid {
  columns: 3;
  column-gap: 12px;
}

.gallery-item {
  position: relative;
  break-inside: avoid;
  margin-bottom: 12px;
  overflow: hidden;
  cursor: pointer;
  background-color: #c8dce8;
}

/* Blur-up placeholder: sits behind the real image while it loads */
.gallery-item::before {
  content: '';
  position: absolute;
  inset: 0;
  background: var(--placeholder, #c8dce8);
  background-size: cover;
  filter: blur(10px);
  transform: scale(1.06);
  z-index: 0;
  opacity: 1;
  transition: opacity 0.4s ease;
  pointer-events: none;
}

.gallery-item.loaded::before {
  opacity: 0;
}

.gallery-item img {
  position: relative;
  z-index: 1;
  display: block;
  width: 100%;
  height: auto;
  opacity: 0;
  transition: opacity 0.4s ease;
}

.gallery-item.loaded img {
  opacity: 1;
}

.gallery-item.loaded:hover img {
  opacity: 0.88;
}

/* picture element is a layout-transparent wrapper */
.gallery-item picture {
  display: block;
}

@media (max-width: 1023px) {
  .gallery-grid {
    columns: 2;
  }
}

@media (max-width: 767px) {
  .gallery-grid {
    columns: 1;
  }
}

/* ---- LIGHTBOX ---- */
.lightbox {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.92);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 200;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
}

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

.lightbox__img {
  max-width: 90vw;
  max-height: 88vh;
  object-fit: contain;
  display: block;
  user-select: none;
}

.lightbox__close {
  position: absolute;
  top: 1.25rem;
  right: 1.25rem;
  display: flex;
  align-items: center;
  gap: 0.4rem;
  background: none;
  border: none;
  color: rgba(255, 255, 255, 0.7);
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  cursor: pointer;
  padding: 0.5rem;
  transition: color 0.15s ease;
}

.lightbox__close:hover {
  color: #fff;
}

.lightbox__nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  color: rgba(255, 255, 255, 0.55);
  cursor: pointer;
  padding: 1rem;
  transition: color 0.15s ease;
}

.lightbox__nav:hover {
  color: #fff;
}

.lightbox__nav--prev { left: 1rem; }
.lightbox__nav--next { right: 1rem; }

.lightbox__nav[hidden] {
  display: none;
}

/* ---- LIGHTBOX MOBILE ---- */
@media (max-width: 767px) {
  .lightbox__img {
    max-width: 100vw;
    max-height: 80vh;
  }

  /* Larger tap targets for prev/next on mobile */
  .lightbox__nav {
    padding: 1.25rem;
    top: auto;
    bottom: 3.5rem;
    transform: none;
    background: rgba(0, 0, 0, 0.35);
  }

  .lightbox__nav--prev { left: 0.5rem; }
  .lightbox__nav--next { right: 0.5rem; }

  /* Close button: easier to tap on mobile */
  .lightbox__close {
    top: 0.75rem;
    right: 0.75rem;
    padding: 0.75rem;
  }
}

.lightbox__watermark {
  position: absolute;
  bottom: 2.5rem;
  left: 50%;
  transform: translateX(-50%);
  font-family: var(--font-body);
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.12em;
  color: rgba(255, 255, 255, 0.88);
  text-shadow: 0 1px 6px rgba(0, 0, 0, 0.7);
  pointer-events: none;
  user-select: none;
  white-space: nowrap;
  z-index: 10;
}

/* 3D Gallery CTA */
.gallery-3d-cta {
  display: flex;
  justify-content: center;
  padding: 3rem 1.5rem 1rem;
}

.gallery-3d-btn {
  font-family: var(--font-body);
  font-size: 0.8125rem;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--color-text);
  border: 1px solid var(--color-border);
  padding: 0.875rem 2.5rem;
  text-decoration: none;
  transition: border-color var(--transition), color var(--transition);
}

.gallery-3d-btn:hover {
  border-color: var(--color-navy);
  color: var(--color-navy);
}
