/* Reserve room outside the image for gallery controls. Inline size overrides
   replace the header/padding space reserved by the shared modal sizing code. */
body.pool-dome-clean-image-viewer .ws-modal-overlay:has(> .ws-modal-card-image) { padding: 72px 68px; }
body.pool-dome-clean-image-viewer .ws-modal-card-image {
    width: auto !important;
    max-width: min(980px, calc(100vw - 136px)) !important;
    max-height: calc(100dvh - 144px) !important;
    border: 0;
    border-radius: 8px;
    overflow: visible;
    background: transparent;
    box-shadow: none;
}
body.pool-dome-clean-image-viewer .ws-modal-card-image .ws-modal-image-header,
body.pool-dome-clean-image-viewer .ws-modal-card-image .ws-modal-image-header-actions { display: contents; }
body.pool-dome-clean-image-viewer .ws-modal-card-image .ws-modal-image-title {
    position: absolute;
    width: 1px;
    height: 1px;
    margin: -1px;
    padding: 0;
    overflow: hidden;
    clip-path: inset(50%);
    white-space: nowrap;
}
body.pool-dome-clean-image-viewer .ws-modal-card-image .ws-modal-image-body {
    position: relative;
    display: block;
    width: auto !important;
    height: auto !important;
    max-height: none !important;
    overflow: visible;
    padding: 0;
    background: transparent;
}
body.pool-dome-clean-image-viewer .ws-modal-card-image .ws-modal-image {
    width: auto !important;
    height: auto !important;
    max-width: min(980px, calc(100vw - 136px));
    max-height: calc(100dvh - 144px);
    border: 0;
    border-radius: 0;
}
body.pool-dome-clean-image-viewer .ws-modal-card-image .ws-modal-close,
body.pool-dome-clean-image-viewer .ws-modal-card-image .ws-modal-image-nav {
    position: absolute;
    z-index: 3;
    width: 44px;
    height: 44px;
    padding: 0;
    box-sizing: border-box;
    align-items: center;
    justify-content: center;
    border: 0;
    border-radius: 50%;
    background: var(--bs-body-bg);
    color: var(--pool-dome-navy);
    box-shadow: 0 2px 8px rgb(0 0 0 / .2);
}
body.pool-dome-clean-image-viewer .ws-modal-card-image .ws-modal-close { top: -56px; right: 0; }
body.pool-dome-clean-image-viewer .ws-modal-card-image .ws-modal-image-nav { top: 50%; transform: translateY(-50%); }
/* Draw the arrows geometrically so font baselines cannot shift the icon. */
body.pool-dome-clean-image-viewer .ws-modal-image-nav span {
    position: relative;
    display: block;
    width: 18px;
    height: 18px;
    font-size: 0;
    line-height: 0;
}
body.pool-dome-clean-image-viewer .ws-modal-image-nav span::before {
    content: "";
    position: absolute;
    left: 1px;
    top: 8px;
    width: 16px;
    height: 2px;
    background: currentColor;
}
body.pool-dome-clean-image-viewer .ws-modal-image-nav span::after {
    content: "";
    position: absolute;
    right: 2px;
    top: 5px;
    width: 8px;
    height: 8px;
    border-top: 2px solid currentColor;
    border-right: 2px solid currentColor;
    transform: rotate(45deg);
}
body.pool-dome-clean-image-viewer .ws-modal-image-prev span { transform: rotate(180deg); }
body.pool-dome-clean-image-viewer .ws-modal-card-image .ws-modal-image-prev { left: -56px; }
body.pool-dome-clean-image-viewer .ws-modal-card-image .ws-modal-image-next { right: -56px; }
body.pool-dome-clean-image-viewer .ws-modal-card-image :is(.ws-modal-close, .ws-modal-image-nav):hover { background: var(--pool-dome-mist); }
body.pool-dome-clean-image-viewer .ws-modal-card-image :is(.ws-modal-close, .ws-modal-image-nav):focus-visible { outline: 3px solid var(--pool-dome-teal); outline-offset: 2px; }

/* Keep mobile arrows centered on the photo without reducing its width. */
@media (max-width: 575px) {
    body.pool-dome-clean-image-viewer .ws-modal-overlay:has(> .ws-modal-card-image) { padding: 72px 12px; }
    body.pool-dome-clean-image-viewer .ws-modal-card-image,
    body.pool-dome-clean-image-viewer .ws-modal-card-image .ws-modal-image { max-width: min(980px, calc(100vw - 24px)) !important; }
    body.pool-dome-clean-image-viewer .ws-modal-card-image .ws-modal-image-prev { left: 8px; }
    body.pool-dome-clean-image-viewer .ws-modal-card-image .ws-modal-image-next { right: 8px; }
}
