/* =========================================================
   Certificate modal
========================================================= */

img.wp-image-534 {
    cursor: zoom-in;
}

.ywcm-modal {
    position: fixed;
    inset: 0;
    z-index: 99999999;

    display: flex;
    align-items: center;
    justify-content: center;

    padding: 28px;

    opacity: 0;
    visibility: hidden;
    pointer-events: none;

    transition:
        opacity 0.45s cubic-bezier(0.22, 1, 0.36, 1),
        visibility 0.45s cubic-bezier(0.22, 1, 0.36, 1);
}

.ywcm-modal.is-active {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

.ywcm-modal-overlay {
    position: fixed;
    inset: 0;

    background: rgba(3, 16, 32, 0.86);
    opacity: 0;

    backdrop-filter: blur(0);
    -webkit-backdrop-filter: blur(0);

    transition:
        opacity 0.45s ease,
        backdrop-filter 0.45s ease,
        -webkit-backdrop-filter 0.45s ease;
}

.ywcm-modal.is-active .ywcm-modal-overlay {
    opacity: 1;
    backdrop-filter: blur(7px);
    -webkit-backdrop-filter: blur(7px);
}

.ywcm-modal-window {
    position: relative;
    z-index: 2;

    width: min(1120px, 100%);
    max-height: calc(100dvh - 56px);

    display: flex;
    align-items: center;
    justify-content: center;

    opacity: 0;
    transform: translateY(34px) scale(0.94);
    filter: blur(8px);

    transition:
        opacity 0.55s cubic-bezier(0.22, 1, 0.36, 1),
        transform 0.55s cubic-bezier(0.22, 1, 0.36, 1),
        filter 0.55s cubic-bezier(0.22, 1, 0.36, 1);
}

.ywcm-modal.is-active .ywcm-modal-window {
    opacity: 1;
    transform: translateY(0) scale(1);
    filter: blur(0);
}

.ywcm-modal-image-wrap {
    position: relative;

    width: auto;
    max-width: 100%;
    max-height: calc(100dvh - 56px);

    padding: 14px;

    border-radius: 22px;
    background: #ffffff;
    box-shadow: 0 34px 90px rgba(0, 0, 0, 0.38);
}

.ywcm-modal-image {
    display: block;

    width: auto;
    max-width: 100%;
    max-height: calc(100dvh - 84px);

    border-radius: 14px;
    object-fit: contain;
}

.ywcm-modal-close {
    position: absolute;
    top: -16px;
    right: -16px;
    z-index: 5;

    width: 42px;
    height: 42px;

    display: flex;
    align-items: center;
    justify-content: center;

    border: 0;
    border-radius: 50%;

    background: #ffffff;
    color: #1f2937;

    font-size: 32px;
    line-height: 1;
    font-weight: 200;

    cursor: pointer;
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.22);

    transition:
        transform 0.2s ease,
        opacity 0.2s ease;
}

.ywcm-modal-close:hover {
    opacity: 0.75;
    transform: scale(0.96);
}

.ywcm-modal-open {
    overflow: hidden !important;
}

/* Mobile */
@media (max-width: 767px) {
    .ywcm-modal {
        padding: 12px;
    }

    .ywcm-modal-window {
        width: 100%;
        max-height: calc(100dvh - 24px);
    }

    .ywcm-modal-image-wrap {
        padding: 8px;
        border-radius: 18px;
        max-height: calc(100dvh - 24px);
    }

    .ywcm-modal-image {
        max-height: calc(100dvh - 40px);
        border-radius: 12px;
    }

    .ywcm-modal-close {
        top: 8px;
        right: 8px;

        width: 38px;
        height: 38px;

        background: rgba(255, 255, 255, 0.92);
        font-size: 30px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .ywcm-modal,
    .ywcm-modal-overlay,
    .ywcm-modal-window,
    .ywcm-modal-close {
        transition: none !important;
        animation: none !important;
        transform: none !important;
        filter: none !important;
    }
}
