.ee-public .article-system-content figure.article-photo-gallery {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin: 34px 0;
}

.article-photo-gallery > a {
  display: block;
  min-width: 0;
  aspect-ratio: 1 / 1;
  cursor: zoom-in;
}

.article-photo-gallery > a > img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
}

.ee-public .article-system-content h2:has(+ figure.article-photo-gallery) {
  font-size: 24px;
}

.article-photo-gallery > a:focus-visible {
  outline: 3px solid #c41230;
  outline-offset: 4px;
}

.article-photo-gallery > figcaption {
  grid-column: 1 / -1;
  color: #555550;
  font: 400 11px/1.5 "Open Sans", Arial, sans-serif;
}

.article-photo-viewer {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100vh;
  height: 100dvh;
  max-width: none;
  max-height: none;
  margin: 0;
  padding: 20px 24px;
  border: 0;
  background: #111111;
  color: #ffffff;
  font: 400 16px/1.5 "Open Sans", Arial, sans-serif;
  opacity: 0;
  transform: translateY(12px);
  transition: opacity 220ms ease, transform 220ms ease;
  overflow: hidden;
}

.article-photo-viewer[open] {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  gap: 12px;
}

.article-photo-viewer::backdrop {
  background: #111111;
  opacity: 0;
  transition: opacity 220ms ease;
}

.article-photo-viewer.is-visible::backdrop {
  opacity: 1;
}

.article-photo-viewer.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.article-photo-viewer-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.article-photo-viewer button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-width: 44px;
  min-height: 44px;
  padding: 8px 14px;
  border: 1px solid #b8b8b8;
  background: #111111;
  color: #ffffff;
  font: 600 16px/1.4 "Open Sans", Arial, sans-serif;
  cursor: pointer;
  transition: background-color 220ms ease;
}

.article-photo-viewer button:hover {
  background: #333333;
}

.article-photo-viewer button[hidden] {
  display: none;
}

.article-photo-viewer button:focus-visible {
  outline: 3px solid #ffffff;
  outline-offset: 3px;
}

.article-photo-viewer .article-photo-viewer-close {
  width: 44px;
  height: 44px;
  padding: 0;
  font-size: 28px;
}

.article-photo-viewer-stage {
  position: relative;
  min-width: 0;
  min-height: 0;
  overflow: hidden;
}

.article-photo-viewer-stage > img {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  max-width: 100%;
  object-fit: contain;
  opacity: 0;
  transform: translateX(12px);
  transition: opacity 220ms ease, transform 220ms ease;
}

.article-photo-viewer-stage > img.is-current {
  opacity: 1;
  transform: translateX(0);
}

.article-photo-viewer-stage > img.is-leaving {
  opacity: 0;
  transform: translateX(-12px);
}

.article-photo-viewer-navigation {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  width: min(360px, 100%);
  margin: 0 auto;
}

@media (max-width: 700px) {
  .ee-public .article-system-content figure.article-photo-gallery {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
  }

  .article-photo-viewer {
    padding: 12px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .article-photo-viewer,
  .article-photo-viewer::backdrop,
  .article-photo-viewer-stage > img,
  .article-photo-viewer button {
    transition: none;
    transform: none;
  }
}
