/* DIGI Photo Gallery - Frontend Styles */

/* Gallery Wrapper */
.digi-gallery-wrap {
    margin: 20px 0;
}

.digi-gallery-title {
    font-size: 1.4em;
    margin-bottom: 15px;
    font-weight: 600;
}

.digi-gallery-error {
    color: #856404;
    background: #fff3cd;
    padding: 12px 16px;
    border-radius: 6px;
    border: 1px solid #ffc107;
}

/* Grid */
.digi-gallery-grid {
    display: grid;
    width: 100%;
    box-sizing: border-box;
}

/* Gallery Item */
.digi-gallery-item {
    position: relative;
    overflow: hidden;
    border-radius: 6px;
    cursor: pointer;
    background: #f0f0f0;
    aspect-ratio: 1 / 1;
}

.digi-gallery-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.35s ease;
}

.digi-gallery-item:hover img {
    transform: scale(1.05);
}

/* Overlay on hover */
.digi-gallery-item-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(transparent, rgba(0, 0, 0, 0.7));
    padding: 30px 14px 12px;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.digi-gallery-item:hover .digi-gallery-item-overlay {
    opacity: 1;
}

.digi-gallery-item-title {
    color: #fff;
    font-size: 14px;
    font-weight: 600;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}

/* ==============================
   LIGHTBOX - FULL SCREEN OVERLAY
   ============================== */
.digi-lightbox {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    width: 100vw !important;
    height: 100vh !important;
    z-index: 9999999 !important;
    display: flex !important;
    align-items: center;
    justify-content: center;
    margin: 0 !important;
    padding: 0 !important;
}

/* Dark overlay background - covers entire screen */
.digi-lightbox-overlay {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    width: 100vw !important;
    height: 100vh !important;
    background: rgba(0, 0, 0, 0.95) !important;
    z-index: 1;
    animation: digiLbFadeIn 0.25s ease;
    margin: 0 !important;
    padding: 0 !important;
}

@keyframes digiLbFadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* Content container - centered on screen */
.digi-lightbox-content {
    position: relative;
    z-index: 2;
    max-width: 88vw;
    max-height: 85vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    animation: digiLbSlideIn 0.3s ease;
}

@keyframes digiLbSlideIn {
    from { opacity: 0; transform: scale(0.95) translateY(10px); }
    to { opacity: 1; transform: scale(1) translateY(0); }
}

/* ==============================
   CLOSE BUTTON - Fixed top-right
   ============================== */
.digi-lightbox-close {
    position: fixed !important;
    top: 15px !important;
    right: 20px !important;
    z-index: 99999999 !important;
    width: 48px !important;
    height: 48px !important;
    background: rgba(255, 255, 255, 0.15) !important;
    border: 2px solid rgba(255, 255, 255, 0.5) !important;
    border-radius: 50% !important;
    color: #fff !important;
    font-size: 28px !important;
    font-weight: 400 !important;
    cursor: pointer !important;
    display: flex !important;
    align-items: center;
    justify-content: center;
    padding: 0 !important;
    margin: 0 !important;
    line-height: 1 !important;
    transition: all 0.25s ease !important;
    text-decoration: none !important;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.5);
}

.digi-lightbox-close:hover {
    background: rgba(255, 0, 0, 0.6) !important;
    border-color: rgba(255, 100, 100, 0.8) !important;
    transform: rotate(90deg) scale(1.1) !important;
}

/* ==============================
   NAV ARROWS - Fixed left/right
   ============================== */
.digi-lightbox-prev,
.digi-lightbox-next {
    position: fixed !important;
    top: 50% !important;
    transform: translateY(-50%);
    z-index: 99999999 !important;
    width: 50px !important;
    height: 50px !important;
    background: rgba(255, 255, 255, 0.12) !important;
    border: 2px solid rgba(255, 255, 255, 0.35) !important;
    border-radius: 50% !important;
    color: #fff !important;
    font-size: 26px !important;
    cursor: pointer !important;
    display: flex !important;
    align-items: center;
    justify-content: center;
    padding: 0 !important;
    margin: 0 !important;
    line-height: 1 !important;
    transition: all 0.25s ease !important;
    text-decoration: none !important;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
}

.digi-lightbox-prev {
    left: 20px !important;
}

.digi-lightbox-next {
    right: 20px !important;
}

.digi-lightbox-prev:hover,
.digi-lightbox-next:hover {
    background: rgba(255, 255, 255, 0.25) !important;
    border-color: #fff !important;
    transform: translateY(-50%) scale(1.1) !important;
}

/* Image */
.digi-lightbox-img-wrap {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 100px;
    min-height: 100px;
}

.digi-lightbox-img {
    max-width: 82vw;
    max-height: 72vh;
    object-fit: contain;
    border-radius: 4px;
    box-shadow: 0 4px 40px rgba(0, 0, 0, 0.6);
    transition: opacity 0.3s ease;
}

.digi-lightbox-img.loading {
    opacity: 0.3;
}

/* Loader spinner */
.digi-lightbox-loader {
    display: none;
    position: absolute;
    width: 36px;
    height: 36px;
    border: 3px solid rgba(255, 255, 255, 0.2);
    border-top-color: #fff;
    border-radius: 50%;
    animation: digiSpin 0.7s linear infinite;
}

.digi-lightbox-loader.active {
    display: block;
}

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

/* Info bar */
.digi-lightbox-info {
    text-align: center;
    padding: 14px 20px;
    max-width: 650px;
    color: #fff;
}

.digi-lightbox-title {
    margin: 0 0 4px;
    font-size: 17px;
    font-weight: 600;
    color: #fff !important;
}

.digi-lightbox-caption {
    margin: 0;
    font-size: 14px;
    color: rgba(255, 255, 255, 0.75);
    line-height: 1.4;
}

.digi-lightbox-counter {
    display: inline-block;
    margin-top: 8px;
    font-size: 13px;
    color: rgba(255, 255, 255, 0.5);
    letter-spacing: 1px;
}

/* Body scroll lock when lightbox open */
body.digi-lightbox-open {
    overflow: hidden !important;
}

/* ==============================
   RESPONSIVE
   ============================== */
@media (max-width: 768px) {
    .digi-lightbox-img {
        max-width: 94vw;
        max-height: 68vh;
    }

    .digi-lightbox-prev {
        left: 8px !important;
        width: 40px !important;
        height: 40px !important;
        font-size: 22px !important;
    }

    .digi-lightbox-next {
        right: 8px !important;
        width: 40px !important;
        height: 40px !important;
        font-size: 22px !important;
    }

    .digi-lightbox-close {
        top: 10px !important;
        right: 10px !important;
        width: 40px !important;
        height: 40px !important;
        font-size: 24px !important;
    }

    .digi-gallery-grid {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 6px !important;
    }
}

@media (max-width: 480px) {
    .digi-gallery-grid {
        grid-template-columns: repeat(1, 1fr) !important;
    }
}
