/* Surface-specific gallery experience styles. */

.gallery-layout {
  align-items: start;
}

.gallery-stage-shell {
  min-height: min(62vh, 620px);
  display: grid;
  gap: var(--space-4);
}

.gallery-top-shell {
  display: grid;
  gap: 0.45rem;
}

.gallery-top-shell h1 {
  margin-bottom: 0;
}

.gallery-service-title {
  margin: 0;
  font-size: clamp(1.3rem, 2vw, 1.9rem);
}

.gallery-service-meta {
  margin: 0;
  max-width: 72ch;
}

.gallery-service-switcher {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 0.75rem;
  align-items: center;
}

.gallery-roller {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  align-items: stretch;
}

.gallery-stage {
  position: relative;
  min-height: clamp(420px, 54vw, 660px);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  overflow: hidden;
  background:
    linear-gradient(165deg, rgba(10, 10, 10, 0.86), rgba(4, 4, 4, 0.92)),
    url('/mainbackground.png') center center / cover no-repeat;
  display: block;
  padding: clamp(0.9rem, 2.4vw, 1.35rem) clamp(4.8rem, 10vw, 7.2rem);
  perspective: 1800px;
  transform-style: preserve-3d;
  isolation: isolate;
}

.roller-card {
  position: absolute;
  top: 50%;
  left: 50%;
  width: min(27vw, 23rem);
  max-width: calc(100% - clamp(9rem, 18vw, 13rem));
  aspect-ratio: 4 / 5;
  overflow: hidden;
  border: 1px solid rgba(209, 164, 74, 0.42);
  border-radius: var(--radius-sm);
  background:
    linear-gradient(165deg, rgba(10, 10, 10, 0.92), rgba(4, 4, 4, 0.96)),
    url('/mainbackground.png') center center / cover no-repeat;
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.44);
  cursor: pointer;
  transform-origin: center center;
  transition: box-shadow 180ms ease, border-color 180ms ease, opacity 180ms ease;
}

.roller-card.is-center {
  border-color: rgba(242, 206, 119, 0.72);
  box-shadow: 0 24px 52px rgba(0, 0, 0, 0.56);
}

.roller-card.is-left,
.roller-card.is-right {
  box-shadow: 0 16px 36px rgba(0, 0, 0, 0.46);
}

.roller-card.is-hidden {
  pointer-events: none;
}

.roller-picture {
  display: block;
  width: 100%;
  height: 100%;
}

.roller-image {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  background: rgba(0, 0, 0, 0.32);
}

.roller-card.is-center .roller-image {
  object-fit: contain;
}

.roller-caption {
  position: absolute;
  inset-inline: 0;
  bottom: 0;
  margin: 0;
  padding: 0.82rem 0.9rem 0.76rem;
  background: linear-gradient(180deg, rgba(0, 0, 0, 0), rgba(0, 0, 0, 0.82) 42%, rgba(0, 0, 0, 0.94));
  font-size: 0.88rem;
  line-height: 1.34;
  color: var(--color-text);
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.82);
  pointer-events: none;
}

.gallery-arrow,
.project-rail-nav {
  width: 44px;
  height: 44px;
  min-height: 44px;
  border-radius: 50%;
  border: 1px solid var(--color-border);
  background:
    linear-gradient(165deg, rgba(10, 10, 10, 0.86), rgba(4, 4, 4, 0.92)),
    url('/boxbackground.png') center center / 100% 100% no-repeat;
  color: var(--color-text);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
}

.gallery-arrow {
  position: absolute;
  top: 50%;
  z-index: 7;
  transform: translateY(-50%);
  box-shadow: 0 12px 24px rgba(0, 0, 0, 0.38);
}

.gallery-roller > .gallery-arrow:first-child {
  left: clamp(0.8rem, 2vw, 1.4rem);
}

.gallery-roller > .gallery-arrow:last-child {
  right: clamp(0.8rem, 2vw, 1.4rem);
}

@media (max-width: 1200px) {
  .page-gallery .page-intro-grid {
    grid-template-columns: 1fr;
  }

  .page-gallery .gallery-stage {
    min-height: clamp(380px, 56vw, 560px);
    padding-inline: clamp(3rem, 5vw, 4rem);
  }

  .page-gallery .roller-card.is-left,
  .page-gallery .roller-card.is-right,
  .page-gallery .roller-card.is-hidden {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
  }

  .page-gallery .roller-card.is-center {
    width: min(30rem, calc(100% - 1.5rem));
    max-width: calc(100% - 1.5rem);
  }
}

.page-gallery .page-intro-grid {
  align-items: start;
}

.gallery-project-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  align-items: center;
  overflow: visible;
  padding-right: 0;
  justify-content: center;
}

.gallery-service-button {
  border: 1px solid var(--color-border);
  border-radius: 999px;
  padding: 0.58rem 0.92rem;
  text-align: center;
  background:
    linear-gradient(165deg, rgba(10, 10, 10, 0.86), rgba(4, 4, 4, 0.92)),
    url('/boxbackground.png') center center / 100% 100% no-repeat;
  color: var(--color-text);
  font: inherit;
  line-height: 1.25;
  white-space: nowrap;
  transition: transform 140ms ease, border-color 140ms ease, background 140ms ease;
}

.gallery-service-button:hover,
.gallery-service-button:focus-visible {
  transform: translateY(-1px);
  border-color: var(--color-gold-2);
}

.gallery-service-button.is-active {
  border-color: var(--color-gold-2);
  background:
    linear-gradient(165deg, rgba(46, 33, 10, 0.72), rgba(12, 8, 2, 0.88)),
    url('/boxbackground.png') center center / 100% 100% no-repeat;
}

.gallery-service-button-label {
  display: inline-block;
  font-weight: 700;
  letter-spacing: 0.04em;
}

.gallery-status {
  margin-top: 0;
  font-size: 0.84rem;
  color: var(--color-text-muted);
}

.gallery-lightbox-open {
  overflow: hidden;
}

.gallery-lightbox {
  position: fixed;
  inset: 0;
  z-index: 260;
}

.gallery-lightbox-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.86);
}

.gallery-lightbox-dialog {
  position: relative;
  margin: min(6vh, 2.6rem) auto;
  width: min(94vw, 1280px);
  max-height: calc(100vh - min(12vh, 5.2rem));
  padding: 0.8rem;
  border: 1px solid var(--color-border-strong);
  border-radius: var(--radius-sm);
  background:
    linear-gradient(165deg, rgba(10, 10, 10, 0.9), rgba(4, 4, 4, 0.96)),
    url('/mainbackground.png') center center / cover no-repeat;
  display: grid;
  gap: 0.52rem;
}

.gallery-lightbox-close {
  justify-self: end;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 1px solid var(--color-border);
  background:
    linear-gradient(165deg, rgba(10, 10, 10, 0.9), rgba(4, 4, 4, 0.96)),
    url('/boxbackground.png') center center / 100% 100% no-repeat;
  font-size: 1.5rem;
  line-height: 1;
}

.gallery-lightbox-figure {
  margin: 0;
  display: grid;
  gap: 0.5rem;
  min-height: 0;
}

.gallery-lightbox-image {
  min-height: 0;
  max-height: calc(100vh - min(22vh, 10rem));
  overflow: hidden;
  border-radius: var(--radius-xs);
  border: 1px solid var(--color-border);
  display: grid;
  place-items: center;
  background:
    linear-gradient(165deg, rgba(10, 10, 10, 0.9), rgba(4, 4, 4, 0.96)),
    url('/mainbackground.png') center center / cover no-repeat;
}

.gallery-lightbox-image img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.gallery-lightbox-caption {
  text-align: center;
  font-size: 0.87rem;
  color: var(--color-text);
}
