.card-visual.has-image,
.modal-hero.show-photo {
  position: relative;
  width: 100%;
  height: auto;
  aspect-ratio: 3 / 2;
  overflow: hidden;
  background: #080909;
  isolation: isolate;
}

.show-photo::before, .card-visual.has-image::before { content: none; }
.card-visual.has-image noscript img,
.show-photo > .show-photo-image,
.show-photo > video {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  margin: auto;
  object-fit: cover;
  object-position: center;
  opacity: 1;
}
.photo-status { padding: 24px; color: var(--text-dim); font-size: 0.85rem; }
.photo-control {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 1px solid #5d6264;
  border-radius: 6px;
  background: #151718;
  color: #fff;
  font: 26px/1 sans-serif;
  cursor: pointer;
}
.photo-control:hover { background: #303536; }
.photo-control:focus-visible { outline: 2px solid var(--teal-light); outline-offset: 3px; }
.photo-expand { position: absolute; right: 18px; bottom: 18px; z-index: 1; }
.photo-control[hidden], .photo-status[hidden] { display: none; }
.show-photo > [hidden], .photo-viewer-image[hidden] { display: none; }

.photo-viewer {
  width: 100vw;
  height: 100svh;
  max-width: none;
  max-height: none;
  margin: 0;
  padding: 0;
  border: 0;
  background: #080909;
  color: #fff;
}
.photo-viewer[open] { display: flex; flex-direction: column; }
.photo-viewer::backdrop { background: #080909; }
.photo-viewer-header {
  display: flex;
  align-items: center;
  gap: 12px;
  flex: 0 0 auto;
  padding: 12px 20px;
  border-bottom: 1px solid #303536;
}
.photo-viewer-title { flex: 1; min-width: 0; font-size: 0.9rem; overflow-wrap: anywhere; }
.photo-viewer-header .photo-control { flex: 0 0 44px; }
.photo-viewer-stage { flex: 1; min-height: 0; overflow: auto; display: grid; place-items: center; }
.photo-viewer-image {
  display: block;
  width: 100%;
  height: 100%;
  max-width: var(--photo-width, 100%);
  max-height: var(--photo-height, 100%);
  min-height: 0;
  object-fit: contain;
}
.photo-viewer.zoomed .photo-viewer-stage { display: block; }
.photo-viewer.zoomed .photo-viewer-image { width: auto; height: auto; max-width: none; margin: 0 auto; }
@media (max-width: 600px) {
  .photo-viewer-header { padding: 10px 12px; gap: 8px; }
  .photo-expand { right: 12px; bottom: 12px; }
}
