/* style for index.php */

/* Basic Reset & Body Styling */
body {
    margin: 0;
    font-family: Arial, sans-serif;
    background-color: #f0f0f0;
    color: #333;
}

/* Main Content Area */
main {
    /* Removed max-width to allow full screen width */
    margin: 0; /* Adjust margin for full width */
    padding: 0; /* Adjust padding for full width */
}

/* Gallery Grid Layout */
#gallery-grid {
    display: grid;
    /* Default to 1 column for very small screens, or if no media query matches */
    grid-template-columns: repeat(1, 1fr);
    gap: 1rem; /* Space between grid items */
    padding: 1rem; /* Add padding to the grid itself */
}

/* Breakpoints for responsive columns */
/* Mobile (e.g., up to 576px) - 1 column */
@media (min-width: 576px) {
    #gallery-grid {
        grid-template-columns: repeat(2, 1fr); /* 2 columns for small tablets/landscape phones */
    }
}

/* Tablet (e.g., up to 768px) - 3 columns */
@media (min-width: 768px) {
    #gallery-grid {
        grid-template-columns: repeat(3, 1fr); /* 3 columns for tablets */
    }
}

/* Desktop (e.g., 992px and up) - 4 columns */
@media (min-width: 992px) {
    #gallery-grid {
        grid-template-columns: repeat(4, 1fr); /* 4 columns for desktop */
    }
}

/* Individual Gallery Item Styling */
.gallery-item {
    display: block; /* Ensure the anchor takes up full space */
    overflow: hidden; /* Hide parts of the image that go beyond the square */
    border: 1px solid #ddd;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    transition: transform 0.2s ease-in-out, box-shadow 0.2s ease-in-out;
}

.gallery-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.2);
}

.gallery-item img {
    width: 100%;
    height: 100%;
    object-fit: cover; /* Ensures images cover the area without distortion */
    aspect-ratio: 1 / 1; /* Forces the image container to be square */
    display: block; /* Remove extra space below image */
}

/* Footer Styling (Optional) */
footer {
    text-align: center;
    padding: 20px;
    margin-top: 40px;
    background-color: #eee;
    color: #666;
    font-size: 0.9em;
}

/* Lightbox Styling */
#lightbox {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.8); /* Dark overlay */
    z-index: 1000; /* Ensure it's on top of everything */
    display: flex;
    justify-content: center;
    align-items: center;
    flex-direction: column; /* Stack image and caption vertically */
}

/* Class to hide the lightbox initially */
#lightbox.hidden {
    display: none;
}

/* Lightbox Image */
#lightbox-img {
    max-width: 90%; /* Max width of the image within the lightbox */
    max-height: 80%; /* Max height, leaving space for caption/buttons */
    object-fit: contain; /* Ensures the entire image is visible, scales down if needed */
    transition: opacity 0.3s ease-in-out; /* Subtle fade transition for image changes */
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.5); /* Subtle shadow for depth */
}

/* Lightbox Caption */
#lightbox-caption {
    color: #fff;
    margin-top: 10px;
    font-size: 1.2em;
    text-align: center;
    max-width: 80%;
    padding: 0 20px; /* Add some padding for readability */
}

/* Lightbox Buttons (Close, Prev, Next) */
#lightbox-close,
#lightbox-prev,
#lightbox-next {
    position: absolute;
    background: rgba(0, 0, 0, 0.5);
    color: #fff;
    border: none;
    padding: 10px 15px;
    font-size: 1.5em;
    cursor: pointer;
    z-index: 1001; /* Ensure buttons are above the image */
    transition: background-color 0.2s ease;
}

#lightbox-close:hover,
#lightbox-prev:hover,
#lightbox-next:hover {
    background-color: rgba(0, 0, 0, 0.8);
}

#lightbox-close { top: 20px; right: 20px; border-radius: 50%; width: 40px; height: 40px; display: flex; justify-content: center; align-items: center; font-size: 1.8em; line-height: 1; }
#lightbox-prev { left: 20px; border-radius: 5px; }
#lightbox-next { right: 20px; border-radius: 5px; }

/* Lightbox Toggle Raw Button */
#lightbox-toggle-raw {
    position: absolute;
    bottom: 20px;
    left: calc(50% - 70px);
    transform: translateX(-50%);
    padding: 8px 15px;
    font-size: 1em;
    border-radius: 5px;
}

#lightbox-autoplay {
    position: absolute;
    bottom: 20px;
    left: calc(50% + 70px);
    transform: translateX(-50%);
    padding: 8px 15px;
    font-size: 1em;
    border-radius: 5px;
    background: rgba(0, 0, 0, 0.5);
    color: #fff;
    border: none;
    cursor: pointer;
}
#lightbox-next { right: 20px; border-radius: 5px; }
