body.monpasie-site .mp-gallery {
  overflow: clip;
  padding: 48px 0 52px;
  background:
    radial-gradient(circle at 84% 12%, rgba(124, 211, 243, .18), transparent 26%),
    linear-gradient(180deg, #fff 0, var(--mp-ice) 168px, #f7fbfc 100%);
}

body.monpasie-site .mp-gallery__heading {
  align-items: center;
  margin-bottom: 18px;
}

body.monpasie-site .mp-gallery__note {
  width: min(390px, 100%);
  margin: 0;
  color: var(--mp-muted);
  font-size: 14px;
}

body.monpasie-site .mp-gallery__mobile-copy,
body.monpasie-site .mp-gallery__open[hidden],
body.monpasie-site .mp-gallery__item[hidden],
body.monpasie-site .mp-gallery__status[hidden] { display: none; }
body.monpasie-site .mp-layered-open[hidden],
body.monpasie-site .mp-layered-track[hidden] { display: none; }
body.monpasie-site .mp-gallery__announcement { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
body.monpasie-site .mp-gallery__status { margin: 8px 0 0; color: var(--mp-muted); font-size: 14px; text-align: center; }

body.monpasie-site .mp-gallery__viewport {
  width: 100%;
  margin: 0 auto;
}

body.monpasie-site .mp-gallery__collage {
  display: grid;
  grid-template-columns: repeat(20, minmax(0, 1fr));
  gap: 14px;
  align-items: start;
  isolation: isolate;
}

body.monpasie-site .mp-gallery__item {
  position: relative;
  display: block;
  grid-column: span 5;
  width: 100%;
  min-width: 0;
  aspect-ratio: 3 / 4;
  margin: 0;
  padding: 0;
  overflow: hidden;
  border: 2px solid rgba(255, 255, 255, .9);
  border-radius: 20px;
  background: var(--mp-surface);
  box-shadow: 0 16px 34px rgba(36, 54, 61, .12);
  cursor: zoom-in;
  transition: transform .24s cubic-bezier(.16, 1, .3, 1), border-color .24s ease, box-shadow .24s ease;
}

body.monpasie-site .mp-gallery__item img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  transition: transform .24s cubic-bezier(.16, 1, .3, 1), filter .24s ease;
}

body.monpasie-site .mp-gallery__item:hover {
  z-index: 20;
  border-color: rgba(144, 39, 41, .3);
  box-shadow: 0 22px 46px rgba(36, 54, 61, .16);
  transform: translateY(-4px);
}

body.monpasie-site .mp-gallery__item:hover img {
  filter: saturate(1.035) contrast(1.01);
  transform: scale(1.015);
}

body.monpasie-site .mp-gallery__item:active {
  transform: translateY(-1px) scale(.98);
}

body.monpasie-site .mp-gallery__item:focus-visible {
  z-index: 21;
  outline: 3px solid var(--mp-blue);
  outline-offset: 4px;
}

body.monpasie-site .mp-gallery__item--landscape,
body.monpasie-site .mp-gallery__item--slot-landscape {
  grid-column: span 10;
  aspect-ratio: 3 / 2;
  border-radius: 22px;
}

body.monpasie-site .mp-gallery__item:nth-child(n + 8) {
  grid-column: span 4;
}

/* Нативный dialog даёт просмотр фото без отдельного состояния страницы и закрывается по Escape. */
body.monpasie-site .mp-gallery-dialog {
  width: fit-content;
  max-width: min(1100px, calc(100% - 48px));
  max-height: calc(100dvh - 48px);
  margin: auto;
  padding: 0;
  overflow: visible;
  border: 0;
  border-radius: 22px;
  background: transparent;
  box-shadow: none;
}

body.monpasie-site .mp-gallery-dialog::backdrop {
  background: rgba(13, 27, 30, .82);
  backdrop-filter: blur(7px);
}

body.monpasie-site .mp-gallery-dialog img {
  display: block;
  width: auto;
  max-width: 100%;
  max-height: calc(100dvh - 48px);
  margin: 0 auto;
  border-radius: 22px;
  box-shadow: 0 28px 80px rgba(0, 0, 0, .42);
}

body.monpasie-site .mp-gallery-dialog__control,
body.monpasie-site .mp-gallery-dialog__close {
  position: absolute;
  z-index: 1;
  top: 12px;
  right: 12px;
  display: grid;
  width: 44px;
  height: 44px;
  min-width: 44px;
  max-width: 44px;
  place-items: center;
  padding: 0;
  border: 1px solid rgba(255, 255, 255, .42);
  border-radius: 50%;
  background: rgba(255, 255, 255, .92);
  box-shadow: 0 2px 12px rgba(13, 27, 30, .16);
  color: var(--mp-ink);
  line-height: 0;
  cursor: pointer;
}

body.monpasie-site .mp-gallery-dialog__control svg {
  width: 22px;
  height: 22px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-width: 2;
}

body.monpasie-site .mp-gallery-dialog__control:hover {
  background: #fff;
  color: var(--mp-ink);
}

body.monpasie-site .mp-gallery-dialog__control:focus-visible {
  outline: 3px solid var(--mp-sky);
  outline-offset: 3px;
}
body.monpasie-site .mp-gallery-dialog__prev { left: 12px; right: auto; top: calc(50% - 22px); }
body.monpasie-site .mp-gallery-dialog__next { right: 12px; top: calc(50% - 22px); }
body.monpasie-site .mp-gallery-dialog__control:disabled { opacity: .28; cursor: default; }
body.monpasie-site .mp-gallery-dialog__control[hidden],
body.monpasie-site .mp-gallery-dialog__status[hidden] { display: none; }
body.monpasie-site .mp-gallery-dialog__status { color: #fff; text-align: center; font-size: 14px; }

@media (max-width: 1100px) {
  body.monpasie-site .mp-gallery__viewport {
    width: 100%;
  }

  body.monpasie-site .mp-gallery__collage {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
  }

  body.monpasie-site .mp-gallery__item,
body.monpasie-site .mp-gallery__item:nth-child(n + 8),
body.monpasie-site .mp-gallery__item[class*="mp-gallery__item--slot-"] {
    grid-column: span 1;
    width: 100%;
  }

  body.monpasie-site .mp-gallery__item.mp-gallery__item--landscape,
body.monpasie-site .mp-gallery__item.mp-gallery__item--slot-landscape {
    grid-column: span 2;
  }

  body.monpasie-site .mp-gallery__item:last-child {
    grid-column: 2;
    width: 100%;
  }
}

@media (max-width: 760px) {
  body.monpasie-site .mp-gallery {
    padding: 40px 0 44px;
  }

  body.monpasie-site .mp-gallery__heading {
    align-items: flex-start;
  }

  body.monpasie-site .mp-gallery__note {
    width: 100%;
  }

  body.monpasie-site .mp-gallery__collage {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
  }

  body.monpasie-site .mp-gallery__item,
body.monpasie-site .mp-gallery__item:nth-child(n + 8),
body.monpasie-site .mp-gallery__item[class*="mp-gallery__item--slot-"] {
    grid-column: span 1;
    width: 100%;
    border-radius: 16px;
    box-shadow: 0 10px 24px rgba(36, 54, 61, .1);
  }

  body.monpasie-site .mp-gallery__item.mp-gallery__item--landscape,
body.monpasie-site .mp-gallery__item.mp-gallery__item--slot-landscape {
    grid-column: 1 / -1;
    width: 100%;
  }

  body.monpasie-site .mp-gallery__item:last-child {
    grid-column: 1 / -1;
    width: calc(50% - 4px);
    justify-self: center;
  }

  body.monpasie-site .mp-gallery-dialog {
    width: fit-content;
    max-width: calc(100% - 24px);
    max-height: calc(100dvh - 24px);
  }

  body.monpasie-site .mp-gallery-dialog img {
    max-height: calc(100dvh - 24px);
    border-radius: 16px;
  }
}

@media (max-width: 760px) {
  body.monpasie-site .mp-gallery { padding: 24px 0 32px; background: linear-gradient(180deg, #fff 0, var(--mp-ice) 96px, #f7fbfc 100%); }
  body.monpasie-site .mp-gallery > .mp-shell { width: calc(100% - 32px); }
  body.monpasie-site .mp-gallery__heading { display: block; margin-bottom: 16px; text-align: center; }
  body.monpasie-site .mp-gallery__heading .mp-kicker,
body.monpasie-site .mp-gallery__desktop-copy { display: none; }
  body.monpasie-site .mp-gallery__mobile-copy { display: inline; }
  body.monpasie-site .mp-gallery__heading h2 { max-width: none; margin: 0; font-size: clamp(26px, 7vw, 28px); line-height: 1.15; }
  body.monpasie-site .mp-gallery__note { margin: 8px auto 0; font-size: 14px; line-height: 1.5; }

  body.monpasie-site .is-layered .mp-layered-track { position: relative; display: block; padding: 12px 0; touch-action: pan-y pinch-zoom; user-select: none; }
  /* The centre-sized spacer reserves the same stage height for every photo orientation. */
  body.monpasie-site .is-layered .mp-layered-track::before { content: ''; display: block; width: min(68%, 260px); aspect-ratio: 3 / 4; margin: 0 auto; }
  body.monpasie-site .is-layered .mp-layered-photo { position: absolute; top: 12px; left: 50%; z-index: var(--mp-gallery-layer); display: flex; align-items: center; justify-content: center; grid-column: auto; width: min(68%, 260px); aspect-ratio: 3 / 4; margin: 0; border: 0; border-radius: 20px; background: var(--mp-ice); box-shadow: none; opacity: var(--mp-gallery-opacity); transform: translate3d(calc(-50% + var(--mp-gallery-shift)), 0, 0) scale(var(--mp-gallery-scale)); transition: transform 280ms cubic-bezier(.16, 1, .3, 1), opacity 220ms ease; cursor: pointer; }
  body.monpasie-site .is-layered .mp-layered-photo[hidden] { display: none; }
  body.monpasie-site .is-layered .mp-layered-photo img { width: auto; height: auto; max-width: 100%; max-height: 100%; border-radius: inherit; object-fit: contain; object-position: center; filter: none; transform: none; transition: none; -webkit-user-drag: none; }
  body.monpasie-site .is-layered .mp-layered-photo::after { content: ''; position: absolute; inset: 0; pointer-events: none; border-radius: inherit; background: linear-gradient(135deg, rgba(255, 255, 255, .3), transparent 18%, rgba(236, 250, 252, .1) 55%, rgba(255, 255, 255, .28)), radial-gradient(ellipse at 0 0, rgba(255, 255, 255, .4), transparent 30%), radial-gradient(ellipse at 100% 100%, rgba(255, 255, 255, .35), transparent 28%); backdrop-filter: blur(1.5px); -webkit-backdrop-filter: blur(1.5px); opacity: var(--mp-gallery-frost); transition: opacity 220ms ease; }
  body.monpasie-site .is-layered .mp-layered-open { display: flex; width: fit-content; min-height: 44px; align-items: center; justify-content: center; margin: 12px auto 0; padding: 8px 16px; border: 0; border-radius: 12px; background: transparent; color: var(--mp-burgundy); font: inherit; font-size: 14px; font-weight: 700; cursor: pointer; }
  body.monpasie-site .is-layered .mp-layered-open:hover { background: rgba(144, 39, 41, .05); }
  body.monpasie-site .mp-layered-open:focus-visible { outline: 3px solid var(--mp-blue); outline-offset: 3px; }
}

@media (prefers-reduced-motion: reduce) {
  body.monpasie-site .mp-gallery__item,
body.monpasie-site .mp-gallery__item img {
    transition-duration: .01ms;
  }
  body.monpasie-site .is-layered .mp-layered-photo,
body.monpasie-site .is-layered .mp-layered-photo::after { transition: none !important; }
}
