/* Ultra-Minimalist CSS with Full Width Layout */

/* CSS Variables for theming */
:root {
    /* Light mode (default) */
    --bg: #ffffff;
    --text: #333333;
    --text-light: #666666;
    --text-lighter: #999999;
    --link: #0066cc;
    --link-hover: #0052a3;
    --border: #eeeeee;
    --code-bg: #f8f8f8;
    --code-text: #333333;
    --tag-bg: #f0f0f0;
    --tag-text: #555555;
}

[data-theme="dark"] {
    /* Dark mode */
    --bg: #1a1a1a;
    --text: #e0e0e0;
    --text-light: #b0b0b0;
    --text-lighter: #808080;
    --link: #6db3f2;
    --link-hover: #8cc8f7;
    --border: #2a2a2a;
    --code-bg: #242424;
    --code-text: #e0e0e0;
    --tag-bg: #2a2a2a;
    --tag-text: #b0b0b0;
}

/* Reset and Base */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* Typography - Clean and minimal */
html {
    font-size: 16px;
    line-height: 1.6;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Helvetica Neue', sans-serif;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    color: var(--text);
    background: var(--bg);
    width: 100%;
    padding: 2rem 3rem;
    transition: background-color 0.3s ease, color 0.3s ease;
}

/* Theme Toggle - Minimal */
.theme-toggle {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    background: var(--code-bg);
    border: 1px solid var(--border);
    border-radius: 50%;
    width: 40px;
    height: 40px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    transition: all 0.2s ease;
    z-index: 1000;
    opacity: 0.6;
}

.theme-toggle:hover {
    opacity: 1;
    transform: scale(1.05);
}

/* Minimal Header - Inline Navigation */
header {
    margin-bottom: 3rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border);
    font-size: 0.95rem;
}

header h1.site-title {
    display: inline;
    font-size: 0.95rem;
    font-weight: 400;
    margin: 0;
}

header h1.site-title a {
    color: var(--text);
    text-decoration: none;
}

header nav {
    display: inline;
    margin-left: 0.5rem;
}

header nav a {
    color: var(--text-light);
    text-decoration: none;
    margin: 0 0.25rem;
}

header nav a:hover {
    color: var(--text);
}

/* Hide redundant page titles */
#content > .title,
#content > h1:first-child {
    display: none;
}

/* Content Area */
#content {
    width: 100%;
    max-width: none;
}

/* Headings - Minimal weight */
h1, h2, h3, h4, h5, h6 {
    margin: 2rem 0 1rem 0;
    font-weight: 500;
    line-height: 1.3;
}

h1 {
    font-size: 1.8rem;
    margin-top: 0;
}

h2 {
    font-size: 1.4rem;
    margin-top: 2.5rem;
}

h3 {
    font-size: 1.2rem;
}

h4, h5, h6 {
    font-size: 1rem;
}

/* Paragraphs */
p {
    margin-bottom: 1.2rem;
    max-width: 65ch; /* Optimal reading width */
}

/* Links - Minimal */
a {
    color: var(--link);
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

/* Lists */
ul, ol {
    margin: 0 0 1.2rem 2rem;
    max-width: 65ch;
}

li {
    margin-bottom: 0.3rem;
}

/* Article listing - Clean */
.article-list {
    list-style: none;
    margin-left: 0;
}

.article-list li {
    margin-bottom: 1.5rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid var(--border);
}

.article-list li:last-child {
    border-bottom: none;
}

/* Blockquotes */
blockquote {
    margin: 2rem 0;
    padding-left: 1.5rem;
    border-left: 2px solid var(--border);
    color: var(--text-light);
    max-width: 65ch;
}

/* Code */
code {
    font-family: 'SF Mono', Monaco, Consolas, 'Courier New', monospace;
    font-size: 0.9em;
    background: var(--code-bg);
    color: var(--code-text);
    padding: 0.1em 0.3em;
    border-radius: 2px;
}

pre {
    background: var(--code-bg);
    color: var(--code-text);
    padding: 1rem;
    border-radius: 4px;
    overflow-x: auto;
    margin: 1.5rem 0;
    line-height: 1.4;
    font-size: 0.9rem;
}

pre code {
    background: none;
    padding: 0;
}

/* Tables */
table {
    border-collapse: collapse;
    margin: 2rem 0;
    font-size: 0.95rem;
}

th, td {
    padding: 0.5rem 1rem;
    text-align: left;
    border-bottom: 1px solid var(--border);
}

th {
    font-weight: 500;
    color: var(--text-light);
}

/* Images */
img {
    max-width: 100%;
    height: auto;
    display: block;
    margin: 2rem 0;
}

/* Tags/Categories */
.tags {
    margin: 1rem 0;
}

.tag {
    display: inline-block;
    background: var(--tag-bg);
    color: var(--tag-text);
    padding: 0.2rem 0.6rem;
    margin-right: 0.5rem;
    margin-bottom: 0.5rem;
    font-size: 0.85rem;
    border-radius: 2px;
    text-decoration: none;
}

.tag:hover {
    text-decoration: none;
    opacity: 0.8;
}

/* Article metadata */
.article-meta {
    color: var(--text-light);
    font-size: 0.9rem;
    margin: 1rem 0;
}

.date {
    color: var(--text-lighter);
    font-size: 0.9rem;
    margin-bottom: 0.5rem;
}

/* Footer - Minimal */
footer {
    margin-top: 4rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border);
    font-size: 0.85rem;
    color: var(--text-lighter);
}

footer p {
    margin-bottom: 0.3rem;
}

footer a {
    color: var(--text-light);
    text-decoration: none;
}

footer a:hover {
    color: var(--text);
}

/* Hide verbose footer elements */
footer .author,
footer .creator {
    display: none;
}

/* Table of Contents - Minimal */
#table-of-contents {
    margin: 2rem 0;
    padding: 1rem;
    background: var(--code-bg);
    border-radius: 4px;
    max-width: 65ch;
}

#table-of-contents h2 {
    font-size: 0.9rem;
    font-weight: 500;
    margin: 0 0 0.5rem 0;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-light);
}

#table-of-contents ul {
    list-style: none;
    margin-left: 0;
}

#table-of-contents li {
    margin-bottom: 0.3rem;
}

#table-of-contents a {
    color: var(--text);
}

/* Horizontal rule */
hr {
    border: none;
    height: 1px;
    background: var(--border);
    margin: 2rem 0;
}

/* Responsive */
@media (max-width: 768px) {
    body {
        padding: 1.5rem;
    }

    h1 { font-size: 1.5rem; }
    h2 { font-size: 1.2rem; }
    h3 { font-size: 1.1rem; }

    .theme-toggle {
        bottom: 1rem;
        right: 1rem;
        width: 36px;
        height: 36px;
    }
}

@media (max-width: 480px) {
    body {
        padding: 1rem;
    }

    header {
        font-size: 0.9rem;
    }
}

/* Syntax Highlighting - Minimal */
.org-keyword { color: var(--link); }
.org-string { color: #16a34a; }
.org-comment { color: var(--text-lighter); font-style: italic; }
.org-function-name { color: var(--link); }
.org-variable-name { color: #d97706; }
.org-type { color: #16a34a; }
.org-builtin { color: var(--link); }
.org-constant { color: #dc2626; }

[data-theme="dark"] .org-string { color: #86efac; }
[data-theme="dark"] .org-variable-name { color: #fbbf24; }
[data-theme="dark"] .org-type { color: #86efac; }
[data-theme="dark"] .org-constant { color: #f87171; }

/* Print styles */
@media print {
    .theme-toggle {
        display: none;
    }

    body {
        padding: 0;
        color: #000;
        background: #fff;
    }

    header, footer {
        display: none;
    }
}

/* Smooth transitions */
* {
    transition: background-color 0.3s ease, color 0.3s ease, border-color 0.3s ease;
}