/* Collections gallery — carousels per collection.
   Desktop: 3 across with arrow paging. Tablet: 2 across. Mobile: 1, swipeable with dots. */

.collections {
  display: flex;
  flex-direction: column;
  gap: 56px;
  padding: 40px 80px 64px;
}

/* Page title */
.gallery-title {
  color: var(--black);
  font-family: Excon, Arial, sans-serif;
  font-weight: 500;
  font-size: 40px;
  line-height: 1.1;
  letter-spacing: -0.01em;
  text-align: center;
  margin: 0 0 16px;
}

/* Collection header: name (left) + controls (right) on one row */
.collection-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
  border-bottom: 1px solid var(--black-12, rgba(10, 9, 8, 0.12));
  padding-bottom: 10px;
}

.collection-title {
  color: var(--black);
  font-family: Excon, Arial, sans-serif;
  font-weight: 500;
  font-size: 19px;
  line-height: 1.3;
  letter-spacing: 0.01em;
  margin: 0;
}

.carousel-controls {
  display: flex;
  gap: 8px;
  flex: 0 0 auto;
}

.carousel {
  position: relative;
}

.carousel-track {
  display: flex;
  gap: 20px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scroll-behavior: smooth;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  padding-bottom: 4px;
}
.carousel-track::-webkit-scrollbar { display: none; }

/* 3 per view on desktop (2 gaps of 20px = 40px) */
.card {
  flex: 0 0 calc((100% - 40px) / 3);
  scroll-snap-align: start;
}

/* Fixed-height image area so every image and every caption line up across a row.
   contain (not cover) keeps the full painting visible — never crops the art. */
.card-figure {
  height: 440px;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.card-img {
  display: block;
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
  object-fit: contain;
  transition: transform .6s cubic-bezier(.2, .6, .2, 1);
}
.card:hover .card-img { transform: scale(1.03); }

.card-caption {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  margin-top: 12px;
  padding-top: 10px;
  border-top: 1px solid var(--black-12, rgba(10, 9, 8, 0.12));
}

.card-title {
  color: var(--black-75);
  font-family: Excon, Arial, sans-serif;
  font-weight: 400;
  font-size: 13px;
  line-height: 18px;
}

.card-meta {
  color: var(--black-75);
  font-family: Excon, Arial, sans-serif;
  font-weight: 300;
  font-size: 12px;
  line-height: 18px;
  text-align: right;
  white-space: nowrap;
}

/* Arrow controls — compact, always visible, disabled at the ends */
.arrow {
  width: 32px;
  height: 32px;
  border: 1px solid var(--black);
  background: var(--white);
  color: var(--black);
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 15px;
  line-height: 1;
  padding: 0;
  transition: background .15s, color .15s, border-color .15s, opacity .15s;
}
.arrow:hover:not(:disabled) { background: var(--black); color: var(--white); }
.arrow:disabled {
  opacity: .25;
  cursor: default;
  border-color: var(--black-75);
}

/* Swipe dots — mobile only */
.carousel-dots {
  display: none;
  justify-content: center;
  gap: 8px;
  margin-top: 14px;
}
.carousel-dots .dot {
  width: 7px;
  height: 7px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: var(--black);
  opacity: .25;
  cursor: pointer;
  transition: opacity .2s, transform .2s;
}
.carousel-dots .dot.active {
  opacity: .9;
  transform: scale(1.25);
}

/* Tablet: 2 per view */
@media screen and (max-width: 991px) {
  .collections { padding: 32px 24px 48px; }
  .card { flex-basis: calc((100% - 20px) / 2); }
  .card-figure { height: 380px; }
  .gallery-title { font-size: 32px; }
}

/* Mobile: 1 per view, swipe with dots (hide arrows, show dots) */
@media screen and (max-width: 600px) {
  .collections { padding: 24px 16px 40px; gap: 44px; }
  .card { flex-basis: 100%; }
  .card-figure { height: 420px; }
  .carousel-controls { display: none; }
  .carousel-dots { display: flex; }
  .gallery-title { font-size: 28px; }
}

/* Fullscreen lightbox */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 4vmin;
  background: rgba(10, 9, 8, 0.92);
  opacity: 0;
  visibility: hidden;
  transition: opacity .3s ease, visibility .3s ease;
}
.lightbox.open {
  opacity: 1;
  visibility: visible;
}

.lightbox-content {
  margin: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  max-width: 100%;
  max-height: 100%;
}

.lightbox-img {
  display: block;
  max-width: 92vw;
  max-height: 82vh;
  object-fit: contain;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.45);
  transform: scale(.96);
  transition: transform .3s cubic-bezier(.2, .6, .2, 1);
}
.lightbox.open .lightbox-img { transform: scale(1); }

.lightbox-caption {
  color: var(--white);
  font-family: Excon, Arial, sans-serif;
  font-weight: 300;
  font-size: 14px;
  line-height: 1.5;
  text-align: center;
  letter-spacing: .02em;
}
.lightbox-caption .lb-title {
  font-weight: 500;
  margin-right: 10px;
}

.lightbox-close,
.lightbox-nav {
  position: absolute;
  background: transparent;
  border: 0;
  color: var(--white);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: .7;
  transition: opacity .2s ease;
}
.lightbox-close:hover,
.lightbox-nav:hover { opacity: 1; }

.lightbox-close {
  top: 3vmin;
  right: 3vmin;
  width: 44px;
  height: 44px;
  font-size: 30px;
  line-height: 1;
}
.lightbox-nav {
  top: 50%;
  transform: translateY(-50%);
  width: 56px;
  height: 56px;
  font-size: 40px;
  line-height: 1;
}
.lightbox-nav.prev { left: 2vmin; }
.lightbox-nav.next { right: 2vmin; }
.lightbox-nav[hidden] { display: none; }

@media screen and (max-width: 600px) {
  .lightbox-nav { width: 40px; height: 40px; font-size: 30px; }
  .lightbox-img { max-height: 76vh; }
}

/* Respect reduced-motion preferences */
@media (prefers-reduced-motion: reduce) {
  .card-img { transition: none; }
  .card:hover .card-img { transform: none; }
  .lightbox, .lightbox-img { transition: opacity .2s ease; }
  .lightbox-img { transform: none; }
  .lightbox.open .lightbox-img { transform: none; }
}
