/* 보도 자료 갤러리 스타일 */
.gallery {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
    max-width: 1200px;
    margin: 50px auto;
    padding: 0 20px;
}

.gallery-item {
    background: #fff;
    border: 1px solid #ddd;
    overflow: hidden;
    transition: all 0.3s ease;
    cursor: pointer;
    position: relative;
}

.gallery-item:hover {
    transform: translateY(-5px);
    border-color: #999;
}

.gallery-img {
    width: 100%;
    height: 200px;
    object-fit: cover;
    border-bottom: 1px solid #eee;
}

.gallery-text {
    padding: 20px;
}

.gallery-title {
    font-size: 16px;
    font-weight: 600;
    line-height: 1.4;
    margin: 0 0 10px 0;
    color: #333;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.gallery-text small {
    font-size: 13px;
    color: #666;
}

/* 모달 스타일 */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    justify-content: center;
    align-items: center;
    padding: 20px;
}

.modal-content {
    background: #fff;
    max-width: 600px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
    border: 1px solid #ddd;
    position: relative;
    animation: modalSlideIn 0.3s ease;
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translateY(-50px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.modal-content img {
    width: 100%;
    height: 250px;
    object-fit: cover;
}

.modal-content h2 {
    font-size: 20px;
    font-weight: 600;
    margin: 20px 20px 10px 20px;
    color: #333;
    line-height: 1.4;
}

.modal-content p {
    margin: 10px 20px;
    color: #666;
    line-height: 1.6;
}

.modal-content small {
    margin: 10px 20px;
    display: block;
    color: #999;
}

.modal-content a {
    color: #007BFF;
    text-decoration: none;
    margin: 10px 20px;
    display: inline-block;
    font-weight: 500;
}

.modal-content a:hover {
    text-decoration: underline;
}

.modal-close {
    position: absolute;
    top: 15px;
    right: 20px;
    background: rgba(0, 0, 0, 0.7);
    color: white;
    border: none;
    padding: 8px 12px;
    cursor: pointer;
    font-size: 12px;
    font-weight: 500;
    transition: background 0.3s ease;
}

.modal-close:hover {
    background: rgba(0, 0, 0, 0.9);
}

/* 반응형 디자인 */
@media (max-width: 768px) {
    .gallery {
        grid-template-columns: 1fr;
        gap: 20px;
        margin: 30px auto;
        padding: 0 15px;
    }
    
    .gallery-img {
        height: 180px;
    }
    
    .gallery-text {
        padding: 15px;
    }
    
    .gallery-title {
        font-size: 15px;
    }
    
    .modal-content {
        width: 95%;
        max-height: 85vh;
    }
    
    .modal-content img {
        height: 200px;
    }
    
    .modal-content h2 {
        font-size: 18px;
        margin: 15px 15px 10px 15px;
    }
    
    .modal-content p,
    .modal-content small,
    .modal-content a {
        margin-left: 15px;
        margin-right: 15px;
    }
    
    .modal-close {
        top: 10px;
        right: 15px;
        padding: 6px 10px;
        font-size: 11px;
    }
}

@media (max-width: 480px) {
    .gallery {
        margin: 20px auto;
        padding: 0 10px;
    }
    
    .gallery-text {
        padding: 12px;
    }
    
    .gallery-title {
        font-size: 14px;
    }
    
    .modal-content h2 {
        font-size: 16px;
    }
}

/* 로딩 상태 스타일 */
.gallery.loading {
    min-height: 200px;
    display: flex;
    justify-content: center;
    align-items: center;
}

.gallery.loading::after {
    content: "보도 자료를 불러오는 중...";
    color: #666;
    font-size: 16px;
}

/* 빈 상태 스타일 */
.gallery.empty {
    min-height: 200px;
    display: flex;
    justify-content: center;
    align-items: center;
}

.gallery.empty::after {
    content: "등록된 보도 자료가 없습니다.";
    color: #999;
    font-size: 16px;
}

/* YouTube 버튼 스타일 */
.youtube-btn {
    display: inline-flex;
    align-items: center;
    padding: 8px 12px;
    background-color: #FF0000;
    color: white;
    text-decoration: none;
    border-radius: 4px;
    font-size: 14px;
    font-weight: 500;
    margin-top: 10px;
    transition: background-color 0.3s ease;
}

.youtube-btn:hover {
    background-color: #CC0000;
}

.youtube-icon {
    width: 16px;
    height: 16px;
    margin-right: 6px;
    fill: white;
}

/* 행사 갤러리 스타일 */
#events-container .gallery {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 40px;
    max-width: 800px;
    margin: 50px auto;
    padding: 0 20px;
}

#events-container .gallery-item {
    position: relative;
    background: #fff;
    border: 1px solid #ddd;
    overflow: hidden;
    transition: all 0.3s ease;
    cursor: pointer;
}

#events-container .gallery-item:hover {
    transform: translateY(-5px);
    border-color: #999;
}

#events-container .gallery-img {
    width: 100%;
    height: 500px; /* 포스터용으로 더 세로로 길게 */
    object-fit: cover;
    border-bottom: 1px solid #eee;
}

#events-container .gallery-text {
    padding: 20px;
}

#events-container .gallery-text p {
    font-size: 16px;
    font-weight: 600;
    color: #333;
    margin: 0 0 8px 0;
    line-height: 1.4;
}

/* 모바일 반응형 - YouTube 버튼 */
@media (max-width: 768px) {
    .youtube-btn {
        font-size: 13px;
        padding: 6px 10px;
    }
    
    .youtube-icon {
        width: 14px;
        height: 14px;
        margin-right: 4px;
    }
    
    /* 행사 갤러리 모바일 스타일 */
    #events-container .gallery {
        grid-template-columns: 1fr;
        gap: 30px;
        margin: 30px auto;
        padding: 0 15px;
    }
    
    #events-container .gallery-img {
        height: 400px;
    }
    
    #events-container .gallery-text {
        padding: 15px;
    }
}

@media (max-width: 480px) {
    /* 행사 갤러리 - 작은 모바일 */
    #events-container .gallery {
        grid-template-columns: 1fr;
        gap: 15px;
        margin: 20px auto;
        padding: 0 10px;
    }
    
    #events-container .gallery-img {
        height: 350px;
    }
    
    #events-container .gallery-text {
        padding: 12px;
    }
    
    #events-container .gallery-text p {
        font-size: 15px;
    }
}