/* Shared MGE catalog photo affordances and accessible native-dialog viewer. */
.catalog-page-visual { position: relative; }
.catalog-page-visual > .page-image { display: block; width: 100%; height: auto; }
.catalog-photo-hotspot {
  position: absolute;
  display: block;
  z-index: 1;
  border: 0;
  border-radius: 4px;
  background: transparent;
  cursor: zoom-in;
  text-decoration: none;
  -webkit-tap-highlight-color: rgba(0, 107, 166, .18);
}
.catalog-photo-hotspot::after {
  content: '+';
  position: absolute;
  right: 5px;
  bottom: 5px;
  display: grid;
  place-items: center;
  width: 27px;
  height: 27px;
  border: 2px solid #fff;
  border-radius: 50%;
  background: #006ba6;
  color: #fff;
  font: 700 22px/1 Arial, Helvetica, sans-serif;
  box-shadow: 0 1px 5px #0005;
  pointer-events: none;
}
.catalog-photo-hotspot:hover,
.catalog-photo-hotspot:focus-visible {
  outline: 3px solid #006ba6;
  outline-offset: -3px;
  background: #006ba612;
}
.new-game a.feature-photo-link,
a.feature-photo-link {
  position: relative;
  display: block;
  max-width: 100%;
  border-radius: 8px;
  cursor: zoom-in;
  text-decoration: none;
}
a.feature-photo-link::after {
  content: 'Expand photo';
  position: absolute;
  bottom: 8px;
  left: 50%;
  transform: translateX(-50%);
  padding: 7px 10px;
  border: 1px solid #fff;
  border-radius: 6px;
  background: #005e92ed;
  color: #fff;
  font: 700 13px/1.2 Arial, Helvetica, sans-serif;
  white-space: nowrap;
  pointer-events: none;
}
a.feature-photo-link:focus-visible { outline: 3px solid #006ba6; outline-offset: 4px; }
.photo-text-link { display: inline-flex; align-items: center; min-height: 44px; }
.photo-viewer-hint { color: #4d6879; font-size: 1rem; line-height: 1.5; }

.mge-photo-viewer {
  box-sizing: border-box;
  position: fixed;
  inset: 0;
  width: min(1100px, calc(100vw - 24px));
  height: min(900px, calc(100vh - 24px));
  height: min(900px, calc(100dvh - 24px));
  max-width: none;
  max-height: none;
  margin: auto;
  padding: 0;
  border: 1px solid #dce7ee;
  border-radius: 14px;
  overflow: hidden;
  background: #fff;
  color: #183c52;
  font-family: Arial, Helvetica, sans-serif;
  box-shadow: 0 20px 80px #0006;
}
.mge-photo-viewer::backdrop { background: #071c2be0; }
.mge-photo-viewer:not([open]) { display: none; }
.mge-photo-viewer * { box-sizing: border-box; }
.photo-viewer-panel { display: flex; flex-direction: column; height: 100%; }
.photo-viewer-header {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 18px 10px;
}
.photo-viewer-title { margin: 0; font-size: 1.35rem; line-height: 1.25; color: #183c52; }
.photo-viewer-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  min-width: 96px;
  min-height: 44px;
  padding: 9px 14px;
  border: 2px solid #006ba6;
  border-radius: 7px;
  background: #fff;
  color: #005e92;
  font: 700 1rem/1.2 Arial, Helvetica, sans-serif;
  cursor: pointer;
}
.photo-viewer-close { background: #006ba6; color: #fff; }
.photo-viewer-button:hover { background: #dff3ff; color: #183c52; }
.photo-viewer-button:disabled { opacity: .5; cursor: default; }
.photo-viewer-controls {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  padding: 0 18px 10px;
}
.photo-viewer-status { margin: 0; font-size: .95rem; line-height: 1.4; }
.photo-viewer-stage {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  grid-template-rows: minmax(0, 1fr);
  flex: 1 1 auto;
  min-height: 0;
  min-width: 0;
  place-items: center;
  overflow: auto;
  overscroll-behavior: contain;
  background: #eaf2f7;
  -webkit-overflow-scrolling: touch;
}
.photo-viewer-image {
  display: block;
  width: auto;
  height: auto;
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}
.photo-viewer-image[hidden] { display: none; }
.photo-viewer-stage.is-zoomed { display: block; }
.photo-viewer-stage.is-zoomed .photo-viewer-image {
  height: auto;
  max-width: none;
  max-height: none;
  margin: 0 auto;
}
.photo-viewer-footer {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  justify-content: space-between;
  gap: 8px 18px;
  padding: 4px 18px;
}
.photo-viewer-caption { margin: 0; max-width: 740px; font-size: .95rem; line-height: 1.45; }
.photo-viewer-caption[hidden] { display: none; }
.photo-viewer-original {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  min-height: 44px;
  color: #005e92;
  font-size: .95rem;
  font-weight: 700;
  text-underline-offset: 3px;
}
.mge-photo-viewer :focus-visible { outline: 3px solid #2384c8; outline-offset: 3px; }
.photo-viewer-stage:focus-visible { outline-offset: -3px; }
@media (max-width: 650px) {
  .new-game a.feature-photo-link { margin-inline: auto; }
  .mge-photo-viewer {
    width: calc(100vw - 16px);
    height: calc(100vh - 16px);
    height: calc(100dvh - 16px);
    border-radius: 10px;
  }
  .photo-viewer-header { align-items: flex-start; gap: 10px; padding: 12px 12px 8px; }
  .photo-viewer-title { font-size: 1.1rem; }
  .photo-viewer-controls { padding: 0 12px 8px; gap: 8px; }
  .photo-viewer-button { min-height: 48px; min-width: 90px; padding-inline: 10px; }
  .photo-viewer-footer { display: block; padding: 6px 12px 2px; }
  .photo-viewer-caption { max-height: 4.4em; overflow-y: auto; font-size: .9rem; }
  .photo-viewer-original { font-size: .9rem; }
  .catalog-photo-hotspot::after { width: 23px; height: 23px; font-size: 19px; right: 3px; bottom: 3px; }
}
@media (prefers-reduced-motion: reduce) {
  .mge-photo-viewer, .photo-viewer-stage { scroll-behavior: auto; }
}
