﻿.cb-lqip-img {
    background-color: #1a1410;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    transition: opacity 0.4s ease-out, filter 0.4s ease-out;
}

.cb-lqip-loading {
    filter: blur(15px);
    transform: scale(1.05);
    opacity: 0.85;
}

.cb-lqip-loaded {
    filter: blur(0);
    transform: scale(1);
    opacity: 1;
}

.cb-img-fade-in {
    animation: cbImgFadeIn 0.45s ease-out;
}

@keyframes cbImgFadeIn {
    from {
        opacity: 0.4;
        filter: blur(8px);
    }

    to {
        opacity: 1;
        filter: blur(0);
    }
}

.cb-img-error {
    background: linear-gradient(135deg, #2a1f1a 0%, #1a1410 100%);
    opacity: 0.6;
}

img.cb-hq-clickable {
    cursor: zoom-in;
    transition: transform 0.3s ease, filter 0.3s ease;
}

    img.cb-hq-clickable:hover {
        filter: brightness(1.08);
    }

/* ───────── Lightbox ───────── */
.cb-hq-lightbox {
    position: fixed;
    inset: 0;
    z-index: 9999;
    background: rgba(0, 0, 0, 0.94);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

    .cb-hq-lightbox.is-open {
        opacity: 1;
        visibility: visible;
    }

.cb-hq-lightbox__content {
    max-width: 95vw;
    max-height: 95vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

.cb-hq-lightbox__img {
    max-width: 95vw;
    max-height: 90vh;
    width: auto;
    height: auto;
    object-fit: contain;
    border-radius: 8px;
    box-shadow: 0 30px 90px rgba(0, 0, 0, 0.6);
    opacity: 0;
    transform: scale(0.92);
    transition: opacity 0.35s ease, transform 0.35s ease;
}

    .cb-hq-lightbox__img.is-loaded {
        opacity: 1;
        transform: scale(1);
    }

.cb-hq-lightbox__close {
    position: fixed;
    top: 1.5rem;
    left: 1.5rem;
    width: 48px;
    height: 48px;
    border: 1px solid rgba(255, 255, 255, 0.15);
    background: rgba(255, 255, 255, 0.05);
    color: #fff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background 0.2s ease, transform 0.2s ease;
    padding: 0;
}

    .cb-hq-lightbox__close svg {
        width: 22px;
        height: 22px;
    }

    .cb-hq-lightbox__close:hover {
        background: rgba(232, 201, 122, 0.18);
        border-color: rgba(232, 201, 122, 0.4);
        transform: rotate(90deg);
    }

.cb-hq-lightbox__loader {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 56px;
    height: 56px;
    padding: 0;
    border: none;
    background: transparent;
    color: #e8c97a;
    display: none;
}

    .cb-hq-lightbox__loader svg {
        width: 100%;
        height: 100%;
        animation: cbLightboxSpin 1s linear infinite;
    }

.cb-hq-lightbox:not(:has(.cb-hq-lightbox__img.is-loaded)) .cb-hq-lightbox__loader {
    display: flex;
}

@keyframes cbLightboxSpin {
    to {
        transform: rotate(360deg);
    }
}

@media (prefers-reduced-motion: reduce) {
    .cb-lqip-img,
    img.cb-hq-clickable,
    .cb-hq-lightbox,
    .cb-hq-lightbox__img {
        transition: none !important;
        animation: none !important;
    }

    .cb-lqip-loading {
        filter: none;
        transform: none;
        opacity: 1;
    }
}

@media (max-width: 768px) {
    .cb-hq-lightbox {
        padding: 0;
    }

    .cb-hq-lightbox__close {
        top: 1rem;
        left: 1rem;
        width: 42px;
        height: 42px;
    }

    .cb-hq-lightbox__img {
        max-width: 100vw;
        max-height: 100vh;
        border-radius: 0;
    }
}

.spa-loader {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, transparent, #e8c97a, #d4a857, #e8c97a, transparent);
    background-size: 200% 100%;
    animation: cbLoadingBar 1.5s infinite;
    display: none;
    z-index: 9999;
    box-shadow: 0 1px 8px rgba(232, 201, 122, 0.6);
    transition: opacity 0.2s ease;
    opacity: 0;
}

@keyframes cbLoadingBar {
    0% {
        background-position: 200% 0;
    }

    100% {
        background-position: -200% 0;
    }
}

@media (prefers-reduced-motion: reduce) {
    .spa-loader {
        animation: none;
    }
}
