/* Gallery Specific Styles */
.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
    padding: 20px 0;
}

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

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

.gallery-item {
    position: relative;
    overflow: hidden;
    border-radius: 8px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
    cursor: pointer;
    background: #fff;
}

.gallery-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.2);
}

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

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

.gallery-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.gallery-item:hover .gallery-overlay {
    opacity: 1;
}

.gallery-overlay i {
    color: #fff;
    font-size: 40px;
}

.gallery-caption {
    padding: 15px;
    text-align: center;
    background: #fff;
}

.gallery-caption h4 {
    margin: 0 0 5px 0;
    font-size: 16px;
    font-weight: 600;
    color: #333;
}

.gallery-caption p {
    margin: 0;
    font-size: 13px;
    color: #666;
}

/* Lightbox Modal */
.lightbox-modal {
    display: none;
    position: fixed;
    z-index: 9999;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.95);
    animation: fadeIn 0.3s ease;
    align-items: center;
    justify-content: center;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.lightbox-content {
    position: relative;
    width: 95%;
    max-width: 1800px;
    height: 95vh;
    margin: 2.5vh auto;
    display: flex;
    align-items: center;
    justify-content: center;
}

.lightbox-content img {
    max-width: 100%;
    max-height: 100%;
    width: auto;
    height: auto;
    min-width: 50vw;
    min-height: 50vh;
    object-fit: contain;
    box-shadow: 0 0 40px rgba(255, 255, 255, 0.3);
    border-radius: 4px;
}

@media (max-width: 768px) {
    .lightbox-content { width: 98%; height: 90vh; }
    .lightbox-content img { min-width: 80vw; min-height: 40vh; }
}

.lightbox-close { position: absolute; top: 20px; right: 40px; color: #fff; font-size: 40px; font-weight: bold; cursor: pointer; z-index: 10000; transition: color 0.3s; background: rgba(0, 0, 0, 0.5); width: 50px; height: 50px; border-radius: 50%; display: flex; align-items: center; justify-content: center; line-height: 1; }
.lightbox-close:hover { color: #ccc; background: rgba(0, 0, 0, 0.8); }
.lightbox-prev, .lightbox-next { position: absolute; top: 50%; transform: translateY(-50%); color: #fff; font-size: 40px; cursor: pointer; padding: 20px; user-select: none; transition: all 0.3s; background: rgba(0, 0, 0, 0.5); border-radius: 4px; }
.lightbox-prev:hover, .lightbox-next:hover { color: #ccc; background: rgba(0, 0, 0, 0.8); }
.lightbox-prev { left: 20px; }
.lightbox-next { right: 20px; }
.lightbox-caption { position: absolute; bottom: 20px; left: 50%; transform: translateX(-50%); color: #fff; text-align: center; background: rgba(0, 0, 0, 0.8); padding: 15px 30px; border-radius: 8px; max-width: 80%; backdrop-filter: blur(10px); }
.lightbox-caption h4 { margin: 0 0 5px 0; font-size: 18px; color: #fff; }
.lightbox-caption p { margin: 0; font-size: 14px; color: #ddd; }

/* Gallery Filters */
.gallery-filters { text-align: center; margin-bottom: 30px; }
.gallery-filters ul { list-style: none; padding: 0; margin: 0; display: inline-block; }
.gallery-filters ul li { display: inline-block; margin: 0 3px; }
.gallery-filters ul li a { display: block; padding: 8px 18px; border: 1px solid #ddd; color: #333; text-decoration: none; font-size: 13px; font-weight: 600; text-transform: uppercase; transition: all 0.3s ease; border-radius: 3px; background: #fff; }
.gallery-filters ul li a:hover { background: #f5f5f5; border-color: #ccc; color: #000; }
.gallery-filters ul li.active a { background: #d32f2f; border-color: #d32f2f; color: #fff; }

/* Override theme switcher color underline (e.g., color5 green) for gallery pagination */
.gallery-filters .pagination > .active > a,
.gallery-filters .pagination > .active > span,
.gallery-filters .pagination > .active > a:hover,
.gallery-filters .pagination > .active > span:hover,
.gallery-filters .pagination > .active > a:focus,
.gallery-filters .pagination > .active > span:focus,
.gallery-filters .pagination > li > a:hover,
.gallery-filters .pagination > li > span:hover,
.gallery-filters .pagination > li > a:focus,
.gallery-filters .pagination > li > span:focus {
    box-shadow: 0 3px 0 0 #d32f2f !important;
}

@media (max-width: 768px) {
    .gallery-filters ul li { margin: 3px; }
    .gallery-filters ul li a { padding: 6px 12px; font-size: 11px; }
    .lightbox-prev, .lightbox-next { font-size: 30px; padding: 15px; }
    .lightbox-close { width: 40px; height: 40px; font-size: 30px; top: 10px; right: 10px; }
}

.header-container-padding { padding-right: 90px; padding-left: 90px; }
@media (max-width: 768px) { .header-container-padding { padding-right: 15px; padding-left: 15px; } }

/* End of gallery.css */

/* Page-specific button (Load More) styling for gallery page */
.page-gallery .btn-success,
.page-gallery .btn-success.btn-effect {
    background-color: #d32f2f !important;
    border-color: #d32f2f !important;
    box-shadow: 5px 0 0 0 #d32f2f !important; /* replaces the green wedge */
}
.page-gallery .btn-success:hover,
.page-gallery .btn-success:focus,
.page-gallery .btn-success:active {
    background-color: #c82333 !important;
    border-color: #c82333 !important;
    box-shadow: 5px 0 0 0 #c82333 !important;
}

/* Keep the 'btn-effect' pseudo-element consistent with the red theme (if used) */
.page-gallery .btn-effect:after { background-color: rgba(0,0,0,0.08); }

