/* 기본 스타일 초기화 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Malgun Gothic', '맑은 고딕', 'Apple SD Gothic Neo', sans-serif;
    line-height: 1.6;
    color: #333;
}

/* Header & Navigation */
header {
    background: white;
    position: fixed;
    width: 100%;
    top: 0;
    z-index: 1000;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

.navbar {
    max-width: 1400px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 40px;
}

.logo {
    display: flex;
    align-items: center;
    gap: 15px;
}

.logo-icon {
    width: 110px;
    height: 110px;
    object-fit: contain;
}

.logo-text {
    color: #2c3e50;
    line-height: 1.1;
}

.logo-denomination {
    font-size: 16px;
    font-weight: 600;
    letter-spacing: 0.5px;
    opacity: 0.85;
    margin-bottom: 0px;
    margin-left: 0px;
}

.logo-main {
    font-size: 42px;
    font-weight: 900;
    letter-spacing: 2px;
    margin-bottom: 0px;
    margin-left: -1px;
}

.logo-sub {
    font-size: 15px;
    font-weight: 700;
    letter-spacing: 0.5px;
    opacity: 0.8;
    margin-top: 0px;
    margin-left: 0px;
}

.nav-menu {
    display: flex;
    gap: 48px;
    align-items: center;
}

.nav-item {
    color: #2c3e50;
    text-decoration: none;
    font-size: 18px;
    font-weight: 600;
    transition: color 0.3s;
}

.nav-item:hover {
    color: #3d4a6e;
}

/* Dropdown Menu */
.nav-item-dropdown {
    position: relative;
    display: inline-block;
}

.dropdown-menu {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    background-color: white;
    min-width: 200px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    border-radius: 8px;
    padding: 8px 0;
    margin-top: 0px;
    z-index: 1000;
}

.nav-item-dropdown:hover .dropdown-menu {
    display: block;
}

.dropdown-item {
    display: block;
    padding: 12px 24px;
    color: #2c3e50;
    text-decoration: none;
    font-size: 15px;
    font-weight: 500;
    transition: all 0.2s;
}

.dropdown-item:hover {
    background-color: #f8f9fa;
    color: #3d4a6e;
    padding-left: 28px;
}

/* Hero Slider Section */
.hero-slider {
    margin-top: 80px;
    background: #3d4a6e;
    padding: 0;
}

.slider-container {
    position: relative;
    max-width: 1400px;
    margin: 0 auto;
}

.slide {
    position: relative;
    display: none;
}

.slide.active {
    display: block;
}

.slide-bg {
    width: 100%;
    height: 600px;
    object-fit: cover;
}

.slide-content {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
    color: white;
    max-width: 800px;
}

.slide-title {
    font-size: 56px;
    font-weight: bold;
    margin-bottom: 30px;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
}

.slide-text {
    font-size: 16px;
    line-height: 2;
    margin-bottom: 30px;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.5);
}

.cta-button {
    background: #ff6b35;
    color: white;
    border: none;
    padding: 15px 40px;
    font-size: 16px;
    border-radius: 30px;
    cursor: pointer;
    transition: background 0.3s;
}

.cta-button:hover {
    background: #e55a2b;
}

.slide-footer {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    color: white;
    font-size: 14px;
    text-align: center;
    opacity: 0.8;
}

.slider-dots {
    position: absolute;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 10px;
}

.dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.5);
    cursor: pointer;
    transition: background 0.3s;
}

.dot.active {
    background: white;
}

/* Sermon Videos Section */
.sermon-section {
    padding: 80px 20px;
    background: white;
}

.sermon-container {
    max-width: 1400px;
    margin: 0 auto;
}

.sermon-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 30px;
    margin-top: 30px;
}

.sermon-card {
    background: white;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s, box-shadow 0.3s;
    cursor: pointer;
}

.sermon-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.15);
}

.sermon-thumbnail {
    position: relative;
    width: 100%;
    padding-top: 56.25%;
    /* 16:9 aspect ratio */
    background-color: #e0e0e0;
    overflow: hidden;
}

.sermon-thumbnail img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.sermon-info {
    padding: 20px;
}

.sermon-category {
    display: inline-block;
    padding: 5px 12px;
    background: #3d4a6e;
    color: white;
    border-radius: 15px;
    font-size: 12px;
    margin-bottom: 10px;
}

.sermon-title {
    font-size: 18px;
    font-weight: bold;
    color: #2c3e50;
    margin: 10px 0;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.sermon-meta {
    color: #666;
    font-size: 14px;
    margin-top: 10px;
}

.sermon-date {
    color: #999;
    font-size: 13px;
}

.loading {
    text-align: center;
    padding: 60px 20px;
    color: #666;
    font-size: 16px;
}

/* Service Cards Section */
.services {
    padding: 60px 20px;
    background: white;
}

/* Community Section */
.community-section {
    padding: 80px 20px;
    background: #f8f9fa;
}

.community-container {
    max-width: 1400px;
    margin: 0 auto;
}

.community-cards {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 20px;
}

.community-card {
    position: relative;
    height: 280px;
    overflow: hidden;
    border-radius: 8px;
    cursor: pointer;
    transition: transform 0.3s;
}

.community-card:hover {
    transform: translateY(-5px);
}

.community-card .card-bg {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.community-card .card-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.4);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    color: white;
    transition: background 0.3s;
}

.community-card:hover .card-overlay {
    background: rgba(0, 0, 0, 0.6);
}

.community-card .card-title {
    font-size: 24px;
    font-weight: bold;
    margin-bottom: 10px;
}

.community-card .card-subtitle {
    font-size: 11px;
    letter-spacing: 2px;
    opacity: 0.9;
}


.service-cards {
    max-width: 1400px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
}

.service-card {
    position: relative;
    height: 250px;
    overflow: hidden;
    border-radius: 8px;
    cursor: pointer;
    transition: transform 0.3s;
}

.service-card:hover {
    transform: translateY(-5px);
}

.card-bg {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.card-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.4);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    color: white;
    transition: background 0.3s;
}

.service-card:hover .card-overlay {
    background: rgba(0, 0, 0, 0.6);
}

.card-title {
    font-size: 28px;
    font-weight: bold;
    margin-bottom: 10px;
}

.card-subtitle {
    font-size: 12px;
    letter-spacing: 2px;
    opacity: 0.9;
}

/* Location Section */
.location-section {
    padding: 80px 20px;
    background: #f8f9fa;
}

.location-container {
    max-width: 1200px;
    margin: 0 auto;
}

.section-title {
    text-align: center;
    font-size: 36px;
    margin-bottom: 50px;
    color: #2c3e50;
}

.map-container {
    width: 100%;
    margin-bottom: 50px;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
}

.location-info-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 30px;
}

.location-info-box {
    background: white;
    padding: 30px;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

.location-info-box h3 {
    font-size: 22px;
    margin-bottom: 20px;
    color: #3d4a6e;
    border-bottom: 2px solid #3d4a6e;
    padding-bottom: 10px;
}

.info-item {
    margin-bottom: 15px;
}

.info-item strong {
    display: block;
    color: #2c3e50;
    margin-bottom: 5px;
    font-size: 16px;
}

.info-item p {
    color: #666;
    line-height: 1.8;
    margin: 0;
}

/* Footer */
footer {
    background: #1a1a1a;
    color: white;
    padding: 40px 20px;
}

.footer-content {
    max-width: 1400px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.footer-left p {
    font-size: 12px;
    margin: 5px 0;
    opacity: 0.8;
}

.footer-address {
    margin-top: 10px;
    line-height: 1.6;
}

.footer-social {
    display: flex;
    gap: 15px;
}

.social-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 20px;
    background: #333;
    color: white;
    text-decoration: none;
    border-radius: 25px;
    font-size: 16px;
    transition: background 0.3s;
}

.social-icon:hover {
    background: #555;
}

.social-icon-symbol {
    font-size: 18px;
}

.social-icon-text {
    font-size: 14px;
    font-weight: 500;
}

/* 반응형 디자인 */
@media (max-width: 1024px) {
    .service-cards {
        grid-template-columns: repeat(2, 1fr);
    }

    .slide-content {
        right: 5%;
        max-width: 400px;
    }

    .slide-title {
        font-size: 42px;
    }
}

@media (max-width: 1024px) {
    .community-cards {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 768px) {
    .navbar {
        flex-direction: column;
        padding: 15px 20px;
        gap: 15px;
    }

    .logo-icon {
        width: 70px;
        height: 70px;
    }

    .logo-denomination {
        font-size: 11px;
    }

    .logo-main {
        font-size: 28px;
    }

    .logo-sub {
        font-size: 9px;
    }

    .nav-menu {
        gap: 20px;
        flex-wrap: wrap;
        justify-content: center;
    }

    .nav-item {
        font-size: 14px;
    }

    .slide-bg {
        height: 400px;
    }

    .slide-content {
        left: 50%;
        top: 50%;
        transform: translate(-50%, -50%);
        text-align: center;
        width: 95%;
        max-width: none;
        padding: 0 20px;
    }

    .slide-title {
        font-size: 32px;
        margin-bottom: 20px;
        line-height: 1.5;
        word-break: keep-all;
        white-space: normal;
    }

    .slide-text {
        font-size: 12px;
        line-height: 1.6;
    }

    .service-cards {
        grid-template-columns: repeat(2, 1fr);
        gap: 15px;
    }

    .service-card {
        height: 200px;
    }

    .community-cards {
        grid-template-columns: repeat(2, 1fr);
        gap: 15px;
    }

    .community-card {
        height: 160px;
    }

    /* 모바일 카드 텍스트 최적화 */
    .card-title,
    .community-card .card-title {
        font-size: 16px;
        margin-bottom: 5px;
    }

    .card-subtitle,
    .community-card .card-subtitle {
        font-size: 10px;
        letter-spacing: 1px;
    }

    .location-info-grid {
        grid-template-columns: 1fr;
    }

    .footer-content {
        flex-direction: column;
        gap: 20px;
        text-align: center;
    }

    /* 모바일 설교 영상 2열 배치 */
    .sermon-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
    }

    .sermon-thumbnail {
        padding-top: 56.25%;
        /* 16:9 비율 유지 */
    }

    .sermon-title {
        font-size: 14px;
        /* 글자 크기 축소 */
        -webkit-line-clamp: 2;
        /* 두 줄 말줄임 */
    }

    /* 모바일 갤러리 가로 스크롤 (스와이프) */
    .gallery-grid {
        display: flex;
        overflow-x: auto;
        scroll-snap-type: x mandatory;
        gap: 15px;
        padding-bottom: 20px;
        /* 스크롤바 공간 확보 */
        -webkit-overflow-scrolling: touch;
        /* 부드러운 스크롤 */
    }

    .gallery-grid::-webkit-scrollbar {
        height: 6px;
    }

    .gallery-grid::-webkit-scrollbar-thumb {
        background: #ccc;
        border-radius: 3px;
    }

    .gallery-item {
        flex: 0 0 90%;
        /* 화면의 90% 차지 (옆에 살짝 보임) */
        scroll-snap-align: center;
        width: 90%;
    }

    .modal-close {
        top: 10px;
        right: 20px;
        font-size: 40px;
    }

    .modal-btn {
        font-size: 30px;
        padding: 8px 16px;
    }

    .modal-caption {
        bottom: 20px;
        font-size: 16px;
        padding: 8px 16px;
    }
}

/* Gallery Section */
.gallery-section {
    padding: 80px 20px;
    background: white;
}

.gallery-container-main {
    max-width: 1400px;
    margin: 0 auto;
}

.main-gallery {
    margin-top: 30px;
}

/* 갤러리 그리드 */
.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 20px;
}

.gallery-item {
    position: relative;
    width: 100%;
    padding-top: 75%;
    /* 4:3 비율 */
    overflow: hidden;
    border-radius: 8px;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s, box-shadow 0.3s;
}

.gallery-item:hover {
    transform: translateY(-4px);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
}

.gallery-item img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.gallery-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.3s;
}

.gallery-item:hover .gallery-overlay {
    background: rgba(0, 0, 0, 0.4);
}

.gallery-icon {
    font-size: 36px;
    opacity: 0;
    transition: opacity 0.3s;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.3));
}

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

/* 이미지 모달 */
.image-modal {
    display: none;
    position: fixed;
    z-index: 10000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.95);
    animation: fadeIn 0.3s;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

.modal-content {
    margin: auto;
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    position: absolute;
    top: 40%;
    left: 50%;
    transform: translate(-50%, -50%);
    animation: zoomIn 0.3s;
}

@keyframes zoomIn {
    from {
        transform: translate(-50%, -50%) scale(0.8);
    }

    to {
        transform: translate(-50%, -50%) scale(1);
    }
}

.modal-close {
    position: absolute;
    top: 20px;
    right: 35px;
    color: #fff;
    font-size: 50px;
    font-weight: 300;
    cursor: pointer;
    transition: color 0.3s;
    z-index: 10001;
}

.modal-close:hover {
    color: #ccc;
}

.modal-nav {
    position: absolute;
    top: 50%;
    width: 100%;
    display: flex;
    justify-content: space-between;
    padding: 0 20px;
    transform: translateY(-50%);
    z-index: 10001;
}

.modal-btn {
    background: rgba(255, 255, 255, 0.2);
    color: white;
    border: none;
    font-size: 40px;
    padding: 10px 20px;
    cursor: pointer;
    border-radius: 4px;
    transition: background 0.3s;
}

.modal-btn:hover {
    background: rgba(255, 255, 255, 0.4);
}

.modal-caption {
    position: absolute;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    color: #fff;
    font-size: 18px;
    text-align: center;
    background: rgba(0, 0, 0, 0.5);
    padding: 10px 20px;
    border-radius: 20px;
}

/* YouTube Floating Button */
.youtube-floating-btn {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 60px;
    height: 60px;
    background-color: #ff0000;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    cursor: pointer;
    z-index: 9999;
    transition: all 0.3s ease;
    text-decoration: none;
}

.youtube-floating-btn:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 20px rgba(255, 0, 0, 0.4);
}

.youtube-floating-btn svg {
    pointer-events: none;
}

/* Community Modal */
.community-modal {
    display: none;
    position: fixed;
    z-index: 10000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    overflow: auto;
}

.modal-content {
    background-color: #fff;
    margin: 5% auto;
    padding: 0;
    width: 90%;
    max-width: 900px;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    position: relative;
    animation: modalSlideIn 0.3s ease-out;
}

@keyframes modalSlideIn {
    from {
        transform: translateY(-50px);
        opacity: 0;
    }

    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.modal-close {
    position: absolute;
    right: 20px;
    top: 20px;
    font-size: 32px;
    font-weight: bold;
    color: #999;
    cursor: pointer;
    z-index: 1;
    transition: color 0.3s;
}

.modal-close:hover {
    color: #333;
}

.modal-header {
    padding: 40px 40px 20px;
    border-bottom: 2px solid #f0f0f0;
}

.modal-header h2 {
    font-size: 32px;
    color: #2c3e50;
    margin-bottom: 8px;
}

.modal-subtitle {
    font-size: 14px;
    color: #999;
    letter-spacing: 2px;
    font-weight: 600;
}

.modal-tabs {
    display: flex;
    gap: 0;
    padding: 0 40px;
    border-bottom: 1px solid #e0e0e0;
    background-color: #fafafa;
}

.tab-btn {
    padding: 15px 30px;
    background: none;
    border: none;
    font-size: 16px;
    font-weight: 600;
    color: #666;
    cursor: pointer;
    transition: all 0.3s;
    border-bottom: 3px solid transparent;
}

.tab-btn:hover {
    color: #3d4a6e;
}

.tab-btn.active {
    color: #3d4a6e;
    border-bottom-color: #3d4a6e;
    background-color: #fff;
}

.modal-body-content {
    padding: 40px;
    line-height: 1.8;
}

.modal-body-content h2 {
    font-size: 28px;
    color: #2c3e50;
    margin-bottom: 20px;
}

.modal-body-content p {
    margin-bottom: 15px;
    color: #555;
    font-size: 16px;
}

.info-row {
    display: flex;
    gap: 20px;
    margin: 30px 0;
    flex-wrap: wrap;
}

.info-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 20px;
    background-color: #f8f9fa;
    border-radius: 8px;
    font-weight: 600;
}

.info-item .icon {
    font-size: 20px;
}

.community-card {
    cursor: pointer;
    text-decoration: none;
    display: block;
}

/* 모바일 대응 */
@media (max-width: 768px) {
    .modal-content {
        width: 95%;
        margin: 10% auto;
    }

    .modal-header {
        padding: 30px 20px 15px;
    }

    .modal-tabs {
        padding: 0 20px;
        overflow-x: auto;
    }

    .tab-btn {
        padding: 12px 20px;
        font-size: 14px;
        white-space: nowrap;
    }

    .modal-body-content {
        padding: 20px;
    }

    .info-row {
        flex-direction: column;
        gap: 10px;
    }
}

/* 공지사항 모달 */
.notice-modal {
    display: none;
    position: fixed;
    z-index: 2000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    animation: fadeIn 0.3s;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

.notice-modal-content {
    background-color: white;
    margin: 10% auto;
    width: 90%;
    max-width: 600px;
    border-radius: 16px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
    animation: slideDown 0.3s;
}

@keyframes slideDown {
    from {
        transform: translateY(-50px);
        opacity: 0;
    }

    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.notice-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 24px 30px;
    border-bottom: 2px solid #f0f0f0;
}

.notice-modal-header h2 {
    font-size: 24px;
    font-weight: 700;
    color: #667eea;
    margin: 0;
}

.notice-modal-close {
    font-size: 32px;
    font-weight: 300;
    color: #999;
    cursor: pointer;
    transition: color 0.2s;
    line-height: 1;
}

.notice-modal-close:hover {
    color: #333;
}

.notice-modal-body {
    padding: 30px;
    max-height: 400px;
    overflow-y: auto;
}

.notice-modal-body h3 {
    font-size: 20px;
    font-weight: 700;
    color: #333;
    margin-bottom: 15px;
}

.notice-modal-body p {
    font-size: 16px;
    line-height: 1.8;
    color: #555;
    margin-bottom: 12px;
}

.notice-modal-body ul {
    margin: 15px 0;
    padding-left: 20px;
}

.notice-modal-body li {
    margin: 8px 0;
    line-height: 1.6;
}

.notice-modal-footer {
    padding: 20px 30px;
    border-top: 1px solid #f0f0f0;
    background-color: #fafafa;
    border-radius: 0 0 16px 16px;
}

.notice-modal-footer label {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    font-size: 14px;
    color: #666;
}

.notice-modal-footer input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
}

/* 모바일 대응 */
@media (max-width: 768px) {
    .notice-modal-content {
        width: 95%;
        margin: 20% auto;
    }

    .notice-modal-header {
        padding: 20px;
    }

    .notice-modal-header h2 {
        font-size: 20px;
    }

    .notice-modal-body {
        padding: 20px;
        max-height: 300px;
    }

    .notice-modal-footer {
        padding: 15px 20px;
    }
}