/* ==========================================================
   JCS Gallery Pro v4 — jcsp.css
   Inline styles handle image display (override-proof).
   This file handles: hover, mobile luxury grid, lightbox.
   ========================================================== */

/* ── Hover effect on items ───────────────────────────────── */
.jcsp-item:hover {
    transform: translateY(-4px) !important;
    box-shadow: 0 16px 40px rgba(0,0,0,0.3) !important;
}

.jcsp-item:focus-visible {
    outline: 3px solid #C8980A;
    outline-offset: 3px;
}

.jcsp-item:hover .jcsp-img {
    transform: scale(1.06);
}

.jcsp-item:hover .jcsp-vid-thumb {
    transform: scale(1.06);
}

/* ── Mobile: luxury 2-column layout ─────────────────────── */
@media (max-width: 768px) {
    .jcsp-grid {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 10px !important;
    }

    .jcsp-item {
        height: 200px !important;
    }

    /* Tall items stay tall on tablet — feels luxury */
    .jcsp-item.jcsp-tall {
        height: 410px !important;
        grid-row: span 2 !important;
    }
}

@media (max-width: 480px) {
    .jcsp-grid {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 8px !important;
    }

    /* 2 columns on mobile — luxury look, not boring single column */
    .jcsp-item {
        height: 170px !important;
        border-radius: 6px !important;
    }

    /* Tall items: span 2 rows = 1 big + 2 small beside it */
    .jcsp-item.jcsp-tall {
        height: 348px !important;
        grid-row: span 2 !important;
    }
}

/* ════════════════════════════════════════════════════════════
   LIGHTBOX
   ════════════════════════════════════════════════════════════ */

.jcsp-lb {
    position: fixed;
    inset: 0;
    background: rgba(5,3,2,0.96);
    z-index: 9999999;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.28s ease;
    overscroll-behavior: contain;
}
.jcsp-lb.jcsp-open { opacity: 1; }

.jcsp-lb-inner {
    position: relative;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 62px 80px 104px;
    box-sizing: border-box;
}

/* Media container */
.jcsp-lb-media {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    flex: 1;
    max-height: 100%;
}

.jcsp-lb-media img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    border-radius: 4px;
    opacity: 0;
    transition: opacity 0.3s ease;
    box-shadow: 0 12px 60px rgba(0,0,0,0.8);
    display: block;
}
.jcsp-lb-media img.jcsp-loaded { opacity: 1; }

.jcsp-lb-media video {
    max-width: 100%;
    max-height: 100%;
    border-radius: 4px;
    box-shadow: 0 12px 60px rgba(0,0,0,0.8);
    display: block;
}

/* Slide in/out */
.jcsp-ol { animation: jcspOL 0.19s ease forwards; }
.jcsp-or { animation: jcspOR 0.19s ease forwards; }
.jcsp-il { animation: jcspIL 0.2s  ease forwards; }
.jcsp-ir { animation: jcspIR 0.2s  ease forwards; }
@keyframes jcspOL { to{opacity:0;transform:translateX(-55px)} }
@keyframes jcspOR { to{opacity:0;transform:translateX(55px)} }
@keyframes jcspIL { from{opacity:0;transform:translateX(55px)} to{opacity:1;transform:none} }
@keyframes jcspIR { from{opacity:0;transform:translateX(-55px)} to{opacity:1;transform:none} }

/* Spinner */
.jcsp-spin {
    width: 38px; height: 38px;
    border: 3px solid rgba(255,255,255,0.1);
    border-top-color: #C8980A;
    border-radius: 50%;
    animation: jcspSP 0.7s linear infinite;
}
@keyframes jcspSP { to{transform:rotate(360deg)} }

/* Close btn */
.jcsp-close {
    position: fixed; top: 16px; right: 20px;
    width: 44px; height: 44px;
    background: rgba(255,255,255,0.08);
    border: 1px solid rgba(255,255,255,0.15);
    border-radius: 50%;
    color: #fff; font-size: 18px; cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    z-index: 10; transition: background 0.2s;
}
.jcsp-close:hover { background: rgba(255,255,255,0.18); }

/* Arrows */
.jcsp-prev, .jcsp-next {
    position: fixed; top: 50%; transform: translateY(-50%);
    width: 52px; height: 52px;
    background: rgba(255,255,255,0.08);
    border: 1px solid rgba(255,255,255,0.15);
    border-radius: 50%;
    color: #fff; font-size: 28px; cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    z-index: 10; transition: background 0.2s, transform 0.2s;
    line-height: 1;
}
.jcsp-prev { left: 14px; }
.jcsp-next { right: 14px; }
.jcsp-prev:hover { background: rgba(255,255,255,0.18); transform: translateY(-50%) scale(1.1); }
.jcsp-next:hover { background: rgba(255,255,255,0.18); transform: translateY(-50%) scale(1.1); }

/* Bottom bar */
.jcsp-bar {
    position: fixed; bottom: 0; left: 0; right: 0;
    padding: 10px 80px 14px;
    background: linear-gradient(to top, rgba(0,0,0,0.75), transparent);
    display: flex; align-items: flex-end; justify-content: space-between;
    pointer-events: none; z-index: 8;
}
.jcsp-lb-cap {
    color: #fff; font-size: 14px; font-family: sans-serif;
    text-shadow: 0 1px 4px rgba(0,0,0,0.7);
    max-width: 65%; line-height: 1.4;
    letter-spacing: 0.01em;
}
.jcsp-cnt {
    color: rgba(255,255,255,0.5); font-size: 12px;
    font-family: sans-serif; white-space: nowrap;
}

/* Thumbnail strip */
.jcsp-thumbstrip {
    position: fixed; bottom: 48px; left: 50%;
    transform: translateX(-50%);
    display: flex; gap: 6px;
    padding: 5px 8px;
    background: rgba(0,0,0,0.55);
    border-radius: 8px;
    max-width: 86vw; overflow-x: auto;
    scrollbar-width: none; z-index: 9;
}
.jcsp-thumbstrip::-webkit-scrollbar { display: none; }

.jcsp-lbthumb {
    width: 52px; height: 38px;
    border-radius: 4px; overflow: hidden;
    cursor: pointer; flex-shrink: 0;
    border: 2px solid transparent;
    opacity: 0.45;
    transition: opacity 0.2s, border-color 0.2s;
    background: #1a1a1a;
    display: flex; align-items: center; justify-content: center;
    color: rgba(255,255,255,0.55); font-size: 15px;
}
.jcsp-lbthumb img, .jcsp-lbthumb video { width:100%;height:100%;object-fit:cover;display:block; }
.jcsp-lbthumb.jcsp-active { border-color: #C8980A; opacity: 1; }
.jcsp-lbthumb:hover { opacity: 0.8; }

/* Mobile lightbox */
@media (max-width: 600px) {
    .jcsp-lb-inner { padding: 52px 10px 110px; }
    .jcsp-prev { left: 4px; width: 40px; height: 40px; font-size: 22px; }
    .jcsp-next { right: 4px; width: 40px; height: 40px; font-size: 22px; }
    .jcsp-bar { padding: 8px 12px 12px; }
    .jcsp-lb-cap { font-size: 13px; max-width: 75%; }
}
