/* ============================================
   GALLERY SECTION STYLES - MASONRY LAYOUT
   ============================================ */

.gallery-section {
    position: relative;
    width: 100%;
    padding: 100px 0;
    background: #f8f9fa;
    overflow: hidden;
}

.gallery-section .section-title {
    margin-bottom: 60px;
}

.gallery-section .section-headline {
    text-align: center;
    margin: 0 auto;
    max-width: 880px;
    padding: 0 24px;
}

.gallery-section .headline-eyebrow {
    display: inline-block;
    padding: 6px 16px;
    border-radius: 999px;
    background: rgba(233, 60, 26, 0.12);
    color: #e93c1a;
    font-size: 14px;
    font-weight: 600;
    letter-spacing: 0.24em;
    text-transform: uppercase;
}

.gallery-section .headline-title {
    margin-top: 20px;
    margin-bottom: 24px;
    font-family: 'GmarketSans', 'Pretendard', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    font-size: 40px;
    font-weight: 600;
    line-height: 1.15;
    letter-spacing: -0.5px;
    color: #222;
}

.gallery-section .headline-title .headline-accent {
    display: inline-block;
    color: #e93c1a;
    border-bottom: 6px solid #e93c1a;
    padding-bottom: 6px;
}

.gallery-section .headline-lead {
    margin-bottom: 18px;
    font-size: 20px;
    font-weight: 500;
    line-height: 1.6;
    color: #404040;
}

.gallery-section .headline-desc {
    margin-bottom: 0;
    font-size: 18px;
    line-height: 1.7;
    color: #626262;
}

/* Gallery Masonry Layout - PC */
.gallery-masonry {
    display: flex;
    width: calc(100% - 100px);
    height: 675px;
    margin: 0 50px;
    gap: 1px;
    background: #f8f9fa;
}

/* Gallery Items - PC */
.gallery-item {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    cursor: pointer;
}

/* Gallery Item Images */
.gallery-item img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    transition: transform 0.5s ease;
    z-index: 1;
}

/* 호버 시 이미지 확대 */
.gallery-item:hover img {
    transform: scale(1.1);
}

/* Large Items (Full Height) - PC에서 450px 고정 */
.gallery-item.large {
    width: 450px;
    height: 100%;
    flex-shrink: 0;
}

/* Medium Items (Half Height) */
.gallery-item.medium {
    width: 100%;
    height: calc(50% - 0.5px);
}

/* Small Items (Quarter Height) */
.gallery-item.small {
    width: calc(50% - 0.5px);
    height: 100%;
}

/* Gallery Columns */
.gallery-column {
    display: flex;
    flex-direction: column;
    gap: 1px;
    height: 100%;
    flex: 1;
}

.center-left {
    flex: 1;
}

.center-right {
    flex: 1;
}

/* Gallery Item Row */
.gallery-item-row {
    display: flex;
    gap: 1px;
    height: calc(50% - 0.5px);
    width: 100%;
}

/* Theme Colors */
.taste-theme {
    background: #d4a5a5; /* Dusty rose/taupe */
}

.green-theme {
    background: #9db299; /* Sage/moss green */
}

.blue-theme {
    background: #4a90e2; /* Royal blue */
}

.orange-theme {
    background: #e67e22; /* Burnt orange */
}

.dark-green-theme {
    background: #2d5016; /* Dark forest green */
}

.beige-theme {
    background: #f5e6d3; /* Light tan/beige */
}

.magenta-theme {
    background: #e91e63; /* Vibrant magenta/fuchsia */
}

.teal-theme {
    background: #26c6da; /* Bright teal/cyan */
}

/* Gallery Overlay */
.gallery-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
    transition: all 0.3s ease;
}

/* Gallery Text - 단일 텍스트 컨테이너 */
.gallery-text {
    text-align: center;
    color: #fff;
    padding: 20px;
    opacity: 1;
    transition: opacity 0.2s ease;
}

.gallery-text h3 {
    font-size: 32px;
    font-weight: 700;
    margin-bottom: 8px;
    font-family: 'GmarketSans', sans-serif;
    color: #fff;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
}

.gallery-text p {
    font-size: 16px;
    margin-bottom: 0;
    font-family: 'GmarketSans', sans-serif;
    color: #fff;
    font-weight: 500;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.3);
    line-height: 1.4;
}

/* JavaScript가 제어하는 호버 효과 */
.gallery-overlay.hover-active {
    background: rgba(0, 0, 0, 0.2);
}

/* ============================================
   MOBILE RESPONSIVE STYLES - COMPLETELY NEW
   ============================================ */

@media (max-width: 750px) {
    .gallery-section {
        padding: 60px 0;
    }
    
    .gallery-section .section-title {
        margin-bottom: 40px;
    }

    .gallery-section .section-headline {
        padding: 0 18px;
    }
    
    .gallery-section .headline-title {
        font-size: 32px;
    }

    .gallery-section .headline-lead,
    .gallery-section .headline-desc {
        font-size: 16px;
    }
    
    /* 모바일에서 완전히 새로운 구조 */
    .gallery-masonry {
        width: calc(100% - 40px);
        margin: 0 20px;
        height: auto;
        flex-direction: column;
        gap: 3px;
    }
    
    /* 큰 블록들 - 모바일에서 100% 너비 */
    .gallery-item.large {
        width: 100% !important;
        height: 250px !important;
        flex-shrink: 0 !important;
        order: 1; /* 첫 번째 큰 블록 */
    }
    
    .gallery-item.large.teal-theme {
        order: 9; /* 마지막 큰 블록 */
    }
    
    /* 중간 컬럼들 - 모바일에서 개별 블록으로 변환 */
    .gallery-column {
        width: 100% !important;
        height: auto !important;
        flex-direction: column !important;
        gap: 3px !important;
        order: 2; /* 중간에 배치 */
    }
    
    .center-right {
        order: 3;
    }
    
    /* 중간 블록들 */
    .gallery-item.medium {
        width: 100% !important;
        height: 200px !important;
        order: 1;
    }
    
    /* 작은 블록들 행 - 모바일에서 가로로 배치 */
    .gallery-item-row {
        width: 100% !important;
        height: 150px !important;
        flex-direction: row !important;
        gap: 3px !important;
        order: 2;
    }
    
    /* 작은 블록들 */
    .gallery-item.small {
        width: calc(50% - 1.5px) !important;
        height: 100% !important;
    }
    
    /* 텍스트 크기 조정 */
    .gallery-text h3 {
        font-size: 24px;
    }
    
    .gallery-text p {
        font-size: 14px;
    }
}

@media (max-width: 480px) {
    .gallery-section {
        padding: 40px 0;
    }

    .gallery-section .section-headline {
        padding: 0 16px;
    }
    
    .gallery-section .headline-title {
        font-size: 28px;
    }

    .gallery-section .headline-lead,
    .gallery-section .headline-desc {
        font-size: 15px;
    }
    
    .gallery-masonry {
        width: calc(100% - 20px);
        margin: 0 10px;
        gap: 2px;
    }
    
    .gallery-item.large {
        height: 250px !important;
    }
    
    .gallery-item.medium {
        height: 200px !important;
    }
    
    .gallery-item-row {
        height: 120px !important;
        gap: 2px !important;
    }
    
    .gallery-item.small {
        width: calc(50% - 1px) !important;
    }
    
    .gallery-text h3 {
        font-size: 20px;
    }
    
    .gallery-text p {
        font-size: 12px;
    }
}

@media (max-width: 320px) {
    .gallery-section .section-headline {
        padding: 0 14px;
    }

    .gallery-section .headline-title {
        font-size: 24px;
    }

    .gallery-section .headline-lead,
    .gallery-section .headline-desc {
        font-size: 14px;
    }
    
    .gallery-item.large {
        height: 250px !important;
    }
    
    .gallery-item.medium {
        height: 200px !important;
    }
    
    .gallery-item-row {
        height: 100px !important;
        gap: 1px !important;
    }
    
    .gallery-item.small {
        width: calc(50% - 0.5px) !important;
    }
    
    .gallery-text h3 {
        font-size: 18px;
    }
    
    .gallery-text p {
        font-size: 11px;
    }
}