/* Shared image viewer, separate from article typography and media layout. */
.image-preview{box-sizing:border-box;inset:0;margin:auto;padding:0;border:0;border-radius:12px;width:min(1280px,calc(100vw - 48px));height:min(960px,calc(100dvh - 48px));max-width:none;max-height:none;background:#fff;color:#172334;overflow:hidden;box-shadow:0 20px 64px #0b15263d}
.image-preview[open]{display:flex;flex-direction:column}
.image-preview::backdrop{background:#101d30b3}
.image-preview-toolbar{display:flex;align-items:center;justify-content:space-between;gap:16px;padding:12px 16px;border-bottom:1px solid #e3e8ef;flex-shrink:0}
.image-preview-toolbar strong{font-size:14px;font-weight:600}
.image-preview-actions{display:flex;align-items:center;gap:10px}
.image-preview-actions button{display:inline-flex;align-items:center;justify-content:center;min-height:40px;border:1px solid #dce3ed;border-radius:8px;background:#fff;color:#263a53;font-family:inherit;font-size:13px;font-weight:500;line-height:1.4;cursor:pointer}
.image-preview-zoom{padding:8px 14px}
.image-preview-close{width:40px;padding:8px}
.image-preview-close svg{width:20px;height:20px;fill:none;stroke:currentColor;stroke-width:1.8}
.image-preview-actions button:hover:not(:disabled){background:#edf3ff;color:#245bd6}
.image-preview-actions button:disabled{opacity:.4;cursor:default}
.image-preview-actions button:focus-visible{outline:3px solid #7c9cf0;outline-offset:2px}
.image-preview-stage{display:flex;align-items:center;justify-content:center;flex:1;min-height:0;min-width:0;overflow:auto;overscroll-behavior:contain;padding:16px;background:#f3f6fa}
.image-preview-stage:focus-visible{outline:3px solid #7c9cf0;outline-offset:-3px}
.image-preview-image{display:block;flex-shrink:1;max-width:100%;max-height:100%;width:auto;height:auto;object-fit:contain}
.image-preview-image[hidden],.image-preview-status[hidden]{display:none}
.image-preview.can-zoom .image-preview-image{cursor:zoom-in}
.image-preview.is-zoomed .image-preview-stage{display:block}
.image-preview.is-zoomed .image-preview-image{width:var(--preview-natural-width);max-width:none;max-height:none;margin:auto;cursor:zoom-out}
.image-preview-status{color:#52647b;font-size:14px;line-height:1.8;text-align:center}
.image-preview-caption{margin:0;padding:12px 16px;max-height:96px;overflow:auto;color:#52647b;font-size:13px;line-height:1.7;flex-shrink:0;overflow-wrap:anywhere}
a[data-image-preview]{cursor:zoom-in}
@media(max-width:640px){
 .image-preview{width:calc(100vw - 16px);height:calc(100dvh - 24px);border-radius:10px}
 .image-preview-toolbar{padding:8px 10px;gap:8px}
 .image-preview-actions{gap:6px}
 .image-preview-stage{padding:12px}
 .image-preview-caption{padding:10px 12px;max-height:112px;font-size:12px}
}
