/* Custom Styles for Resound Ministry */

/* Smooth scrolling */
html {
    scroll-behavior: smooth;
}

/* Navigation styles */
.nav-link {
    position: relative;
}

.nav-link::after {
    content: '';
    position: absolute;
    width: 0;
    height: 2px;
    bottom: -4px;
    left: 0;
    background-color: #2C3E50;
    transition: width 0.3s ease;
}

.nav-link:hover::after {
    width: 100%;
}

/* Gallery styles - 흑백 정사각형 썸네일 그리드 */
.gallery-item {
    position: relative;
    overflow: hidden;
    border-radius: 0;
    cursor: pointer;
    transition: transform 0.3s ease, filter 0.3s ease;
    aspect-ratio: 1;
    background-color: #f8f9fa;
    transform-origin: center;
}

.gallery-item:hover {
    transform: scale(1.2);
    filter: brightness(1.1);
    z-index: 10;
    box-shadow: 0 10px 30px rgba(0,0,0,0.3);
}

.gallery-item.expanded {
    transform: scale(3);
    z-index: 20;
    box-shadow: 0 20px 60px rgba(0,0,0,0.5);
}

.gallery-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: filter 0.3s ease;
    filter: grayscale(100%);
    display: block;
}

.gallery-item:hover img {
    filter: grayscale(0%);
}

.gallery-item::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.3);
    opacity: 0;
    transition: opacity 0.3s ease;
    z-index: 1;
}

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



/* 교회명 텍스트 - 호버 시에만 표시 */
.gallery-item .church-name {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.8), transparent);
    color: white;
    padding: 0.25rem;
    font-size: 0.6rem;
    font-weight: 500;
    opacity: 0;
    transform: translateY(100%);
    transition: all 0.3s ease;
    z-index: 3;
    line-height: 1.2;
}

.gallery-item:hover .church-name {
    opacity: 1;
    transform: translateY(0);
}



/* 교회 합성 이미지 팝업 스타일 */
.church-summary-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.8);
    z-index: 1000;
    display: flex;
    justify-content: center;
    align-items: center;
    animation: fadeIn 0.3s ease-in-out;
}

.church-summary-overlay {
    position: relative;
    width: 90%;
    max-width: 800px;
    max-height: 90vh;
    background: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
    animation: slideIn 0.3s ease-in-out;
}

.church-summary-content {
    position: relative;
    width: 100%;
    height: 100%;
}

.church-summary-close {
    position: absolute;
    top: 15px;
    right: 20px;
    background: rgba(0, 0, 0, 0.7);
    color: white;
    border: none;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    font-size: 24px;
    cursor: pointer;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.3s ease;
}

.church-summary-close:hover {
    background: rgba(0, 0, 0, 0.9);
}

.church-summary-header {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    background: linear-gradient(to bottom, rgba(0, 0, 0, 0.8), transparent);
    color: white;
    padding: 20px;
    z-index: 5;
}

.church-summary-header h3 {
    margin: 0;
    font-size: 1.5rem;
    font-weight: 600;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
}

.church-summary-image {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 60px 20px 20px 20px;
}

.church-summary-image img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    border-radius: 8px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

.error-message {
    color: #dc2626;
    font-size: 1.1rem;
    text-align: center;
    padding: 2rem;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: scale(0.9) translateY(-20px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

/* 갤러리 그리드 반응형 설정 - 모든 이미지 표시 */
#gallery-grid {
    display: grid;
    grid-template-columns: repeat(16, 1fr);
    gap: 0;
    padding: 1rem 0;
    max-width: 1400px;
    margin: 0 auto;
}

@media (max-width: 1400px) {
    #gallery-grid {
        grid-template-columns: repeat(14, 1fr);
    }
}

@media (max-width: 1200px) {
    #gallery-grid {
        grid-template-columns: repeat(12, 1fr);
    }
}

@media (max-width: 768px) {
    #gallery-grid {
        grid-template-columns: repeat(12, 1fr);
    }
}

@media (max-width: 480px) {
    #gallery-grid {
        grid-template-columns: repeat(8, 1fr);
    }
}



/* Form styles */
input:focus, textarea:focus {
    outline: none;
}

/* Custom scrollbar */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
}

::-webkit-scrollbar-thumb {
    background: #2C3E50;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #34495E;
}

/* Loading animation */
.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: #fff;
    animation: spin 1s ease-in-out infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Success/Error messages */
.message {
    padding: 1rem;
    border-radius: 8px;
    margin: 1rem 0;
    display: block;
    animation: fadeIn 0.3s ease-in-out;
}

.message.success {
    background-color: #d1fae5;
    color: #065f46;
    border: 1px solid #a7f3d0;
}

.message.error {
    background-color: #fee2e2;
    color: #991b1b;
    border: 1px solid #fca5a5;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .filter-btn {
        font-size: 0.875rem;
        padding: 0.5rem 1rem;
    }
}

/* Hero section background with images */
#hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image: url('../images/main 0.jpg');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    filter: grayscale(100%);
    transition: opacity 1s ease-in-out;
    z-index: -1;
}

.hero-bg {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    filter: grayscale(100%);
    opacity: 0;
    transition: opacity 1s ease-in-out;
    z-index: -1;
}

.hero-bg.active {
    opacity: 1;
}

/* About us section background */
#about {
    position: relative;
    overflow: hidden;
}

#about .bg-light-gray {
    background-color: #ECF0F1;
}

#about .absolute.inset-0 {
    z-index: 1;
}

#about .container {
    position: relative;
    z-index: 2;
}

/* Ensure background images are visible */
#about .absolute.inset-0 > div {
    background-size: cover !important;
    background-position: center !important;
    background-repeat: no-repeat !important;
}

/* Direct background image styles for About section */
#about .absolute.inset-0 > div:first-child {
    background-image: url('../images/main 1.webp') !important;
    filter: grayscale(100%) !important;
}

#about .absolute.inset-0 > div:last-child {
    background-image: url('../images/main 2.jpg') !important;
    filter: grayscale(100%) !important;
}

/* Card hover effects */
.card-hover {
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.card-hover:hover {
    transform: translateY(-5px);
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
}

/* Text selection */
::selection {
    background-color: #2C3E50;
    color: white;
}

/* Focus styles for accessibility */
button:focus, a:focus, input:focus, textarea:focus {
    outline: 2px solid #2C3E50;
    outline-offset: 2px;
}

/* Print styles */
@media print {
    nav, footer, .no-print {
        display: none !important;
    }
    
    body {
        background: white !important;
        color: black !important;
    }
    
    section {
        page-break-inside: avoid;
    }
}

/* Lightbox 스타일 개선 - 원본 이미지 최적화 */
.lb-outerContainer {
    border-radius: 8px !important;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5) !important;
}

.lb-image {
    border-radius: 4px !important;
    max-width: 90vw !important;
    max-height: 80vh !important;
    object-fit: contain !important;
}

.lb-dataContainer {
    border-radius: 0 0 8px 8px !important;
    background: rgba(0, 0, 0, 0.8) !important;
}

.lb-data .lb-caption {
    font-size: 1.1rem !important;
    font-weight: 600 !important;
    color: white !important;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5) !important;
}



/* Gallery image container cursor */
.gallery-image-container {
    cursor: pointer;
    transition: transform 0.3s ease;
    width: 100%;
    height: 100%;
    display: block;
}

/* 모바일 최적화 */
@media (max-width: 768px) {
    .lb-image {
        max-width: 95vw !important;
        max-height: 70vh !important;
    }
    
    .lb-data .lb-caption {
        font-size: 1rem !important;
    }
    
    .lb-nav a.lb-prev,
    .lb-nav a.lb-next {
        width: 40px !important;
        height: 40px !important;
    }
} 