/* ===========================
   제목 + 네비게이션 폰트: 페이퍼로지 (Paperlogy)
   ===========================
   · 본문은 기존 Noto Sans KR 300 그대로
   · 제목(h1~h4)과 상단 네비게이션 메뉴(.nav-menu a)에만 적용
   · SIL 오픈폰트라이선스(OFL) — 상업용 사용 가능
   · 공식 배포 CDN이 없어 jsDelivr(GitHub 미러)의 고정 커밋에서 로드
     커밋 SHA 고정 → 저장소가 바뀌어도 같은 파일이 계속 제공됨
   · 프로젝트에 파일을 넣지 않는 이유: Worker 용량(1MB) 초과 방지
   · 로드하는 굵기는 400 / 500 / 600 세 가지
     (제목 = 400·500, 네비게이션 메뉴 = 600. 700 은 미사용)
   · font-display: swap → 폰트가 늦어도 글자가 먼저 보임 */
@font-face {
    font-family: 'Paperlogy';
    src: url('https://cdn.jsdelivr.net/gh/fonts-archive/Paperlogy@d73efc3cd471a7faf198f39b1783b14da13dd7c4/Paperlogy-4Regular.woff2') format('woff2');
    font-weight: 400;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'Paperlogy';
    src: url('https://cdn.jsdelivr.net/gh/fonts-archive/Paperlogy@d73efc3cd471a7faf198f39b1783b14da13dd7c4/Paperlogy-5Medium.woff2') format('woff2');
    font-weight: 500;
    font-style: normal;
    font-display: swap;
}

/* 상단 네비게이션 메뉴는 font-weight: 600 이라 600 파일도 필요 */
@font-face {
    font-family: 'Paperlogy';
    src: url('https://cdn.jsdelivr.net/gh/fonts-archive/Paperlogy@d73efc3cd471a7faf198f39b1783b14da13dd7c4/Paperlogy-6SemiBold.woff2') format('woff2');
    font-weight: 600;
    font-style: normal;
    font-display: swap;
}

/* 제목 + 상단 네비게이션 메뉴를 페이퍼로지로 교체.
   페이지별 CSS(worship.css 등)는 이들에 font-family를 지정하지 않으므로
   본문·버튼·입력창은 그대로 Noto Sans KR을 유지합니다. */
h1, h2, h3, h4,
.section-header h2,
.welcome-card h2,
.welcome-card h3,
.feed-content h3,
.quick-card h3,
.hero-content h1,
.hero-news .hero-content h1,
.hero-weekly .hero-content h1,
.hero-morning .hero-content h1,
.article-body h2,
.article-body h3,
.auth-header h1,
.write-header h1,
.worship-schedule h2,
.morning-guard h2,
.pastor-info h3,
.empty-state h3,
.navbar .nav-menu a,
.nav-menu a {
    font-family: 'Paperlogy', 'Noto Sans KR', sans-serif;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-color: #5c8fdc;
    --secondary-color: #7ba5e8;
    --teal-color: #5c8fdc;
    --text-dark: #333;
    --text-light: #666;
    --bg-light: #f8f9fa;
    --white: #ffffff;
    --shadow: 0 2px 15px rgba(0,0,0,0.1);
    --shadow-hover: 0 5px 25px rgba(0,0,0,0.15);
    /* --transition: all 0.3s ease; (애니메이션 제거됨) */
}

body {
    font-family: 'Noto Sans KR', sans-serif;
    color: var(--text-dark);
    line-height: 1.6;
    overflow-x: hidden;
    font-weight: 300;
    word-break: keep-all;
    word-wrap: break-word;
}

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

/* Navigation */
.navbar {
    background: var(--white); /* 파란색 → 흰색 배경으로 복구 */
    box-shadow: none; /* 그림자 제거 */
    position: sticky;
    top: 0;
    z-index: 1000;
    padding: 20px 0;
}

.navbar .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.nav-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 1.5rem;
    font-weight: 300;
    color: var(--primary-color); /* 흰색 → 파란색으로 복구 */
}

.nav-brand .logo-img {
    height: 40px;
    width: auto;
    object-fit: contain;
}

.nav-brand i {
    font-size: 1.8rem;
}

.nav-menu {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    list-style: none;
    gap: 35px;
}

.nav-menu a {
    text-decoration: none;
    color: var(--text-dark); /* 흰색 → 어두운색으로 복구 */
    font-weight: 600; /* 굵게 유지 */
    font-size: 1.05rem; /* 크기 유지 */
    padding-bottom: 5px;
    border-bottom: 3px solid transparent;
    white-space: nowrap; /* 메뉴 5개로 늘어나도 단어가 쪼개지지 않도록 */
    /* transition: color 0.3s; (애니메이션 제거됨) */
}

.nav-menu a:hover {
    color: var(--primary-color); /* 파란색 호버 */
    border-bottom-color: var(--primary-color); /* 파란색 밑줄 */
}

.nav-menu a:hover {
    color: var(--primary-color);
}

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

.nav-icon {
    color: var(--text-dark); /* 흰색 → 어두운색으로 복구 */
    font-size: 1.3rem;
    /* transition: color 0.3s; (애니메이션 제거됨) */
}

.nav-icon:hover {
    color: var(--primary-color); /* 파란색 호버 */
}

/* Navigation Auth */
.nav-auth {
    margin-left: 10px;
}

.btn-login {
    display: inline-block;
    padding: 4px 12px;
    background: transparent; /* 흰색 → 투명으로 복구 */
    color: var(--text-dark) !important; /* 파란색 → 어두운 회색 */
    text-decoration: none;
    border: 1px solid #ddd; /* 테두리 */
    border-radius: 15px;
    font-size: 0.8rem;
    font-weight: 400; /* 500 → 400 */
    /* transition: all 0.3s ease; (애니메이션 제거됨) */
}

.btn-login:hover {
    background: #f5f5f5; /* 살짝 회색 배경 */
    border-color: #ccc;
    color: var(--text-dark) !important;
    /* transform: translateY(-2px); (애니메이션 제거됨) */
}

.user-name {
    color: var(--text-dark); /* 흰색 → 어두운색으로 복구 */
    font-size: 0.9rem;
    font-weight: 500;
    margin-right: 10px;
}

.btn-logout {
    padding: 6px 16px;
    background: transparent;
    color: var(--text-dark);
    border: 1px solid var(--text-light);
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 400;
    cursor: pointer;
    /* transition: all 0.3s ease; (애니메이션 제거됨) */
}

.btn-logout:hover {
    background: var(--primary-color);
    color: var(--white);
    border-color: var(--primary-color);
}

/* Hero Section with Slideshow */
.hero {
    position: relative;
    width: 100%;
    height: 0;
    padding-bottom: 41.67%;
    overflow: hidden;
}

.hero-slide {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    opacity: 0;
    transition: opacity 1.5s ease-in-out;
    image-rendering: -webkit-optimize-contrast;
    image-rendering: crisp-edges;
    -webkit-backface-visibility: hidden;
    backface-visibility: hidden;
}

.hero-slide.active {
    opacity: 1;
    z-index: 1;
}

/* Hero content styles removed - using image only */

/* @keyframes fadeInUp (애니메이션 제거됨) */

/* Welcome Section */
.welcome-section {
    padding: 40px 0;
    background: var(--white);
}

.welcome-card {
    max-width: 800px;
    margin: 0 auto;
    text-align: center;
    background: transparent;
    padding: 60px 40px;
    border-radius: 0;
    box-shadow: none;
}

.welcome-icon {
    font-size: 2.4rem;
    color: var(--primary-color);
    margin-bottom: 20px;
}

.welcome-card h3 {
    color: var(--secondary-color);
    font-size: 1.2rem;
    margin-bottom: 10px;
    font-weight: 400;
}

.welcome-card h2 {
    font-size: 2rem;
    margin-bottom: 25px;
    color: var(--text-dark);
    font-weight: 400;
}

.welcome-card p {
    font-size: 1.1rem;
    color: var(--text-light);
    line-height: 1.8;
    margin-bottom: 30px;
}

.btn-primary {
    display: inline-block;
    padding: 15px 40px;
    background: var(--primary-color);
    color: var(--white);
    text-decoration: none;
    border-radius: 30px;
    font-weight: 400;
    /* transition: all 0.3s; (애니메이션 제거됨) */
    box-shadow: 0 4px 15px rgba(74, 144, 226, 0.3);
}

.btn-primary:hover {
    background: #357abd;
    /* transform: translateY(-2px); (애니메이션 제거됨) */
    box-shadow: 0 6px 20px rgba(74, 144, 226, 0.4);
}

/* Feed Section - Card Style (Like Jeju Haengwon Church) */
.feed-section {
    padding: 80px 0;
    background: var(--white);
}

.section-header {
    text-align: center;
    margin-bottom: 60px;
}

.section-header h2 {
    font-size: 2.5rem;
    margin-bottom: 15px;
    color: var(--text-dark);
    font-weight: 400;
}

.section-header p {
    font-size: 1.1rem;
    color: var(--text-light);
}

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

/* Feed Card Style - Image Background with Text Overlay (Jeju Haengwon Style) */
.feed-card {
    position: relative;
    background: var(--white);
    border-radius: 15px;
    overflow: hidden;
    box-shadow: var(--shadow);
    /* transition: all 0.3s ease; (애니메이션 제거됨) */
    cursor: pointer;
    height: 400px;
}

.feed-card:hover {
    /* transform: translateY(-10px); (애니메이션 제거됨) */
    box-shadow: var(--shadow-hover);
}

.feed-image {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
}

.feed-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    /* transition: transform 0.5s ease; (애니메이션 제거됨) */
}

.feed-card:hover .feed-image img {
    /* transform: scale(1.1); (애니메이션 제거됨) */
}

/* Dark gradient overlay for better text readability */
.feed-image::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(to bottom, 
        rgba(0, 0, 0, 0.3) 0%, 
        rgba(0, 0, 0, 0.5) 70%, 
        rgba(0, 0, 0, 0.8) 100%);
    z-index: 1;
}

.feed-overlay {
    position: absolute;
    top: 20px;
    left: 20px;
    z-index: 3;
}

.feed-category {
    background: rgba(255, 255, 255, 0.95);
    color: var(--primary-color);
    padding: 8px 20px;
    border-radius: 25px;
    font-size: 0.9rem;
    font-weight: 400;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
}

/* Text content overlay at the bottom */
.feed-content {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    padding: 30px;
    z-index: 2;
    color: var(--white);
}

.feed-content h3 {
    font-size: 1.6rem;
    margin-bottom: 12px;
    color: var(--white);
    font-weight: 400;
    text-shadow: 2px 2px 8px rgba(0, 0, 0, 0.3);
    line-height: 1.3;
}

.feed-content p {
    color: rgba(255, 255, 255, 0.95);
    line-height: 1.6;
    margin-bottom: 15px;
    font-size: 1rem;
    text-shadow: 1px 1px 4px rgba(0, 0, 0, 0.5);
}

.feed-meta {
    display: flex;
    align-items: center;
    gap: 15px;
    color: rgba(255, 255, 255, 0.9);
    font-size: 0.9rem;
}

.feed-meta i {
    color: var(--white);
}

/* Quick Links */
.quick-links {
    padding: 60px 0;
    background: var(--white);
}

.quick-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 25px;
}

.quick-card {
    background: rgba(255, 255, 255, 0.95);
    padding: 40px 30px;
    border-radius: 15px;
    text-align: center;
    text-decoration: none;
    color: var(--text-dark);
    /* transition: all 0.3s; (애니메이션 제거됨) */
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}

.quick-card:hover {
    transform: translateY(-5px);
    background: var(--white);
    box-shadow: 0 8px 25px rgba(0,0,0,0.15);
}

.quick-card i {
    font-size: 3rem;
    color: var(--primary-color);
    margin-bottom: 15px;
}

.quick-card h3 {
    font-size: 1.3rem;
    font-weight: 400;
}

/* Footer */
.footer {
    background: #f8f8f8;
    color: #999;
    padding: 40px 0 20px;
    border-top: 1px solid #e8e8e8;
}

.footer-main {
    padding-bottom: 30px;
}

.footer-logo {
    margin-bottom: 10px;
}

.footer-church-logo {
    height: 40px;
    width: auto;
    object-fit: contain;
}

.footer-info {
    margin-left: 0;
    margin-top: 0;
}

.footer-address {
    font-size: 0.95rem;
    color: #666;
    margin-bottom: 8px;
}

.footer-contact {
    font-size: 0.9rem;
    color: #999;
}

.footer-contact .separator {
    margin: 0 10px;
}

.footer-bottom {
    text-align: left;
    padding-top: 20px;
    border-top: 1px solid #e8e8e8;
    font-size: 0.85rem;
    color: #999;
}

.footer-bottom p {
    margin: 0;
}

/* Responsive Design */
@media (max-width: 768px) {
    body {
        font-size: 14px;
    }
    
    .navbar .container {
        flex-wrap: wrap;
        justify-content: center;  /* 가운데 정렬 추가 */
        gap: 15px;
        padding-left: 12px;   /* 메뉴가 쓸 수 있는 가로폭 확보 */
        padding-right: 12px;
    }
    
    .nav-brand {
        order: 1;
    }
    
    .nav-brand .logo-img {
        height: 40px;
        margin-right: 10px;
    }
    
    .navbar .nav-menu {
        width: 100%;
        flex-wrap: nowrap;      /* 한 줄 유지 */
        justify-content: center;
        gap: 14px;
        padding: 12px 0;
        order: 3;
    }

    /* 모바일: 폰트는 아래 480px 블록의 clamp 가 담당합니다.
       .navbar 를 붙여 각 페이지 CSS(worship.css 등)보다 우선 적용되게 합니다. */
    .navbar .nav-menu a {
        font-size: 0.88rem;
        padding-bottom: 4px;
        border-bottom-width: 2px;
    }
    
    .nav-icons {
        order: 2;
        justify-content: center;  /* 가운데 정렬 추가 */
    }
    
    /* Hero - 모바일에서 4:3 비율 */
    .hero {
        padding-bottom: 85%;  /* 약 6:5 비율 (1:1과 4:3 중간) */
    }
    
    /* 환영 섹션 폰트 축소 */
    .welcome-card h2 {
        font-size: 1.6rem;
    }
    
    .welcome-card h3 {
        font-size: 1.1rem;
    }
    
    .welcome-card p {
        font-size: 0.9rem;
        line-height: 1.7;
    }
    
    .feed-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .feed-card {
        height: 350px;
    }
    
    .feed-content h3 {
        font-size: 1.3rem;
    }
    
    .feed-content p {
        font-size: 0.95rem;
    }
    
    .section-header h2 {
        font-size: 2rem;
    }
    
    .welcome-card {
        padding: 40px 25px;
    }
}

@media (max-width: 480px) {
    /* Hero is responsive via aspect ratio */

    /* 5개 메뉴 유지 + 가독성 확보:
       space-between 은 첫/끝 항목을 화면 끝에 붙여 놓기 때문에
       가운데 정렬 + 고정 간격으로 바꿉니다(양옆에 자연스러운 여백 생김). */
    .navbar .container {
        padding-left: 16px;
        padding-right: 16px;
    }

    .navbar .nav-menu {
        flex-wrap: nowrap;
        justify-content: center;
        gap: clamp(6px, 2.6vw, 14px);
        padding: 10px 0 12px;
    }

    /* 화면 폭에 비례해 자동 조절 (clamp) — 원래(11.8px)보다 살짝만 큰 수준.
       · 390px  → 약 12.9px
       · 375px  → 약 12.4px
       · 360px  → 약 11.9px
       좁은 폰에서도 다성 5개가 한 줄에 유지됩니다. */
    .navbar .nav-menu a {
        font-size: clamp(0.74rem, 3.3vw, 0.86rem);
    }
}

/* 아주 좁은 기기(iPhone SE 1세대 등) — 메뉴 폰트는 위 clamp 가 처리 */
@media (max-width: 360px) {
    .nav-brand {
        font-size: 1.2rem;
    }
    
    .feed-card {
        height: 320px;
    }
    
    .feed-content {
        padding: 20px;
    }
    
    .feed-content h3 {
        font-size: 1.2rem;
    }
    
    .feed-content p {
        font-size: 0.9rem;
    }
    
    .feed-overlay {
        top: 15px;
        left: 15px;
    }
    
    .feed-category {
        padding: 6px 15px;
        font-size: 0.85rem;
    }
}

/* ===========================
   Scroll to Top Button
   ========================== */
.scroll-top {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 50px;
    height: 50px;
    background: var(--primary-color);
    color: var(--white);
    border: none;
    border-radius: 50%;
    font-size: 1.2rem;
    cursor: pointer;
    box-shadow: var(--shadow);
    transition: var(--transition);
    opacity: 0;
    visibility: hidden;
    z-index: 1000;
}

.scroll-top.show {
    opacity: 1;
    visibility: visible;
}

.scroll-top:hover {
    background: var(--secondary-color);
    transform: translateY(-5px);
}
