/* Simple Gallery Block - Clean Layout */

.section-gallery {
    padding: 80px 0;
    background-color: #fff;
    position: relative;
}

.etsmp-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Header Section: Title on left, text below */
.gallery-header {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 60px;
    margin-bottom: 60px;
    align-items: start;
}

.gallery-title-side {
    position: relative;
}

.gallery-title {
    font-size: 48px;
    font-weight: 700;
    line-height: 1.2;
    margin: 0;
    color: #002f5d;
    position: relative;
}

.gallery-title::after {
    content: '';
    position: absolute;
    bottom: -15px;
    left: 0;
    width: 80px;
    height: 4px;
    background: linear-gradient(90deg, #fbcc6c 0%, #ff6b35 100%);
}

.gallery-text-side {
    padding-top: 20px;
}

.gallery-text {
    font-size: 18px;
    line-height: 1.7;
    color: #666;
    margin: 0;
}

/* Gallery Grid - Masonry Style */
.gallery-grid-container {
    margin-top: 40px;
}

.gallery-grid {
    display: grid;
    gap: 20px;
    width: 100%;
}

/* Column layouts */
.gallery-grid.columns-2 {
    grid-template-columns: repeat(2, 1fr);
}

.gallery-grid.columns-3 {
    grid-template-columns: repeat(3, 1fr);
}

.gallery-grid.columns-4 {
    grid-template-columns: repeat(4, 1fr);
}

/* Gallery Items - Masonry Style */
.gallery-item {
    position: relative;
    overflow: hidden;
    border-radius: 8px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
    break-inside: avoid;
    margin-bottom: 20px;
}

/* Remove fixed aspect ratio for masonry */
.gallery-item:nth-child(odd) {
    grid-row: span 1;
}

.gallery-item:nth-child(even) {
    grid-row: span 1;
}

/* Specific masonry positioning for different column layouts */
.gallery-grid.columns-3 .gallery-item:nth-child(3n+1) {
    grid-row: span 1;
}

.gallery-grid.columns-3 .gallery-item:nth-child(3n+2) {
    grid-row: span 1;
}

.gallery-grid.columns-3 .gallery-item:nth-child(3n+3) {
    grid-row: span 1;
}

.gallery-grid.columns-4 .gallery-item:nth-child(4n+1) {
    grid-row: span 1;
}

.gallery-grid.columns-4 .gallery-item:nth-child(4n+2) {
    grid-row: span 1;
}

.gallery-grid.columns-4 .gallery-item:nth-child(4n+3) {
    grid-row: span 1;
}

.gallery-grid.columns-4 .gallery-item:nth-child(4n+4) {
    grid-row: span 1;
}

.gallery-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

.gallery-image-wrapper {
    position: relative;
    width: 100%;
    height: 100%;
    overflow: hidden;
}

.gallery-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: all 0.3s ease;
    display: block;
}

.gallery-item:hover .gallery-image {
    transform: scale(1.05);
}

/* Gallery Overlay */
.gallery-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 47, 93, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: all 0.3s ease;
}

.gallery-item:hover .gallery-overlay {
    opacity: 1;
}

.gallery-overlay-icon {
    width: 60px;
    height: 60px;
    background: rgba(255, 255, 255, 0.9);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.gallery-overlay-icon svg {
    width: 28px;
    height: 28px;
    color: #002f5d;
}

.gallery-item:hover .gallery-overlay-icon {
    transform: scale(1.1);
    background: #fbcc6c;
}

.gallery-item:hover .gallery-overlay-icon svg {
    color: #002f5d;
}

/* Gallery Links */
.gallery-link {
    display: block;
    width: 100%;
    height: 100%;
    text-decoration: none;
    color: inherit;
}

/* Responsive Design */
@media (max-width: 991px) {
    .gallery-header {
        grid-template-columns: 1fr;
        gap: 40px;
        margin-bottom: 50px;
    }
    
    .gallery-title {
        font-size: 40px;
    }
    
    .gallery-text {
        font-size: 16px;
    }
}

@media (max-width: 768px) {
    .section-gallery {
        padding: 60px 0;
    }
    
    .gallery-header {
        gap: 30px;
        margin-bottom: 40px;
    }
    
    .gallery-title {
        font-size: 36px;
    }
    
    .gallery-grid.columns-3,
    .gallery-grid.columns-4 {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .gallery-grid {
        gap: 15px;
    }
}

@media (max-width: 576px) {
    .section-gallery {
        padding: 40px 0;
    }
    
    .gallery-header {
        gap: 25px;
        margin-bottom: 30px;
    }
    
    .gallery-title {
        font-size: 28px;
    }
    
    .gallery-text {
        font-size: 15px;
    }
    
    .gallery-grid.columns-2,
    .gallery-grid.columns-3,
    .gallery-grid.columns-4 {
        grid-template-columns: 1fr;
    }
    
    .gallery-grid {
        gap: 12px;
    }
}

/* Accessibility */
@media (prefers-reduced-motion: reduce) {
    .gallery-item,
    .gallery-image,
    .gallery-overlay,
    .gallery-overlay-icon {
        transition: none;
    }
    
    .gallery-item:hover {
        transform: none;
    }
    
    .gallery-item:hover .gallery-image {
        transform: none;
    }
}

/* Lightbox Styles */
.gallery-lightbox {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 9999;
    display: none;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.gallery-lightbox.active {
    display: flex;
    opacity: 1;
}

.lightbox-backdrop {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
    cursor: pointer;
}

.lightbox-container {
    position: relative;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    z-index: 1;
}

.lightbox-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    color: white;
    background: rgba(0, 0, 0, 0.5);
}

.lightbox-counter {
    font-size: 16px;
    font-weight: 500;
}

.lightbox-close {
    background: none;
    border: none;
    color: white;
    cursor: pointer;
    padding: 8px;
    border-radius: 50%;
    transition: background 0.3s ease;
}

.lightbox-close:hover {
    background: rgba(255, 255, 255, 0.2);
}

.lightbox-close svg {
    width: 24px;
    height: 24px;
}

.lightbox-content {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.lightbox-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255, 255, 255, 0.1);
    border: none;
    color: white;
    cursor: pointer;
    padding: 16px 12px;
    border-radius: 50%;
    transition: all 0.3s ease;
    z-index: 2;
}

.lightbox-nav:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: translateY(-50%) scale(1.1);
}

.lightbox-nav.lightbox-prev {
    left: 20px;
}

.lightbox-nav.lightbox-next {
    right: 20px;
}

.lightbox-nav svg {
    width: 24px;
    height: 24px;
}

.lightbox-image-container {
    text-align: center;
    max-width: 90%;
    max-height: 90%;
}

.lightbox-image {
    max-width: 100%;
    max-height: 80vh;
    object-fit: contain;
    border-radius: 8px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
}

.lightbox-caption {
    margin-top: 20px;
    color: white;
    font-size: 18px;
    font-weight: 500;
    text-align: center;
}

/* Make gallery items clickable */
.gallery-item {
    cursor: pointer;
}

/* Focus States */
.gallery-item:focus {
    outline: 3px solid #fbcc6c;
    outline-offset: 2px;
}

/* Print Styles */
@media print {
    .gallery-overlay {
        display: none;
    }
    
    .gallery-item {
        break-inside: avoid;
        box-shadow: none;
        border: 1px solid #ccc;
    }
    
    .gallery-lightbox {
        display: none !important;
    }
}