/**
 * @file
 * Gallery and lightbox.
 */

.gallery--grid {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
}

.gallery--grid .gallery__item {
  width: 100%;
  overflow: hidden;
}

@media (min-width: 768px) {
  .gallery--grid .gallery__item {
    width: calc(50% - 0.5rem);
  }
}

@media (min-width: 992px) {
  .gallery--grid .gallery__item {
    width: calc(100% / 3 - 2rem / 3);
  }
}

.gallery__image {
  max-width: 100%;
  height: auto;
  vertical-align: middle;
  object-fit: cover;
  transition: scale 0.12s ease-in-out;
}

.gallery--grid .gallery__image:hover {
  scale: 1.05;
}

.gallery--stack .gallery__item {
  display: block;
  margin-bottom: 1rem;
}

/* Lightbox dialog (created by gallery.js). */
.lightbox {
  max-width: 100vw;
  max-height: 100vh;
  padding: 0;
  overflow: visible;
  background: transparent;
  border: 0;
}

.lightbox::backdrop {
  background: rgba(0, 0, 0, 0.8);
}

.lightbox__frame {
  position: relative;
  padding: 4px;
  background: var(--imtm-color-white);
  border-radius: 3px;
}

.lightbox__image {
  display: block;
  max-width: calc(100vw - 2rem);
  max-height: calc(100vh - 7rem);
  height: auto;
}

.lightbox__nav {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 34%;
  padding: 0;
  cursor: pointer;
  background: transparent no-repeat;
  border: 0;
  opacity: 0;
  transition: opacity 0.6s;
}

.lightbox__nav:hover,
.lightbox__nav:focus-visible {
  opacity: 1;
}

.lightbox__nav--prev {
  left: 0;
  background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 50 45'%3e%3cpath d='M30 8 16 22.5 30 37' fill='none' stroke='%23fff' stroke-width='4' stroke-linecap='round' stroke-linejoin='round' filter='drop-shadow(0 0 2px rgba(0,0,0,.6))'/%3e%3c/svg%3e");
  background-position: left 10px center;
  background-size: 50px 45px;
}

.lightbox__nav--next {
  right: 0;
  background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 50 45'%3e%3cpath d='M20 8 34 22.5 20 37' fill='none' stroke='%23fff' stroke-width='4' stroke-linecap='round' stroke-linejoin='round' filter='drop-shadow(0 0 2px rgba(0,0,0,.6))'/%3e%3c/svg%3e");
  background-position: right 10px center;
  background-size: 50px 45px;
}

.lightbox__footer {
  display: flex;
  gap: 1rem;
  align-items: flex-start;
  padding: 0.5rem 0.25rem 0;
  font-size: 0.75rem;
  color: #ccc;
}

.lightbox__caption {
  flex: 1;
}

.lightbox__caption strong {
  display: block;
  font-size: 0.8125rem;
  font-weight: 700;
  color: var(--imtm-color-white);
}

.lightbox__close {
  width: 30px;
  height: 30px;
  padding: 0;
  cursor: pointer;
  background: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 27 27'%3e%3cpath d='M6 6l15 15M21 6 6 21' fill='none' stroke='%23fff' stroke-width='3' stroke-linecap='round'/%3e%3c/svg%3e") no-repeat center / 27px;
  border: 0;
  opacity: 0.7;
}

.lightbox__close:hover {
  opacity: 1;
}
