
/* ============================================================
   BESPOKE GALLERY — reusable component
   Structural CSS below is meant to travel unmodified between
   templates. Only the variables in the --bgallery-* block should
   be re-skinned per site (colours, fonts, spacing).
   ============================================================ */

.bgallery {
  --bgallery-bg: transparent;
  --bgallery-text: #edebe5;
  --bgallery-muted: rgba(237, 235, 229, 0.6);
  --bgallery-accent: #c9a35c;
  --bgallery-font-display: 'Syne', sans-serif;
  --bgallery-font-body: 'Figtree', system-ui, sans-serif;
  --bgallery-card-w: 230px;
  --bgallery-card-h: 320px;
  --bgallery-gap: 168px;
  --bgallery-angle: 32deg;
  --bgallery-depth: 90px;

  position: relative;
  padding: 4rem 0 3rem;
  background: var(--bgallery-bg);
  color: var(--bgallery-text);
  font-family: var(--bgallery-font-body);
  overflow: hidden;
}

.bgallery__heading {
  text-align: center;
  max-width: 620px;
  margin: 0 auto 3rem;
  padding: 0 1.5rem;
}

.bgallery__heading h2 {
  font-family: var(--bgallery-font-display);
  font-weight: 600;
  font-size: clamp(1.6rem, 3.4vw, 2.4rem);
  margin: 0 0 0.6rem;
  line-height: 1.15;
}

.bgallery__heading p {
  color: var(--bgallery-muted);
  margin: 0;
  font-size: 1rem;
  line-height: 1.6;
}

.bgallery__stage {
  position: relative;
  height: calc(var(--bgallery-card-h) + 40px);
  perspective: 1400px;
  perspective-origin: 50% 40%;
  display: flex;
  align-items: center;
  justify-content: center;
  touch-action: pan-y;
  user-select: none;
}

.bgallery__track {
  position: relative;
  width: var(--bgallery-card-w);
  height: var(--bgallery-card-h);
  list-style: none;
  margin: 0;
  padding: 0;
  transform-style: preserve-3d;
}

.bgallery__card {
  position: absolute;
  top: 0;
  left: 0;
  width: var(--bgallery-card-w);
  height: var(--bgallery-card-h);
  transition: transform 0.6s cubic-bezier(0.22, 0.61, 0.36, 1),
              opacity 0.6s ease,
              filter 0.6s ease;
  will-change: transform, opacity;
}

.bgallery__card-inner {
  position: relative;
  width: 100%;
  height: 100%;
  border: 0;
  border-radius: 14px;
  padding: 0;
  cursor: pointer;
  background-size: cover;
  background-position: center;
  overflow: hidden;
  box-shadow: 0 20px 45px rgba(0, 0, 0, 0.5);
  -webkit-tap-highlight-color: transparent;
}

.bgallery__card-inner::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.75) 0%, rgba(0, 0, 0, 0.05) 55%, transparent 75%);
}

.bgallery__card[data-active="true"] .bgallery__card-inner {
  cursor: zoom-in;
}

.bgallery__label {
  position: absolute;
  left: 14px;
  right: 14px;
  bottom: 14px;
  z-index: 1;
  font-size: 0.95rem;
  font-weight: 600;
  text-align: left;
  letter-spacing: 0.01em;
}

.bgallery__expand {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 1;
  width: 30px;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  background: rgba(11, 13, 16, 0.55);
  border: 1px solid rgba(255, 255, 255, 0.25);
  color: var(--bgallery-text);
  font-size: 0.85rem;
  opacity: 0;
  transform: translateY(-4px);
  transition: opacity 0.3s ease, transform 0.3s ease;
}

.bgallery__card[data-active="true"] .bgallery__expand {
  opacity: 1;
  transform: translateY(0);
}

.bgallery__nav {
  position: relative;
  z-index: 20;
  flex: none;
  width: 46px;
  height: 46px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  background: rgba(255, 255, 255, 0.04);
  color: var(--bgallery-text);
  font-size: 1.3rem;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.25s ease, border-color 0.25s ease, transform 0.25s ease;
  margin: 0 clamp(0.5rem, 3vw, 2.5rem);
}

.bgallery__nav:hover {
  background: var(--bgallery-accent);
  border-color: var(--bgallery-accent);
  color: #1a1408;
  transform: translateY(-2px);
}

.bgallery__caption {
  max-width: 480px;
  margin: 2.25rem auto 0;
  padding: 0 1.5rem;
  text-align: center;
  min-height: 4.5rem;
}

.bgallery__caption h3 {
  font-family: var(--bgallery-font-display);
  font-weight: 600;
  font-size: 1.3rem;
  margin: 0 0 0.4rem;
  color: var(--bgallery-accent);
}

.bgallery__caption p {
  margin: 0;
  color: var(--bgallery-muted);
  font-size: 0.95rem;
  line-height: 1.55;
}

.bgallery__dots {
  display: flex;
  justify-content: center;
  gap: 0.4rem;
  margin-top: 1.5rem;
}

.bgallery__dots button {
  width: 7px;
  height: 7px;
  border-radius: 999px;
  border: 0;
  background: rgba(255, 255, 255, 0.22);
  cursor: pointer;
  padding: 0;
  transition: background 0.25s ease, transform 0.25s ease;
}

.bgallery__dots button[aria-current="true"] {
  background: var(--bgallery-accent);
  transform: scale(1.3);
}

@media (max-width: 640px) {
  .bgallery {
    --bgallery-card-w: 168px;
    --bgallery-card-h: 240px;
    --bgallery-gap: 108px;
    --bgallery-angle: 30deg;
    --bgallery-depth: 60px;
  }
  .bgallery__nav { width: 38px; height: 38px; font-size: 1.1rem; }
}

/* Lightbox */

.bgallery-lightbox {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(6, 7, 9, 0.92);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.bgallery-lightbox[data-open="true"] {
  opacity: 1;
  pointer-events: auto;
}

.bgallery-lightbox figure {
  margin: 0;
  max-width: min(90vw, 720px);
  text-align: center;
  transform: scale(0.96);
  transition: transform 0.3s ease;
}

.bgallery-lightbox[data-open="true"] figure { transform: scale(1); }

.bgallery-lightbox img {
  max-width: 100%;
  max-height: 74vh;
  border-radius: 10px;
  box-shadow: 0 30px 70px rgba(0, 0, 0, 0.6);
}

.bgallery-lightbox figcaption {
  margin-top: 1rem;
  color: rgba(242, 240, 234, 0.85);
  font-family: 'Figtree', system-ui, sans-serif;
  font-size: 0.95rem;
}

.bgallery-lightbox__close,
.bgallery-lightbox__nav {
  position: absolute;
  border: 1px solid rgba(255, 255, 255, 0.2);
  background: rgba(255, 255, 255, 0.06);
  color: #f2f0ea;
  border-radius: 999px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

.bgallery-lightbox__close {
  top: 1.5rem;
  right: 1.5rem;
  width: 40px;
  height: 40px;
  font-size: 1.1rem;
}

.bgallery-lightbox__nav {
  top: 50%;
  width: 46px;
  height: 46px;
  font-size: 1.4rem;
  transform: translateY(-50%);
}

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

@media (max-width: 640px) {
  .bgallery-lightbox__nav { width: 38px; height: 38px; }
  .bgallery-lightbox__nav--prev { left: 0.5rem; }
  .bgallery-lightbox__nav--next { right: 0.5rem; }
  .bgallery-lightbox__close { top: 0.75rem; right: 0.75rem; }
}
