.image-gallery {
  display: flex;
  gap: 16px;
}
.image-gallery__thumbs {
  flex: 0 0 66px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 8px;
}
.image-gallery__thumb {
  border: solid 1px transparent;
  transition: border-color 0.35s;
}
.image-gallery__thumb:hover,
.image-gallery__thumb:focus-visible,
.image-gallery__thumb:focus {
  border: solid 1px #004494;
}
.image-gallery__thumb img {
  width: 64px;
  height: 64px;
  object-fit: cover;
}
.image-gallery__thumb--more {
  width: 64px;
  height: 64px;
  background: #f6f6f6;
  font-weight: bold;
}
.image-gallery__main {
  aspect-ratio: 1;
  width: 100%;
}
.image-gallery__main:is([data-open-modal]) {
  cursor: pointer;
}
.image-gallery__main picture {
  display: block;
}
.image-gallery__main img {
  width: 100%;
  height: auto;
}
/* Modal */
.image-gallery__modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.25);
  opacity: 0;
  visibility: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity 0.3s ease;
}
.image-gallery__modal--visible {
  opacity: 1;
  visibility: visible;
  z-index: 109;
}
.image-gallery__modal-content-wrapper {
  position: relative;
  outline: none;
  width: 90vw;
  max-height: 90vh;
}
.image-gallery__modal-content {
  position: relative;
  background: #f6f6f6;
  height: calc(100vh - 200px);
  outline: none;
  overflow-y: scroll;
  overflow-x: hidden;
  padding: 60px;
}
.image-gallery__modal-header {
  display: flex;
  justify-content: space-between;
}
.image-gallery__modal-header h2 {
  margin-top: 0;
}
.image-gallery__close {
  border: solid 1px transparent;
  cursor: pointer;
  position: absolute;
  top: -15px;
  right: -15px;
  z-index: 3;
  outline: 0;
  width: 45px;
  height: 45px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #f6f6f6;
  border-color: #cccccc;
}
.image-gallery__modal [class*="-prev"],
.image-gallery__modal [class*="-next"] {
  opacity: 0;
  z-index: 1;
  width: 48px;
  height: 48px;
  transition: opacity .2s;
  border: 0;
  background: transparent;
}
.image-gallery__modal [class*="-prev"]:before,
.image-gallery__modal [class*="-next"]:before {
  content: "" !important;
  display: block;
  position: absolute;
  top: 0;
  left: 0;
  z-index: 0;
  margin: 0 auto;
  opacity: 1;
  width: 35px;
  height: 35px;
  border-radius: 100%;
  background: #004494;
  border: solid 1px #004494;
}
.image-gallery__modal [class*="-prev"]:after,
.image-gallery__modal [class*="-next"]:after {
  content: '';
  display: inline-block;
  position: absolute;
  z-index: 1;
  top: 13px;
  border: solid 1px white;
  border-width: 0 2px 2px 0;
  padding: 4px;
}
.image-gallery__modal [class*="-prev"][class*="-arrow"][aria-disabled="true"]:before,
.image-gallery__modal [class*="-next"][class*="-arrow"][aria-disabled="true"]:before {
  background: white;
  opacity: 1;
}
.image-gallery__modal [class*="-prev"][class*="-arrow"][aria-disabled="true"]:after,
.image-gallery__modal [class*="-next"][class*="-arrow"][aria-disabled="true"]:after {
  border-color: #004494;
  opacity: 1;
}
.image-gallery__modal [class*="-prev"]:after {
  left: 14px;
  transform: rotate(135deg);
  -webkit-transform: rotate(135deg);
}
.image-gallery__modal [class*="-next"]:after {
  right: 26px;
  transform: rotate(-45deg);
  -webkit-transform: rotate(-45deg);
}
.image-gallery__modal:hover [class*="-prev"],
.image-gallery__modal:hover [class*="-next"] {
  opacity: 1;
}
.image-gallery__modal [class*="-prev"],
.image-gallery__modal [class*="-next"] {
  position: relative;
  opacity: 1;
  flex: 0 0 50px;
  height: 50px;
  max-width: 50px;
  align-self: center;
  display: flex;
  align-items: center;
}
.image-gallery__modal [class*="-prev"]:after,
.image-gallery__modal [class*="-next"]:after,
.image-gallery__modal [class*="-prev"]:before,
.image-gallery__modal [class*="-next"]:before {
  padding: 6px;
}
.image-gallery__modal [class*="-prev"]:before,
.image-gallery__modal [class*="-next"]:before {
  width: 100%;
  height: 100%;
  right: 20px;
  box-sizing: border-box;
}
.image-gallery__modal [class*="-prev"]:after,
.image-gallery__modal [class*="-next"]:after {
  top: 17px;
}
.image-gallery__modal [class*="-prev"]:after {
  left: 20px;
}
.image-gallery__modal [class*="-next"]:after {
  right: 20px;
}
.image-gallery__modal-title {
  font-family: 'Avant Garde for MT Bd', Arial, sans-serif;
  font-weight: 700;
  color: #004494 !important;
  font-size: 30px !important;
  line-height: 39px !important;
}
.image-gallery__modal-images {
  display: flex;
}
.image-gallery__modal-images .image-gallery__modal-main {
  flex: 0 0 60%;
  display: flex;
  gap: 10px;
  margin: 0 20px 0 0;
  aspect-ratio: 1;
}
.image-gallery__modal-images .image-gallery__modal-main picture {
  flex: 1;
  display: flex;
  justify-content: center;
  align-items: flex-start;
}
.image-gallery__modal-images .image-gallery__modal-main img {
  max-width: 730px;
  width: 100%;
  height: auto;
}
.image-gallery__modal-thumbs {
  flex: 1;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  grid-auto-rows: min-content;
  align-items: start;
  column-gap: 40px;
  row-gap: 20px;
}
.image-gallery__modal-thumbs .image-gallery__modal-thumb {
  flex: 0 0 33.333333%;
  display: flex;
  align-items: center;
  aspect-ratio: 1;
  max-width: 130px;
  max-height: 130px;
  border: solid 1px #cccccc;
  transition: border-color 0.35s;
}
.image-gallery__modal-thumbs .image-gallery__modal-thumb picture {
  display: block;
  width: 100%;
  height: 100%;
}
.image-gallery__modal-thumbs .image-gallery__modal-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.image-gallery__modal-thumbs .image-gallery__modal-thumb:hover,
.image-gallery__modal-thumbs .image-gallery__modal-thumb:focus-visible,
.image-gallery__modal-thumbs .image-gallery__modal-thumb:focus {
  border-color: #004494;
}
/* Change z-index stacking of .mt-stage when 
   .image-gallery__modal is visible, 
   so it stacks on top of the header 
*/
.mt-stage:has(.image-gallery__modal--visible) {
  position: relative;
  z-index: 109;
}
@media (max-width: 1200px) {
  .image-gallery__modal-content-wrapper {
    width: 95vw;
  }
  .image-gallery__modal-thumbs {
    gap: 20px;
  }
  .image-gallery__modal-thumbs .image-gallery__modal-thumb {
    max-width: none;
    max-height: none;
  }
}
@media (max-width: 767px) {
  .image-gallery {
    flex-direction: column;
    margin: 0 0 30px 0;
  }
  .image-gallery__thumbs {
    order: 2;
    flex: 1;
    display: grid;
    grid-template-columns: repeat(5, 1fr);
  }
  .image-gallery__thumb {
    width: 100%;
    height: auto;
  }
  .image-gallery__thumb img {
    width: 100%;
    height: auto;
  }
  .image-gallery__main {
    order: 1;
  }
  .image-gallery__modal {
    display: block;
  }
  .image-gallery__modal [class*="-prev"],
  .image-gallery__modal [class*="-next"] {
    display: none;
    opacity: 0;
  }
  .image-gallery__modal-header h2 {
    margin-bottom: 10px;
  }
  .image-gallery__modal-content-wrapper {
    width: 100vw;
  }
  .image-gallery__modal-content {
    padding: 40px 20px 20px;
    margin: 20px 10px;
    height: auto;
    max-height: 87vh;
  }
  .image-gallery__close {
    right: 0;
  }
  .image-gallery__modal-images {
    display: block;
  }
  .image-gallery__modal-images .image-gallery__modal-main {
    display: block;
    margin: 0 0 20px 0;
  }
  .image-gallery__modal-thumbs {
    grid-template-columns: repeat(5, 1fr);
    gap: 10px;
  }
}
