@import url('https://fonts.googleapis.com/css2?family=Noto+Sans+KR:wght@400;500&family=Quicksand:wght@400;500;700&display=swap');

:root {
    --primary-color: #0a2463; /* Deep Blue */
    --secondary-color: #d4af37; /* Gold */
    --text-color: #333;
    --light-text-color: #f8f8f8;
    --background-color: #fdfdfa;
    --white-color: #fff;
    --border-color: #e0e0e0;
    --heading-font: 'Quicksand', sans-serif;
    --body-font: 'Noto Sans KR', sans-serif;
}

/* General & Preloader */

.container {
    max-width: 1063px; /* 924px * 1.15 */
    margin: 0 auto;
    padding: 0 15px;
    width: 100%;
    box-sizing: border-box;
}

body {
    font-family: var(--body-font);
    margin: 0;
    line-height: 1.8;
    color: var(--text-color);
    background-color: var(--background-color);
    opacity: 0;
    transition: opacity 0.5s ease-in-out;
}
body.loaded {
    opacity: 1;
}
.preloader { /* ... existing preloader styles ... */ }

/* Header */
header {
    background: rgba(255, 255, 255, 0.95);
    border-bottom: 1px solid var(--border-color);
    padding: 1rem 0;
    position: fixed;
    width: 100%;
    top: 0;
    z-index: 1000;
    backdrop-filter: blur(8px);
}
header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.logo-area a {
    display: flex;
    align-items: center;
    text-decoration: none;
}
.logo-area img {
    height: 50px;
}
.logo-area span {
    font-family: var(--heading-font);
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--primary-color);
    margin-left: 1rem;
}
.gnb ul {
    display: flex;
    gap: 2.5rem;
}
.gnb ul li a {
    font-size: 1.2rem;
    font-weight: 500;
    color: var(--primary-color);
    transition: color 0.3s ease;
}
.gnb ul li a:hover {
    color: var(--secondary-color);
}

/* Dropdown Menu */
.gnb .dropdown {
    position: relative;
}

.gnb .dropdown-menu {
    display: none;
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    background-color: #fff;
    box-shadow: 0 8px 16px rgba(0,0,0,0.1);
    border-radius: 8px;
    padding: 0.5rem 0;
    margin-top: 10px; /* Space between main menu and dropdown */
    list-style: none;
    min-width: 120px;
    text-align: center;
    z-index: 1001;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease, margin-top 0.3s ease;
}

.gnb .dropdown:hover .dropdown-menu {
    display: block;
    opacity: 1;
    visibility: visible;
    margin-top: 0;
}

.gnb .dropdown-menu li {
    padding: 0;
}

.gnb .dropdown-menu li a {
    display: block;
    padding: 0.75rem 1.5rem;
    font-size: 1rem;
    white-space: nowrap;
}

/* Main Content */
main { padding-top: 85px; /* Header height */ }

.hero {
    padding: 2rem 0;
}

.hero-content-wrapper {
    position: relative;
    /* The width will be constrained by the parent .container */
}

.hero-image {
    width: 100%;
    height: auto; /* Maintain aspect ratio */
    display: block;
    filter: brightness(60%); /* Reduce brightness by 40% */
    border-radius: 8px; /* Optional: for soft edges */
}

.verse-slider-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2;
    overflow: hidden;
}

.verse-slider {
    width: 100%;
}

.slide-track {
    display: flex;
    transition: transform 1s ease-in-out;
}

.slide {
    flex-shrink: 0;
    width: 100%; /* Each slide takes the full width of the container */
    text-align: center;
    padding: 0 2rem;
    box-sizing: border-box;
    color: var(--white-color); /* Ensure text is white */
}

.slide .verse {
    font-size: 1.5rem;
    font-weight: 500;
    margin-bottom: 1rem;
    text-shadow: 1px 1px 3px rgba(0,0,0,0.5); /* Add shadow for readability */
}

.slide .reference {
    font-size: 1.1rem;
    font-style: italic;
    text-shadow: 1px 1px 3px rgba(0,0,0,0.5);
}

@keyframes scroll {
    0% { transform: translateX(0); }
    100% { transform: translateX(-50%); } /* Adjust based on number of original slides */
}

.hero-content-wrapper:hover .slide-track {
    animation-play-state: paused;
}

.section-title {
    font-family: var(--heading-font);
    font-size: 2.8rem;
    font-weight: 700;
    color: var(--primary-color);
    text-align: center;
    margin-bottom: 3rem;
}

/* Service Times */
.service-times { padding: 5rem 0; background: var(--white-color); }
.time-list {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 2rem;
    text-align: center;
}
.time-item {
    border: 1px solid var(--border-color);
    padding: 2rem;
    border-radius: 8px;
    transition: all 0.3s ease;
}
.time-item:hover { box-shadow: 0 10px 25px rgba(0,0,0,0.1); transform: translateY(-5px); }
.time-item h3 { font-family: var(--heading-font); font-size: 1.5rem; color: var(--primary-color); margin-bottom: 0.5rem; }

/* Latest Sermon */
.latest-sermon { padding: 5rem 0; }
.sermon-content { display: flex; gap: 2rem; align-items: center; }
.sermon-video { flex: 1.5; }
.sermon-video iframe { width: 100%; height: 350px; border-radius: 8px; }
.sermon-info { flex: 1; }
.sermon-info h3 { font-family: var(--heading-font); font-size: 2rem; color: var(--primary-color); }
.sermon-info .preacher, .sermon-info .date { margin-bottom: 1rem; }
.btn-more { display: inline-block; background: var(--primary-color); color: var(--white-color); padding: 0.8rem 1.5rem; border-radius: 5px; transition: background 0.3s; }
.btn-more:hover { background: var(--secondary-color); }

/* News & Events */
.news-events { padding: 5rem 0; background: var(--white-color); }

.news-list-container {
    border-radius: 8px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.05);
    overflow: hidden;
}

.news-list-header,
.news-item a {
    display: grid;
    grid-template-columns: 1fr 120px; /* 제목과 날짜 컬럼 너비 지정 */
    align-items: center;
    padding: 0 1.2rem; /* 수직 패딩 제거, 높이는 line-height로 제어 */
    height: 50px; /* 고정 높이 지정 */
    border-bottom: 1px solid var(--border-color);
}

.news-list-header {
    font-weight: bold;
    background-color: #f0f2f5;
    color: var(--primary-color);
}

.header-title, .news-title {
    grid-column: 1;
    display: block; /* 블록 요소로 명시 */
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 50px; /* 높이와 동일하게 설정하여 수직 중앙 정렬 효과 */
}

.header-date, .news-date {
    grid-column: 2;
    display: block; /* 블록 요소로 명시 */
    text-align: right;
    color: #666;
    font-size: 0.95rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 50px; /* 높이와 동일하게 설정하여 수직 중앙 정렬 효과 */
}

.news-item a {
    text-decoration: none;
    color: var(--text-color);
    transition: background-color 0.3s ease, transform 0.2s ease;
}

.news-item a:hover {
    background-color: #f5f5f5;
    transform: translateY(-2px);
}

.news-item a:visited {
    color: var(--text-color);
}

.news-title {
    font-size: 1.1rem;
}

.btn-more-center { display: block; width: fit-content; margin: 2rem auto 0; background: #555; color: var(--white-color); padding: 0.8rem 2rem; border-radius: 5px; transition: background 0.3s; }
.btn-more-center:hover { background: var(--primary-color); }

/* News & Events (news.html 전용 스타일) */
.news-content .container {
    max-width: 1063px; /* index.html과 동일하게 설정 */
    margin: 0 auto;
    padding: 0 15px;
}

.news-content .news-list { /* news.html의 news-list에 적용 */
    border-radius: 8px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.05);
    overflow: hidden;
}

.news-content .news-list-header,
.news-content .news-list-item { /* news.html의 news-list-item에 적용 */
    display: grid;
    grid-template-columns: 1fr 120px; /* 제목과 날짜 컬럼 너비 지정 */
    align-items: center;
    padding: 0 1.2rem; /* 수직 패딩 제거, 높이는 line-height로 제어 */
    height: 50px; /* 고정 높이 지정 */
    border-bottom: 1px solid var(--border-color);
}

.news-content .news-list-header {
    font-weight: bold;
    background-color: #f0f2f5;
    color: var(--primary-color);
}

.news-content .header-title,
.news-content .news-title {
    grid-column: 1;
    display: block;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 50px;
    font-size: 1.1rem;
}

.news-content .header-date,
.news-content .news-date {
    grid-column: 2;
    display: block;
    text-align: right;
    color: #666;
    font-size: 0.95rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 50px;
}

.news-content .news-list-item {
    text-decoration: none;
    color: var(--text-color);
    transition: background-color 0.3s ease, transform 0.2s ease;
}

.news-content .news-list-item:hover {
    background-color: #f5f5f5;
    transform: translateY(-2px);
}

.news-content .news-list-item:visited { /* 방문한 링크 색상 재정의 */
    color: var(--text-color);
}

/* Location */
.location { padding: 5rem 0; }
.map-area { height: 400px; border-radius: 8px; overflow: hidden; }
.address { text-align: center; margin-top: 1.5rem; font-size: 1.2rem; }

/* Page-specific Layouts */
.page-layout {
    display: flex;
    gap: 3rem;
    padding: 3rem 0;
}

.side-menu {
    flex: 0 0 200px; /* flex-grow, flex-shrink, flex-basis */
}

.side-menu ul {
    list-style: none;
    padding: 0;
    margin: 0;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    overflow: hidden;
}

.side-menu ul li a {
    display: block;
    padding: 1rem 1.5rem;
    font-size: 1.1rem;
    font-weight: 500;
    color: var(--primary-color);
    border-bottom: 1px solid var(--border-color);
    transition: background-color 0.3s;
}

.side-menu ul li:last-child a {
    border-bottom: none;
}

.side-menu ul li a:hover {
    background-color: #f7f7f7;
}

.side-menu ul li a.active {
    background-color: var(--primary-color);
    color: var(--white-color);
    font-weight: bold;
}

.main-content-area {
    flex-grow: 1;
}


/* Floating Offering Button */
.floating-offering {
    position: fixed;
    right: 30px;
    bottom: 30px;
    z-index: 999;
}
.offering-btn {
    background: var(--secondary-color);
    color: var(--white-color);
    border: none;
    border-radius: 50%;
    width: 80px;
    height: 80px;
    font-size: 1rem;
    font-weight: bold;
    cursor: pointer;
    box-shadow: 0 5px 15px rgba(0,0,0,0.2);
    transition: all 0.3s ease;
}
.offering-btn:hover { transform: scale(1.1); }
.offering-info {
    position: absolute;
    bottom: 100px;
    right: 0;
    background: var(--white-color);
    padding: 1.5rem;
    border-radius: 8px;
    box-shadow: 0 5px 20px rgba(0,0,0,0.2);
    width: 280px;
    display: none; /* Initially hidden */
}
.offering-info.active { display: block; }
.offering-info p { margin: 0.5rem 0; }
.btn-close-offering { position: absolute; top: 10px; right: 10px; background: none; border: none; font-size: 1.5rem; cursor: pointer; }

/* Responsive, Animations, etc. */
.fade-in { opacity: 0; transform: translateY(30px); transition: opacity 0.8s ease-out, transform 0.8s ease-out; }
.fade-in.visible { opacity: 1; transform: translateY(0); }

.mobile-menu-button {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
    width: 30px;
    height: 30px;
    position: relative;
    z-index: 1001;
}
.mobile-menu-button span {
    display: block;
    width: 25px;
    height: 3px;
    background: var(--primary-color);
    margin: 5px auto;
    transition: all 0.3s ease-in-out;
    position: absolute;
    left: 2.5px;
}
.mobile-menu-button span:nth-child(1) { top: 5px; }
.mobile-menu-button span:nth-child(2) { top: 13px; }
.mobile-menu-button span:nth-child(3) { top: 21px; }

header.mobile-open .mobile-menu-button span:nth-child(1) {
    transform: rotate(45deg);
    top: 13px;
}
header.mobile-open .mobile-menu-button span:nth-child(2) {
    opacity: 0;
}
header.mobile-open .mobile-menu-button span:nth-child(3) {
    transform: rotate(-45deg);
    top: 13px;
}


@media (max-width: 768px) {
    .logo-area span { display: block; } /* Make logo text visible on mobile */
    .mobile-menu-button {
        display: block;
    }

    .gnb {
        display: none;
        position: absolute;
        top: 100%;
        left: 0;
        width: 100%;
        background: rgba(255, 255, 255, 0.98);
        border-top: 1px solid var(--border-color);
        box-shadow: 0 5px 10px rgba(0,0,0,0.05);
    }

    header.mobile-open .gnb {
        display: block;
    }

    .gnb ul {
        flex-direction: column;
        gap: 0;
        padding-left: 0; /* Remove default padding */
        margin: 0;
    }

    .gnb ul li {
        border-bottom: 1px solid var(--border-color);
        list-style: none;
    }
    .gnb ul li:last-child {
        border-bottom: none;
    }

    .gnb ul li a {
        display: block;
        padding: 1.2rem;
        text-align: center;
        font-size: 1.1rem;
    }

    .time-list { grid-template-columns: repeat(2, 1fr); }
    .sermon-content { flex-direction: column; }

    .slide {
        padding: 1rem 2rem; /* Add vertical padding for mobile */
    }
    .slide .verse {
        font-size: 1.2rem; /* Smaller font size for mobile */
    }
    .slide .reference {
        font-size: 0.9rem; /* Smaller font size for mobile */
    }

    .page-layout {
        flex-direction: column; /* 좌측 메뉴와 본문이 세로로 쌓이도록 변경 */
        gap: 1.5rem; /* 세로 간격 조정 */
    }

    .side-menu {
        flex: none; /* 고정 너비 제거 */
        width: 100%; /* 전체 너비 사용 */
        margin-bottom: 1.5rem; /* 본문과의 간격 */
    }

    .side-menu ul {
        display: flex; /* 메뉴 항목들을 가로로 정렬 */
        flex-direction: row;
        justify-content: space-around; /* 항목들을 균등하게 분배 */
        border: none; /* 기존 테두리 제거 */
        border-radius: 0; /* 기존 둥근 모서리 제거 */
        overflow: visible;
        background-color: var(--white-color); /* 메뉴 배경색 추가 */
        box-shadow: 0 2px 5px rgba(0,0,0,0.1); /* 그림자 추가 */
    }

    .side-menu ul li {
        flex: 1; /* 각 메뉴 항목이 균등한 너비를 갖도록 */
        text-align: center; /* 텍스트 중앙 정렬 */
        border-bottom: none; /* 기존 하단 테두리 제거 */
        border-right: 1px solid var(--border-color); /* 항목 간 구분선 추가 */
    }

    .side-menu ul li:last-child {
        border-right: none; /* 마지막 항목에는 구분선 제거 */
    }

    .side-menu ul li a {
        padding: 0.8rem 0.5rem; /* 가로 메뉴에 맞게 패딩 조정 */
        font-size: 1rem; /* 글자 크기 조정 */
    }
}

/* Admin Page Styles */
.admin-container {
    width: 100%;
    max-width: 924px;
    margin: 2rem auto;
    padding: 2rem;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}
.admin-title {
    font-family: var(--heading-font);
    color: var(--primary-color);
    text-align: center;
    margin-bottom: 2rem;
}
.login-form {
    max-width: 320px;
    margin: 0 auto;
}
.login-form input {
    width: 100%;
    padding: 0.8rem;
    margin-bottom: 1rem;
    border: 1px solid var(--border-color);
    border-radius: 5px;
    font-size: 1rem;
    box-sizing: border-box;
}
.login-form button {
    width: 100%;
    padding: 0.8rem 1.5rem;
    background: var(--primary-color);
    color: var(--white-color);
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 1rem;
}
.admin-dashboard {
    display: none; /* Hidden by default */
}
.admin-menu ul {
    list-style: none;
    padding: 0;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 1.5rem;
}
.admin-menu ul li a {
    display: block;
    padding: 2rem;
    background: #f9f9f9;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    text-align: center;
    font-size: 1.2rem;
    font-weight: 500;
    color: var(--primary-color);
    transition: all 0.3s ease;
}
.admin-menu ul li a:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 20px rgba(0,0,0,0.1);
    background: var(--primary-color);
    color: var(--white-color);
}
.logout-button {
    display: block;
    width: fit-content;
    margin: 2rem auto 0;
    padding: 0.7rem 2rem;
    background: #e74c3c;
    color: white;
    border-radius: 5px;
    text-decoration: none;
}

.btn-home {
    display: inline-block;
    margin-bottom: 2rem;
    padding: 0.6rem 1.2rem;
    background: #6c757d;
    color: white;
    text-decoration: none;
    border-radius: 5px;
    transition: background 0.3s;
}
.btn-home:hover {
    background: #5a6268;
}

.password-wrapper {
    position: relative;
}

.password-toggle-icon {
    position: absolute;
    top: 50%;
    right: 15px;
    transform: translateY(-50%);
    cursor: pointer;
    color: #888;
}

/* Motto Section */
.motto-section {
    padding: 5rem 0;
    background-color: var(--white-color);
    text-align: center;
}

.motto-title {
    font-family: var(--heading-font);
    font-size: 2.2rem;
    font-weight: 700;
    color: var(--primary-color);
    margin-bottom: 3rem;
    position: relative;
    display: inline-block;
    padding-bottom: 1rem;
}

.motto-title::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 60px;
    height: 3px;
    background-color: var(--secondary-color);
}

.goals-container {
    display: flex;
    justify-content: center;
    gap: 2rem;
    flex-wrap: wrap;
}

.goal-item {
    flex: 1;
    min-width: 280px;
    max-width: 310px; /* 최대 너비를 320px에서 310px로 줄입니다. */
    padding: 2rem;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    transition: all 0.3s ease;
    box-sizing: border-box; /* 이 라인을 추가하여 레이아웃 문제를 해결합니다. */
}

.goal-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(0,0,0,0.08);
}

.goal-item i {
    font-size: 2.5rem;
    color: var(--secondary-color);
    margin-bottom: 1rem;
}

.goal-item h3 {
    font-family: var(--body-font);
    font-size: 1.3rem;
    font-weight: 500;
    color: var(--primary-color);
    margin: 0;
}

/* Single Post View Redesign */
.post-header-new {
    border-top: 2px solid var(--primary-color);
    border-bottom: 1px solid var(--border-color);
    padding: 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background-color: #f9f9f9;
}
.post-header-new .header-item {
    display: flex;
    align-items: center;
    gap: 1rem;
}
.post-header-new .header-label {
    font-weight: bold;
    color: var(--primary-color);
}
.post-body {
    padding: 2rem 1rem;
    min-height: 250px;
    line-height: 1.8;
    font-size: 1.1rem;
    border-bottom: 1px solid var(--border-color);
    white-space: pre-line; /* Preserve newlines, collapse spaces */
}
.post-footer-new {
    padding: 1.5rem 1rem;
    text-align: left;
}
.post-footer-new .btn-list {
    background: #6c757d;
    color: white;
    padding: 0.6rem 1.5rem;
    text-decoration: none;
    border-radius: 5px;
    transition: background-color 0.2s;
}
.post-footer-new .btn-list:hover {
    background: #5a6268;
}

@media (max-width: 992px) {
    .goals-container {
        flex-direction: column;
        align-items: center;
    }
}

/* --- Footer Styles V3 --- */
.site-footer {
    background-color: #2a2a2a;
    color: #aaa;
    padding: 40px 0 30px;
    font-size: 0.9rem;
}
.site-footer .container {
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 20px;
}
.site-footer .footer-content {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
    margin-bottom: 30px;
}
.site-footer .footer-section {
    flex: 1;
    min-width: 220px;
}

/* Grouping logo and about text */
.site-footer .logo-and-about {
    display: flex;
    align-items: center;
    gap: 20px;
    flex: 2; /* Give it more space */
    min-width: 300px;
}
.site-footer .footer-logo-link img {
    height: 45px;
    filter: grayscale(100%);
    opacity: 0.6;
    transition: opacity 0.3s ease;
}
.site-footer .footer-logo-link:hover img {
    opacity: 0.8;
}
.site-footer .about-text h4 {
    color: #fff;
    font-size: 1.1rem;
    margin: 0 0 5px;
    font-weight: 500;
}
.site-footer .about-text p {
    margin: 0;
    font-size: 0.9rem;
}

.site-footer .contact, .site-footer .service-times {
    text-align: left;
}

.site-footer .footer-section p {
    margin: 5px 0;
    line-height: 1.7;
    font-size: 0.95rem;
}
.site-footer .footer-section i {
    color: var(--secondary-color);
    margin-right: 8px;
    width: 14px;
    text-align: center;
}
.site-footer .footer-bottom {
    padding-top: 20px;
    margin-top: 20px;
    border-top: 1px solid #444;
    font-size: 0.85rem;
    color: #777;
    text-align: center;
}

/* Fix for style conflict */
.site-footer .service-times {
    background: none !important;
    padding: 0 !important;
}

@media (max-width: 992px) {
    .site-footer .footer-content {
        flex-direction: column;
        align-items: flex-start; /* Align items to the start */
        gap: 35px;
    }
    .site-footer .logo-and-about {
       min-width: unset;
    }
    .site-footer .contact, .site-footer .service-times {
        text-align: left;
    }
}
