/* A full-frame viewing surface shared by archive and product photography. */
.photo-viewer, .product-zoom-dialog {
  --viewer-bg: #07121c;
  --viewer-ink: #e0edf7;
  --viewer-caption: #a5bbcf;
  --viewer-focus: #8acce5;
  width: 100%;
  max-width: none;
  height: 100dvh;
  max-height: none;
  margin: auto;
  padding: max(6px, env(safe-area-inset-top)) max(clamp(10px, 3.5vw, 56px), env(safe-area-inset-right)) max(6px, env(safe-area-inset-bottom)) max(clamp(10px, 3.5vw, 56px), env(safe-area-inset-left));
  border: 0;
  color-scheme: dark;
  color: var(--viewer-ink);
  background: var(--viewer-bg);
  overflow: auto;
}
.photo-viewer::backdrop, .product-zoom-dialog::backdrop { background: #07121c; }
.photo-viewer[open], .product-zoom-dialog[open] { display: flex; flex-direction: column; }
.viewer-heading, .product-zoom-header { flex: none; min-height: 52px; margin: 0; padding: 0; }
.viewer-heading h2, .product-zoom-header h2 {
  color: var(--viewer-ink);
  font: 500 clamp(.98rem, 1.25vw, 1.16rem)/1.3 var(--font-body);
  text-transform: none;
  letter-spacing: -.015em;
}
.photo-viewer .viewer-image-shell, .product-zoom-dialog .product-zoom-viewport {
  flex: 1 1 0;
  width: 100%;
  min-height: 0;
  height: auto;
  background: var(--viewer-bg);
}
.photo-viewer .viewer-image { grid-area: 1 / 1; width: 100%; height: 100%; max-height: 100%; }
.product-zoom-viewport[data-zoom="fit"] { touch-action: pan-y pinch-zoom; }
.product-zoom-viewport[data-zoom="enlarged"] { touch-action: auto; }
.viewer-image-shell { grid-template: minmax(0, 1fr) / minmax(0, 1fr); }
.viewer-image-shell[data-state="error"] .viewer-image { visibility: hidden; }
.viewer-image-message p:not([hidden]), .viewer-image-message button {
  color: var(--viewer-ink);
  background: var(--viewer-bg);
}
.photo-icon {
  position: relative;
  display: inline-flex;
  flex: 0 0 44px;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--viewer-ink);
  cursor: pointer;
  touch-action: manipulation;
}
.photo-icon:hover, .photo-scale-menu[open] > summary { background: #152a3a; }
.photo-icon::before, .photo-icon::after { content: ""; position: absolute; }
.photo-close::before, .photo-close::after { left: 12px; top: 21px; width: 20px; height: 2px; background: currentColor; }
.photo-close::before { transform: rotate(45deg); }
.photo-close::after { transform: rotate(-45deg); }
.photo-prev::before, .photo-next::before { width: 11px; height: 11px; top: 16px; left: 18px; border: solid currentColor; border-width: 0 0 2px 2px; transform: rotate(45deg); }
.photo-next::before { left: 14px; transform: rotate(225deg); }
.photo-lens::before { left: 12px; top: 11px; width: 16px; height: 16px; border: 2px solid currentColor; border-radius: 50%; }
.photo-lens::after { left: 26px; top: 26px; height: 2px; width: 8px; background: currentColor; transform: rotate(45deg); transform-origin: left; }
.photo-viewer :focus-visible, .product-zoom-dialog :focus-visible { outline: 2px solid var(--viewer-focus); outline-offset: 2px; }
.photo-viewer .viewer-thumbnails { flex: none; min-width: 0; justify-content: center; align-items: center; gap: 5px; padding: 6px 2px; margin: 4px 0 0; }
.photo-viewer .viewer-thumbnail {
  width: 55px; height: 46px; min-height: 44px; border: 0; padding: 2px 2px 5px; border-radius: 0;
  background: transparent; color: var(--viewer-ink);
}
.photo-viewer .viewer-thumbnail img { width: 100%; height: 100%; object-fit: cover; background: #142633; }
.photo-viewer .viewer-thumbnail[aria-pressed="true"] { box-shadow: inset 0 -2px var(--viewer-focus); }
.photo-viewer .viewer-thumbnail[aria-pressed="true"]:not(:focus-visible) { outline: 0; }
.photo-viewer .viewer-controls { position: relative; margin: 0; padding: 0; }
.photo-viewer .viewer-controls .photo-icon { display: none; }
.photo-viewer #viewer-caption {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap;
}
.photo-viewer .viewer-image-shell.photo-crossfade .viewer-image { animation: studio-photo-arrive 160ms ease-out; }
@keyframes studio-photo-arrive { from { opacity: .45; } to { opacity: 1; } }
.motion-paused .photo-viewer .viewer-image-shell.photo-crossfade .viewer-image { animation: none; }
.product-zoom-dialog .product-zoom-controls {
  display: grid; grid-template-columns: 1fr auto 1fr; gap: .5rem; align-items: center;
  min-height: 52px; flex: none; padding-top: 3px;
}
.product-angle-caption, .product-photo-pages span { margin: 0; color: var(--viewer-caption); font-size: .875rem; }
.product-photo-pages { justify-content: center; flex-wrap: nowrap; gap: 3px; }
.product-photo-pages:has([data-photo-next]:disabled) { visibility: hidden; }
.photo-scale-menu { position: relative; justify-self: end; }
.photo-scale-menu summary { list-style: none; }
.photo-scale-menu summary::-webkit-details-marker { display: none; }
.photo-scale-menu .product-zoom-options {
  position: absolute; right: 0; bottom: calc(100% + 6px); z-index: 1; display: flex; flex-wrap: nowrap;
  gap: 0; margin: 0; padding: 3px; border: 1px solid #466074; background: #0e202e; color: var(--viewer-ink);
}
.product-zoom-options > button {
  min-width: 44px; min-height: 44px; padding: 0 .55rem; border: 0; background: transparent; color: inherit; font: inherit; cursor: pointer;
}
.product-zoom-options > button:hover:enabled { background: #22394a; }
.product-zoom-options > button:disabled { color: #92a7b7; background: transparent; }
.product-zoom-options > output { min-width: 44px; }
.product-photo-open .product-photo-hint { display: none; }
.product-photo-open { touch-action: manipulation; }
.product-photo-open .product-main-photo { position: relative; }
.photo-angle-underlay {
  position: absolute; inset: 0; width: 100%; height: 100%;
  object-fit: contain; pointer-events: none;
}
.photo-angle-underlay.is-curated { object-fit: cover; object-position: 50% 51%; }
@media screen and (prefers-reduced-motion: no-preference) and (forced-colors: none) {
  .motion-enabled .photo-angle-arrive { animation: studio-angle-arrive 240ms ease-out; }
}
@keyframes studio-angle-arrive { from { opacity: 0; } to { opacity: 1; } }
@media (max-height: 28rem) {
  .photo-viewer .viewer-thumbnails { display: none; }
  .photo-viewer .viewer-controls { flex: none; justify-content: center; gap: .5rem; min-height: 44px; }
  .photo-viewer .viewer-controls:has([data-next][hidden]) { display: none; }
  .photo-viewer .viewer-controls .photo-icon:not([hidden]) { display: inline-flex; }
  .photo-viewer #viewer-caption { position: static; width: auto; height: auto; margin: 0; overflow: visible; clip-path: none; color: var(--viewer-caption); font-size: .875rem; }
  .viewer-heading, .product-zoom-header, .product-zoom-dialog .product-zoom-controls { min-height: 44px; }
}
@media (prefers-reduced-motion: reduce) {
  .photo-viewer .viewer-image-shell.photo-crossfade .viewer-image { animation: none; }
}
@media (forced-colors: active) {
  .photo-viewer .viewer-thumbnail[aria-pressed="true"] { border-bottom: 3px solid Highlight; }
  .photo-icon::before, .photo-icon::after { forced-color-adjust: none; color: ButtonText; }
}
