/* ============================================================
   Playmochi — Shared Gallery CSS
   Type A: Crossfade  |  Type B: Scroll-snap  |  Type C: Lightbox
   ============================================================ */

/* ----------------------------------------------------------
   TYPE A — Crossfade gallery
---------------------------------------------------------- */
.gallery-fade {
  position: relative;
  overflow: hidden;
  width: 100%;
  height: 100%;
  outline: none; /* focus ring via JS tabindex, handled by browser default */
}

/* Aspect-ratio helpers for gallery frames.
   The FRAME owns the size (width + aspect ratio); slides are all absolute.
   Never let a slide's intrinsic media size drive layout — a 1280px video
   in a flex column squishes the text beside it, then the frame collapses
   to zero when an absolutely-positioned slide becomes active. */
.gal-portrait  { aspect-ratio: 4 / 5; width: 100%; }
.gal-landscape { aspect-ratio: 3 / 2; width: 100%; }

/* Flex columns that hold galleries must be allowed to shrink */
.hero-media-col, .ph-media-col, .split-media-col, .about-hero-media-col { min-width: 0; }

/* Show landscape gallery on desktop, portrait gallery on mobile */
.only-mobile  { display: block; }
.only-desktop { display: none; }
@media (min-width: 1024px) {
  .only-mobile  { display: none; }
  .only-desktop { display: block; }
}

.gf-slide {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center top;
  opacity: 0;
  transition: opacity 1s ease-in-out;
}

.gf-slide.active {
  opacity: 1;
}

/* Prev / next buttons — sit inside the gallery frame */
.gf-prev,
.gf-next {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 10;
  background: rgba(33, 28, 26, 0.45);
  border: none;
  color: #F7F2EA;
  font-size: 2rem;
  line-height: 1;
  padding: 0.5rem 0.75rem;
  cursor: pointer;
  border-radius: 2px;
  transition: background 0.2s;
}

.gf-prev:hover,
.gf-next:hover {
  background: rgba(33, 28, 26, 0.75);
}

.gf-prev { left: 12px; }
.gf-next { right: 12px; }

@media (prefers-reduced-motion: reduce) {
  .gf-slide { transition: none; }
}


/* ----------------------------------------------------------
   TYPE B — Scroll-snap carousel
---------------------------------------------------------- */
.img-carousel {
  position: relative;
}

.ic-track {
  display: flex;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scrollbar-width: none;
  gap: 0;
}

.ic-track::-webkit-scrollbar { display: none; }

.ic-slide {
  flex: 0 0 100%;
  scroll-snap-align: start;
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  object-position: center;
}

/* Prev / next buttons — overlay the track edges */
.ic-prev,
.ic-next {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 10;
  background: rgba(33, 28, 26, 0.45);
  border: none;
  color: #F7F2EA;
  font-size: 2rem;
  line-height: 1;
  padding: 0.5rem 0.75rem;
  cursor: pointer;
  border-radius: 2px;
  transition: background 0.2s;
  /* Sit above the dots row, not below it */
  margin-top: -18px; /* half of dots height */
}

.ic-prev:hover,
.ic-next:hover {
  background: rgba(33, 28, 26, 0.75);
}

.ic-prev { left: 8px; }
.ic-next { right: 8px; }

/* Dots */
.ic-dots {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin-top: 12px;
}

.ic-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--border);
  border: none;
  cursor: pointer;
  padding: 0;
  transition: background 0.3s;
}

.ic-dot.active { background: var(--orange); }


/* ----------------------------------------------------------
   TYPE C — Lightbox
---------------------------------------------------------- */
#lightbox {
  position: fixed;
  inset: 0;
  z-index: 200;
  background: rgba(33, 28, 26, 0.94);
  display: flex;
  align-items: center;
  justify-content: center;
}

#lightbox[hidden] { display: none; }

#lb-close {
  position: absolute;
  top: 20px;
  right: 24px;
  background: none;
  border: none;
  color: #F7F2EA;
  font-size: 32px;
  cursor: pointer;
  line-height: 1;
}

#lb-prev,
#lb-next {
  position: absolute;
  background: none;
  border: none;
  color: #F7F2EA;
  font-size: 48px;
  cursor: pointer;
  line-height: 1;
  opacity: 0.7;
  transition: opacity 0.2s;
}

#lb-prev:hover,
#lb-next:hover { opacity: 1; }

#lb-prev { left: 16px; }
#lb-next { right: 16px; }

#lb-img {
  max-width: 90vw;
  max-height: 90vh;
  object-fit: contain;
  display: block;
}
