.lcpg-layout-mosaic .lcpg-gallery__grid {
  grid-auto-flow: dense;
  grid-auto-rows: minmax(120px, 15vw);
}

.lcpg-layout-mosaic .lcpg-photo:nth-child(7n + 1),
.lcpg-layout-mosaic .lcpg-photo:nth-child(7n + 5) {
  grid-column: span 2;
  grid-row: span 2;
}

.lcpg-layout-mosaic .lcpg-photo:nth-child(7n + 3) {
  grid-column: span 2;
}

.lcpg-layout-mosaic .lcpg-photo__link {
  height: 100%;
  aspect-ratio: auto;
}

.lcpg-layout-hero .lcpg-gallery__grid {
  display: flex;
  gap: .7rem;
  overflow-x: auto;
  padding: .45rem .2rem .75rem;
  scroll-behavior: smooth;
  scroll-snap-type: x mandatory;
  scrollbar-width: thin;
}

.lcpg-layout-hero .lcpg-photo {
  flex: 0 0 104px;
  scroll-snap-align: center;
}

.lcpg-layout-hero .lcpg-photo__link {
  border: 3px solid transparent;
  border-radius: .55rem;
  transition: border-color .18s ease, opacity .18s ease;
}

.lcpg-layout-hero .lcpg-photo__link.is-selected {
  border-color: #3858e9;
  opacity: 1;
}

.lcpg-layout-hero .lcpg-photo__link:not(.is-selected) { opacity: .72; }
.lcpg-layout-hero .lcpg-photo figcaption { display: none; }

.lcpg-hero-stage {
  position: relative;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: .7rem;
  margin-bottom: .8rem;
}

.lcpg-hero-stage__media {
  position: relative;
  display: grid;
  place-items: center;
  min-height: min(68vh, 720px);
  overflow: hidden;
  border-radius: .8rem;
  background: #111827;
}

.lcpg-hero-stage__media img {
  display: block;
  width: 100%;
  height: min(68vh, 720px);
  object-fit: contain;
}

.lcpg-hero-stage__caption {
  position: absolute;
  right: 0;
  bottom: 0;
  left: 0;
  padding: 2.5rem 1rem .85rem;
  color: #fff;
  font-weight: 600;
  background: linear-gradient(transparent, rgba(0, 0, 0, .72));
}

.lcpg-hero-stage__caption:empty { display: none; }

.lcpg-viewer-arrow {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  padding: 0;
  color: #fff;
  font-size: 30px;
  line-height: 1;
  border: 0;
  border-radius: 50%;
  background: #263b9c;
  box-shadow: 0 5px 16px rgba(16, 24, 40, .2);
  cursor: pointer;
}

.lcpg-viewer-arrow:hover,
.lcpg-viewer-arrow:focus-visible { background: #3858e9; }
.lcpg-viewer-arrow:focus-visible { outline: 3px solid #8ca0ff; outline-offset: 3px; }

.lcpg-layout-carousel { position: relative; }
.lcpg-carousel-controls { display: flex; justify-content: flex-end; gap: .55rem; margin-bottom: .75rem; }

.lcpg-layout-carousel .lcpg-gallery__grid {
  display: flex;
  gap: var(--lcpg-gap);
  overflow-x: auto;
  overscroll-behavior-inline: contain;
  padding: .25rem .2rem .9rem;
  scroll-behavior: smooth;
  scroll-snap-type: x mandatory;
  scrollbar-width: thin;
}

.lcpg-layout-carousel .lcpg-photo {
  flex: 0 0 clamp(180px, 21vw, 300px);
  scroll-snap-align: start;
}

.lcpg-layout-carousel .lcpg-photo__link { aspect-ratio: var(--lcpg-thumbnail-ratio, 4 / 3); }

@media (max-width: 900px) {
  .lcpg-layout-mosaic .lcpg-gallery__grid { grid-auto-rows: minmax(110px, 24vw); }
  .lcpg-layout-carousel .lcpg-photo { flex-basis: clamp(180px, 42vw, 280px); }
  .lcpg-hero-stage__media,
  .lcpg-hero-stage__media img { min-height: 52vw; height: 52vw; }
}

@media (max-width: 520px) {
  .lcpg-layout-mosaic .lcpg-gallery__grid { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; }
  .lcpg-layout-mosaic .lcpg-photo:nth-child(n) { grid-column: span 1; grid-row: span 1; }
  .lcpg-layout-mosaic .lcpg-photo:nth-child(5n + 1) { grid-column: span 2; }
  .lcpg-hero-stage { grid-template-columns: 1fr; }
  .lcpg-hero-stage .lcpg-viewer-arrow { position: absolute; z-index: 2; top: calc(50% - 22px); }
  .lcpg-hero-stage .lcpg-viewer-arrow--previous { left: .55rem; }
  .lcpg-hero-stage .lcpg-viewer-arrow--next { right: .55rem; }
  .lcpg-hero-stage__media,
  .lcpg-hero-stage__media img { min-height: 68vw; height: 68vw; }
  .lcpg-layout-carousel .lcpg-photo { flex-basis: 78vw; }
}

@media (prefers-reduced-motion: reduce) {
  .lcpg-layout-hero .lcpg-photo__link,
  .lcpg-layout-hero .lcpg-gallery__grid,
  .lcpg-layout-carousel .lcpg-gallery__grid { scroll-behavior: auto; transition: none; }
}
