/* Gallery — masonry grid + vertical feed modal */

.gallery-mount {
  min-height: 12rem;
}

.gallery-mount.is-ready {
  min-height: 0;
}

.gallery__loading {
  margin: 2rem 0 0;
  text-align: center;
  font-size: 0.88rem;
  color: var(--text-muted);
}

.gallery-mount.is-ready .gallery__loading {
  display: none;
}

/* ── Masonry grid ── */
.gallery-grid {
  column-count: 2;
  column-gap: 0.5rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

@media (min-width: 36rem) {
  .gallery-grid {
    column-count: 3;
  }
}

.gallery-grid__item {
  break-inside: avoid;
  margin: 0 0 0.5rem;
  border-radius: 1rem;
  overflow: hidden;
  background: linear-gradient(145deg, rgba(240, 180, 41, 0.12), rgba(8, 9, 15, 0.9));
}

.gallery-grid__card {
  display: flex;
  flex-direction: column-reverse;
  width: 100%;
  margin: 0;
  padding: 0;
  border: 0;
  background: none;
  cursor: pointer;
  text-align: left;
  color: inherit;
  font: inherit;
}

.gallery-grid__card:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 2px;
}

.gallery-grid__media {
  position: relative;
  display: block;
  width: 100%;
  line-height: 0;
}

.gallery-grid__media picture,
.gallery-feed__media picture {
  display: block;
  width: 100%;
}

.gallery-grid__media img,
.gallery-grid__media video,
.gallery-feed__media img,
.gallery-feed__media video {
  display: block;
  width: 100%;
  height: auto;
  vertical-align: bottom;
}

.gallery-grid__caption {
  display: block;
  padding: 0.6rem 0.65rem 0.5rem;
  font-size: 0.72rem;
  font-weight: var(--fw-thick);
  line-height: 1.35;
  color: rgba(250, 248, 245, 0.55);
}

/* ── Shared media controls ── */
.gallery-media__unmute {
  position: absolute;
  right: 0.45rem;
  bottom: 0.45rem;
  z-index: 2;
  display: grid;
  place-items: center;
  width: 1.75rem;
  height: 1.75rem;
  padding: 0;
  border: 1px solid rgba(250, 248, 245, 0.2);
  border-radius: var(--radius-round);
  background: rgba(4, 5, 10, 0.65);
  color: var(--text);
  cursor: pointer;
}

.gallery-media__unmute:hover {
  background: rgba(4, 5, 10, 0.85);
}

.gallery-media__unmute:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 2px;
}

.gallery-media__unmute svg {
  width: 0.9rem;
  height: 0.9rem;
}

.gallery-media__unmute.is-unmuted .icon-muted {
  display: none;
}

.gallery-media__unmute:not(.is-unmuted) .icon-unmuted {
  display: none;
}

/* ── Feed modal (booking-modal pattern) ── */
.gallery-modal {
  position: fixed;
  inset: 0;
  z-index: 210;
  display: flex;
  align-items: center;
  justify-content: center;
  padding:
    max(0.75rem, env(safe-area-inset-top))
    max(0.75rem, env(safe-area-inset-right))
    max(0.75rem, env(safe-area-inset-bottom))
    max(0.75rem, env(safe-area-inset-left));
  pointer-events: none;
  visibility: hidden;
}

.gallery-modal.is-open {
  pointer-events: auto;
  visibility: visible;
}

.gallery-modal__backdrop {
  position: absolute;
  inset: 0;
  background: #000;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.gallery-modal.is-open .gallery-modal__backdrop {
  opacity: 1;
}

.gallery-modal__panel {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: min(100%, 28rem);
  max-height: min(
    88svh,
    calc(100svh - 1.5rem - env(safe-area-inset-top) - env(safe-area-inset-bottom))
  );
  margin: 0 auto;
  background: #000;
  border: 1px solid rgba(250, 248, 245, 0.08);
  border-radius: 1.25rem;
  box-shadow: 0 -12px 48px rgba(0, 0, 0, 0.45);
  overflow: hidden auto;
  transform: translateY(1.25rem) scale(0.97);
  opacity: 0;
  transition:
    transform 0.35s cubic-bezier(0.22, 1, 0.36, 1),
    opacity 0.35s ease;
  -webkit-overflow-scrolling: touch;
}

.gallery-modal.is-open .gallery-modal__panel {
  transform: translateY(0) scale(1);
  opacity: 1;
}

.gallery-modal__header {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 1.25rem var(--pad) 0.75rem;
  background: #0e1018;
  border-bottom: 1px solid rgba(250, 248, 245, 0.06);
}

.gallery-modal__title {
  margin: 0;
  font-size: 1.15rem;
  font-weight: var(--fw-thick);
  line-height: 1.25;
}

.gallery-modal__close {
  flex-shrink: 0;
  display: grid;
  place-items: center;
  width: 2.25rem;
  height: 2.25rem;
  border: 1px solid rgba(250, 248, 245, 0.12);
  border-radius: var(--radius-round);
  background: rgba(250, 248, 245, 0.06);
  color: var(--text);
  font-size: 1.35rem;
  line-height: 1;
  cursor: pointer;
}

.gallery-modal__close:hover {
  background: rgba(250, 248, 245, 0.12);
}

.gallery-modal__close:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 2px;
}

.gallery-modal__feed {
  position: relative;
  z-index: 0;
  display: flex;
  flex-direction: column;
  background: #000;
}

.gallery-feed__item {
  scroll-margin-top: 4.5rem;
}

.gallery-feed__item--has-caption {
  padding-top: 1.25rem;
}

.gallery-feed__item--has-caption:first-child {
  padding-top: 1rem;
}

.gallery-feed__media {
  position: relative;
  z-index: 0;
  display: block;
  width: 100%;
  line-height: 0;
  background: #000;
  overflow: hidden;
}

.gallery-feed__media img,
.gallery-feed__media video {
  display: block;
  width: 100%;
  height: auto;
  position: relative;
  z-index: 0;
}

.gallery-feed__media--labeled img,
.gallery-feed__media--labeled video {
  margin-top: 0;
}

.gallery-feed__caption {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1;
  margin: 0;
  padding: 0.7rem var(--pad) 0.8rem;
  font-size: 0.92rem;
  font-weight: var(--fw-thick);
  line-height: 1.3;
  letter-spacing: 0.01em;
  color: #faf8f5;
  background: rgba(0, 0, 0, 0.72);
  -webkit-backdrop-filter: blur(4px);
  backdrop-filter: blur(4px);
  pointer-events: none;
}

.gallery-feed__media .gallery-media__unmute {
  z-index: 3;
}

.gallery-feed__footer {
  padding: 1.5rem var(--pad) max(1.75rem, env(safe-area-inset-bottom));
  text-align: center;
  border-top: 1px solid rgba(250, 248, 245, 0.08);
  background: rgba(8, 9, 15, 0.94);
  -webkit-backdrop-filter: blur(18px);
  backdrop-filter: blur(18px);
}

.gallery-feed__book {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.75rem;
  max-width: 100%;
  margin: 0 auto;
}

.logo--gallery-footer {
  align-items: center;
  text-align: center;
}

.gallery-feed__book-text {
  margin: 0;
  max-width: 18rem;
  font-size: 0.88rem;
  line-height: 1.45;
  color: var(--text-muted);
}

.gallery-feed__book-btn {
  width: 100%;
  max-width: 18rem;
}

html.gallery-modal-open,
html.gallery-modal-open body {
  overflow: hidden;
}

@media (min-width: 36rem) {
  .gallery-modal {
    padding: var(--pad);
  }

  .gallery-modal__panel {
    max-height: min(88svh, 44rem);
  }
}

@media (prefers-reduced-motion: reduce) {
  .gallery-modal__backdrop,
  .gallery-modal__panel {
    transition: none;
  }

  .gallery-modal__panel {
    transform: none;
    opacity: 1;
  }
}
