/**
 * Plugin Name: My Custom Photo Gallery
 * Author: Staphon Arnold
 */

/* --- Gallery Grid Layout (Masonry Columns) --- */
.masonry-grid {
    column-count: 3; /* Create 3 columns */
    column-gap: 1rem; /* Adjust space between columns */
    max-width: 1200px;
    margin: 2rem auto;
}

/* New style for the primary image to make it span the full width of the grid */
.masonry-grid .primary-image {
    column-span: all;
    margin-bottom: 1rem;
}

.masonry-grid .grid-item {
    display: inline-block; /* Essential for the column layout to work */
    width: 100%;
    margin-bottom: 1rem; /* Space between rows */
    overflow: hidden;
    border-radius: 0.5rem;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    transition: transform 0.2s ease-in-out;
    cursor: pointer;
}

.masonry-grid .grid-item:hover {
    transform: translateY(-5px);
}

.masonry-grid .grid-item img {
    width: 100%;
    height: auto;
    display: block;
    object-fit: cover;
    opacity: 0; /* Start with opacity 0 for the fade-in effect */
    animation: fadeIn 0.8s ease-in-out forwards;
    transition: transform 0.3s ease-in-out;
}

/* --- Fade-in Animation --- */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* --- Lightbox/Spotlight View --- */
#lightbox-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.9);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 10000; /* Updated z-index */
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s, visibility 0.3s;
}

#lightbox-overlay.visible {
    opacity: 1;
    visibility: visible;
}

.lightbox-content {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 90%; /* Let's allow it to take up a significant portion of the screen */
    height: 90%;
    padding: 2rem;
}

.lightbox-image-wrapper {
    position: relative;
    max-width: 100%;
    max-height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
}

.lightbox-image-wrapper img {
    /* Corrected styles to allow full image display */
    max-width: 100%;
    max-height: 100%;
    width: auto;
    height: auto;
    object-fit: contain;
    border-radius: 0.5rem;
}

.lightbox-controls {
    position: absolute;
    top: 50%;
    width: 98%;
    display: flex;
    justify-content: space-between;
    transform: translateY(-50%);
    padding: 0 5px;
}

.lightbox-controls .nav-button,
.lightbox-close {
    background: none;
    border: none;
    color: white;
    font-size: 2rem;
    cursor: pointer;
    background-color: rgba(0, 0, 0, 0.5);
    border-radius: 50%;
    width: 40px;
    height: 40px;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: background-color 0.2s;
}

.lightbox-controls .nav-button:hover,
.lightbox-close:hover {
    background-color: rgba(0, 0, 0, 0.7);
}

.lightbox-close {
    position: absolute;
    top: -1rem; /* Positioning relative to the image wrapper */
    right: -1rem; /* Positioning relative to the image wrapper */
    font-size: 1.5rem;
}

@media (max-width: 600px) {
    .masonry-grid {
        column-count: 1;
        padding: 0 10px;
    }
    .lightbox-controls .nav-button {
        font-size: 1.5rem;
        width: 30px;
        height: 30px;
    }
}
