/* MD Image Viewer — Maria Deprma | AD-M */
.md-image-viewer-target { cursor: zoom-in; }
.md-image-viewer-overlay,
.md-image-viewer-overlay * { box-sizing: border-box; }
.md-image-viewer-overlay { position: fixed; inset: 0; z-index: 999999; display: none; overflow: hidden; color: #fff; background: rgba(0,0,0,.985); direction: ltr; font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif; isolation: isolate; }
.md-image-viewer-overlay.mdiv-open { display: block; animation: mdiv-fade-in .16s ease-out both; }
.md-image-viewer-overlay .mdiv-topbar { position: absolute; top: 0; left: 0; right: 0; z-index: 4; display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 54px; padding: 8px 14px; background: linear-gradient(to bottom, rgba(0,0,0,.58), transparent); }
.md-image-viewer-overlay .mdiv-counter { min-width: 50px; color: rgba(255,255,255,.94); font-size: 13px; line-height: 1.4; font-variant-numeric: tabular-nums; text-align: left; user-select: none; }
.md-image-viewer-overlay .mdiv-tools { display: flex; align-items: center; gap: 4px; }
.md-image-viewer-overlay button { appearance: none; -webkit-appearance: none; display: inline-flex; align-items: center; justify-content: center; margin: 0; padding: 0; border: 0; border-radius: 5px; color: #fff; background: transparent; box-shadow: none; text-decoration: none; line-height: 1; cursor: pointer; transition: background-color .15s ease, opacity .15s ease; }
.md-image-viewer-overlay button:hover { color: #fff; background: rgba(255,255,255,.15); }
.md-image-viewer-overlay button:focus-visible { outline: 2px solid #fff; outline-offset: 3px; }
.md-image-viewer-overlay .mdiv-tool { width: 34px; height: 34px; }
.md-image-viewer-overlay .mdiv-tool svg { display: block; width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.md-image-viewer-overlay .mdiv-close { margin-left: 1px; }
.md-image-viewer-overlay .mdiv-close svg { width: 22px; height: 22px; }
.md-image-viewer-overlay .mdiv-stage { position: absolute; inset: 54px 56px 64px; display: flex; align-items: center; justify-content: center; overflow: auto; overscroll-behavior: contain; }
.md-image-viewer-overlay .mdiv-main-image { display: block; width: auto !important; height: auto !important; max-width: 100% !important; max-height: 100% !important; object-fit: contain; margin: auto !important; border: 0 !important; border-radius: 0 !important; outline: 0; box-shadow: none !important; background: transparent; cursor: zoom-in; user-select: none; -webkit-user-drag: none; transition: transform .18s ease; }
.md-image-viewer-overlay.mdiv-is-zoomed .mdiv-stage { display: block; text-align: center; }
.md-image-viewer-overlay.mdiv-is-zoomed .mdiv-main-image { max-width: none !important; max-height: none !important; transform: scale(1.8); transform-origin: center center; cursor: zoom-out; }
.md-image-viewer-overlay .mdiv-main-image.mdiv-image-error { visibility: hidden; }
.md-image-viewer-overlay .mdiv-loading { display: none; position: absolute; left: 50%; top: 50%; width: 34px; height: 34px; margin: -17px 0 0 -17px; border: 2px solid rgba(255,255,255,.3); border-top-color: #fff; border-radius: 50%; animation: mdiv-spin .7s linear infinite; pointer-events: none; }
.md-image-viewer-overlay.mdiv-is-loading .mdiv-loading { display: block; }
.md-image-viewer-overlay .mdiv-nav { position: absolute; z-index: 3; top: 50%; width: 42px; height: 56px; margin-top: -28px; border-radius: 6px; background: transparent; transform: translateY(0); }
.md-image-viewer-overlay .mdiv-nav svg { width: 25px; height: 25px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.md-image-viewer-overlay .mdiv-prev { left: 0; }
.md-image-viewer-overlay .mdiv-next { right: 0; }
.md-image-viewer-overlay .mdiv-caption { position: absolute; z-index: 3; right: 70px; bottom: 12px; left: 70px; max-height: 3.2em; overflow: auto; color: rgba(255,255,255,.92); font-size: 13px; font-weight: 400; line-height: 1.55; text-align: center; text-wrap: pretty; }
.md-image-viewer-overlay .mdiv-caption[hidden] { display: none; }
.md-image-viewer-overlay:fullscreen { width: 100%; height: 100%; }
body.mdiv-viewer-open { overflow: hidden !important; }
@keyframes mdiv-spin { to { transform: rotate(360deg); } }
@keyframes mdiv-fade-in { from { opacity: 0; } to { opacity: 1; } }
@media (min-width: 900px) { .md-image-viewer-overlay .mdiv-stage { inset: 56px 64px 68px; } .md-image-viewer-overlay .mdiv-nav { width: 48px; } }
@media (max-width: 640px) {
    .md-image-viewer-overlay .mdiv-topbar { min-height: 48px; padding: 6px 8px; gap: 8px; }
    .md-image-viewer-overlay .mdiv-counter { font-size: 12px; }
    .md-image-viewer-overlay .mdiv-tool { width: 32px; height: 32px; }
    .md-image-viewer-overlay .mdiv-tool svg { width: 19px; height: 19px; }
    .md-image-viewer-overlay .mdiv-stage { inset: 50px 36px 58px; }
    .md-image-viewer-overlay .mdiv-nav { width: 31px; height: 48px; margin-top: -24px; background: rgba(0,0,0,.17); }
    .md-image-viewer-overlay .mdiv-nav svg { width: 22px; height: 22px; }
    .md-image-viewer-overlay .mdiv-prev { left: 0; }
    .md-image-viewer-overlay .mdiv-next { right: 0; }
    .md-image-viewer-overlay .mdiv-caption { right: 12px; bottom: 8px; left: 12px; max-height: 3.3em; font-size: 12px; }
}
@media (max-width: 360px) { .md-image-viewer-overlay .mdiv-stage { right: 30px; left: 30px; } .md-image-viewer-overlay .mdiv-tool { width: 29px; height: 30px; } }
@media (prefers-reduced-motion: reduce) { .md-image-viewer-overlay, .md-image-viewer-overlay *, .md-image-viewer-target { animation-duration: .01ms !important; transition-duration: .01ms !important; } }
