/* ============================================
   한홍석 원로목사 설교 아카이브
   Classic & Dynamic Design
   ============================================ */

:root {
    --color-primary: #1a1a2e;
    --color-secondary: #16213e;
    --color-accent: #8b6914;
    --color-accent-light: #c9a84c;
    --color-gold: #d4af37;
    --color-cream: #faf8f0;
    --color-warm: #f5f0e8;
    --color-text: #2d2d2d;
    --color-text-light: #6b6b6b;
    --color-border: #e8e0d0;
    --font-serif: 'Noto Serif KR', serif;
    --font-display: 'Cormorant Garamond', serif;
    --shadow-soft: 0 4px 20px rgba(0,0,0,0.08);
    --shadow-medium: 0 8px 40px rgba(0,0,0,0.12);
    --shadow-heavy: 0 16px 60px rgba(0,0,0,0.2);
    --transition: all 0.4s cubic-bezier(0.25, 0.8, 0.25, 1);
}

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

html {
    scroll-behavior: smooth;
    font-size: 16px;
}

body {
    font-family: var(--font-serif);
    color: var(--color-text);
    background: var(--color-cream);
    overflow-x: hidden;
    line-height: 1.8;
}

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

/* ============================================
   Navigation
   ============================================ */
#navbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    padding: 1.5rem 0;
    transition: var(--transition);
}

#navbar.scrolled {
    background: rgba(26, 26, 46, 0.95);
    backdrop-filter: blur(10px);
    padding: 0.8rem 0;
    box-shadow: 0 2px 20px rgba(0,0,0,0.3);
}

.nav-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.nav-logo {
    font-family: var(--font-serif);
    font-size: 1.2rem;
    font-weight: 600;
    color: #fff;
    text-decoration: none;
    letter-spacing: 0.05em;
}

.nav-links {
    display: flex;
    list-style: none;
    gap: 2.5rem;
}

.nav-links a {
    color: rgba(255,255,255,0.85);
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 400;
    letter-spacing: 0.05em;
    transition: var(--transition);
    position: relative;
}

.nav-links a::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 0;
    width: 0;
    height: 1px;
    background: var(--color-gold);
    transition: width 0.3s ease;
}

.nav-links a:hover {
    color: var(--color-gold);
}

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

.nav-toggle {
    display: none;
    flex-direction: column;
    gap: 5px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 5px;
}

.nav-toggle span {
    width: 24px;
    height: 2px;
    background: #fff;
    transition: var(--transition);
}

/* ============================================
   Hero Section
   ============================================ */
#hero {
    position: relative;
    height: 100vh;
    min-height: 700px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 50%, #0f3460 100%);
    overflow: hidden;
}

.hero-overlay {
    position: absolute;
    inset: 0;
    background:
        radial-gradient(ellipse at 20% 50%, rgba(212, 175, 55, 0.05) 0%, transparent 50%),
        radial-gradient(ellipse at 80% 20%, rgba(212, 175, 55, 0.03) 0%, transparent 40%);
}

.hero-particles {
    position: absolute;
    inset: 0;
    overflow: hidden;
}

.hero-particles .particle {
    position: absolute;
    width: 2px;
    height: 2px;
    background: rgba(212, 175, 55, 0.6);
    border-radius: 50%;
    box-shadow: 0 0 4px rgba(212, 175, 55, 0.3);
    animation: float-particle linear infinite;
}

.hero-particles .particle-bright {
    background: rgba(255, 223, 100, 0.85);
    box-shadow: 0 0 8px rgba(255, 223, 100, 0.5), 0 0 16px rgba(212, 175, 55, 0.2);
}

@keyframes float-particle {
    0% { transform: translateY(100vh) rotate(0deg); opacity: 0; }
    10% { opacity: 1; }
    90% { opacity: 1; }
    100% { transform: translateY(-100px) rotate(720deg); opacity: 0; }
}

.hero-content {
    position: relative;
    z-index: 2;
    text-align: center;
    padding: 2rem;
}

.hero-subtitle {
    font-family: var(--font-display);
    font-size: 1.1rem;
    color: var(--color-gold);
    letter-spacing: 0.3em;
    text-transform: uppercase;
    margin-bottom: 1rem;
    opacity: 0;
    transform: translateY(30px);
}

.hero-title {
    font-family: var(--font-serif);
    font-size: clamp(2.5rem, 6vw, 4.5rem);
    font-weight: 700;
    color: #fff;
    letter-spacing: 0.1em;
    margin-bottom: 1.5rem;
    opacity: 0;
    transform: translateY(30px);
}

.hero-divider {
    width: 80px;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--color-gold), transparent);
    margin: 0 auto 2rem;
    opacity: 0;
    transform: translateY(30px);
}

.hero-verse {
    font-family: var(--font-serif);
    font-size: 1.05rem;
    font-weight: 300;
    color: rgba(255,255,255,0.7);
    line-height: 2;
    font-style: italic;
    margin-bottom: 2.5rem;
    opacity: 0;
    transform: translateY(30px);
}

.hero-verse span {
    display: block;
    margin-top: 0.5rem;
    font-size: 0.85rem;
    color: rgba(212, 175, 55, 0.7);
    font-style: normal;
}

.hero-btn {
    display: inline-block;
    padding: 1rem 2.5rem;
    border: 1px solid var(--color-gold);
    color: var(--color-gold);
    text-decoration: none;
    font-size: 0.9rem;
    letter-spacing: 0.15em;
    transition: var(--transition);
    opacity: 0;
    transform: translateY(30px);
}

.hero-btn:hover {
    background: var(--color-gold);
    color: var(--color-primary);
}

.scroll-indicator {
    position: absolute;
    bottom: 3rem;
    left: 50%;
    transform: translateX(-50%);
    animation: bounce 2s infinite;
}

.scroll-arrow {
    width: 24px;
    height: 24px;
    border-right: 1px solid rgba(212, 175, 55, 0.5);
    border-bottom: 1px solid rgba(212, 175, 55, 0.5);
    transform: rotate(45deg);
}

@keyframes bounce {
    0%, 20%, 50%, 80%, 100% { transform: translateX(-50%) translateY(0); }
    40% { transform: translateX(-50%) translateY(-10px); }
    60% { transform: translateX(-50%) translateY(-5px); }
}

/* ============================================
   Section Common Styles
   ============================================ */
section {
    position: relative;
    padding: 8rem 0;
}

.section-bg-pattern {
    position: absolute;
    inset: 0;
    opacity: 0.03;
    background-image:
        repeating-linear-gradient(45deg, var(--color-accent) 0, var(--color-accent) 1px, transparent 1px, transparent 50%);
    background-size: 30px 30px;
    pointer-events: none;
}

.section-header {
    text-align: center;
    margin-bottom: 4rem;
}

.section-label {
    font-family: var(--font-display);
    font-size: 0.85rem;
    letter-spacing: 0.3em;
    color: var(--color-accent);
    text-transform: uppercase;
    display: block;
    margin-bottom: 0.8rem;
}

.section-title {
    font-family: var(--font-serif);
    font-size: clamp(1.8rem, 4vw, 2.8rem);
    font-weight: 700;
    color: var(--color-primary);
    margin-bottom: 1rem;
}

.title-ornament {
    width: 60px;
    height: 2px;
    background: linear-gradient(90deg, transparent, var(--color-gold), transparent);
    margin: 0 auto;
}

.section-desc {
    margin-top: 1.5rem;
    color: var(--color-text-light);
    font-size: 1rem;
}

/* ============================================
   About Section
   ============================================ */
#about {
    background: var(--color-warm);
}

.about-photo {
    position: relative;
    max-width: 700px;
    margin: 0 auto 3rem;
}

.photo-frame {
    position: relative;
    border: 2px solid var(--color-border);
    padding: 0.8rem;
    background: #fff;
    box-shadow: var(--shadow-soft);
}

.photo-frame img {
    width: 100%;
    height: auto;
    display: block;
}

.photo-decoration {
    position: absolute;
    top: -10px;
    right: -10px;
    width: 100%;
    height: 100%;
    border: 1px solid var(--color-gold);
    z-index: -1;
    opacity: 0.4;
}

.about-bio-section {
    max-width: 750px;
    margin: 0 auto;
}

.about-bio p {
    margin-bottom: 1.2rem;
    color: var(--color-text);
    font-size: 1rem;
    line-height: 2;
    text-align: center;
}

.about-stats {
    display: flex;
    justify-content: center;
    gap: 3.5rem;
    margin: 2.5rem 0;
    padding: 2rem 0;
    border-top: 1px solid var(--color-border);
    border-bottom: 1px solid var(--color-border);
}

.stat-item {
    text-align: center;
}

.stat-number {
    display: block;
    font-family: var(--font-display);
    font-size: 2.5rem;
    font-weight: 600;
    color: var(--color-accent);
    line-height: 1;
    margin-bottom: 0.5rem;
}

.stat-prefix {
    font-family: var(--font-serif);
    font-size: 1.2rem;
    font-weight: 300;
    color: var(--color-text-light);
}

.stat-label {
    font-size: 0.8rem;
    color: var(--color-text-light);
    letter-spacing: 0.05em;
}

.about-quote {
    font-style: italic;
    font-size: 1rem;
    color: var(--color-accent);
    padding-left: 1.5rem;
    border-left: 2px solid var(--color-gold);
    line-height: 1.8;
}

.about-video {
    margin-top: 4rem;
}

.about-video-wrapper {
    position: relative;
    padding-bottom: 56.25%;
    height: 0;
    overflow: hidden;
    border: 1px solid var(--color-border);
    box-shadow: var(--shadow-medium);
}

.about-video-wrapper iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

/* ============================================
   Books Section
   ============================================ */
#books {
    background: var(--color-cream);
}

.books-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    gap: 3rem;
    justify-items: center;
}

.book-card {
    display: flex;
    gap: 2.5rem;
    background: #fff;
    padding: 2.5rem;
    border: 1px solid var(--color-border);
    box-shadow: var(--shadow-soft);
    transition: var(--transition);
    max-width: 600px;
    width: 100%;
}

.book-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-medium);
}

.book-cover {
    flex-shrink: 0;
    width: 180px;
    transition: transform 0.6s ease;
}

.book-cover img {
    width: 100%;
    height: auto;
    display: block;
    border-radius: 2px;
    box-shadow: 4px 4px 15px rgba(0,0,0,0.25);
}

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

.book-info {
    flex: 1;
}

.book-title {
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--color-primary);
    margin-bottom: 0.2rem;
}

.book-subtitle {
    font-size: 0.95rem;
    font-weight: 400;
    color: var(--color-accent);
    margin-bottom: 0.8rem;
}

.book-author {
    font-size: 0.85rem;
    color: var(--color-text-light);
    margin-bottom: 1rem;
}

.book-desc {
    font-size: 0.9rem;
    line-height: 1.8;
    color: var(--color-text);
    margin-bottom: 1.5rem;
}

.book-link {
    display: inline-block;
    color: var(--color-accent);
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 500;
    transition: var(--transition);
    border-bottom: 1px solid transparent;
}

.book-link:hover {
    color: var(--color-gold);
    border-bottom-color: var(--color-gold);
}

.books-note {
    text-align: center;
    margin-top: 2rem;
    font-size: 0.85rem;
    color: var(--color-text-light);
    font-style: italic;
}

/* ============================================
   Archive Section
   ============================================ */
#archive {
    background: #fff;
    min-height: 100vh;
}

.archive-controls {
    margin-bottom: 3rem;
}

.search-box {
    position: relative;
    margin-bottom: 1.5rem;
}

.search-icon {
    position: absolute;
    left: 1.2rem;
    top: 50%;
    transform: translateY(-50%);
    width: 20px;
    height: 20px;
    color: var(--color-text-light);
}

#searchInput {
    width: 100%;
    padding: 1.2rem 3rem 1.2rem 3.5rem;
    font-family: var(--font-serif);
    font-size: 1rem;
    border: 1px solid var(--color-border);
    background: var(--color-cream);
    outline: none;
    transition: var(--transition);
}

#searchInput:focus {
    border-color: var(--color-gold);
    box-shadow: 0 0 0 3px rgba(212, 175, 55, 0.1);
}

.clear-btn {
    position: absolute;
    right: 1rem;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    font-size: 1.2rem;
    color: var(--color-text-light);
    cursor: pointer;
    opacity: 0;
    transition: var(--transition);
}

.clear-btn.visible {
    opacity: 1;
}

.filter-row {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

.filter-row select {
    padding: 0.8rem 2rem 0.8rem 1rem;
    font-family: var(--font-serif);
    font-size: 0.9rem;
    border: 1px solid var(--color-border);
    background: var(--color-cream);
    color: var(--color-text);
    outline: none;
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%236b6b6b' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.8rem center;
    transition: var(--transition);
    min-width: 140px;
}

.filter-row select:focus {
    border-color: var(--color-gold);
}

.reset-btn {
    padding: 0.8rem 1.5rem;
    font-family: var(--font-serif);
    font-size: 0.85rem;
    border: 1px solid var(--color-border);
    background: transparent;
    color: var(--color-text-light);
    cursor: pointer;
    transition: var(--transition);
}

.reset-btn:hover {
    border-color: var(--color-accent);
    color: var(--color-accent);
}

.results-info {
    margin-top: 1rem;
    font-size: 0.85rem;
    color: var(--color-text-light);
}

#resultsCount {
    font-weight: 600;
    color: var(--color-accent);
}

/* ============================================
   Sermon List
   ============================================ */
.sermon-list {
    display: flex;
    flex-direction: column;
    gap: 1px;
    background: var(--color-border);
    border: 1px solid var(--color-border);
}

.sermon-item {
    display: grid;
    grid-template-columns: 100px 1fr 200px auto;
    align-items: center;
    gap: 1.5rem;
    padding: 1.2rem 1.5rem;
    background: #fff;
    cursor: pointer;
    transition: var(--transition);
    animation: fadeIn 0.3s ease forwards;
    opacity: 0;
}

.sermon-item:hover {
    background: var(--color-warm);
    transform: translateX(4px);
}

.sermon-item.no-video {
    cursor: default;
    opacity: 0.7;
}

.sermon-item.no-video:hover {
    transform: none;
}

@keyframes fadeIn {
    to { opacity: 1; }
}

.sermon-date {
    font-size: 0.8rem;
    color: var(--color-text-light);
    white-space: nowrap;
}

.sermon-title-text {
    font-size: 0.95rem;
    font-weight: 500;
    color: var(--color-primary);
}

.sermon-scripture {
    font-size: 0.85rem;
    color: var(--color-accent);
    text-align: right;
}

.sermon-play {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--color-accent);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
    flex-shrink: 0;
}

.sermon-play svg {
    width: 12px;
    height: 12px;
    fill: #fff;
    margin-left: 2px;
}

.sermon-item:hover .sermon-play {
    background: var(--color-gold);
    transform: scale(1.1);
}

.sermon-no-play {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--color-text-light);
    font-size: 0.7rem;
}

.sermon-empty {
    padding: 4rem 2rem;
    text-align: center;
    background: #fff;
    color: var(--color-text-light);
    font-size: 1rem;
}

/* ============================================
   Pagination
   ============================================ */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.5rem;
    margin-top: 3rem;
}

.page-btn {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--color-border);
    background: #fff;
    color: var(--color-text);
    font-family: var(--font-serif);
    font-size: 0.85rem;
    cursor: pointer;
    transition: var(--transition);
}

.page-btn:hover {
    border-color: var(--color-gold);
    color: var(--color-accent);
}

.page-btn.active {
    background: var(--color-primary);
    border-color: var(--color-primary);
    color: #fff;
}

.page-btn.disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

/* ============================================
   Video Modal
   ============================================ */
.modal {
    position: fixed;
    inset: 0;
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: var(--transition);
}

.modal.active {
    opacity: 1;
    visibility: visible;
}

.modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.85);
}

.modal-content {
    position: relative;
    width: 90%;
    max-width: 900px;
    background: var(--color-primary);
    padding: 2rem;
    transform: translateY(20px) scale(0.95);
    transition: var(--transition);
}

.modal.active .modal-content {
    transform: translateY(0) scale(1);
}

.modal-close {
    position: absolute;
    top: 1rem;
    right: 1.5rem;
    background: none;
    border: none;
    color: rgba(255,255,255,0.7);
    font-size: 1.5rem;
    cursor: pointer;
    transition: var(--transition);
    z-index: 10;
}

.modal-close:hover {
    color: var(--color-gold);
}

.modal-header {
    margin-bottom: 1.5rem;
}

.modal-header h3 {
    color: #fff;
    font-size: 1.2rem;
    font-weight: 500;
    margin-bottom: 0.3rem;
}

.modal-header p {
    color: rgba(255,255,255,0.5);
    font-size: 0.85rem;
}

.modal-video {
    position: relative;
    padding-bottom: 56.25%;
    height: 0;
    overflow: hidden;
}

.modal-video iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

#ytPlayer {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

.video-error {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 1.5rem;
    background: rgba(26, 26, 46, 0.95);
}

.video-error p {
    color: rgba(255,255,255,0.7);
    font-size: 1rem;
}

.modal-fallback {
    text-align: center;
    margin-top: 1.2rem;
}

.youtube-direct-link {
    display: inline-block;
    padding: 0.7rem 2rem;
    color: var(--color-gold);
    border: 1px solid rgba(212, 175, 55, 0.4);
    text-decoration: none;
    font-family: var(--font-serif);
    font-size: 0.9rem;
    letter-spacing: 0.05em;
    transition: var(--transition);
}

.youtube-direct-link:hover {
    background: var(--color-gold);
    color: var(--color-primary);
}

/* ============================================
   Footer
   ============================================ */
#footer {
    background: var(--color-primary);
    color: rgba(255,255,255,0.7);
    padding: 4rem 0 2rem;
}

.footer-content {
    padding-bottom: 3rem;
    border-bottom: 1px solid rgba(255,255,255,0.1);
}

.footer-info h3 {
    color: #fff;
    font-size: 1.2rem;
    margin-bottom: 0.8rem;
}

.footer-info p {
    font-size: 0.9rem;
    margin-bottom: 0.4rem;
}

.footer-info a {
    color: var(--color-gold);
    text-decoration: none;
}

.footer-quote {
    text-align: center;
}

.footer-quote p {
    font-style: italic;
    font-size: 0.9rem;
    line-height: 1.8;
    margin-bottom: 0.5rem;
}

.footer-quote span {
    font-size: 0.8rem;
    color: var(--color-gold);
}

.footer-bottom {
    padding-top: 2rem;
    text-align: center;
    font-size: 0.8rem;
    color: rgba(255,255,255,0.4);
}

/* ============================================
   Animations
   ============================================ */
[data-animate] {
    opacity: 0;
    transform: translateY(40px);
    transition: opacity 0.8s ease, transform 0.8s ease;
}

[data-animate="fade-right"] {
    transform: translateX(-40px);
}

[data-animate="fade-left"] {
    transform: translateX(40px);
}

[data-animate].animated {
    opacity: 1;
    transform: translate(0, 0);
}

/* ============================================
   Responsive
   ============================================ */
@media (max-width: 968px) {
    .about-photo {
        max-width: 100%;
    }
}

@media (max-width: 768px) {
    .nav-links {
        display: none;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background: rgba(26, 26, 46, 0.98);
        flex-direction: column;
        padding: 2rem;
        gap: 1.5rem;
    }

    .nav-links.active {
        display: flex;
    }

    .nav-toggle {
        display: flex;
    }

    .sermon-item {
        grid-template-columns: 80px 1fr auto;
        gap: 0.8rem;
        padding: 1rem;
    }

    .sermon-scripture {
        display: none;
    }

    .filter-row {
        flex-direction: column;
    }

    .filter-row select {
        width: 100%;
    }

    .about-stats {
        gap: 1.5rem;
    }

    .book-card {
        flex-direction: column;
        align-items: center;
        text-align: center;
    }

    .books-grid {
        grid-template-columns: 1fr;
    }

    section {
        padding: 5rem 0;
    }
}

@media (max-width: 480px) {
    .hero-title {
        font-size: 2rem;
    }

    .stat-number {
        font-size: 2rem;
    }

    .about-stats {
        flex-wrap: wrap;
        justify-content: center;
    }
}
