/* ============================================
   MARIE HARTIG STUDIO — Collection Page
   Grid left, text panel right — Nate Berkus style
   ============================================ */

.collection-page {
  background: #ffffff;
}

/* ============================================
   MAIN LAYOUT
   ============================================ */
.collection-wrap {
  display: flex;
  gap: 2vw;
  height: calc(100vh - 64px - 4vw);
  margin: calc(64px + 2vw) 2vw 2vw;
  overflow: hidden;
}

/* ---- LEFT — Image grid ---- */
.collection-grid {
  flex: 1 1 auto;
  min-width: 0;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 3px;
  background: #e8e4de;
  align-content: stretch;
}

/* Dynamically set row heights based on image count via JS — fallback */
.collection-grid-item {
  overflow: hidden;
  cursor: pointer;
  background: #eee;
  min-height: 0;
}

.collection-grid-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  display: block;
}

/* ---- RIGHT — Text panel ---- */
.collection-info {
  flex: 0 0 32%;
  min-width: 280px;
  max-width: 460px;
  background: #dedad3;
  padding: 3.5vw 3vw 2.5vw;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  overflow: hidden;
  height: 100%;
  box-sizing: border-box;
}

.collection-info-top {
  display: flex;
  flex-direction: column;
  flex: 1;
  overflow: hidden;
  min-height: 0;
}

.collection-rule {
  width: 100%;
  height: 1px;
  background: rgba(0,0,0,0.18);
  margin-bottom: 1.6rem;
  flex-shrink: 0;
}

.collection-title {
  font-family: 'Velour', serif;
  font-weight: 700;
  font-size: clamp(1.4rem, 2.6vw, 2.4rem);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #111;
  line-height: 1.15;
  margin-bottom: 1.4rem;
  flex-shrink: 0;
}

.collection-desc {
  font-family: 'Jost', sans-serif;
  font-weight: 300;
  font-size: clamp(0.72rem, 0.85vw, 0.88rem);
  line-height: 1.75;
  color: #444;
  margin-bottom: 0.8rem;
  overflow: hidden;
}

.collection-meta {
  margin-top: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  flex-shrink: 0;
}

.collection-meta-item {
  font-family: 'Jost', sans-serif;
  font-weight: 300;
  font-size: 0.74rem;
  letter-spacing: 0.06em;
  color: #555;
}

/* ---- Prev / Next navigation ---- */
.collection-nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 1.6rem;
  border-top: 1px solid rgba(0,0,0,0.1);
  margin-top: 1.6rem;
  flex-shrink: 0;
  white-space: nowrap;
}

.collection-nav a {
  font-family: 'Velour', serif;
  font-weight: 700;
  font-size: clamp(0.7rem, 1vw, 0.9rem);
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: #111;
  text-decoration: none;
  transition: color 0.2s ease;
}

.collection-nav a:hover { color: #666; }

/* ============================================
   LIGHTBOX
   ============================================ */
.col-lightbox {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 1000;
  background: #fff;
  align-items: center;
  justify-content: center;
}

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

.col-lightbox-close {
  position: fixed;
  top: 1.2rem;
  right: 1.8rem;
  background: none;
  border: none;
  color: rgba(0,0,0,0.5);
  font-family: 'Jost', sans-serif;
  font-weight: 200;
  font-size: 0.7rem;
  letter-spacing: 0.25em;
  text-transform: uppercase;
  cursor: pointer;
  z-index: 20;
}
.col-lightbox-close:hover { color: #000; }

.col-lightbox img {
  max-width: 94vw;
  max-height: 94vh;
  object-fit: contain;
  display: block;
}

.col-lightbox-prev,
.col-lightbox-next {
  position: fixed;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  color: rgba(0,0,0,0.4);
  font-size: 2rem;
  cursor: pointer;
  padding: 1.4rem;
  z-index: 20;
  line-height: 1;
  transition: color 0.2s;
}
.col-lightbox-prev { left: 0.4rem; }
.col-lightbox-next { right: 0.4rem; }
.col-lightbox-prev:hover,
.col-lightbox-next:hover { color: #000; }

/* Active nav link */
.nav-links a.active {
  border-bottom: 1px solid #111;
  padding-bottom: 1px;
}

/* ============================================
   FOOTER
   ============================================ */
.collection-footer {
  background: #ffffff;
  border-top: 1px solid rgba(0,0,0,0.08);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.2rem 4vw;
  font-family: 'Jost', sans-serif;
  font-weight: 300;
  font-size: 0.7rem;
  letter-spacing: 0.1em;
  color: #888;
}
.collection-footer a { color: #888; text-decoration: none; }
.collection-footer a:hover { color: #333; }

/* ============================================
   RESPONSIVE
   ============================================ */
@media (max-width: 1024px) {
  .collection-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .collection-info {
    flex: 0 0 34%;
  }
}

@media (max-width: 768px) {
  .collection-wrap {
    flex-direction: column;
    gap: 2vw;
    height: auto;
    margin: 56px 2vw 2vw;
    overflow: visible;
  }
  .collection-info {
    order: -1;
    flex: none;
    max-width: 100%;
    height: auto;
    padding: 10vw 7vw;
    overflow: visible;
  }
  .collection-info-top {
    overflow: visible;
  }
  .collection-desc {
    overflow: visible;
  }
  .collection-grid {
    order: 2;
    height: auto;
    gap: 2vw;
    background: #ffffff;
    grid-template-columns: 1fr;
  }
  .collection-grid-item {
    aspect-ratio: 4/3;
  }
  .collection-footer { flex-direction: column; gap: 0.5rem; text-align: center; }
}
