/* Gallery Bay — Salon Focus triptych. Transform layout (no overflow scroll). Tokens only. */

.gallery-bay {
  display: grid;
  gap: 0.95rem;
  min-width: 0;
}

.gallery-bay:focus-visible {
  outline: 2px solid var(--color-accent);
  outline-offset: 0.35rem;
  border-radius: var(--radius-lg);
}

.gallery-bay__stage {
  position: relative;
  min-width: 0;
  overflow: hidden;
  isolation: isolate;
  container-type: inline-size;
  padding-block: 0.85rem 0.65rem;
  /* Open sides — only centered top/bottom rails (see ::before / ::after). */
  border: none;
  border-radius: calc(var(--radius-lg) + 0.15rem);
  background:
    radial-gradient(
      75% 55% at 50% 28%,
      color-mix(in srgb, var(--color-spot) 16%, transparent),
      transparent 62%
    ),
    radial-gradient(
      55% 40% at 50% 100%,
      color-mix(in srgb, var(--color-accent) 10%, transparent),
      transparent 70%
    ),
    linear-gradient(
      168deg,
      color-mix(in srgb, var(--color-stage) 42%, var(--color-surface-elevated)),
      color-mix(in srgb, var(--color-stage-deep) 82%, var(--color-surface))
    );
  box-shadow: var(--shadow);
}

/* Top + bottom accent rails: corners + left/right sides stay open; rail ends are soft-rounded. */
.gallery-bay__stage::before,
.gallery-bay__stage::after {
  content: "";
  position: absolute;
  z-index: 5;
  left: 50%;
  width: min(56%, 26rem);
  height: 2px;
  border-radius: 999px;
  transform: translateX(-50%);
  pointer-events: none;
  background: linear-gradient(
    90deg,
    transparent 0%,
    color-mix(in srgb, var(--color-spot) 45%, transparent) 8%,
    color-mix(in srgb, var(--color-spot) 85%, var(--color-accent)) 22%,
    var(--color-spot) 50%,
    color-mix(in srgb, var(--color-spot) 85%, var(--color-accent)) 78%,
    color-mix(in srgb, var(--color-spot) 45%, transparent) 92%,
    transparent 100%
  );
  box-shadow: 0 0 0.65rem color-mix(in srgb, var(--color-spot) 32%, transparent);
}

.gallery-bay__stage::before {
  top: 0.45rem;
}

.gallery-bay__stage::after {
  bottom: 0.45rem;
}

.gallery-bay__veil {
  position: absolute;
  inset: 0;
  z-index: 4;
  pointer-events: none;
  background:
    linear-gradient(
      90deg,
      color-mix(in srgb, var(--color-stage-deep) 78%, transparent) 0%,
      transparent 16%,
      transparent 84%,
      color-mix(in srgb, var(--color-stage-deep) 78%, transparent) 100%
    ),
    radial-gradient(
      70% 48% at 50% 100%,
      color-mix(in srgb, var(--color-stage-deep) 42%, transparent),
      transparent 74%
    );
}

.gallery-bay__podium {
  position: absolute;
  left: 50%;
  /* Sit under the photo strip, not under the plaque. */
  top: calc(min(20rem, 58cqw) * 3 / 4 + 0.15rem);
  bottom: auto;
  z-index: 1;
  width: min(16rem, 48%);
  height: 1rem;
  pointer-events: none;
  border-radius: 50%;
  transform: translateX(-50%);
  background: radial-gradient(
    ellipse at center,
    color-mix(in srgb, var(--color-spot) 42%, var(--color-stage-deep)),
    color-mix(in srgb, var(--color-accent) 12%, transparent) 48%,
    transparent 72%
  );
  box-shadow:
    0 0.35rem 1.1rem color-mix(in srgb, var(--color-spot) 22%, transparent),
    0 0.65rem 1.6rem color-mix(in srgb, var(--color-text) 14%, transparent);
  opacity: 0.92;
}

.gallery-bay__viewport {
  position: relative;
  z-index: 2;
  min-width: 0;
  /* Height tracks the card photo (58% wide × 4:3) + small salon padding. */
  height: calc(min(20rem, 58cqw) * 3 / 4 + 1.1rem);
  max-height: 16.5rem;
  touch-action: pan-y;
  cursor: grab;
  user-select: none;
  -webkit-user-select: none;
}

.gallery-bay.is-dragging .gallery-bay__viewport {
  cursor: grabbing;
}

.gallery-bay__track {
  position: absolute;
  inset: 0;
  margin: 0;
  padding: 0;
  list-style: none;
  overflow: visible;
}

.gallery-bay__item {
  --bay-x: 0px;
  --bay-scale: 0.88;
  --bay-opacity: 0.42;
  --bay-y: 4px;
  --bay-rot: 0deg;
  position: absolute;
  top: 0.35rem;
  left: 50%;
  width: min(20rem, 58%);
  margin: 0;
  opacity: var(--bay-opacity);
  transform:
    translate3d(calc(-50% + var(--bay-x)), var(--bay-y), 0)
    rotate(var(--bay-rot))
    scale(var(--bay-scale));
  transform-origin: center bottom;
  transition:
    transform 0.4s cubic-bezier(0.22, 1, 0.36, 1),
    opacity 0.4s cubic-bezier(0.22, 1, 0.36, 1);
  will-change: transform, opacity;
  pointer-events: auto;
}

.gallery-bay.is-dragging .gallery-bay__item,
.gallery-bay.is-settling .gallery-bay__item {
  transition: none;
}

.gallery-bay__item.is-active .gallery-bay__card {
  cursor: pointer;
}

.gallery-bay__item.is-near {
  pointer-events: auto;
}

.gallery-bay__item.is-near .gallery-bay__card {
  cursor: pointer;
  padding: 0.35rem;
  margin: -0.35rem;
}

.gallery-bay__item.is-far .gallery-bay__card {
  cursor: grab;
}

.gallery-bay.is-dragging .gallery-bay__item .gallery-bay__card {
  cursor: grabbing;
}

.gallery-bay__card {
  display: block;
  color: inherit;
  text-decoration: none;
  -webkit-user-drag: none;
  user-select: none;
}

.gallery-bay__card:focus-visible {
  outline: 2px solid var(--color-accent);
  outline-offset: 0.25rem;
  border-radius: var(--radius);
}

.gallery-bay__item.is-active .gallery-bay__card:focus-visible {
  outline-offset: 0.35rem;
}

.gallery-bay__media {
  position: relative;
  overflow: hidden;
  border-radius: calc(var(--radius) + 0.1rem);
  border: 1px solid color-mix(in srgb, var(--color-border) 80%, transparent);
  background: color-mix(in srgb, var(--color-stage-deep) 35%, var(--color-surface-elevated));
  aspect-ratio: 4 / 3;
  box-shadow: var(--shadow);
  transition:
    box-shadow 0.55s cubic-bezier(0.22, 1, 0.36, 1),
    border-color 0.45s ease,
    transform 0.55s cubic-bezier(0.22, 1, 0.36, 1);
}

.gallery-bay__item.is-active .gallery-bay__media {
  border-color: color-mix(in srgb, var(--color-spot) 72%, var(--color-border));
  box-shadow:
    var(--shadow-lift),
    0 0 0 1px color-mix(in srgb, var(--color-spot) 38%, transparent),
    0 0 0 5px color-mix(in srgb, var(--color-accent) 8%, transparent),
    0 1.35rem 2.6rem color-mix(in srgb, var(--color-text) 18%, transparent);
}

.gallery-bay__image {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 40%;
  pointer-events: none;
  -webkit-user-drag: none;
  user-select: none;
  transform: scale(1.04);
  transition: transform 0.85s cubic-bezier(0.22, 1, 0.36, 1);
}

.gallery-bay__item.is-active .gallery-bay__image {
  transform: scale(1);
}

/* Ribbon look lives in mark-ribbon.css; bay only dims inactive wings. */
.gallery-bay__item:not(.is-active) .gallery-bay__ribbon {
  opacity: 0.72;
  filter: saturate(0.85);
}

/* Single details plaque under the viewport — never on wing cards (no mobile overlap). */
.gallery-bay__plaque {
  position: relative;
  z-index: 3;
  display: grid;
  gap: 0.45rem;
  justify-items: start;
  width: 100%;
  max-width: 20.5rem;
  margin: 0.35rem auto 0;
  padding: 0.1rem 0.5rem 0.2rem;
  text-align: start;
  color: inherit;
  text-decoration: none;
}

.gallery-bay__plaque.is-fresh {
  animation: gallery-bay-plaque-in 0.35s cubic-bezier(0.22, 1, 0.36, 1);
}

.gallery-bay__plaque:focus-visible {
  outline: 2px solid var(--color-accent);
  outline-offset: 0.3rem;
  border-radius: var(--radius);
}

@keyframes gallery-bay-plaque-in {
  from {
    opacity: 0;
    transform: translateY(0.3rem);
  }

  to {
    opacity: 1;
    transform: none;
  }
}

.gallery-bay__name {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow: hidden;
  margin: 0;
  max-width: 100%;
  font-family: var(--font-heading, inherit);
  font-size: clamp(0.98rem, 1.8vw, 1.12rem);
  font-weight: 700;
  line-height: 1.35;
  letter-spacing: 0.005em;
  color: var(--color-text);
  text-wrap: balance;
}

.gallery-bay__desc {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow: hidden;
  margin: 0;
  max-width: 100%;
  color: var(--color-muted);
  font-size: 0.78rem;
  font-weight: 500;
  line-height: 1.45;
}

.gallery-bay__price {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.25rem 0.45rem;
  margin: 0.15rem 0 0;
  padding-block-start: 0.55rem;
  border-block-start: 1px solid color-mix(in srgb, var(--color-border) 70%, var(--color-spot));
  max-width: 100%;
  text-align: start;
}

.gallery-bay__price-label {
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  line-height: 1.3;
  color: color-mix(in srgb, var(--color-spot) 70%, var(--color-muted));
  white-space: nowrap;
}

.gallery-bay__price-label::after {
  content: ":";
}

.gallery-bay__price-value {
  font-size: 0.84rem;
  font-weight: 650;
  letter-spacing: 0;
  line-height: 1.35;
  color: var(--color-text);
  font-variant-numeric: tabular-nums;
}

.gallery-bay__price--plain {
  margin: 0.15rem 0 0;
  padding-block-start: 0.55rem;
  border-block-start: 1px solid color-mix(in srgb, var(--color-border) 70%, var(--color-spot));
  font-size: 0.8rem;
  font-weight: 600;
  line-height: 1.4;
  color: var(--color-text);
  text-align: start;
}

/* Quiet floor rail — diamonds under the stage. */
.gallery-bay__floor {
  position: relative;
  z-index: 1;
  display: grid;
  gap: 0.45rem;
  justify-items: center;
  margin: 0;
  padding-block: 0.15rem 0;
}

.gallery-bay__rail {
  display: none;
}

.gallery-bay__progress {
  display: none;
}

.gallery-bay__slots {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  justify-content: center;
  margin: 0;
  padding: 0.35rem 0.75rem;
  border-radius: 999px;
  border: 1px solid color-mix(in srgb, var(--color-border) 70%, var(--color-spot));
  background: color-mix(in srgb, var(--color-surface) 55%, transparent);
}

.gallery-bay__slot {
  position: relative;
  width: 0.42rem;
  height: 0.42rem;
  padding: 0;
  border: 1px solid color-mix(in srgb, var(--color-spot) 40%, var(--color-border));
  border-radius: 0.1rem;
  background: color-mix(in srgb, var(--color-surface) 50%, transparent);
  transform: rotate(45deg);
  cursor: pointer;
  transition:
    background 0.3s ease,
    transform 0.35s cubic-bezier(0.22, 1, 0.36, 1),
    border-color 0.3s ease,
    box-shadow 0.3s ease;
}

.gallery-bay__slot::before {
  content: "";
  position: absolute;
  inset: -0.55rem;
}

.gallery-bay__slot.is-active {
  background: var(--color-spot);
  border-color: var(--color-spot);
  transform: rotate(45deg) scale(1.28);
  box-shadow: 0 0 0.55rem color-mix(in srgb, var(--color-spot) 45%, transparent);
}

.gallery-bay__slot:focus-visible {
  outline: 2px solid var(--color-accent);
  outline-offset: 4px;
}

/* Public bay: swipe + slot dots only (no hint / prev / next chrome). */
.gallery-bay__hint,
.gallery-bay__controls,
.gallery-bay__nav {
  display: none !important;
}

.gallery-bay__status--sr {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.gallery-bay--solo .gallery-bay__viewport {
  height: auto;
  min-height: 16rem;
  cursor: default;
}

.gallery-bay--solo .gallery-bay__item {
  position: relative;
  left: auto;
  top: auto;
  width: min(20rem, 78%);
  margin-inline: auto;
  opacity: 1;
  transform: none;
}

.gallery-bay--solo .gallery-bay__track {
  position: relative;
  display: grid;
  place-items: center;
  padding-block: 1.25rem;
}

.gallery-bay--solo .gallery-bay__veil,
.gallery-bay--solo .gallery-bay__podium,
.gallery-bay--solo .gallery-bay__floor,
.gallery-bay--solo .gallery-bay__hint {
  display: none;
}

.gallery-bay--solo .gallery-bay__plaque,
.gallery-bay--solo .gallery-bay__plaque.is-fresh {
  animation: none;
}

@media (max-width: 720px) {
  .gallery-bay__viewport {
    height: calc(min(16.5rem, 68cqw) * 3 / 4 + 0.95rem);
    max-height: 14.5rem;
  }

  .gallery-bay__podium {
    top: calc(min(16.5rem, 68cqw) * 3 / 4 + 0.05rem);
    width: min(14rem, 52%);
  }

  .gallery-bay__item {
    width: min(16.5rem, 68%);
    top: 0.15rem;
  }

  .gallery-bay__stage {
    padding-block: 0.65rem 0.5rem;
  }

  .gallery-bay__plaque {
    gap: 0.4rem;
    max-width: min(18.5rem, 100%);
    margin-block-start: 0.25rem;
    padding-inline: 0.45rem;
  }

  .gallery-bay__name {
    font-size: 0.95rem;
  }

  .gallery-bay__price-value {
    font-size: 0.8rem;
  }

  .gallery-bay__price--plain {
    font-size: 0.76rem;
  }

  .gallery-bay__nav {
    min-height: 2.25rem;
    padding-inline: 0.85rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  .gallery-bay__item,
  .gallery-bay__image,
  .gallery-bay__media,
  .gallery-bay__progress,
  .gallery-bay__slot {
    transition: none !important;
  }

  .gallery-bay__plaque,
  .gallery-bay__plaque.is-fresh {
    animation: none !important;
  }

  .gallery-bay__item.is-active .gallery-bay__image {
    transform: none;
  }
}
