/**
 * Money Tracker Blog - Dark Mode Shared Stylesheet
 * Optimized for readability with high contrast and clear typography
 */

/* ========================================
   CSS VARIABLES - Dark Mode Color Palette
   ======================================== */
:root {
    /* Primary Brand Colors */
    --primary: #60a5fa;
    /* Light blue - accessible on dark backgrounds */
    --primary-dark: #3b82f6;
    /* Slightly darker for hover states */

    /* Background Layers */
    --bg: #0a0e1a;
    /* Deep blue-black (softer than pure black) */
    --card: #1a1f2e;
    /* Elevated surface for cards/articles */
    --card-hover: #242938;
    /* Hover state for interactive cards */

    /* Text Colors - High Contrast for Readability */
    --text: #e8eaed;
    /* Main body text - near white (contrast 12.8:1) */
    --text-light: #9ca3af;
    /* Secondary text (contrast 5.2:1) */
    --heading: #f1f3f5;
    /* Headings - brightest (contrast 13.5:1) */

    /* UI Elements */
    --border: #2d3748;
    /* Subtle borders */
    --category-bg: #1e3a5f;
    /* Dark blue background for badges */
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.4);
}

/* ========================================
   BASE STYLES
   ======================================== */
/* ========================================
   BASE STYLES
   ======================================== */
body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Noto Sans TC", "Microsoft JhengHei", "Helvetica Neue", Arial, sans-serif !important;
    background-color: var(--bg) !important;
    color: var(--text) !important;
    line-height: 1.8;
    margin: 0;
    padding: 0;
    /* Improve font rendering for clarity */
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

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

/* ========================================
   HEADER
   ======================================== */
header {
    background: var(--card) !important;
    padding: 24px 0;
    text-align: center;
    border-bottom: 1px solid var(--border);
    box-shadow: var(--shadow-sm);
    position: sticky;
    top: 0;
    z-index: 10;
}

.logo {
    font-size: 24px;
    font-weight: 800;
    color: var(--primary) !important;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

/* ========================================
   TYPOGRAPHY - Optimized for Readability
   ======================================== */
h1 {
    font-size: 36px;
    margin-bottom: 32px;
    line-height: 1.3;
    color: var(--heading) !important;
    font-weight: 800;
    /* Slightly increase letter spacing for better readability */
    letter-spacing: -0.02em;
}

h2 {
    font-size: 24px;
    margin-top: 40px;
    margin-bottom: 20px;
    /* Override hardcoded dark colors in HTML files */
    color: var(--heading) !important;
    font-weight: 700;
    letter-spacing: -0.01em;
}

h3 {
    font-size: 20px;
    margin-top: 30px;
    margin-bottom: 16px;
    color: var(--heading) !important;
    font-weight: 600;
}

/* ========================================
   CONTENT SECTIONS
   ======================================== */
.hero {
    text-align: center;
    padding: 40px 0;
}

.hero h1 {
    font-size: 36px;
    color: var(--heading) !important;
    margin-bottom: 16px;
}

.hero p {
    font-size: 18px;
    color: var(--text-light) !important;
    max-width: 600px;
    margin: 0 auto;
    line-height: 1.6;
}

article {
    background: var(--card) !important;
    padding: 60px;
    border-radius: 16px;
    box-shadow: var(--shadow-md);
    margin-top: 30px;
}

.content {
    font-size: 18px;
    color: var(--text) !important;
    /* Optimize text for long-form reading */
    max-width: 70ch;
}

.content p {
    margin-bottom: 24px;
    line-height: 1.8;
}

.content ul,
.content ol {
    margin-bottom: 24px;
    padding-left: 24px;
    color: var(--text) !important;
}

.content li {
    margin-bottom: 12px;
    line-height: 1.7;
}

.content strong {
    color: var(--heading) !important;
    font-weight: 600;
}

/* ========================================
   POST LIST (INDEX PAGE)
   ======================================== */
.post-list {
    list-style: none;
    padding: 0;
    display: grid;
    gap: 16px;
}

.post-item {
    background: var(--card) !important;
    padding: 24px;
    border-radius: 12px;
    box-shadow: var(--shadow-sm);
    transition: transform 0.2s, box-shadow 0.2s, background 0.2s;
    border: 1px solid var(--border);
}

.post-item:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
    background: var(--card-hover) !important;
}

.post-item a {
    text-decoration: none;
    color: var(--heading) !important;
    font-weight: 700;
    font-size: 18px;
    display: block;
    margin-bottom: 8px;
    transition: color 0.2s;
}

.post-item a:hover {
    color: var(--primary) !important;
}

/* ========================================
   CATEGORY BADGES
   ======================================== */
.category,
.post-item .cat {
    display: inline-block;
    background: var(--category-bg) !important;
    color: var(--primary) !important;
    padding: 6px 16px;
    border-radius: 9999px;
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 16px;
}

.post-item .cat {
    font-size: 13px;
    padding: 4px 12px;
    margin-bottom: 12px;
}

/* ========================================
   CALL-TO-ACTION SECTION
   ======================================== */
.cta {
    margin-top: 60px;
    padding: 48px;
    background: linear-gradient(135deg, #1e40af 0%, #2563eb 100%) !important;
    border-radius: 16px;
    color: #ffffff !important;
    text-align: center;
    box-shadow: 0 10px 15px -3px rgba(37, 99, 235, 0.3);
}

.cta h2 {
    margin-top: 0;
    color: #ffffff !important;
    font-size: 28px;
}

.cta p {
    font-size: 18px;
    opacity: 0.95;
    margin-bottom: 32px;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
    line-height: 1.6;
    color: #ffffff !important;
}

.btn {
    display: inline-block;
    background: #ffffff !important;
    color: #1e40af !important;
    padding: 16px 40px;
    border-radius: 12px;
    font-weight: 700;
    font-size: 18px;
    text-decoration: none;
    transition: all 0.2s;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.2);
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.3);
}

/* ========================================
   FOOTER
   ======================================== */
footer {
    text-align: center;
    padding: 60px 0;
    color: var(--text-light) !important;
    font-size: 14px;
    border-top: 1px solid var(--border);
    margin-top: 60px;
}

footer a {
    color: var(--text-light) !important;
    text-decoration: none;
    margin: 0 12px;
    transition: color 0.2s;
}

footer a:hover {
    color: var(--primary) !important;
}

/* ========================================
   RESPONSIVE DESIGN
   ======================================== */
@media (max-width: 640px) {
    article {
        padding: 24px;
    }

    h1 {
        font-size: 28px;
    }

    .hero h1 {
        font-size: 28px;
    }

    .content {
        font-size: 16px;
    }

    .cta {
        padding: 32px 20px;
    }

    .cta h2 {
        font-size: 24px;
    }
}