/**
 * HJR Reefscaping Gallery Styles
 * Custom lightbox gallery system
 */

/* Gallery Grid */
.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 20px;
    margin: 40px 0;
}

.gallery-grid-item {
    position: relative;
    aspect-ratio: 4/3;
    overflow: hidden;
    border-radius: 12px;
    cursor: pointer;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.gallery-grid-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

.gallery-grid-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

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

.gallery-grid-item .gallery-caption {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.8), transparent);
    color: white;
    padding: 15px;
    font-size: 14px;
    transform: translateY(100%);
    transition: transform 0.3s ease;
}

.gallery-grid-item:hover .gallery-caption {
    transform: translateY(0);
}

/* Lightbox */
.hjr-lightbox {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 10000;
    display: none;
    align-items: center;
    justify-content: center;
}

.hjr-lightbox.active {
    display: flex;
}

.hjr-lightbox-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.95);
    cursor: pointer;
}

.hjr-lightbox-content {
    position: relative;
    z-index: 10001;
    max-width: 90vw;
    max-height: 90vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

.hjr-lightbox-image-container {
    position: relative;
    max-width: 100%;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.hjr-lightbox-image {
    max-width: 100%;
    max-height: 80vh;
    object-fit: contain;
    border-radius: 8px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}

.hjr-lightbox-caption {
    color: white;
    font-size: 16px;
    margin-top: 15px;
    text-align: center;
    max-width: 600px;
    line-height: 1.5;
}

.hjr-lightbox-counter {
    position: absolute;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    color: white;
    font-size: 14px;
    background: rgba(0, 0, 0, 0.5);
    padding: 8px 16px;
    border-radius: 20px;
    font-weight: 500;
}

/* Lightbox Controls */
.hjr-lightbox-close {
    position: absolute;
    top: 20px;
    right: 20px;
    background: rgba(255, 255, 255, 0.1);
    border: 2px solid white;
    color: white;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    font-size: 32px;
    line-height: 1;
    cursor: pointer;
    transition: all 0.3s ease;
    z-index: 10002;
}

.hjr-lightbox-close:hover {
    background: white;
    color: #003d5c;
    transform: rotate(90deg);
}

.hjr-lightbox-prev,
.hjr-lightbox-next {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255, 255, 255, 0.1);
    border: 2px solid white;
    color: white;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    font-size: 32px;
    line-height: 1;
    cursor: pointer;
    transition: all 0.3s ease;
    z-index: 10002;
}

.hjr-lightbox-prev {
    left: 20px;
}

.hjr-lightbox-next {
    right: 20px;
}

.hjr-lightbox-prev:hover,
.hjr-lightbox-next:hover {
    background: white;
    color: #003d5c;
    transform: translateY(-50%) scale(1.1);
}

/* Responsive Design */
@media (max-width: 768px) {
    .gallery-grid {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
        gap: 15px;
    }

    .hjr-lightbox-image {
        max-height: 70vh;
    }

    .hjr-lightbox-caption {
        font-size: 14px;
        padding: 0 20px;
    }

    .hjr-lightbox-close,
    .hjr-lightbox-prev,
    .hjr-lightbox-next {
        width: 40px;
        height: 40px;
        font-size: 24px;
    }

    .hjr-lightbox-prev {
        left: 10px;
    }

    .hjr-lightbox-next {
        right: 10px;
    }

    .hjr-lightbox-counter {
        font-size: 12px;
        padding: 6px 12px;
    }
}

@media (max-width: 480px) {
    .gallery-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }

    .hjr-lightbox-content {
        max-width: 95vw;
        max-height: 95vh;
    }

    .hjr-lightbox-image {
        max-height: 60vh;
    }
}

/* Gallery Button */
.btn-gallery {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 15px 30px;
    background: var(--gradient-ocean);
    color: white;
    border: none;
    border-radius: 50px;
    font-size: 16px;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 10px 30px rgba(0, 212, 170, 0.3);
}

.btn-gallery:hover {
    transform: translateY(-3px);
    box-shadow: 0 15px 40px rgba(0, 212, 170, 0.4);
}

.btn-gallery::before {
    content: "📷";
    font-size: 18px;
}
