/*
 * Project modal refinements
 * Source of truth: Frontend/Resources/assets. Never edit public/assets directly.
 */

html.has-project-modal,
body.has-project-modal {
    overflow: hidden;
    overscroll-behavior: none;
}

body.has-project-modal {
    position: fixed;
    inset-inline: 0;
    width: 100%;
}

.ps-modal-overlay {
    position: fixed;
    inset: 0;
    z-index: 1200;
    display: grid;
    place-items: center;
    padding: clamp(18px, 4vw, 48px);
    overflow: hidden;
}

.ps-modal-overlay[hidden] {
    display: none !important;
}

.ps-modal {
    position: relative;
    width: min(720px, 100%);
    max-height: calc(100dvh - clamp(36px, 8vw, 96px));
    margin: auto;
    overflow: auto;
    overscroll-behavior: contain;
    scrollbar-width: thin;
}

.ps-modal__media {
    position: relative;
}

.ps-modal__zoom-action {
    position: absolute;
    right: 18px;
    bottom: 18px;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-height: 38px;
    padding: 0 14px;
    border: 1px solid rgba(255, 255, 255, .7);
    border-radius: 999px;
    background: rgba(255, 255, 255, .92);
    color: var(--ink, #122033);
    font: inherit;
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
    box-shadow: 0 10px 28px rgba(18, 32, 51, .16);
    backdrop-filter: blur(12px);
    transition: transform .2s ease, box-shadow .2s ease, border-color .2s ease;
}

.ps-modal__zoom-action:hover {
    transform: translateY(-2px);
    border-color: rgba(16, 152, 162, .35);
    box-shadow: 0 14px 32px rgba(18, 32, 51, .22);
}

.ps-modal__collab {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    margin-top: 18px;
    padding: 14px 16px;
    border: 1px solid var(--line, #d9e4ec);
    border-radius: 12px;
    background: #f7fbfc;
}

.ps-modal__collab-label {
    color: var(--brand, #1098a2);
    font-size: 11px;
    font-weight: 800;
    letter-spacing: .1em;
    text-transform: uppercase;
}

.ps-modal__collab-value {
    color: var(--ink, #122033);
    font-size: 12px;
    font-weight: 700;
    text-align: right;
}

.pdf-lightbox {
    position: fixed;
    inset: 0;
    z-index: 1400;
    display: none;
    place-items: center;
    padding: clamp(16px, 4vw, 44px);
    background: rgba(9, 20, 34, .88);
    backdrop-filter: blur(12px);
}

.pdf-lightbox.is-open {
    display: grid;
}

.pdf-lightbox__figure {
    position: relative;
    display: grid;
    place-items: center;
    width: min(1180px, 100%);
    height: min(850px, calc(100dvh - 48px));
    margin: 0;
}

.pdf-lightbox__image {
    display: block;
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    border-radius: 12px;
    background: #fff;
    box-shadow: 0 28px 80px rgba(0, 0, 0, .34);
}

.pdf-lightbox__close {
    position: absolute;
    top: 10px;
    right: 10px;
    z-index: 2;
    display: grid;
    place-items: center;
    width: 42px;
    height: 42px;
    border: 1px solid rgba(255, 255, 255, .75);
    border-radius: 50%;
    background: rgba(255, 255, 255, .94);
    color: var(--ink, #122033);
    font: inherit;
    font-size: 24px;
    cursor: pointer;
    box-shadow: 0 10px 28px rgba(0, 0, 0, .2);
}

@media (max-width: 640px) {
    .ps-modal-overlay {
        align-items: center;
        padding: 12px;
    }

    .ps-modal {
        width: 100%;
        max-height: calc(100dvh - 24px);
        border-radius: 16px;
    }

    .ps-modal__zoom-action {
        right: 12px;
        bottom: 12px;
        width: 38px;
        min-height: 38px;
        padding: 0;
        justify-content: center;
        overflow: hidden;
        color: transparent;
    }

    .ps-modal__zoom-action svg {
        color: var(--ink, #122033);
        flex: 0 0 auto;
    }

    .ps-modal__collab {
        align-items: flex-start;
        flex-direction: column;
        gap: 6px;
    }

    .ps-modal__collab-value {
        text-align: left;
    }

    .pdf-lightbox {
        padding: 10px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .ps-modal__zoom-action {
        transition: none;
    }
}
