/* Public Frontend Stylesheet */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&family=Playfair+Display:ital,wght@0,600;0,700;0,800;1,400&display=swap');

:root {
    /* Color Palette (Warm & Thoughtful Light Theme) */
    --bg-base: #faf8f5;
    --bg-surface: #ffffff;
    --bg-footer: #1e293b;
    --text-main: #27272a;
    --text-muted: #71717a;
    --text-light: #a1a1aa;
    --primary: #9a3412; /* Warm terracotta/crimson */
    --primary-hover: #7c2d12;
    --accent: #1e3a8a; /* Deep Slate Blue */
    --accent-light: #eff6ff;
    --border: #e4e4e7;
    --success: #059669;
    --shadow-sm: 0 1px 3px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -1px rgba(0, 0, 0, 0.03);
    --shadow-lg: 0 10px 25px -5px rgba(0, 0, 0, 0.05), 0 8px 10px -6px rgba(0, 0, 0, 0.03);
    
    /* Typography */
    --font-serif: 'Playfair Display', Georgia, Cambria, "Times New Roman", Times, serif;
    --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    
    --radius-md: 0.5rem;
    --radius-lg: 0.75rem;
    --max-width: 900px;
}

/* System Dark Theme Preference */
@media (prefers-color-scheme: dark) {
    :root {
        --bg-base: #0b0f19;
        --bg-surface: #121826;
        --bg-footer: #080b12;
        --text-main: #e2e8f0;
        --text-muted: #94a3b8;
        --text-light: #64748b;
        --primary: #f97316;
        --primary-hover: #ea580c;
        --accent: #3b82f6;
        --accent-light: #1e293b;
        --border: #1e293b;
        --success: #10b981;
        --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.2);
        --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.3);
        --shadow-lg: 0 10px 25px -5px rgba(0, 0, 0, 0.4);
    }
}

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

body {
    background-color: var(--bg-base);
    color: var(--text-main);
    font-family: var(--font-sans);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

a {
    color: inherit;
    text-decoration: none;
    transition: color 0.15s ease;
}

/* Header / Navigation */
.site-header {
    background-color: var(--bg-surface);
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: var(--shadow-sm);
}

.header-container {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 1rem 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.site-logo {
    font-family: var(--font-serif);
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.site-nav {
    display: flex;
    gap: 1.5rem;
    align-items: center;
}

.nav-link {
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-muted);
}

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

/* Main Container */
.main-wrapper {
    flex-grow: 1;
    max-width: var(--max-width);
    width: 100%;
    margin: 0 auto;
    padding: 2.5rem 1.5rem;
}

/* Home Welcome Hero */
.hero-section {
    text-align: center;
    margin-bottom: 3rem;
    padding: 2rem 0;
}

.hero-title {
    font-family: var(--font-serif);
    font-size: 2.5rem;
    font-weight: 800;
    line-height: 1.2;
    margin-bottom: 1rem;
    color: var(--text-main);
}

.hero-subtitle {
    font-size: 1.125rem;
    color: var(--text-muted);
    max-width: 600px;
    margin: 0 auto 2rem auto;
}

/* Search Box Container */
.search-container {
    max-width: 500px;
    margin: 0 auto;
    position: relative;
}

.search-input {
    width: 100%;
    padding: 0.875rem 1.25rem;
    padding-right: 3rem;
    border: 1px solid var(--border);
    border-radius: 9999px;
    background-color: var(--bg-surface);
    color: var(--text-main);
    font-size: 0.95rem;
    font-family: inherit;
    box-shadow: var(--shadow-sm);
    transition: all 0.25s ease;
}

.search-input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(154, 52, 18, 0.15);
}

.search-button {
    position: absolute;
    right: 1.25rem;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    cursor: pointer;
    font-size: 1.1rem;
}

/* Grid of Post Cards */
.posts-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 2rem;
    margin-bottom: 3rem;
}

.post-card {
    background-color: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 2rem;
    box-shadow: var(--shadow-md);
    transition: all 0.25s ease;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    position: relative;
}

.post-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
    border-color: var(--primary);
}

.post-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    font-size: 0.8rem;
    color: var(--text-muted);
    font-weight: 500;
}

.post-card-title {
    font-family: var(--font-serif);
    font-size: 1.75rem;
    font-weight: 700;
    line-height: 1.3;
    margin-bottom: 0.25rem;
}

.post-card-title a:hover {
    color: var(--primary);
}

.post-excerpt {
    color: var(--text-muted);
    font-size: 0.95rem;
    line-height: 1.6;
}

.post-card-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border);
}

.read-more-link {
    font-weight: 600;
    font-size: 0.875rem;
    color: var(--primary);
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
}

.read-more-link:hover {
    color: var(--primary-hover);
}

/* Engagement Widgets */
.interactions {
    display: flex;
    gap: 1rem;
    align-items: center;
}

.like-button {
    background-color: var(--bg-base);
    border: 1px solid var(--border);
    padding: 0.375rem 0.75rem;
    border-radius: 9999px;
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    transition: all 0.2s ease;
    color: var(--text-main);
}

.like-button:hover {
    background-color: var(--accent-light);
    border-color: var(--primary);
}

.like-button.liked {
    background-color: #fee2e2;
    color: #ef4444;
    border-color: #fca5a5;
}

.views-counter {
    font-size: 0.8rem;
    color: var(--text-light);
    font-weight: 500;
}

/* Single Article Styling */
.article-container {
    background-color: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 3rem 2.5rem;
    box-shadow: var(--shadow-md);
    margin-bottom: 2.5rem;
}

.article-header {
    text-align: center;
    margin-bottom: 2.5rem;
    padding-bottom: 2rem;
    border-bottom: 1px solid var(--border);
}

.article-title {
    font-family: var(--font-serif);
    font-size: 2.75rem;
    font-weight: 800;
    line-height: 1.25;
    margin-bottom: 1.25rem;
    color: var(--text-main);
}

.article-meta {
    justify-content: center;
    font-size: 0.875rem;
}

/* Beautiful Pastoral Article Body Typography */
.article-body {
    font-family: var(--font-serif); /* Serif body for excellent long-form reading */
    font-size: 1.18rem;
    line-height: 1.75;
    color: var(--text-main);
}

.article-body p {
    margin-bottom: 1.75rem;
}

.article-body strong {
    font-weight: 700;
    color: var(--primary); /* Highlight scriptures/important truths in warm tone */
}

.article-body ul {
    margin: 1.5rem 0 1.5rem 1.5rem;
    list-style-type: none;
}

.article-body li {
    position: relative;
    margin-bottom: 0.75rem;
    padding-left: 1.25rem;
}

.article-body li::before {
    content: "•";
    color: var(--primary);
    font-weight: bold;
    display: inline-block;
    width: 1rem;
    margin-left: -1rem;
    position: absolute;
    left: 0;
}

/* Closing / Share Tools */
.article-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1.5rem;
    margin-top: 3rem;
    padding-top: 2rem;
    border-top: 1px solid var(--border);
}

.share-toolbar {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.share-label {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-muted);
}

.share-btn {
    width: 2.25rem;
    height: 2.25rem;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    color: #ffffff;
    cursor: pointer;
    transition: opacity 0.15s ease;
    border: none;
}

.share-btn:hover {
    opacity: 0.9;
}

.share-facebook { background-color: #1877f2; }
.share-twitter { background-color: #1da1f2; }
.share-whatsapp { background-color: #25d366; }

/* Related Posts Section */
.related-section {
    margin-top: 4rem;
}

.related-title {
    font-family: var(--font-serif);
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 1.5rem;
    color: var(--text-main);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.related-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 1.5rem;
}

.related-card {
    background-color: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 1.5rem;
    box-shadow: var(--shadow-sm);
    transition: all 0.2s ease;
}

.related-card:hover {
    transform: translateY(-2px);
    border-color: var(--primary);
    box-shadow: var(--shadow-md);
}

.related-card-title {
    font-family: var(--font-serif);
    font-size: 1.2rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    line-height: 1.3;
}

.back-link {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 600;
    color: var(--primary);
    margin-bottom: 1.5rem;
    font-size: 0.875rem;
}

.back-link:hover {
    color: var(--primary-hover);
}

/* Pagination navigation bar */
.public-pagination {
    display: flex;
    justify-content: center;
    gap: 0.5rem;
    margin-top: 2rem;
}

/* Footer Section */
.site-footer {
    background-color: var(--bg-footer);
    color: #94a3b8;
    padding: 3rem 1.5rem;
    margin-top: 4rem;
    text-align: center;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.footer-container {
    max-width: var(--max-width);
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.footer-logo {
    font-family: var(--font-serif);
    font-size: 1.35rem;
    color: #ffffff;
    font-weight: 700;
}

.footer-desc {
    font-size: 0.875rem;
    max-width: 500px;
    margin: 0 auto;
}

.footer-copyright {
    font-size: 0.8rem;
    margin-top: 1rem;
    padding-top: 1.5rem;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .hero-title {
        font-size: 2rem;
    }
    .article-title {
        font-size: 2rem;
    }
    .article-container {
        padding: 2rem 1.25rem;
    }
    .article-body {
        font-size: 1.1rem;
    }
}
