/* =========================================================
   ProCode Media Core (Global)
   File: procode/includes/media/view/procode-media.css
   - Skeleton (aspect-ratio box) + shimmer
   - Base media item styles (image/video)
   - Play icon overlay for videos
   - Lightbox UI (shared for masonry/grid)
   Modern browsers only
========================================================= */

/* -----------------------------
   Base Item
------------------------------ */
/*.swiper-wrapper{align-items: center;}*/

/*.pc-media-item {
    position: relative;
    display: flex;
    border-radius: 12px;
    cursor: pointer!important;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    user-select: none;
    transform: translateZ(0);
    transition: box-shadow .18s ease, transform .18s ease;
}

.pc-media-item:hover {
    box-shadow: 0 10px 24px rgba(0, 0, 0, .12);
    transform: translateY(-2px);
}

/* اگر layout=carousel بود ممکنه cursor لازم نباشه */
/*.pc-layout-carousel {
    cursor: default;
}

/* تصاویر/پوسترها */
/*.pc-media-img,
.pc-media-poster {
    display: block;
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    background: transparent;
    border-radius: 12px;
}
*/
.pc-media-carousel{
    border: 1px solid #212121;
    border-radius: 15px;
    padding: 5px!important;
    background: #e3e3d6;}

.pc-media-item {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1;
}

.pc-media-frame {
    position: relative;
}

.swiper-slide-active .pc-media-frame {
    width: auto;
    height: auto;
    max-width: 100%;
    max-height: 70vh;
}

.swiper-slide-active img {
    width: auto;
    height: auto;
    max-width: 100%;
    max-height: 70vh;
    object-fit: contain;
    box-shadow: 0 5px 15px #7c7c7c;
}

.swiper-slide:not(.swiper-slide-active) .pc-media-frame {
    width: 240px;
    height: 160px;
    overflow: hidden;
}

.swiper-slide:not(.swiper-slide-active) img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border: 1px solid #000;
}

.swiper-wrapper{min-height: 590px;}
.swiper-wrapper img{border-radius: 15px;}

.swiper-slide {
    transition: transform 0.4s ease, opacity 0.4s ease;
    width: 30%!important;
    height: auto!important;
    display: flex!important;
    justify-content: center!important;
}

.swiper-slide-active {
    transform: scale(1);
    opacity: 1;
    z-index: 5;
}

.swiper-slide-prev,
.swiper-slide-next {
    transform: scale(0.85);
    opacity: 0.7;
}

.swiper-slide:not(.swiper-slide-active):not(.swiper-slide-prev):not(.swiper-slide-next) {
    transform: scale(0.65);
    opacity: 0.4;
}

.pc-layout-masonry {margin-bottom: 15px;}
.pc-layout-masonry img{border-radius: 15px;}


.pc-layout-grid {position: relative;z-index: 1;}
.pc-layout-grid .pc-media-frame {
    position: relative;
    width: 100%;
    height: 300px;
    overflow: hidden;
    background: #f2f2f2;
    transition:transform 300ms ease,box-shadow 300ms ease,filter 200ms ease,opacity 200ms ease;
}
.pc-layout-grid .pc-media-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}
.pc-layout-grid:hover {
    z-index: 20;
}
.pc-media-grid:hover .pc-media-frame {
    filter: blur(1px);
    opacity: 0.4;
    transition: all 0.3s ease;
}
.pc-layout-grid:hover .pc-media-frame {
    filter: blur(0);
    opacity: 1;
    transform: scale(1.2);
    box-shadow: 0 30px 60px rgba(0, 0, 0, 0.3);
}

/* -----------------------------
   Skeleton Loader (Shimmer)
------------------------------ */
.pc-skeleton {
    position: absolute;
    inset: 0;
    background: #e9eaee;
    overflow: hidden;
    pointer-events: none;
    z-index: 1;
}

/* shimmer effect: خیلی سبک */
.pc-skeleton::before {
    content: "";
    position: absolute;
    top: 0;
    left: -60%;
    width: 60%;
    height: 100%;
    background: linear-gradient(90deg,
            rgba(255, 255, 255, 0) 0%,
            rgba(255, 255, 255, .55) 50%,
            rgba(255, 255, 255, 0) 100%);
    animation: pcShimmer 1.1s linear infinite;
}

@keyframes pcShimmer {
    0% {
        left: -60%;
    }

    100% {
        left: 120%;
    }
}

/* وقتی لود شد (JS این کلاس رو اضافه میکنه) */
.pc-media-item.pc-loaded .pc-skeleton {
    opacity: 0;
    transition: opacity .18s ease;
}

/* -----------------------------
   Video Play Icon
------------------------------ */
.pc-type-video .pc-play-icon {
    position: absolute;
    inset: 0;
    display: grid;
    place-items: center;
    z-index: 2;
    pointer-events: none;
}

.pc-type-video .pc-play-icon::before {
    content: "";
    width: 54px;
    height: 54px;
    border-radius: 50%;
    background: rgba(0, 0, 0, .55);
    box-shadow: 0 8px 20px rgba(0, 0, 0, .22);
    display: block;
}

.pc-type-video .pc-play-icon::after {
    content: "";
    position: absolute;
    width: 0;
    height: 0;
    border-left: 14px solid rgba(255, 255, 255, .95);
    border-top: 9px solid transparent;
    border-bottom: 9px solid transparent;
    margin-left: 3px;
}

/* -----------------------------
   Lightbox (Shared)
   NOTE: Carousel layout will not trigger lightbox (JS)
------------------------------ */

.pc-lb {
    position: fixed;
    inset: 0;
    z-index: 999999;
    display: none;
}

.pc-lb.pc-open {
    display: block;
}

.pc-lb-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, .78);
}

.pc-lb-wrap {
    position: absolute;
    inset: 0;
    display: grid;
    place-items: center;
    padding: 18px;
}

.pc-lb-content {
    position: relative;
    width: min(1100px, 100%);
    max-height: 92vh;
    border-radius: 14px;
    overflow: hidden;
    background: #0b0c10;
    box-shadow: 0 18px 45px rgba(0, 0, 0, .45);
}

.pc-lb-media {
    position: absolute;
    width: 70%;
    height: 70%;
    background: #0b0c10;
    display: grid;
    place-items: center;
}

/* image/video داخل لایت باکس */
.pc-lb-media img,
.pc-lb-media video {
    display: block;
    width: 100%;
    height: auto;
    max-height: 92vh;
    object-fit: contain;
    background: #0b0c10;
}

/* Top bar */
.pc-lb-top {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    padding: 10px 10px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
    z-index: 3;
    background: linear-gradient(180deg, rgba(0, 0, 0, .62), rgba(0, 0, 0, 0));
}

.pc-lb-title {
    color: rgba(255, 255, 255, .92);
    font-size: 13px;
    line-height: 1.4;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 70%;
    user-select: none;
}

.pc-lb-btn {
    appearance: none;
    border: none;
    background: rgba(255, 255, 255, .12);
    color: #fff;
    width: 38px;
    height: 38px;
    border-radius: 10px;
    cursor: pointer;
    display: grid;
    place-items: center;
    transition: background .15s ease, transform .15s ease;
}

.pc-lb-btn:hover {
    background: rgba(255, 255, 255, .18);
    transform: translateY(-1px);
}

.pc-lb-btn:focus {
    outline: 2px solid rgba(255, 255, 255, .55);
    outline-offset: 2px;
}

/* Close icon */
.pc-lb-btn.pc-lb-close::before {
    content: "×";
    font-size: 22px;
    line-height: 1;
}
.pc-lb-close{
position: absolute;
    top: 13%;
    right: 5%;
    z-index: 9;
}
/* Nav arrows */
.pc-lb-nav {
    position: absolute;
    top: 0;
    bottom: 0;
    width: 15%;
    min-width: 80px;
    z-index: 2;
    display: grid;
    place-items: center;
    cursor: pointer;
}

.pc-lb-prev {
    left: 0;position: absolute;
}

.pc-lb-next {
    right: 0;position: absolute;
}

.pc-lb-nav .pc-lb-btn {
    width: 44px;
    height: 44px;
    border-radius: 12px;
}

.pc-lb-prev .pc-lb-btn::before {
    content: "‹";
    font-size: 26px;
    line-height: 1;
}

.pc-lb-next .pc-lb-btn::before {
    content: "›";
    font-size: 26px;
    line-height: 1;
}

/* Mobile: nav zone کوچکتر */
@media (max-width: 768px) {
    .pc-lb-nav {
        width: 18%;
        min-width: 60px;
    }

    .pc-type-video .pc-play-icon::before {
        width: 48px;
        height: 48px;
    }
}

/* Body lock helper (JS اینو روی body میذاره) */
.pc-lb-lock {
    overflow: hidden !important;
    touch-action: none !important;
}