/* ui_modal — pair file for src/ui_system/modal.jl
 *
 * Native <dialog>-based modal with edge-anchored chevrons, top-right
 * close button, and a centered image+info panel layout. The
 * .verdict-modal-dialog wrapper is the dialog element; .verdict-modal
 * is the inner content panel. */

.verdict-modal-dialog {
    width: 100vw;
    height: 100vh;
    max-width: none;
    max-height: none;
    margin: 0;
    padding: 1rem;
    background: transparent;
    border: 0;
    color: #fff;
    cursor: pointer;
}
.verdict-modal-dialog[open] {
    display: flex;
    align-items: center;
    justify-content: center;
}
.verdict-modal-dialog::backdrop {
    background: rgba(0, 0, 0, 0.78);
    animation: verdict-modal-fade-in 0.18s ease;
}
.verdict-modal {
    width: 100%;
    height: auto;
    max-width: 1400px;
    max-height: 100%;
    background: var(--pico-background-color);
    border-radius: var(--ds-radius-md);
    display: flex;
    gap: 1.5rem;
    padding: 1.5rem;
    position: relative;
    cursor: default;
    color: var(--pico-color);
    animation: verdict-modal-scale-in 0.18s ease;
}
@keyframes verdict-modal-fade-in {
    from { opacity: 0; }
    to   { opacity: 1; }
}
@keyframes verdict-modal-scale-in {
    from { transform: scale(0.97); opacity: 0; }
    to   { transform: scale(1);    opacity: 1; }
}
@media (prefers-reduced-motion: reduce) {
    .verdict-modal-dialog::backdrop,
    .verdict-modal { animation: none; }
}
.verdict-modal-info {
    flex: 0 0 280px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 0.1rem;
}
.verdict-modal-info p { margin: 0 0 var(--ds-space-1); }
/* Verdict value wrapper (a div, not a p, so the block editor stays in flow);
   match the paragraph spacing of the other info rows. */
.verdict-modal-value { margin: 0 0 var(--ds-space-1); }
.verdict-modal-esa {
    font-family: var(--pico-font-family-monospace);
    font-size: var(--ds-font-md);
    overflow-wrap: anywhere;
}
.verdict-modal-image {
    flex: 1;
    min-width: 0;
    align-self: center;
    aspect-ratio: 1;
    max-width: 100%;
    max-height: calc(100vh - 9rem);
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--pico-muted-border-color);
    border-radius: var(--ds-radius-md);
    overflow: hidden;
    position: relative;
}
.verdict-modal-image img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    image-rendering: pixelated;
    display: block;
}
.verdict-modal-close {
    position: absolute;
    top: 0.5rem;
    right: 0.5rem;
    width: auto;
    margin: 0;
    padding: 0.35rem 0.5rem;
    background: rgba(0, 0, 0, 0.22);
    border: none;
    border-radius: var(--ds-radius-md);
    color: rgba(255, 255, 255, 0.85);
    cursor: pointer;
    z-index: 3;
    transition: background-color var(--ds-transition-base),
                color var(--ds-transition-base);
}
.verdict-modal-close:hover,
.verdict-modal-close:focus-visible {
    background: rgba(0, 0, 0, 0.4);
    color: #fff;
    outline: none;
}

.verdict-modal-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 4rem;
    height: 4rem;
    margin: 0;
    padding: 0;
    background: rgba(0, 0, 0, 0.22);
    border: none;
    color: rgba(255, 255, 255, 0.85);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    opacity: 0.55;
    transition: opacity var(--ds-transition-base),
                background-color var(--ds-transition-base);
    z-index: 2;
}
.verdict-modal-nav:hover,
.verdict-modal-nav:focus-visible {
    opacity: 1;
    background: rgba(0, 0, 0, 0.4);
    color: #fff;
    outline: none;
}
.verdict-modal-nav-prev { left: 0; }
.verdict-modal-nav-next { right: 0; }
.verdict-modal-nav .nav-chevron {
    width: 1.75rem;
    height: 1.75rem;
}
@media (prefers-reduced-motion: reduce) {
    .verdict-modal-nav { transition: none; }
}
@media (max-width: 767.98px) {
    .verdict-modal-nav { width: 2.75rem; height: 2.75rem; }
    .verdict-modal-nav .nav-chevron {
        width: 1.4rem;
        height: 1.4rem;
    }
}

@media (max-width: 767.98px) {
    .verdict-modal-dialog { padding: 0.75rem; overflow-y: auto; }
    .verdict-modal-dialog[open] { align-items: flex-start; }
    .verdict-modal {
        flex-direction: column;
        padding: 1rem;
        gap: 0.75rem;
        max-height: none;
    }
    .verdict-modal-info { flex: 0 0 auto; }
    .verdict-modal-image { flex: 0 0 auto; max-height: 60vh; }
}
