* {
    box-sizing: border-box;
}

img {
    max-width: 100%;
    height: auto;
}

:root {
    --primary-gold: #C5A059;
    --bg-warm-white: #FDFBF5; /* A slightly warmer white */
    --text-navy: #2C3E50;
    --card-bg: #ffffff;
    --accent-red: #e74c3c;
    --secondary-brown: #8D6E63;
    --border-color: #ECECEC;
}

body {
    background-color: var(--bg-warm-white);
    color: var(--text-navy);
    font-family: 'Noto Sans TC', sans-serif;
    margin: 0;
    font-size: 17px;
    line-height: 1.7;
}

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

/* --- Header & Navigation --- */
header {
    background: var(--card-bg);
    border-bottom: 2px solid var(--primary-gold);
    padding: 1rem 0;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
}

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

header h1 { margin: 0; font-size: 1.5rem; color: var(--primary-gold); }

.logo-link {
    color: inherit;
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 12px;
}

.header-logo {
    height: 48px;
    width: auto;
    object-fit: contain;
}

nav a {
    text-decoration: none;
    color: var(--text-navy);
    margin-left: 20px;
    font-weight: 500;
    transition: color 0.2s ease-in-out;
}

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


/* --- Main Content & Cards --- */
.page-header {
    padding: 40px 0;
    text-align: left;
}
.page-header h2 {
    margin-bottom: 10px;
}
.page-header p {
    color: #888;
    margin-bottom: 40px;
}

.hero {
    margin: 20px 0 40px 0;
}

.greeting-box {
    background: var(--card-bg);
    color: var(--secondary-brown);
    padding: 25px;
    border-radius: 12px;
    margin-bottom: 25px;
    font-size: 1.15rem;
    font-weight: 500;
    box-shadow: 0 4px 20px rgba(0,0,0,0.06);
    border-left: 6px solid var(--primary-gold);
}

.video-container {
    position: relative;
    padding-bottom: 56.25%;
    height: 0;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
    border-radius: 12px;
    overflow: hidden;
    background: #000;
}

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

h2 {
    border-bottom: 2px solid var(--primary-gold);
    display: inline-block;
    padding-bottom: 5px;
    margin-bottom: 20px;
}

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

#activity-list, #content-grid {
    min-height: 250px;
}

.grid > * {
    width: 100%;
}

.card {
    background: var(--card-bg);
    border-radius: 12px;
    padding: 20px 20px 20px 25px;
    box-shadow: 0 6px 25px rgba(197, 160, 89, 0.2);
    transition: transform 0.2s ease-in-out, box-shadow 0.2s ease-in-out;
    border-left: 6px solid var(--primary-gold);
}

.card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 30px rgba(197, 160, 89, 0.25);
}

.card h3 {
    margin-top: 0;
    margin-bottom: 10px;
    font-size: 1.25rem;
    color: var(--primary-gold);
}

/* Video/Live Card Styles */
.card h4 {
    color: var(--text-navy);
    font-size: 1.05rem;
    margin: 10px 0 5px 0;
    text-align: left;
}

.card p, .card small {
    margin: 5px 0;
    font-size: 1.05rem;
}
.card small {
    font-size: 0.9rem;
    color: #666;
    text-align: left;
    display: block;
}
.card img {
    width: 100%;
    border-radius: 8px;
}

/* FAQ Section Styles */
.qa-section {
    margin-top: 60px;
}

.qa-box {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.faq-item {
    background: var(--card-bg);
    border-radius: 12px;
    padding: 20px 20px 20px 25px;
    box-shadow: 0 6px 25px rgba(197, 160, 89, 0.2);
    border-left: 6px solid var(--primary-gold);
}

.faq-q {
    font-weight: bold;
    color: var(--text-navy);
    font-size: 1.1rem;
    margin-bottom: 10px;
}
.faq-q::before {
    content: 'Q.';
    color: var(--primary-gold);
    margin-right: 8px;
    font-weight: bold;
}
.faq-a {
    color: var(--secondary-brown);
    font-size: 1.05rem;
    padding-left: 28px;
}
.faq-a p {
    margin: 0;
}


/* --- Video/Live Search Bar --- */
.search-bar { 
    background: #f9f9f9; 
    padding: 25px; 
    border-radius: 12px; 
    margin-bottom: 40px; 
    display: flex; 
    gap: 15px; 
    flex-wrap: wrap; 
    align-items: flex-end; 
    box-shadow: 0 2px 8px rgba(0,0,0,0.05); 
}
.search-group label { 
    font-size: 0.9rem; 
    color: #666; 
    font-weight: bold; 
}
.search-group input { 
    padding: 10px; 
    border: 1px solid #ddd; 
    border-radius: 6px; 
    font-family: inherit; 
    font-size: 0.95rem; 
}
.search-group input[type="date"] { 
    min-width: 160px; 
}
.search-btn { 
    padding: 10px 30px; 
    background: var(--primary-gold); 
    color: white; 
    border: none; 
    border-radius: 6px; 
    cursor: pointer; 
    font-weight: bold; 
    height: 42px; 
}
.search-btn:hover { 
    background: var(--secondary-brown); 
}


/* --- Forms & Buttons --- */
.form-input, .form-select {
    width: 100%; 
    padding: 10px;
    border: 1px solid #ddd; 
    border-radius: 8px; 
    font-size: 1rem; 
    box-sizing: border-box;
}

#qa-input:focus, .form-input:focus, .form-select:focus {
    outline: none;
    border-color: var(--primary-gold);
}

button, .btn-full-width {
    background: var(--primary-gold);
    color: white;
    border: none;
    padding: 12px 25px;
    border-radius: 8px;
    cursor: pointer;
    font-weight: bold;
    text-align: center;
    transition: background 0.2s ease-in-out;
}

button:hover, .btn-full-width:hover {
    background: #b38f4d;
}


/* --- Footer --- */
.footer-logo {
    width: 100px;
    height: auto;
    margin-bottom: 20px;
    filter: invert(68%) sepia(18%) saturate(763%) hue-rotate(7deg) brightness(91%) contrast(87%) drop-shadow(0 2px 4px rgba(0,0,0,0.1));
    transition: transform 0.3s ease;
}

.footer-logo:hover {
    transform: scale(1.05);
}

footer {
    border-top: 1px solid var(--border-color);
    margin-top: 50px;
    padding: 60px 20px;
    color: #7f8c8d;
}

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

.footer-info {
    margin-bottom: 25px;
    line-height: 1.8;
}

.church-name {
    font-size: 1.1rem;
    color: #333;
    margin-bottom: 10px;
}

.version-info {
    margin-top: 30px;
    border-top: 1px solid var(--border-color);
    padding-top: 20px;
    font-size: 0.85rem;
    line-height: 1.7;
    text-align: left;
    max-width: 900px;
    margin-left: auto;
    margin-right: auto;
}
.version-title {
    font-size: 1rem;
    color: #333;
    margin-bottom: 15px;
    text-align: center;
}
.version-detail {
    margin-bottom: 15px;
}
.version-text {
    margin-left: 15px;
}
.copyright {
    font-size: 0.85rem;
    margin-top: 20px;
}


/* --- Mobile Menu --- */
.menu-toggle { display: none; }
.menu-overlay { display: none; }

@media (max-width: 992px) {
    .container { padding: 15px; }
    .grid { grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); }
    header .container { flex-direction: row; justify-content: space-between; padding: 10px 20px; align-items: center; }
    header h1 { font-size: 1.2rem; flex: 1; text-align: left; }
    nav {
        position: fixed; top: 0; right: -250px; width: 250px; height: 100vh;
        background: white; flex-direction: column; display: flex; padding: 60px 0 20px 0;
        box-shadow: -5px 0 15px rgba(0,0,0,0.1); transition: right 0.3s ease; z-index: 1000; align-items: stretch;
    }
    nav.active { right: 0; }
    nav a { margin: 0 !important; padding: 15px 25px; border-bottom: 1px solid #eee; width: auto; font-size: 1.1rem; display: block; }
    .menu-toggle { display: block; font-size: 1.8rem; cursor: pointer; color: var(--primary-gold); padding: 5px; line-height: 1; }
    .menu-overlay { position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0,0,0,0.5); z-index: 999; }
    .menu-overlay.active { display: block; }
    h2 { font-size: 1.3rem; }
    .hero { margin-bottom: 25px; }
    .greeting-box { font-size: 1rem; padding: 18px; }
    footer .container { padding: 30px 15px; }
}

/*
 * ===============================================
 * Bible Page Specific Styles
 * ===============================================
 */

.bible-container { 
    display: flex; 
    gap: 20px; 
    margin-top: 20px; 
    min-height: 80vh; 
    align-items: flex-start; 
}
.bible-sidebar { 
    width: 320px; 
    background: #f9f9f9; 
    padding: 20px; 
    border-radius: 8px; 
    flex-shrink: 0; 
}
.bible-main { 
    flex: 1; 
    background: white; 
    padding: 30px; 
    border-radius: 8px; 
    box-shadow: 0 2px 10px rgba(0,0,0,0.05); 
}

.bible-sidebar-card {
    margin-bottom: 20px;
    background: #fff;
    padding: 15px;
    border-radius: 8px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
}

.search-form {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.bible-sidebar .btn-full-width {
    font-size: 0.95rem;
}

.search-form {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.bible-sidebar .btn-full-width {
    font-size: 0.95rem;
}

.card-title {
    font-size: 1rem;
    margin-bottom: 10px;
    border: none;
}

.book-group { margin-bottom: 20px; }
.book-group h3 { 
    border-bottom: 2px solid var(--primary-gold); 
    padding-bottom: 5px; 
    margin-bottom: 10px; 
    font-size: 1.1rem; 
}
.book-list { 
    display: grid; 
    grid-template-columns: 1fr 1fr; 
    gap: 5px; 
}
.book-item { 
    cursor: pointer; 
    padding: 5px 8px; 
    border-radius: 4px; 
    font-size: 0.95rem; 
    text-align: left; 
    border: 1px solid transparent; 
    transition: all 0.2s;
    display: flex;
    align-items: center;
    min-height: 38px;
    line-height: 1.3;
}
.book-item:hover { 
    background: var(--bg-warm-white); 
    border-color: var(--primary-gold); 
}
.book-item.active { 
    background: var(--primary-gold); 
    color: white; 
}

.bible-header .divider {
    margin: 20px 0;
    border: 0;
    border-top: 1px solid var(--border-color);
}

.results-header {
    display: flex;
    font-weight: bold;
    border-bottom: 2px solid var(--primary-gold);
    padding: 15px 0;
    background: #fdfaf5;
    align-items: center;
}

.results-header-col.index {
    width: 22%;
    padding-left: 10px;
    color: var(--text-navy);
    font-size: 1.1rem;
}
.results-header-col.content {
    flex: 1;
    padding: 0 15px;
    color: var(--text-navy);
    font-size: 1.1rem;
}
.placeholder-text {
    padding: 40px;
    text-align: center;
    color: #999;
}

.chapter-selector { 
    display: grid; 
    grid-template-columns: repeat(auto-fill, minmax(45px, 1fr)); 
    gap: 8px; 
    margin-top: 15px; 
}
.chapter-btn { 
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid #ddd; 
    border-radius: 4px; 
    cursor: pointer; 
    font-size: 0.9rem;
    transition: all 0.2s;
}
.chapter-btn:hover { 
    border-color: var(--primary-gold); 
    background: #fdfaf5; 
}
.chapter-btn.active { 
    background: var(--secondary-brown); 
    color: white; 
    border-color: var(--secondary-brown); 
}

@media (max-width: 992px) {
    .bible-container { 
        flex-direction: column; 
        align-items: stretch;
    }
    .bible-sidebar { width: 100%; box-sizing: border-box; }
    .bible-main { width: 100%; box-sizing: border-box; }
}

/* --- Bible Content Rows --- */
.bible-row-content {
    display: flex;
    border-bottom: 1px solid var(--border-color);
    padding: 15px 0;
}

.bible-ref-col {
    width: 22%;
    color: var(--primary-gold);
    font-weight: bold;
    font-size: 1.1rem;
    padding-left: 10px;
    line-height: 1.4;
    flex-shrink: 0;
}

.bible-ref-book {
    white-space: nowrap;
    margin-bottom: 5px;
    color: var(--secondary-brown);
    font-size: 1.1rem;
}

.bible-ref-verse {
    font-size: 1.1rem;
    color: var(--primary-gold);
}

.bible-content-col {
    flex: 1;
    padding: 0 15px;
    font-size: 1.1rem;
    color: var(--secondary-brown);
}

.highlight {
    color: var(--primary-gold);
    font-weight: bold;
    background: #fff9e6;
    padding: 0 2px;
    border-radius: 2px;
}

/* --- Search & Pagination --- */
.search-header-info {
    padding: 15px;
    background: var(--bg-warm-white);
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 20px;
    border-radius: 8px;
}

.book-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 10px;
}

.book-tag {
    padding: 4px 12px;
    background: white;
    border: 1px solid var(--primary-gold);
    border-radius: 15px;
    font-size: 0.85rem;
    cursor: pointer;
    color: var(--primary-gold);
    transition: all 0.2s;
}

.book-tag:hover {
    background: var(--primary-gold);
    color: white;
}

.bible-pagination {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 8px;
    margin: 40px 0;
}

.bible-pagination button {
    padding: 8px 15px;
    min-width: 40px;
    background: white;
    color: #333;
    border: 1px solid #ddd;
    border-radius: 4px;
}

.bible-pagination button.active {
    background: var(--primary-gold);
    color: white;
    border-color: var(--primary-gold);
}

@media (max-width: 768px) {
    .bible-row-content { flex-direction: column; }
    .bible-ref-col {
        width: 100%; display: flex; align-items: baseline; gap: 10px;
        margin-bottom: 10px; border-bottom: 1px dashed #eee; padding-bottom: 8px;
    }
    .bible-content-col { padding: 0 5px; }
}

/* --- Markdown --- */
.markdown-body h1, .markdown-body h2, .markdown-body h3 { margin-top: 24px; margin-bottom: 16px; font-weight: 600; line-height: 1.25; }
.markdown-body h1 { font-size: 1.5em; border-bottom: 1px solid #eee; padding-bottom: .3em; }
.markdown-body h2 { font-size: 1.3em; border-bottom: 1px solid #eee; padding-bottom: .3em; }
.markdown-body h3 { font-size: 1.1em; }
.markdown-body p { margin-top: 0; margin-bottom: 16px; }
.markdown-body ul, .markdown-body ol { padding-left: 2em; margin-bottom: 16px; }
.markdown-body li { margin-bottom: 0.25em; }
.markdown-body img { max-width: 100%; border-radius: 8px; margin: 10px 0; }
.markdown-body blockquote { padding: 0 1em; color: #6a737d; border-left: .25em solid #dfe2e5; margin: 0 0 16px 0; }
