/* frontend-gallery-styles.css */

/* Main gallery wrapper for full width */
.custom-gallery-wrapper {
    max-width: 100%; /* Ensure it takes full available width */
    margin: 20px auto; /* Center the wrapper and add some vertical space */
    padding: 0 15px; /* Add some padding on the sides for responsiveness */
    box-sizing: border-box; /* Include padding in the width calculation */
}

/* Grid container for the images */
.custom-gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    grid-auto-rows: minmax(250px, max-content);
    gap: 10px; /* Gap between grid items */
    justify-content: center;
    align-items: stretch;
}

/* Style for each gallery item (the <a> tag) */
.custom-gallery-grid .frontend-gallery-item {
    display: block;
    overflow: hidden;
    border-radius: 5px;
    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;
    line-height: 0;
}

.custom-gallery-grid .frontend-gallery-item:hover {
    transform: scale(1.02);
    box-shadow: 0 4px 10px rgba(0,0,0,0.2);
}

/* Style for the image itself within the gallery item */
.custom-gallery-grid .frontend-gallery-item img {
    width: 100%;
    height: 100%; /* Make image fill its container height (this is key for covering) */
    object-fit: cover; /* Crop image to cover the entire grid area while maintaining aspect ratio */
    display: block;
}

/* Style for the Load More button */
.load-more-gallery {
    display: block;
    margin: 30px auto;
    padding: 12px 25px;
    background: gold; /* Changed to golden color */
    color: #000; /* Black text for contrast */
    border: none;
    border-radius: 5px;
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
    transition: background-color 0.2s ease-in-out, transform 0.1s ease-in-out;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.load-more-gallery:hover {
    background-color: #e6b800; /* Slightly darker gold on hover */
    transform: translateY(-1px);
}

.load-more-gallery:disabled {
    background-color: #ccc;
    cursor: not-allowed;
    color: #666;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .custom-gallery-grid {
        grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
        grid-auto-rows: minmax(180px, max-content);
    }
}

@media (max-width: 480px) {
    .custom-gallery-wrapper {
        padding: 0 10px;
    }
    .custom-gallery-grid {
        grid-template-columns: 1fr;
        grid-auto-rows: minmax(150px, max-content);
    }
}