/* ═══════════════════════════════════════════════════════
   Axiom Gallery — Frontend Styles
   ═══════════════════════════════════════════════════════ */

/* ── Gallery Grid ─────────────────────────────────────── */
.pcbg-gallery {
    --pcbg-cols-desktop: 4;
    --pcbg-cols-mobile: 2;
    --pcbg-gap: 8px;

    display: grid;
    grid-template-columns: repeat(var(--pcbg-cols-desktop), 1fr);
    gap: var(--pcbg-gap);
    margin: 20px 0;
}

@media (max-width: 767px) {
    .pcbg-gallery {
        grid-template-columns: repeat(var(--pcbg-cols-mobile), 1fr);
    }
}

.pcbg-item {
    position: relative;
    overflow: hidden;
    border-radius: 4px;
    aspect-ratio: 1;
    background: #1a1a1a;
}

.pcbg-item a {
    display: block;
    width: 100%;
    height: 100%;
}

.pcbg-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.3s ease, opacity 0.3s ease;
}

.pcbg-item:hover img {
    transform: scale(1.05);
    opacity: 0.9;
}

/* ── Lightbox Overlay ─────────────────────────────────── */
.pcbg-lightbox {
    position: fixed;
    inset: 0;
    z-index: 999999;
    background: rgba(0, 0, 0, 0.95);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.pcbg-lightbox.pcbg-active {
    opacity: 1;
    visibility: visible;
}

/* Close */
.pcbg-lb-close {
    position: absolute;
    top: 16px;
    right: 16px;
    width: 44px;
    height: 44px;
    background: rgba(255, 255, 255, 0.1);
    border: none;
    border-radius: 50%;
    color: #fff;
    font-size: 28px;
    line-height: 44px;
    text-align: center;
    cursor: pointer;
    z-index: 10;
    transition: background 0.2s;
}
.pcbg-lb-close:hover {
    background: rgba(255, 255, 255, 0.25);
}

/* Navigation arrows */
.pcbg-lb-prev,
.pcbg-lb-next {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 48px;
    height: 48px;
    background: rgba(255, 255, 255, 0.1);
    border: none;
    border-radius: 50%;
    color: #fff;
    font-size: 24px;
    cursor: pointer;
    z-index: 10;
    transition: background 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}
.pcbg-lb-prev { left: 16px; }
.pcbg-lb-next { right: 16px; }
.pcbg-lb-prev:hover,
.pcbg-lb-next:hover {
    background: rgba(255, 255, 255, 0.25);
}

/* Image container */
.pcbg-lb-image-wrap {
    max-width: 90vw;
    max-height: 80vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

.pcbg-lb-image-wrap img {
    max-width: 100%;
    max-height: 80vh;
    object-fit: contain;
    border-radius: 4px;
    user-select: none;
    -webkit-user-drag: none;
}

/* ── Bottom toolbar (download + share) ────────────────── */
.pcbg-lb-toolbar {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 8px;
    align-items: center;
    padding: 8px 16px;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border-radius: 30px;
    z-index: 10;
}

.pcbg-lb-toolbar button,
.pcbg-lb-toolbar a {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: none;
    background: rgba(255, 255, 255, 0.12);
    color: #fff;
    cursor: pointer;
    text-decoration: none;
    transition: background 0.2s, transform 0.15s;
    font-size: 18px;
}

.pcbg-lb-toolbar button:hover,
.pcbg-lb-toolbar a:hover {
    background: rgba(255, 255, 255, 0.25);
    transform: scale(1.1);
}

/* Specific share button colors on hover */
.pcbg-share-fb:hover       { background: #1877f2 !important; }
.pcbg-share-x:hover        { background: #000 !important; }
.pcbg-share-tiktok:hover   { background: #010101 !important; }
.pcbg-share-snap:hover     { background: #fffc00 !important; color: #000 !important; }
.pcbg-share-pinterest:hover{ background: #e60023 !important; }

.pcbg-download-btn { font-size: 20px; }

/* Loading spinner for lightbox */
.pcbg-lb-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid rgba(255,255,255,0.2);
    border-top-color: #fff;
    border-radius: 50%;
    animation: pcbgSpin 0.7s linear infinite;
    position: absolute;
}

@keyframes pcbgSpin {
    to { transform: rotate(360deg); }
}

/* Counter (e.g. 3 / 12) */
.pcbg-lb-counter {
    position: absolute;
    top: 20px;
    left: 20px;
    color: rgba(255,255,255,0.6);
    font-size: 14px;
    font-weight: 500;
    z-index: 10;
}

/* ── Responsive adjustments ───────────────────────────── */
@media (max-width: 767px) {
    .pcbg-lb-prev,
    .pcbg-lb-next {
        width: 36px;
        height: 36px;
        font-size: 18px;
    }
    .pcbg-lb-prev { left: 8px; }
    .pcbg-lb-next { right: 8px; }

    .pcbg-lb-toolbar {
        bottom: 12px;
        padding: 6px 12px;
        gap: 6px;
    }
    .pcbg-lb-toolbar button,
    .pcbg-lb-toolbar a {
        width: 36px;
        height: 36px;
        font-size: 16px;
    }
}
