:root {
  color-scheme: light;
  --mh-blue: #005baa;
  --mh-yellow: #ffe600;
  --mh-text: #202124;
  --mh-muted: #62666d;
}

* {
  box-sizing: border-box;
}

html,
body {
  width: 100%;
  height: 100%;
  margin: 0;
  /* Страница живёт в iframe фиксированной высоты: вертикального скролла у неё
     быть не должно, листается только лента по горизонтали. */
  overflow: hidden;
  background: transparent;
  color: var(--mh-text);
  font-family: Arial, sans-serif;
}

.mh-gallery-app {
  display: flex;
  width: 100%;
  height: 100%;
  flex-direction: column;
  justify-content: center;
}

/* ─── Лента ──────────────────────────────────────────────────────────────── */

.mh-gallery {
  display: flex;
  overflow-x: auto;
  overflow-y: hidden;
  gap: 12px;
  padding: 4px;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
}

.mh-gallery::-webkit-scrollbar {
  height: 6px;
}

.mh-gallery::-webkit-scrollbar-thumb {
  border-radius: 999px;
  background: rgba(0, 91, 170, 0.35);
}

.mh-gallery__item {
  position: relative;
  flex: 0 0 auto;
  width: min(78vw, 420px);
  height: 470px;
  padding: 0;
  border: 0;
  border-radius: 12px;
  margin: 0;
  background: #eef0f2;
  cursor: zoom-in;
  overflow: hidden;
  scroll-snap-align: center;
}

.mh-gallery__item:focus-visible {
  outline: 3px solid var(--mh-blue);
  outline-offset: 2px;
}

.mh-gallery__img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.mh-gallery__index {
  position: absolute;
  right: 10px;
  bottom: 10px;
  padding: 4px 9px;
  border-radius: 999px;
  background: rgba(0, 91, 170, 0.88);
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  pointer-events: none;
}

.mh-gallery-status {
  margin: 0;
  padding: 16px;
  color: var(--mh-muted);
  font-size: 14px;
  text-align: center;
}

.mh-gallery-status[hidden] {
  display: none;
}

/* ─── Лайтбокс ───────────────────────────────────────────────────────────── */

.mh-lightbox {
  position: fixed;
  z-index: 20;
  display: grid;
  inset: 0;
  align-items: center;
  justify-items: center;
  background: rgba(15, 18, 22, 0.94);
}

.mh-lightbox[hidden] {
  display: none;
}

.mh-lightbox__image {
  max-width: 92vw;
  max-height: 84vh;
  border-radius: 10px;
  object-fit: contain;
}

.mh-lightbox__close,
.mh-lightbox__nav {
  position: absolute;
  display: grid;
  border: 0;
  background: rgba(255, 255, 255, 0.14);
  color: #fff;
  cursor: pointer;
  place-items: center;
  transition: background 0.15s ease;
}

.mh-lightbox__close {
  top: 12px;
  right: 12px;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  font-size: 26px;
  line-height: 1;
}

.mh-lightbox__nav {
  top: 50%;
  width: 46px;
  height: 64px;
  border-radius: 10px;
  font-size: 34px;
  line-height: 1;
  transform: translateY(-50%);
}

.mh-lightbox__nav_prev {
  left: 10px;
}

.mh-lightbox__nav_next {
  right: 10px;
}

.mh-lightbox__close:hover,
.mh-lightbox__nav:hover {
  background: rgba(255, 230, 0, 0.9);
  color: var(--mh-text);
}

.mh-lightbox__close:focus-visible,
.mh-lightbox__nav:focus-visible {
  outline: 3px solid var(--mh-yellow);
  outline-offset: 2px;
}

.mh-lightbox__nav[hidden] {
  display: none;
}

.mh-lightbox__counter {
  position: absolute;
  bottom: 16px;
  margin: 0;
  padding: 6px 12px;
  border-radius: 999px;
  background: rgba(0, 91, 170, 0.9);
  color: #fff;
  font-size: 13px;
  font-weight: 700;
}

/* Телефон: iframe 320px — карточка ниже, элементы компактнее. */
@media (max-width: 600px) {
  .mh-gallery__item {
    width: 80vw;
    height: 290px;
  }

  .mh-lightbox__nav {
    width: 38px;
    height: 54px;
    font-size: 28px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .mh-gallery {
    scroll-behavior: auto;
  }

  .mh-lightbox__close,
  .mh-lightbox__nav {
    transition: none;
  }
}
