#main > #mgmha-photo-gallery {
  width: 100%;
  max-width: none;
  margin: 0;
  padding: clamp(30px, 3.5vw, 54px) 0;
  color: var(--mgmha-ink, #19191b);
  background: #f4f5f5;
  scroll-margin-top: 96px;
}

.mgmha-photo-gallery__inner {
  width: min(94%, 1400px);
  margin-inline: auto;
}

.mgmha-photo-gallery__header {
  margin-bottom: 19px;
  text-align: center;
}

#mgmha-photo-gallery h2 {
  margin: 0 0 9px;
  font-size: clamp(25px, 2.42vw, 36px);
  font-weight: 750;
  line-height: 1.15;
  letter-spacing: -.025em;
  text-transform: none;
}

#mgmha-photo-gallery .mgmha-photo-gallery__header p {
  max-width: 58ch;
  margin: 0 auto;
  color: #484a4e;
  font-size: clamp(14px, 1.12vw, 17px);
  line-height: 1.45;
}

.mgmha-photo-gallery__toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 12px;
}

#mgmha-photo-gallery [data-mgmha-photo-filters],
#mgmha-photo-gallery [data-mgmha-photo-controls] {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

#mgmha-photo-gallery [data-mgmha-photo-controls] {
  flex-wrap: nowrap;
  margin-inline-start: auto;
}

#mgmha-photo-gallery .mgmha-photo-gallery__toolbar button {
  box-sizing: border-box;
  min-height: 40px;
  padding: 7px 15px;
  border: 1px solid #d7d8db;
  border-radius: 999px;
  background: #fff;
  color: #292a2d;
  font: inherit;
  font-size: .875rem;
  font-weight: 650;
  line-height: 1.2;
  cursor: pointer;
}

#mgmha-photo-gallery .mgmha-photo-gallery__toolbar button:hover:not(:disabled) {
  border-color: #9b7129;
  color: #795213;
}

#mgmha-photo-gallery [data-mgmha-photo-filters] button[aria-pressed="true"] {
  border-color: #a1762b;
  background: #fff7e8;
  color: #6b4611;
}

#mgmha-photo-gallery [data-mgmha-photo-controls] button {
  display: grid;
  width: 42px;
  padding: 0;
  place-items: center;
}

#mgmha-photo-gallery [data-mgmha-photo-controls] button:disabled {
  opacity: .42;
  cursor: default;
}

.mgmha-photo-gallery__toolbar svg {
  display: block;
  width: 18px;
  height: 18px;
  pointer-events: none;
}

#mgmha-photo-gallery [hidden] { display: none !important; }

#mgmha-photo-gallery .mgmha-photo-gallery__track {
  --mgmha-photo-gap: clamp(10px, 1.2vw, 18px);
  --mgmha-photo-width: calc((100% - 4 * var(--mgmha-photo-gap)) / 5);
  display: flex;
  min-width: 0;
  max-width: 100%;
  gap: var(--mgmha-photo-gap);
  margin: 0;
  padding: 0;
  overflow-x: auto;
  overflow-y: hidden;
  overscroll-behavior-x: contain;
  list-style: none;
  scroll-snap-type: x mandatory;
}

#mgmha-photo-gallery.mgmha-photo-gallery--interactive .mgmha-photo-gallery__track { scrollbar-width: none; }
#mgmha-photo-gallery.mgmha-photo-gallery--interactive .mgmha-photo-gallery__track::-webkit-scrollbar { display: none; }

#mgmha-photo-gallery .mgmha-photo-gallery__track > li {
  position: relative;
  box-sizing: border-box;
  min-width: 0;
  flex: 0 0 var(--mgmha-photo-width);
  margin: 0;
  padding: 0;
  list-style: none;
  scroll-snap-align: start;
}

#mgmha-photo-gallery .mgmha-photo-gallery__track > li > a {
  position: relative;
  display: grid;
  box-sizing: border-box;
  width: 100%;
  aspect-ratio: 1;
  place-items: center;
  padding: 5%;
  overflow: hidden;
  border: 1px solid #e8e7e4;
  border-radius: 9px;
  background: #fff;
  text-decoration: none;
}

#mgmha-photo-gallery .mgmha-photo-gallery__track > li > a:hover { border-color: #b48b4a; }

#mgmha-photo-gallery .mgmha-photo-gallery__track img {
  display: block;
  width: 100%;
  height: 100%;
  min-height: 0;
  max-width: 100%;
  max-height: 100%;
  margin: 0;
  object-fit: contain;
}

#mgmha-photo-gallery :is(button, a, .mgmha-photo-gallery__track):focus-visible {
  outline: 2px solid #805715;
  outline-offset: -3px;
}

.mgmha-photo-gallery__status {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

@media (max-width: 980px) {
  #mgmha-photo-gallery .mgmha-photo-gallery__track { --mgmha-photo-width: 30%; }
}

@media (min-width: 981px) {
  #mgmha-photo-gallery .mgmha-photo-gallery__track:has(> li[hidden]) {
    --mgmha-photo-width: calc((100% - 3 * var(--mgmha-photo-gap)) / 4);
  }
}

@media (max-width: 640px) {
  #main > #mgmha-photo-gallery { scroll-margin-top: 72px; }
  #mgmha-photo-gallery .mgmha-photo-gallery__track { --mgmha-photo-width: 42%; }
  #mgmha-photo-gallery .mgmha-photo-gallery__toolbar { flex-wrap: nowrap; }
  #mgmha-photo-gallery [data-mgmha-photo-filters] {
    min-width: 0;
    flex-wrap: nowrap;
    overflow-x: auto;
    padding: 2px 0;
    scrollbar-width: thin;
  }
  #mgmha-photo-gallery [data-mgmha-photo-filters] button { flex: none; }
  #mgmha-photo-gallery [data-mgmha-photo-controls] { flex: none; }
  #mgmha-photo-gallery .mgmha-photo-gallery__toolbar button { padding-inline: 10px; }
  #mgmha-photo-gallery [data-mgmha-photo-controls] button { padding-inline: 0; }
}
