:root {
    --brand: #0a69c7; /* fresh blue */
    --brand-600: #0857a4;
    --bg: #f6f8fb;
    --text: #1f2937;
    --muted: #6b7280;
    --card: #ffffff;
    --border: #e5e7eb;
}

body {
    font-family: 'Segoe UI', system-ui, -apple-system, Arial, sans-serif;
    background: var(--bg);
    color: var(--text);
    margin: 0;
    padding: 0;
    line-height: 1.6;
}
/* Note/Disclaimer/Remark block styling */
.note {
    margin: 1em 2em;
    padding: 0.8em 1em;
    border-left: 4px solid #0078d4;
    background: #f5f8fa;
    font-style: italic;
    font-size: 0.95em;
    color: #444;
}
/* Header */
.site-header {
    background: linear-gradient(90deg, var(--brand), var(--brand-600));
    color: #fff;
}
.site-header .container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 1rem 1.25rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.brand {
    font-weight: 700;
    letter-spacing: 0.2px;
    color: #fff;
    text-decoration: none;
}
.nav a {
    color: #fff;
    text-decoration: none;
    margin-left: 1rem;
    opacity: 0.95;
}
.nav a:hover { opacity: 1; text-decoration: underline; }
/* Main container */
main {
    max-width: 1100px;
    margin: 2rem auto;
    padding: 0 1.25rem 3rem;
}

/* Intro block */
.intro h1 { margin-bottom: 0.5rem; }
.intro .intro-content { margin-bottom: 2rem; }

/* Cards for posts */
.post-list { list-style: none; padding: 0; margin: 0; }
.post-card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 1.25rem 1.25rem 1rem;
    margin: 0 0 1rem 0;
    box-shadow: 0 4px 16px rgba(0,0,0,0.04);
}
.post-title { font-size: 1.1rem; font-weight: 600; color: var(--brand-600); text-decoration: none; }
.post-title:hover { text-decoration: underline; }
.post-meta { color: var(--muted); font-size: 0.9rem; margin: 0.25rem 0 0.5rem; }
.post-excerpt { margin: 0 0 0.75rem; }

/* Buttons */
.btn {
    display: inline-block;
    background: var(--brand);
    color: #fff;
    padding: 0.45rem 0.8rem;
    border-radius: 8px;
    text-decoration: none;
    font-size: 0.9rem;
}
.btn:hover { background: var(--brand-600); }

/* Chips (categories) */
.chips { margin: 0.25rem 0 0.5rem; }
.chip {
    display: inline-block;
    background: rgba(10,105,199,0.08);
    color: var(--brand-600);
    border: 1px solid rgba(10,105,199,0.18);
    border-radius: 999px;
    padding: 0.15rem 0.6rem;
    font-size: 0.8rem;
    margin-right: 0.4rem;
}

/* Tables & code blocks */
table { width: 100%; border-collapse: collapse; margin: 1rem 0; }
th, td { border: 1px solid var(--border); padding: 0.6rem; }
th { background: #f3f4f6; text-align: left; }
pre, code { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; }
pre { background: #0b1220; color: #e5e7eb; padding: 1rem; border-radius: 8px; overflow: auto; }
code { background: #f3f4f6; padding: 0.1rem 0.3rem; border-radius: 4px; }

/* Theme toggle */
.theme-toggle { margin-left: 1rem; background: transparent; border: none; color: #fff; cursor: pointer; font-size: 1rem; }

/* Dark mode */
[data-theme="dark"] body { background: #0b1220; color: #e5e7eb; }
[data-theme="dark"] .site-header { background: linear-gradient(90deg, #0b63b6, #064a88); }
[data-theme="dark"] .post-card { background: #0f172a; border-color: #1f2a44; }
[data-theme="dark"] .post-title { color: #76b4ff; }
[data-theme="dark"] .site-footer { color: #9aa4b2; }
[data-theme="dark"] table th { background: #111827; }
h1, h2 { color: #0f172a; }
.site-footer {
    text-align: center;
    padding: 2rem 0 3rem;
    color: var(--muted);
}
/* Restore bullets and indentation for lists */
ul { list-style: disc; padding-left: 1.5em; margin: 0 0 1em 0; }
ol { list-style: decimal; padding-left: 1.5em; margin: 0 0 1em 0; }
ul li { margin-bottom: 0.5em; }
ol li { margin-bottom: 0.5em; }
img {
    max-width: 100%;
    height: auto;
    display: block;
    margin: 1em auto;
    image-rendering: -webkit-optimize-contrast;
    image-rendering: crisp-edges;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

/* Smaller image size option using div wrappers */
.img-small {
    max-width: 60%;
    margin: 0 auto;
}

.img-medium {
    max-width: 75%;
    margin: 0 auto;
}

.img-small img,
.img-medium img {
    width: 100%;
    max-width: 100%;
}

/* Caption styling inside sized containers */
.img-small em,
.img-medium em {
    display: block;
    text-align: center;
    margin: 0.75em auto 2em;
    font-size: 0.9em;
    color: var(--muted);
    font-style: italic;
    padding: 0 1em;
}

[data-theme="dark"] .img-small em,
[data-theme="dark"] .img-medium em {
    color: #9aa4b2;
}

/* Image caption styling - italic text immediately after an image */
img + em {
    display: block;
    text-align: center;
    margin: 0.75em auto 2em;
    font-size: 0.9em;
    color: var(--muted);
    font-style: italic;
    padding: 0 1em;
}

[data-theme="dark"] img + em {
    color: #9aa4b2;
}

/* Figure and caption styling for images */
figure {
    margin: 2em auto;
    text-align: center;
    max-width: 100%;
}

figure img {
    margin: 0 auto;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

figcaption {
    margin-top: 0.75em;
    font-size: 0.9em;
    color: var(--muted);
    font-style: italic;
    padding: 0 1em;
}

[data-theme="dark"] figcaption {
    color: #9aa4b2;
}
