/* ── Global image lightbox modal ──────────────────────────────────────────
   Reusable across the whole site. Any <img> (or clickable element wrapping
   one) with the `modal-image` class opens this modal when clicked — see
   js/image-modal.js. Elements sharing a `data-modal-group` value are
   browsable together with prev/next; elements without one share the
   page-wide default group.
*/

.modal-image {
    cursor: zoom-in;
}

.image-modal-overlay {
    position: fixed;
    inset: 0;
    z-index: 1000;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 30px;
    background: rgba(0, 0, 0, 0.85);
}

.image-modal-overlay.open {
    display: flex;
}

.image-modal {
    position: relative;
    display: flex;
    flex-direction: column;
    max-width: 720px;
    max-height: 100%;
    width: 100%;
    background: var(--mac-white);
    border: 2px solid var(--mac-black);
    border-radius: 0;
    box-shadow: var(--shadow-flat-3);
    overflow: hidden;
}

.image-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    background: var(--mac-grey-2);
    color: var(--mac-black);
    padding: 6px 6px 6px 10px;
    border-radius: 0;
    border-bottom: 3px solid;
    border-image: var(--rainbow-gradient) 1;
}

.image-modal-counter {
    font-family: var(--font-chrome);
    font-size: 10px;
    font-weight: bold;
    letter-spacing: 0.5px;
}

.image-modal-close {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    border: 1px solid var(--mac-black);
    border-radius: 0;
    background: var(--mac-white);
    color: var(--mac-black);
    font-size: 12px;
    line-height: 1;
    cursor: pointer;
}

.image-modal-close img.nav-icon,
.image-modal-nav img.nav-icon {
    margin-right: 0;
}

.image-modal-close:hover {
    background: var(--mac-black);
    color: var(--mac-white);
}

.image-modal-body {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--mac-grey-1);
    min-height: 200px;
}

.image-modal-img {
    display: block;
    max-width: 100%;
    max-height: 60vh;
    object-fit: contain;
}

.image-modal-nav {
    position: absolute;
    top: 0;
    bottom: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    border: none;
    background: rgba(0, 0, 0, 0.4);
    color: var(--mac-white);
    font-size: 18px;
    cursor: pointer;
    border-radius: 0;
}

.image-modal-nav:hover {
    background: rgba(0, 0, 0, 0.7);
}

.image-modal-nav.prev {
    left: 0;
}

.image-modal-nav.next {
    right: 0;
}

.image-modal-caption {
    padding: 10px 12px;
}

.image-modal-title {
    font-size: 11.5px;
    font-weight: bold;
    color: var(--mac-black);
    margin-bottom: 4px;
}

.image-modal-desc {
    font-size: 10px;
    line-height: 1.5;
    color: var(--mac-grey-6);
}

@media (max-width: 480px) {
    .image-modal-overlay {
        padding: 10px;
    }
}
