/* --- Variables & Themes --- */
:root {
    --primary: #2563eb; /* Default Blue */
    --bg-body: #ffffff;
    --text-main: #1f2937;
    --text-muted: #6b7280;
    --bg-card: #ffffff;
    --border: #e5e7eb;
    --code-bg: #f3f4f6;
    --container: 800px;
}

/* Dark Mode Variables */
[data-theme="dark"] {
    --bg-body: #111827;
    --text-main: #f9fafb;
    --text-muted: #9ca3af;
    --bg-card: #1f2937;
    --border: #374151;
    --code-bg: #111827;
}

/* 8 Pilihan Warna (Diatur via JS nanti) */
[data-color="red"] { --primary: #dc2626; }
[data-color="green"] { --primary: #16a34a; }
[data-color="purple"] { --primary: #9333ea; }
[data-color="orange"] { --primary: #ea580c; }
[data-color="teal"] { --primary: #0d9488; }
[data-color="pink"] { --primary: #db2777; }
[data-color="dark"] { --primary: #000000; }

/* --- Base Reset --- */
* { box-sizing: border-box; margin: 0; padding: 0; }
body { font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif; background: var(--bg-body); color: var(--text-main); line-height: 1.6; transition: background 0.3s, color 0.3s; }
a { color: var(--primary); text-decoration: none; }
img { max-width: 100%; height: auto; border-radius: 8px; }

/* --- Components --- */
.container { max-width: var(--container); margin: 0 auto; padding: 20px; }
.btn { display: inline-block; padding: 10px 20px; background: var(--primary); color: white; border-radius: 6px; font-weight: 500; cursor: pointer; border: none; }

/* Progress Bar */
#progress-bar { position: fixed; top: 0; left: 0; width: 0%; height: 4px; background: var(--primary); z-index: 9999; transition: width 0.1s; }

/* Navbar */
nav { display: flex; justify-content: space-between; align-items: center; padding: 20px 0; border-bottom: 1px solid var(--border); }
.theme-switch { cursor: pointer; font-size: 1.2rem; }

/* Blog Grid (1-3 Columns Responsive) */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 25px; margin-top: 30px; }
.card { background: var(--bg-card); border: 1px solid var(--border); border-radius: 12px; overflow: hidden; transition: transform 0.2s; }
.card:hover { transform: translateY(-3px); }
.card-body { padding: 20px; }
.card-meta { font-size: 0.85rem; color: var(--text-muted); margin-bottom: 10px; }

/* Single Post Specifics */
.post-header { margin-bottom: 30px; text-align: center; }
.post-meta { display: flex; justify-content: center; gap: 15px; font-size: 0.9rem; color: var(--text-muted); margin-top: 10px; }

/* Table of Contents (TOC) */
.toc { background: var(--code-bg); padding: 20px; border-radius: 8px; margin-bottom: 30px; border-left: 4px solid var(--primary); }
.toc ul { list-style: none; padding-left: 0; }
.toc li { margin-bottom: 8px; }
.toc a { color: var(--text-main); font-size: 0.95rem; }
.toc a:hover { color: var(--primary); }

/* Syntax Highlighting Base */
pre { background: var(--code-bg); padding: 15px; border-radius: 8px; overflow-x: auto; margin: 20px 0; border: 1px solid var(--border); }

/* Ad Slots */
.ad-slot { background: var(--code-bg); padding: 20px; text-align: center; margin: 30px 0; border-radius: 8px; color: var(--text-muted); font-size: 0.8rem; border: 1px dashed var(--border); }

/* Footer */
footer { margin-top: 50px; padding: 30px 0; border-top: 1px solid var(--border); text-align: center; font-size: 0.9rem; color: var(--text-muted); }