/**
 * Gallery Section Block Styles
 * 
 * Colors:
 * - Primary Green: #006a3c
 * - White: #ffffff
 * - Dark Green (Active): #004d2a
 * - Text Dark: #252525
 * - Border/Overlay: rgba(0, 0, 0, 0.7)
 * 
 * Fonts:
 * - Roboto Bold
 * - Roboto Regular
 */

/* ============================================
   Block Container
   ============================================ */
.gallery-section-block {
    padding: 80px 0;
    background-color: var(--white, #ffffff);
    width: 100%;
}

.gs-container {
    max-width: var(--theme-normal-container-max-width, 1290px);
    width: var(--theme-container-width, 100%);
    margin: 0 auto;
    padding: 0 20px;
}

/* ============================================
   Section Title
   ============================================ */
.gs-section-title {
    font-family: 'Roboto', sans-serif;
    font-weight: 700;
    font-size: 48px;
    line-height: 1.2;
    color: #252525;
    text-align: center;
    margin: 0 0 50px 0;
}

/* ============================================
   Category Filter Tabs
   ============================================ */
.gs-category-filters {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 15px;
    margin-bottom: 50px;
}

.gs-filter-btn {
    font-family: 'Roboto', sans-serif;
    font-weight: 600;
    font-size: 16px;
    line-height: 1.4;
    color: #252525;
    background-color: #ffffff;
    border: none;
    border-radius: 25px;
    padding: 5px 10px;
    cursor: pointer;
    transition: all 0.3s ease;
    white-space: nowrap;
}

.gs-filter-btn:hover {
    background-color: #006a3c;
    color: #ffffff;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

.gs-filter-btn.active {
    background-color: #006a3c;
    color: #ffffff;
    font-weight: 700;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

.gs-filter-btn:focus {
    outline: 2px solid #006a3c;
    outline-offset: 2px;
}

/* ============================================
   Gallery Grid
   ============================================ */
.gs-gallery-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
    margin-bottom: 0;
}

.gs-gallery-item {
    position: relative;
    overflow: hidden;
    cursor: pointer;
    transition: transform 0.3s ease, opacity 0.3s ease;
    background-color: #f5f5f5;
}

.gs-gallery-item.hidden {
    display: none;
}

.gs-gallery-item:hover {
    transform: scale(1.05);
    z-index: 1;
}

.gs-image-wrapper {
    position: relative;
    width: 100%;
    padding-bottom: 75%; /* 4:3 aspect ratio */
    overflow: hidden;
}

.gs-image-wrapper img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

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

/* Image Overlay (for titles) */
.gs-image-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.8) 0%, rgba(0, 0, 0, 0) 100%);
    padding: 15px;
    opacity: 0;
    transition: opacity 0.3s ease;
}

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

.gs-image-title {
    font-family: 'Roboto', sans-serif;
    font-weight: 700;
    font-size: 16px;
    line-height: 1.3;
    color: #ffffff;
    display: block;
}

/* ============================================
   Load More Button
   ============================================ */
.gs-load-more-wrapper {
    text-align: center;
    margin-top: 40px;
    margin-bottom: 20px;
}

.gs-load-more-btn {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    font-family: 'Roboto', sans-serif;
    font-weight: 700;
    font-size: 16px;
    line-height: 1.4;
    color: #ffffff;
    background-color: #006a3c;
    border: none;
    padding: 14px 14px;
    cursor: pointer;
    transition: all 0.3s ease;
    width: auto;
}

.gs-load-more-btn:hover {
    background-color: #f7b119;
    transform: translateY(-2px);
}

.gs-load-more-btn-icon {
    display: inline-flex;
    align-items: center;
    flex-shrink: 0;
}

.gs-load-more-btn-icon svg {
    width: 16px;
    height: 16px;
    display: block;
}

.gs-load-more-btn:active {
    transform: translateY(0);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}
/*
.gs-load-more-btn:focus {
    outline: 2px solid #006a3c;
    outline-offset: 2px;
}
*/

/* ============================================
   Lightbox Modal
   ============================================ */
.gs-lightbox {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
}

.gs-lightbox-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.9);
}

.gs-lightbox-content {
    position: relative;
    z-index: 10000;
    max-width: 90%;
    max-height: 90vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

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

.gs-lightbox-image {
    max-width: 100%;
    max-height: 80vh;
    object-fit: contain;
    border-radius: 4px;
}

.gs-lightbox-caption {
    font-family: 'Roboto', sans-serif;
    font-weight: 400;
    font-size: 18px;
    line-height: 1.4;
    color: #ffffff;
    text-align: center;
    margin-top: 20px;
    padding: 0 20px;
}

/* Lightbox Controls */
.gs-lightbox-close,
.gs-lightbox-prev,
.gs-lightbox-next {
    position: absolute;
    background-color: rgba(0, 0, 0, 0.6);
    color: #ffffff;
    border: 2px solid rgba(255, 255, 255, 0.3);
    font-size: 32px;
    line-height: 1;
    padding: 10px;
    cursor: pointer;
    transition: all 0.3s ease;
    z-index: 10001;
    border-radius: 4px;
}

.gs-lightbox-close:hover,
.gs-lightbox-prev:hover,
.gs-lightbox-next:hover {
    background-color: rgba(0, 106, 60, 0.8);
    border-color: rgba(255, 255, 255, 0.6);
    transform: scale(1.1);
}

.gs-lightbox-close {
    top: 20px;
    right: 20px;
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.gs-lightbox-prev {
    left: 20px;
    top: 50%;
    transform: translateY(-50%);
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.gs-lightbox-next {
    right: 20px;
    top: 50%;
    transform: translateY(-50%);
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.gs-lightbox-prev:hover,
.gs-lightbox-next:hover {
    transform: translateY(-50%) scale(1.1);
}

/* ============================================
   Responsive Design
   ============================================ */

/* Large Tablets and Desktop */
@media (max-width: 1200px) {
    .gs-container {
        max-width: 960px;
    }
    
    .gs-gallery-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 18px;
    }
}

/* Tablet */
@media (max-width: 992px) {
    .gallery-section-block {
        padding: 60px 0;
    }
    
    .gs-section-title {
        font-size: 40px;
        margin-bottom: 40px;
    }
    
    .gs-category-filters {
        gap: 12px;
        margin-bottom: 40px;
    }
    
    .gs-filter-btn {
        font-size: 15px;
        padding: 10px 24px;
    }
    
    .gs-gallery-grid {
        gap: 16px;
    }
    
    .gs-load-more-btn {
        font-size: 15px;
        padding: 11px 36px;
    }
}

/* Small Tablets */
@media (max-width: 768px) {
    .gallery-section-block {
        padding: 50px 0;
        padding-top: 10px;
    }

    .gs-container {
        padding: 0;
    }
    
    .gs-section-title {
        font-size: 36px;
        margin-bottom: 35px;
    }
    
    .gs-category-filters {
        gap: 10px;
        margin-bottom: 35px;
    }
    
    .gs-filter-btn {
        font-size: 14px;
        padding: 10px 20px;
    }
    
    .gs-gallery-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 15px;
        margin-bottom: 35px;
    }
    
    .gs-image-title {
        font-size: 14px;
    }
    
    .gs-load-more-wrapper {
        margin-top: 35px;
    }
    
    .gs-load-more-btn {
        font-size: 14px;
        padding: 10px 32px;
        min-width: 160px;
    }
    
    .gs-lightbox-close,
    .gs-lightbox-prev,
    .gs-lightbox-next {
        width: 40px;
        height: 40px;
        font-size: 24px;
    }
    
    .gs-lightbox-close {
        top: 10px;
        right: 10px;
    }
    
    .gs-lightbox-prev {
        left: 10px;
    }
    
    .gs-lightbox-next {
        right: 10px;
    }
    
    .gs-lightbox-caption {
        font-size: 16px;
        margin-top: 15px;
    }
}

/* Mobile */
@media (max-width: 576px) {
    .gallery-section-block {
        padding: 0;
        padding-top: 0px;
        padding-bottom: 40px;
    }
    
    .gs-container {
        padding: 0;
    }
    
    .gs-section-title {
        font-size: 32px;
        margin-bottom: 30px;
    }
    
    .gs-category-filters {
        gap: 8px;
        margin-bottom: 30px;
    }
    
    .gs-filter-btn {
        font-size: 13px;
        padding: 8px 16px;
        border-radius: 20px;
    }
    
    .gs-gallery-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
        margin-bottom: 30px;
    }
    
    .gs-image-wrapper {
        padding-bottom: 100%; /* Square aspect ratio on mobile */
    }
    
    .gs-load-more-wrapper {
        margin-top: 30px;
    }
    
    .gs-load-more-btn {
        font-size: 14px;
        padding: 10px 28px;
        min-width: 140px;
    }
    
    .gs-lightbox-content {
        max-width: 95%;
    }
    
    .gs-lightbox-image {
        max-height: 70vh;
    }
    
    .gs-lightbox-caption {
        font-size: 14px;
        margin-top: 10px;
    }
}

/* Extra Small Mobile */
@media (max-width: 400px) {
    .gs-section-title {
        font-size: 28px;
    }
    
    .gs-filter-btn {
        font-size: 12px;
        padding: 7px 14px;
    }

    .gs-load-more-btn-icon svg {
        width: 14px;
        height: 14px;
    }
    
    .gs-gallery-grid {
        grid-template-columns: 1fr;
        gap: 10px;
    }
}

/* ============================================
   Gutenberg Editor Specific Styles
   ============================================ */
.block-editor-block-list__block[data-type="acf/gallery-section"] {
    margin: 20px 0;
}

.block-editor-block-list__block[data-type="acf/gallery-section"] .gallery-section-block {
    padding: 40px 0;
}

/* ============================================
   Alignment Support
   ============================================ */
.gallery-section-block.alignwide .gs-container {
    max-width: var(--theme-container-width, 1400px);
}

.gallery-section-block.alignfull {
    width: 100%;
    padding-left: 0;
    padding-right: 0;
}

.gallery-section-block.alignfull .gs-container {
    max-width: 100%;
    padding: 0 20px;
}

@media (max-width: 768px) {
    .gallery-section-block.alignfull .gs-container {
        padding: 0;
    }
}

@media (max-width: 576px) {
    .gallery-section-block.alignfull .gs-container {
        padding: 0;
    }
}

/* ============================================
   Accessibility
   ============================================ */
.gs-filter-btn:focus,
.gs-gallery-item:focus {
    outline: 2px solid #006a3c;
    outline-offset: 2px;
}

.gs-lightbox-close:focus,
.gs-lightbox-prev:focus,
.gs-lightbox-next:focus {
    outline: 2px solid #ffffff;
    outline-offset: 2px;
}

/* Ensure proper contrast for all text */
@media (prefers-contrast: high) {
    .gs-section-title {
        color: #000000;
    }
    
    .gs-filter-btn {
        border: 2px solid #000000;
    }
}

/* Respect reduced motion preferences */
@media (prefers-reduced-motion: reduce) {
    .gs-filter-btn,
    .gs-gallery-item,
    .gs-image-wrapper img,
    .gs-image-overlay,
    .gs-lightbox-close,
    .gs-lightbox-prev,
    .gs-lightbox-next {
        transition: none !important;
    }
    
    .gs-gallery-item:hover {
        transform: none !important;
    }
}

/* Prevent body scroll when lightbox is open */
body.gs-lightbox-open {
    overflow: hidden;
}

