/* Project Preview Modal — aligned with site branding */
.project-preview-modal {
    position: fixed;
    inset: 0;
    z-index: 99999;
    display: none;
    align-items: flex-start;
    justify-content: center;
    padding: 10px 14px 14px;
}

.project-preview-modal.is-open,
.project-preview-modal:not([hidden]) {
    display: flex;
}

.project-preview-modal[hidden] {
    display: none !important;
}

.project-preview-modal .ppm-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(20, 28, 40, 0.72);
    backdrop-filter: blur(2px);
}

.project-preview-modal .ppm-dialog {
    position: relative;
    z-index: 1;
    width: min(1180px, 100%);
    height: calc(100vh - 20px);
    max-height: calc(100vh - 20px);
    margin-top: 0;
    background: #ffffff;
    border-radius: 10px;
    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.28);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.project-preview-modal .ppm-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 8px 14px;
    background: linear-gradient(90deg, #2f3e4c 0%, #3a505f 100%);
    color: #fff;
    flex-shrink: 0;
}

.project-preview-modal .ppm-toolbar-meta {
    min-width: 0;
    flex: 1;
}

.project-preview-modal .ppm-category {
    display: block;
    font-size: 11px;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    opacity: 0.75;
    margin-bottom: 0;
    line-height: 1.2;
}

.project-preview-modal .ppm-title {
    margin: 1px 0 0;
    font-size: 16px;
    font-weight: 600;
    line-height: 1.25;
    color: #fff;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.project-preview-modal .ppm-description {
    margin: 2px 0 0;
    font-size: 12px;
    line-height: 1.35;
    color: rgba(255, 255, 255, 0.78);
    max-width: 720px;
    display: -webkit-box;
    -webkit-line-clamp: 1;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.project-preview-modal .ppm-description:empty {
    display: none;
}

.project-preview-modal .ppm-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}

.project-preview-modal .ppm-open-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 6px 12px !important;
    font-size: 12px !important;
    line-height: 1.2 !important;
    margin: 0;
    white-space: nowrap;
}

.project-preview-modal .ppm-open-link[hidden] {
    display: none !important;
}

.project-preview-modal .ppm-btn {
    width: 34px;
    height: 34px;
    border: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.12);
    color: #fff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background 0.2s ease, transform 0.2s ease;
}

.project-preview-modal .ppm-btn:hover,
.project-preview-modal .ppm-btn:focus {
    background: rgba(255, 104, 43, 0.95);
    outline: none;
    transform: translateY(-1px);
}

.project-preview-modal .ppm-body {
    display: flex;
    flex-direction: column;
    min-height: 0;
    flex: 1;
    background: #1b2430;
    overflow: hidden;
}

.project-preview-modal .ppm-stage {
    position: relative;
    flex: 1;
    min-height: 0;
    height: 100%;
    background: #1b2430;
    display: flex;
    align-items: stretch;
    justify-content: stretch;
}

.project-preview-modal .ppm-stage.is-fullscreen {
    position: fixed;
    inset: 0;
    z-index: 100000;
    min-height: 100vh;
    height: 100vh;
    background: #0f141b;
}

.project-preview-modal .ppm-stage-inner {
    position: relative;
    width: 100%;
    height: 100%;
    min-height: 0;
    display: flex;
    align-items: stretch;
    justify-content: stretch;
}

.project-preview-modal .ppm-stage.is-fullscreen .ppm-stage-inner {
    min-height: 100vh;
    height: 100%;
}

.project-preview-modal .ppm-empty {
    color: #d7dde6;
    text-align: center;
    padding: 40px 24px;
    font-size: 15px;
    margin: auto;
}

.project-preview-modal .ppm-frame-wrap,
.project-preview-modal .ppm-gallery {
    width: 100%;
    height: 100%;
    min-height: 0;
    flex: 1;
}

.project-preview-modal .ppm-frame-wrap {
    position: relative;
    overflow: hidden;
}

.project-preview-modal .ppm-empty[hidden],
.project-preview-modal .ppm-frame-wrap[hidden],
.project-preview-modal .ppm-gallery[hidden] {
    display: none !important;
}

.project-preview-modal .ppm-frame-wrap iframe {
    width: 100%;
    height: 100%;
    min-height: 0;
    border: 0;
    background: #1b2430;
    display: block;
    pointer-events: auto;
    touch-action: auto;
    -webkit-overflow-scrolling: touch;
    overflow: auto;
}

.project-preview-modal .ppm-frame-fallback {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 16px;
    padding: 24px;
    text-align: center;
    color: #d7dde6;
    background: #1b2430;
}

.project-preview-modal .ppm-frame-fallback[hidden] {
    display: none !important;
}

.project-preview-modal .ppm-frame-fallback p {
    margin: 0;
    max-width: 420px;
    font-size: 14px;
    line-height: 1.6;
}

.project-preview-modal .ppm-stage.is-fullscreen .ppm-frame-wrap,
.project-preview-modal .ppm-stage.is-fullscreen .ppm-frame-wrap iframe,
.project-preview-modal .ppm-stage.is-fullscreen .ppm-gallery,
.project-preview-modal .ppm-stage.is-fullscreen .ppm-stage-inner {
    min-height: 100vh;
    height: 100%;
}

.project-preview-modal .ppm-gallery {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    justify-content: stretch;
    gap: 0;
    padding: 0;
    overflow: hidden;
}

.project-preview-modal .ppm-main-image-wrap {
    flex: 1;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: stretch;
    justify-content: stretch;
    min-height: 0;
    background: #121820;
}

.project-preview-modal .ppm-main-image-wrap img {
    width: 100%;
    height: 100%;
    max-width: none;
    max-height: none;
    object-fit: contain;
    object-position: center;
    border-radius: 0;
    box-shadow: none;
    background: #121820;
    display: block;
}

.project-preview-modal .ppm-stage.is-fullscreen .ppm-main-image-wrap img {
    max-height: none;
}

.project-preview-modal .ppm-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 42px;
    height: 42px;
    border: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.14);
    color: #fff;
    cursor: pointer;
    z-index: 3;
}

.project-preview-modal .ppm-nav:hover {
    background: rgba(255, 104, 43, 0.95);
}

.project-preview-modal .ppm-nav-prev {
    left: 12px;
}

.project-preview-modal .ppm-nav-next {
    right: 12px;
}

html[dir="rtl"] .project-preview-modal .ppm-nav-prev {
    left: auto;
    right: 12px;
}

html[dir="rtl"] .project-preview-modal .ppm-nav-next {
    right: auto;
    left: 12px;
}

.project-preview-modal .ppm-thumbs {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 3;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 8px;
    max-width: 100%;
    padding: 10px 12px 12px;
    background: linear-gradient(transparent, rgba(10, 14, 20, 0.72));
}

.project-preview-modal .ppm-thumbs button {
    width: 64px;
    height: 48px;
    padding: 0;
    border: 2px solid transparent;
    border-radius: 4px;
    overflow: hidden;
    background: #2a3542;
    cursor: pointer;
    opacity: 0.7;
}

.project-preview-modal .ppm-thumbs button.is-active,
.project-preview-modal .ppm-thumbs button:hover {
    opacity: 1;
    border-color: #ff682b;
}

.project-preview-modal .ppm-thumbs img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.project-preview-modal .ppm-toast {
    position: absolute;
    left: 50%;
    bottom: 18px;
    transform: translateX(-50%);
    background: rgba(30, 40, 52, 0.94);
    color: #fff;
    padding: 10px 18px;
    border-radius: 30px;
    font-size: 13px;
    z-index: 3;
    pointer-events: none;
}

body.ppm-open {
    overflow: hidden;
}

/* Card open affordance without redesigning layout */
.project-block-one .inner-box {
    cursor: pointer;
}

.project-block-one .inner-box .content-box .view-btn {
    cursor: pointer;
}

@media only screen and (max-width: 991px) {
    .project-preview-modal .ppm-toolbar {
        flex-wrap: wrap;
        align-items: center;
        padding: 8px 12px;
    }

    .project-preview-modal .ppm-actions {
        width: 100%;
        justify-content: flex-end;
    }

    .project-preview-modal .ppm-gallery {
        padding: 0;
    }
}

@media only screen and (max-width: 575px) {
    .project-preview-modal {
        padding: 0;
    }

    .project-preview-modal .ppm-dialog {
        width: 100%;
        height: 100vh;
        max-height: 100vh;
        border-radius: 0;
    }

    .project-preview-modal .ppm-title {
        font-size: 14px;
    }

    .project-preview-modal .ppm-description {
        -webkit-line-clamp: 1;
        font-size: 11px;
    }

    .project-preview-modal .ppm-open-link {
        padding: 6px 10px !important;
        font-size: 11px !important;
    }

    .project-preview-modal .ppm-btn {
        width: 32px;
        height: 32px;
    }
}
