/* =========================================
   Gallery collection page styles
   Reusable for ANY city / project
   Depends on landing.css
   Page-specific only.
   ========================================= */

/* Slightly tighter page width for photo collections */
.page{
  max-width: 980px;
}

/* Main wrapper */
.collection-page{
  display: grid;
  gap: clamp(14px, 2.2vw, 22px);
}

/* -------------------------
   Collection hero
------------------------- */
.collection-hero{
  position: relative;
  overflow: hidden;

  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;

  padding: clamp(16px, 2.2vw, 22px);
  border-radius: var(--radius);
  border: var(--stroke) solid var(--black);
  background: rgba(255,255,255,.78);
  box-shadow: 10px 10px 0 rgba(0,0,0,.10);
}

.collection-hero::after{
  content:"";
  position: absolute;
  inset: -40px;
  background: radial-gradient(circle at 1px 1px, rgba(0,0,0,.10) 1px, transparent 1.6px);
  background-size: 12px 12px;
  opacity: .14;
  transform: rotate(-6deg);
  pointer-events: none;
}

.collection-hero__title{
  margin: 0;
  font-size: clamp(26px, 3.2vw, 40px);
  letter-spacing: -0.02em;
  line-height: 1.05;
}

.collection-hero__lead{
  margin: 10px 0 0;
  max-width: 75ch;
  opacity: .85;
  font-weight: 600;
  line-height: 1.5;
}

.collection-hero__nav{
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

/* Back / navigation links */
.collection-link{
  display: inline-flex;
  align-items: center;

  text-decoration: none;
  font-weight: 900;
  color: var(--black);

  padding: 10px 12px;
  border-radius: 14px;
  border: 2px solid var(--black);
  background: rgba(255,255,255,.75);
  box-shadow: 6px 6px 0 rgba(0,0,0,.10);

  transition: transform .12s ease, box-shadow .12s ease;
}

.collection-link:hover{
  transform: translateY(-1px);
  box-shadow: 7px 7px 0 rgba(0,0,0,.14);
}

/* -------------------------
   Individual set section
------------------------- */
.collection-set{
  padding: clamp(14px, 2vw, 18px);
  border-radius: var(--radius);
  border: var(--stroke) solid var(--black);
  background: rgba(255,255,255,.70);
  box-shadow: 10px 10px 0 rgba(0,0,0,.08);
}

.collection-set__header{
  display: flex;
  justify-content: center;
  margin: clamp(18px, 3vw, 28px) 0 12px;
}

/* “mini tile” header */
.sethead{
  width: min(860px, 100%);
  text-align: center;

  padding: 14px 16px;
  border: 2px solid #000;
  border-radius: 14px;

  background: rgba(255,255,255,0.92);

  /* comic/tile vibe */
  box-shadow: 8px 8px 0 rgba(0,0,0,0.10);
}

/* big, confident title */
.sethead__title{
  margin: 0;
  font-size: clamp(1.25rem, 2.4vw, 1.8rem);
  letter-spacing: 0.02em;
}

/* optional description under title */
.sethead__desc{
  margin: 6px auto 0;
  max-width: 70ch;

  font-size: 0.98rem;
  line-height: 1.5;
  opacity: 0.85;
}

/* optional: give breathing room before masonry */
.collection-set .masonry{
  margin-top: 12px;
}

/* -------------------------
   Masonry grid (CSS columns)
------------------------- */
.masonry{
  column-count: var(--mcols, 3);
  column-gap: clamp(10px, 1.6vw, 14px);
}

/* Prevent items from breaking across columns */
.masonry-item{
  margin: 0 0 clamp(10px, 1.6vw, 14px);
  break-inside: avoid;
  -webkit-column-break-inside: avoid;
  page-break-inside: avoid;

  overflow: hidden;
  background: transparent;
}

/* Images */
.masonry-item img{
  display: block;
  width: 100%;
  height: auto;

  transform: scale(1.01);
  transition: transform .25s ease, filter .25s ease;
}

.masonry-item:hover img{
  transform: scale(1.04);
  filter: saturate(1.04);
}

.masonry-img{
  opacity: 0;
  transition: opacity .18s ease;
  display: block;
  width: 100%;
  height: auto;
}

.masonry-img.is-loaded{
  opacity: 1;
}


/* -------------------------
   Footer
------------------------- */
.collection-footer{
  display: flex;
  justify-content: flex-end;
}

/* -------------------------
   Responsive rules
------------------------- */
@media (max-width: 900px){
  .masonry{ column-count: 2; }
}

@media (max-width: 700px) and (orientation: portrait){
  .masonry{ column-count: 1; }
  .collection-hero{ align-items: flex-start; }
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce){
  .masonry-item img,
  .collection-link{
    transition: none !important;
  }
  .masonry-item:hover img{
    transform: none;
    filter: none;
  }
}

/* =========================
   Lightbox
   ========================= */
.lightbox{
  position: fixed;
  inset: 0;
  z-index: 9999;

  background: rgba(0,0,0,.88);
  display: none;
  align-items: center;
  justify-content: center;

  padding: clamp(12px, 2vw, 22px);
}

.lightbox.is-open{ display: flex; }

/* Stage: always fit screen */
.lb-stage{
  width: min(94vw, 1400px);
  height: min(90vh, 900px);
  display: grid;
  place-items: center;
}

/* Critical: keep image contained even with global img rules */
#lbImg{
  width: auto !important;
  height: auto !important;
  max-width: 94vw;
  max-height: 88vh;
  object-fit: contain;
  display: block;
}

/* Navigation arrows */
.lb-nav{
  position: absolute;
  top: 50%;
  transform: translateY(-50%);

  width: 56px;
  height: 56px;
  border-radius: 50%;
  border: 3px solid var(--black);
  background: rgba(255,255,255,.85);
  box-shadow: 6px 6px 0 rgba(0,0,0,.25);
  cursor: pointer;
  user-select: none;
  -webkit-tap-highlight-color: transparent;

  transition: transform .12s ease;
}

/* keep controls reachable on small screens */
.lb-prev{ left: clamp(10px, 2vw, 24px); }
.lb-next{ right: clamp(10px, 2vw, 24px); }

/* Arrow icons */
.lb-nav::before{
  content:"";
  width: 16px;
  height: 16px;
  border-top: 4px solid var(--black);
  border-right: 4px solid var(--black);
  display: block;
  margin: auto;
}

.lb-prev::before{ transform: rotate(-135deg); }
.lb-next::before{ transform: rotate(45deg); }

.lb-nav:hover{
  transform: translateY(-50%) scale(1.05);
}

/* Close button */
.lb-close{
  position: absolute;
  top: clamp(10px, 2vw, 24px);
  right: clamp(10px, 2vw, 24px);

  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 3px solid var(--black);
  background: rgba(255,255,255,.85);
  box-shadow: 6px 6px 0 rgba(0,0,0,.25);
  cursor: pointer;
  user-select: none;
  -webkit-tap-highlight-color: transparent;

  transition: transform .12s ease;
}

.lb-close::before,
.lb-close::after{
  content:"";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 18px;
  height: 3px;
  background: var(--black);
}

.lb-close::before{ transform: translate(-50%,-50%) rotate(45deg); }
.lb-close::after{ transform: translate(-50%,-50%) rotate(-45deg); }

.lb-close:hover{ transform: scale(1.05); }

@media (max-width: 700px){
  .lb-nav{
    width: 44px;
    height: 44px;
  }
}
