/**
 * Property Gallery Styles
 *
 * @package HomeProz
 */

.property-gallery {
    margin-bottom: 2rem;
}

// Main Image
.gallery-main {
    position: relative;
    margin-bottom: 0.75rem;
}

.gallery-main-image {
    display: block;
    width: 100%;
    padding: 0;
    border: none;
    background: none;
    cursor: pointer;
    border-radius: 0.5rem;
    overflow: hidden;

    img {
        width: 100%;
        height: auto;
        aspect-ratio: 16 / 10;
        object-fit: cover;
        display: block;
    }
}

.gallery-count {
    position: absolute;
    bottom: 1rem;
    right: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    background-color: rgba(0, 0, 0, 0.75);
    border-radius: 0.25rem;
    color: white;
    font-size: 0.875rem;
    font-weight: 500;
}

// Thumbnails
.gallery-thumbnails {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 0.5rem;

    @media (max-width: 640px) {
        grid-template-columns: repeat(4, 1fr);
    }
}

.gallery-thumbnail {
    position: relative;
    padding: 0;
    border: 2px solid transparent;
    background: none;
    cursor: pointer;
    border-radius: 0.25rem;
    overflow: hidden;

    &.is-active {
        border-color: var(--color-accent);
    }

    img {
        width: 100%;
        aspect-ratio: 1;
        object-fit: cover;
        display: block;
    }
}

.thumbnail-more {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: rgba(0, 0, 0, 0.7);
    color: white;
    font-size: 1rem;
    font-weight: 600;
}

// Gallery Placeholder
.gallery-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 400px;
    background-color: var(--color-bg-card);
    border-radius: 0.5rem;
    color: var(--color-text-muted);

    svg {
        margin-bottom: 1rem;
    }

    p {
        margin: 0;
    }
}

// Lightbox
.gallery-lightbox {
    position: fixed;
    inset: 0;
    z-index: 1000;
    display: none;

    &[aria-hidden="false"] {
        display: block;
    }
}

.lightbox-overlay {
    position: absolute;
    inset: 0;
    background-color: rgba(0, 0, 0, 0.95);
}

.lightbox-container {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
    padding: 4rem 1rem;
}

.lightbox-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    z-index: 10;
    padding: 0.5rem;
    background: none;
    border: none;
    color: white;
    cursor: pointer;
    opacity: 0.8;

    &:hover {
        opacity: 1;
    }
}

.lightbox-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    z-index: 10;
    padding: 1rem;
    background-color: rgba(255, 255, 255, 0.1);
    border: none;
    border-radius: 50%;
    color: white;
    cursor: pointer;
    opacity: 0.8;

    &:hover {
        opacity: 1;
        background-color: rgba(255, 255, 255, 0.2);
    }

    &.lightbox-prev {
        left: 1rem;
    }

    &.lightbox-next {
        right: 1rem;
    }
}

.lightbox-image-container {
    max-width: 90vw;
    max-height: calc(100vh - 8rem);
    display: flex;
    align-items: center;
    justify-content: center;
}

.lightbox-image {
    max-width: 100%;
    max-height: calc(100vh - 8rem);
    object-fit: contain;
}

.lightbox-counter {
    position: absolute;
    bottom: 1rem;
    left: 50%;
    transform: translateX(-50%);
    padding: 0.5rem 1rem;
    background-color: rgba(0, 0, 0, 0.75);
    border-radius: 0.25rem;
    color: white;
    font-size: 0.875rem;
}
