/* px_stay stay-gallery — layout + look per style (template tokens only) */

/* ===== style-1 · split head | photo mosaic ===== */
.px-stay-gallery.style-1 .px-stay-gallery__grid {
  --px-gallery-row: 11rem;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  grid-auto-rows: var(--px-gallery-row);
  grid-auto-flow: dense;
  gap: var(--px-sp-3);
}
.px-stay-gallery.style-1 .px-stay-gallery__item {
  position: relative;
  margin: 0;
  min-width: 0;
  overflow: hidden;
  background: var(--px-ink-bg);
}
.px-stay-gallery.style-1 .px-stay-gallery__item:first-child {
  grid-column: span 2;
  grid-row: span 2;
}

/* Frame fills the cell; the edit-mode wrapper and the img fill the frame */
.px-stay-gallery.style-1 .px-stay-gallery__frame {
  position: absolute;
  inset: 0;
  display: block;
}
.px-stay-gallery.style-1 .px-stay-gallery__frame > .px-editable-media,
.px-stay-gallery.style-1 .px-stay-gallery__img {
  display: block;
  width: 100%;
  height: 100%;
}
.px-stay-gallery.style-1 .px-stay-gallery__img {
  object-fit: cover;
  transition: transform 0.6s var(--px-ease, ease);
}
.px-stay-gallery.style-1 .px-stay-gallery__link:hover .px-stay-gallery__img,
.px-stay-gallery.style-1 .px-stay-gallery__link:focus-visible .px-stay-gallery__img {
  transform: scale(1.04);
}
.px-stay-gallery.style-1 .px-stay-gallery__link:focus-visible {
  outline: 2px solid var(--color-primary);
  outline-offset: -2px;
}

/* Round sage expand button, top right */
.px-stay-gallery.style-1 .px-stay-gallery__zoom {
  position: absolute;
  top: var(--px-sp-4);
  right: var(--px-sp-4);
  display: grid;
  place-items: center;
  width: 2.75rem;
  height: 2.75rem;
  border-radius: 50%;
  background: var(--color-primary);
  color: var(--color-dark);
  font-size: var(--px-icon-sm);
  opacity: 0;
  transform: scale(0.85);
  transition: opacity 0.25s ease, transform 0.25s ease;
}
.px-stay-gallery.style-1 .px-stay-gallery__link:hover .px-stay-gallery__zoom,
.px-stay-gallery.style-1 .px-stay-gallery__link:focus-visible .px-stay-gallery__zoom {
  opacity: 1;
  transform: none;
}

/* Caption on an ink scrim at the bottom of the photo */
.px-stay-gallery.style-1 .px-stay-gallery__caption {
  position: absolute;
  inset: auto 0 0 0;
  margin: 0;
  padding: var(--px-sp-9) var(--px-sp-5) var(--px-sp-4);
  background: linear-gradient(to top, color-mix(in srgb, var(--color-secondary) 85%, transparent), transparent);
  font-family: var(--px-font-display);
  font-size: var(--px-fs-ui);
  font-weight: 500;
  line-height: 1.3;
  color: var(--color-white);
  pointer-events: none;
  opacity: 0;
  transform: translateY(var(--px-sp-2));
  transition: opacity 0.25s ease, transform 0.25s ease;
}
.px-stay-gallery.style-1 .px-stay-gallery__item:hover .px-stay-gallery__caption,
.px-stay-gallery.style-1 .px-stay-gallery__item:focus-within .px-stay-gallery__caption {
  opacity: 1;
  transform: none;
}
@media (hover: none) {
  .px-stay-gallery.style-1 .px-stay-gallery__caption {
    opacity: 1;
    transform: none;
  }
}
.px-edit-mode .px-stay-gallery.style-1 .px-stay-gallery__caption {
  opacity: 1;
  transform: none;
  pointer-events: auto;
}

@media (min-width: 768px) {
  .px-stay-gallery.style-1 .px-stay-gallery__grid {
    --px-gallery-row: 13rem;
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}
/* Desktop: in every run of seven the 1st is 2 × 2, the 3rd tall, the 6th wide (seven fill three rows) */
@media (min-width: 992px) {
  .px-stay-gallery.style-1 .px-stay-gallery__grid {
    --px-gallery-row: 15rem;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: var(--px-sp-4);
  }
  .px-stay-gallery.style-1 .px-stay-gallery__item:nth-child(7n + 1) {
    grid-column: span 2;
    grid-row: span 2;
  }
  .px-stay-gallery.style-1 .px-stay-gallery__item:nth-child(7n + 3) {
    grid-row: span 2;
  }
  .px-stay-gallery.style-1 .px-stay-gallery__item:nth-child(7n + 6) {
    grid-column: span 2;
  }
}

/* Lightbox caption bar (PhotoSwipe UI element registered by js/script.js) */
.pswp__px-caption {
  position: absolute;
  left: 50%;
  bottom: var(--px-sp-6);
  max-width: min(90vw, 40rem);
  padding: var(--px-sp-2) var(--px-sp-4);
  background: color-mix(in srgb, var(--color-secondary) 80%, transparent);
  font-family: var(--px-font-display);
  font-size: var(--px-fs-ui);
  color: var(--color-white);
  text-align: center;
  transform: translateX(-50%);
}
.pswp__px-caption[hidden] {
  display: none;
}
