/* Independent of the legacy gallery/slideshow transforms and shades. */
body.photo-viewer-open {overflow:hidden}
.gallery-slideshow-tools {display:flex;align-items:center;gap:10px}
.gallery-slideshow-tools [hidden] {display:none!important}
.gallery-slideshow:not(.is-office) .gallery-slideshow-media img {cursor:zoom-in;animation:none}
.photo-viewer[hidden] {display:none!important}
.photo-viewer {
  position:fixed;inset:0;z-index:15000;box-sizing:border-box;
  width:100%;max-width:none;height:100vh;height:100dvh;max-height:none;
  margin:0;padding:0;border:0;border-radius:0;background:#080809;color:#fff;
  overflow:hidden;overscroll-behavior:contain;isolation:isolate;
}
.photo-viewer.is-open {display:grid;grid-template-rows:auto minmax(0,1fr) auto auto}
.photo-viewer::backdrop {background:#080809}
.photo-viewer [hidden] {display:none!important}
.photo-viewer-bar {
  display:flex;align-items:center;justify-content:space-between;gap:12px;
  min-width:0;padding:12px max(16px,env(safe-area-inset-right)) 12px max(16px,env(safe-area-inset-left));
  background:#111112;border-bottom:1px solid #ffffff24;
}
.photo-viewer-bar:first-child {padding-top:max(12px,env(safe-area-inset-top))}
.photo-viewer-title {min-width:0;margin:0;font-size:clamp(14px,1.6vw,19px);font-weight:500;line-height:1.4;overflow-wrap:anywhere}
.photo-viewer button {
  flex:none;display:inline-flex;align-items:center;justify-content:center;gap:8px;
  min-width:46px;min-height:46px;padding:8px 12px;margin:0;border:1px solid #ffffff35;
  border-radius:12px;background:#1c1c1f;color:#fff;box-shadow:none;
  font:500 16px/1.2 var(--font,sans-serif);cursor:pointer;touch-action:manipulation;
}
.photo-viewer button svg {width:22px;height:22px;display:block;flex:none;pointer-events:none}
.photo-viewer button:disabled {opacity:.35;cursor:default}
.photo-viewer button:focus-visible,.photo-viewer a:focus-visible {outline:2px solid #ffda00;outline-offset:3px}
@media(hover:hover){.photo-viewer button:hover:not(:disabled){border-color:#ffda00;color:#ffda00;background:#29271b}}
.photo-viewer-stage {
  position:relative;min-width:0;min-height:0;display:flex;align-items:center;justify-content:center;
  padding:0;overflow:hidden;background:#080809;touch-action:none;user-select:none;-webkit-user-select:none;
}
.photo-viewer-stage>img {
  flex:none;display:block;max-width:none;max-height:none;object-fit:contain;
  opacity:1;filter:none;box-shadow:none;transform-origin:center;cursor:zoom-in;
  -webkit-user-drag:none;transition:none;
}
.photo-viewer-stage.is-zoomed>img {cursor:grab}
.photo-viewer-stage.is-zoomed:active>img {cursor:grabbing}
.photo-viewer-stage>p,.photo-viewer-error {margin:0;padding:24px;text-align:center;color:#f5f5f5;font-size:16px;line-height:1.6}
.photo-viewer-error button {margin:14px auto 0}
.photo-viewer-bottom {flex-wrap:wrap;justify-content:center;border-top:1px solid #ffffff24;border-bottom:0;padding-bottom:max(12px,env(safe-area-inset-bottom))}
.photo-viewer-navigation,.photo-viewer-zoom {display:flex;align-items:center;justify-content:center;gap:8px}
.photo-viewer-navigation {margin-right:auto}
.photo-viewer-count {min-width:54px;text-align:center;color:#ffda00;font-size:14px;font-variant-numeric:tabular-nums}
.photo-viewer-original {color:#ffe24a;font-size:13px;text-underline-offset:4px;white-space:nowrap}
.photo-viewer-zoom-label {min-width:44px}
.photo-viewer-help {flex-basis:100%;margin:0;text-align:center;font-size:12px;color:#dedede}
/* A separate, collapsible row, never an overlay on the full photograph. */
.photo-viewer-thumbnails {
  display:flex;align-items:center;gap:8px;min-width:0;min-height:0;
  padding:10px max(12px,env(safe-area-inset-right)) 10px max(12px,env(safe-area-inset-left));
  overflow-x:auto;overflow-y:hidden;overscroll-behavior-x:contain;
  background:#111112;border-top:1px solid #ffffff24;scrollbar-width:thin;
  scrollbar-color:#ffda00 #1c1c1f;touch-action:pan-x pinch-zoom;
}
.photo-viewer .photo-viewer-thumbnail {
  position:relative;flex:0 0 auto;width:104px;height:72px;min-width:0;min-height:0;
  padding:3px;overflow:hidden;border:2px solid transparent;border-radius:8px;background:#080809;
}
.photo-viewer-thumbnail img {width:100%;height:100%;object-fit:contain;pointer-events:none}
.photo-viewer-thumbnail span {position:absolute;right:3px;bottom:3px;padding:2px 5px;border-radius:4px;background:#080809e6;color:#fff;font-size:11px}
.photo-viewer .photo-viewer-thumbnail[aria-current="true"] {border-color:#ffda00;background:#2d280d}
.photo-viewer .photo-viewer-thumbnails-toggle {font-size:13px}
.photo-viewer-thumbnails-toggle[aria-expanded="false"] svg {transform:rotate(180deg)}
/* A real link preserves access to full-size photos without JavaScript. */
main .car-photo-open {display:block;width:100%;height:100%;cursor:zoom-in}
main .car-photo-open>img {display:block;width:100%;height:100%;object-fit:contain;object-position:center;background:#080809;opacity:1;filter:none;transform:none}
main .car-photo-open:focus-visible {outline:3px solid #ffda00;outline-offset:-5px}
main .car-gallery .image-counter {pointer-events:none}
main .car-main-image > .car-gallery-playback {position:absolute;z-index:4;top:16px;left:16px;right:auto;bottom:auto;display:flex;align-items:center;justify-content:center;width:auto;height:auto;min-height:44px;max-width:calc(100% - 140px);padding:8px 12px;border:1px solid #ffffff45;border-radius:999px;background:#080809d9;color:#fff;font-size:12px;line-height:1.3;cursor:pointer}
main .car-main-image > .car-gallery-playback:focus-visible {outline:2px solid #ffda00;outline-offset:3px}
@media(max-width:600px){
  .photo-viewer-bar{gap:8px;padding-inline:max(10px,env(safe-area-inset-left))}
  .photo-viewer-bottom{display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1fr);justify-items:center;gap:6px}
  .photo-viewer-navigation{margin-right:0;gap:4px}
  .photo-viewer-zoom{gap:4px}
  .photo-viewer-count{min-width:44px}
  .photo-viewer-original{flex-basis:auto;text-align:center;white-space:normal}
  .photo-viewer-help{display:none}
  .photo-viewer-zoom-label{min-width:38px}
  .photo-viewer button{padding:8px;min-width:44px;min-height:44px}
  .photo-viewer .photo-viewer-thumbnail{width:84px;height:58px;min-width:0;min-height:0;padding:3px}
  .photo-viewer-thumbnails{padding-block:8px}
}
@media(max-height:460px){
  .photo-viewer-bar{padding-block:5px}
  .photo-viewer-help{display:none}
  .photo-viewer-original{flex-basis:auto}
  .photo-viewer .photo-viewer-thumbnail{width:72px;height:48px}
  .photo-viewer-thumbnails{padding-block:5px}
}
