/* 2001.sh — A Minimalist Writing Space */

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

/* ============================================
   COLOUR SYSTEM
   ============================================ */

/* Light Theme */
:root {
    --bg-primary: #fafafa;
    --bg-secondary: #ffffff;
    --bg-elevated: #f2f2f2;
    --text-primary: #0a0a0a;
    --text-secondary: #6b6b6b;
    --text-tertiary: #909090;
    --border-color: #e8e8e8;
    --hover-bg: #f5f5f5;
    --accent: #2962ff;
    --accent-hover: #1e4fd6;
    --shadow-sm: rgba(0, 0, 0, 0.08);
    --shadow-md: rgba(0, 0, 0, 0.12);
    --code-bg: rgba(0, 0, 0, 0.05);
    --code-text: #0a0a0a;
    --blockquote-border: #d0d0d0;
    --mono: 'SF Mono', 'SFMono-Regular', 'Menlo', 'Consolas', monospace;
    --measure: 680px;
    --wide: 760px;
}

/* Dark Theme */
[data-theme="dark"] {
    --bg-primary: #0f0f0f;
    --bg-secondary: #1a1a1a;
    --bg-elevated: #242424;
    --text-primary: #e8e8e8;
    --text-secondary: #b0b0b0;
    --text-tertiary: #606060;
    --border-color: #2a2a2a;
    --hover-bg: #181818;
    --accent: #4d8eff;
    --accent-hover: #6ba1ff;
    --shadow-sm: rgba(0, 0, 0, 0.3);
    --shadow-md: rgba(0, 0, 0, 0.5);
    --code-bg: rgba(255, 255, 255, 0.08);
    --code-text: #e8e8e8;
    --blockquote-border: #3a3a3a;
}

/* ============================================
   BASE
   ============================================ */

html {
    font-size: 16px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Helvetica', sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    overflow-x: hidden;
    transition: background-color 0.3s ease, color 0.3s ease;
}

::selection {
    background: var(--text-primary);
    color: var(--bg-primary);
}

a:focus-visible,
button:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 4px;
}

/* Skip link */
.skip-link {
    position: absolute;
    top: -40px;
    left: 1rem;
    background: var(--bg-secondary);
    color: var(--text-primary);
    padding: 8px 16px;
    border-radius: 4px;
    font-size: 0.85rem;
    text-decoration: none;
    z-index: 999;
    transition: top 0.2s ease;
    border: 1px solid var(--border-color);
}
.skip-link:focus { top: 1rem; }

/* Reading progress bar */
.reading-progress {
    position: fixed;
    top: 0; left: 0;
    height: 2px;
    width: 0%;
    background: var(--accent);
    z-index: 100;
    transition: width 50ms linear;
}

/* ============================================
   HEADER (shared across home + post)
   ============================================ */

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

/* Monospace site name */
.site-name {
    font-family: var(--mono);
    font-size: 0.85rem;
    font-weight: 400;
    letter-spacing: -0.02em;
    color: var(--text-primary);
    text-decoration: none;
    transition: opacity 0.2s ease;
}
.site-name:hover { opacity: 0.7; }

/* Nav */
.site-nav {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    list-style: none;
}

.site-nav .nav-link {
    font-size: 0.82rem;
    font-weight: 400;
    color: var(--text-tertiary);
    text-decoration: none;
    transition: color 0.2s ease;
}
.site-nav .nav-link:hover { color: var(--text-primary); }

/* Language switcher dropdown */
.lang-switcher {
    position: relative;
    line-height: 1;
}
.lang-btn {
    list-style: none;
    cursor: pointer;
    font-size: 0.82rem;
    font-family: var(--mono);
    color: var(--text-tertiary);
    user-select: none;
    transition: color 0.2s ease;
    display: flex;
    align-items: center;
}
.lang-btn::-webkit-details-marker { display: none; }
.lang-btn::marker { display: none; }
.lang-btn::after {
    content: '▾';
    font-size: 0.6rem;
    margin-left: 2px;
    opacity: 0.5;
}
.lang-btn:hover { color: var(--text-primary); }
.lang-menu {
    position: absolute;
    right: 0;
    top: calc(100% + 6px);
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    list-style: none;
    padding: 0.25rem 0;
    min-width: 68px;
    z-index: 100;
    box-shadow: 0 4px 16px var(--shadow-md);
}
.lang-option {
    display: block;
    padding: 0.3rem 0.8rem;
    font-size: 0.78rem;
    font-family: var(--mono);
    color: var(--text-secondary);
    text-decoration: none;
    transition: color 0.15s ease, background 0.15s ease;
}
.lang-option:hover {
    color: var(--text-primary);
    background: var(--hover-bg);
}

/* Translation disclaimer banner */
.translation-banner {
    max-width: var(--measure);
    margin: 0 auto 0;
    padding: 1.5rem 2rem 0;
}
.translation-banner-inner {
    background: var(--bg-elevated);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    padding: 0.6rem 1rem;
}
.translation-banner-text {
    font-size: 0.78rem;
    color: var(--text-tertiary);
    line-height: 1.6;
    margin: 0;
}
.translation-banner-link {
    color: var(--text-secondary);
    text-decoration: underline;
    text-underline-offset: 2px;
    text-decoration-color: var(--border-color);
    transition: color 0.15s ease;
}
.translation-banner-link:hover {
    color: var(--text-primary);
}
.translation-banner-highlight {
    color: rgb(161, 132, 6);
}
[data-theme="dark"] .translation-banner-highlight {
    color: rgb(234, 179, 8);
}

/* Site footer */
.site-footer {
    max-width: var(--measure);
    margin: 0 auto;
    padding: 2rem 2rem 3rem;
}
.footer-link {
    font-size: 0.8rem;
    color: var(--text-tertiary);
    text-decoration: none;
}
.footer-link:hover {
    color: var(--text-secondary);
}
.footer-sep {
    font-size: 0.8rem;
    color: var(--text-tertiary);
    margin: 0 0.4rem;
}

/* Theme toggle */
.theme-toggle {
    all: unset;
    cursor: pointer;
    width: 28px; height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    color: var(--text-tertiary);
    transition: color 0.2s ease, background 0.2s ease;
}
.theme-toggle:hover {
    color: var(--text-primary);
    background: var(--hover-bg);
}

.theme-icon {
    width: 16px;
    height: 16px;
}

/* ============================================
   HOME — INTRO
   ============================================ */

.intro {
    max-width: var(--measure);
    margin: 0 auto;
    padding: 5rem 2rem 3.5rem;
}

.intro-label {
    font-family: var(--mono);
    font-size: 0.75rem;
    font-weight: 400;
    color: var(--text-tertiary);
    letter-spacing: 0.02em;
    margin-bottom: 0.75rem;
}

.intro-desc {
    font-size: clamp(1.25rem, 3vw, 1.35rem);
    font-weight: 200;
    color: var(--text-primary);
    line-height: 1.55;
    letter-spacing: -0.02em;
}

/* ============================================
   HOME — ESSAY LIST
   ============================================ */

.essays-section {
    max-width: var(--measure);
    margin: 0 auto;
    padding: 0 2rem 2rem;
}

.section-label {
    font-size: 0.7rem;
    font-weight: 500;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--text-tertiary);
    margin-bottom: 1.25rem;
}

/* Sticky year header */
.essays-year {
    font-family: var(--mono);
    font-size: 0.7rem;
    font-weight: 400;
    color: var(--text-tertiary);
    letter-spacing: 0.03em;
    padding: 0.6rem 0;
    position: sticky;
    top: 0;
    background: var(--bg-primary);
    z-index: 10;
    transition: background 0.3s ease;
}

.essay-list {
    list-style: none;
    margin-bottom: 2.5rem;
}

.essay-item {
    border-top: 1px solid var(--border-color);
}
.essay-item:last-child {
    border-bottom: 1px solid var(--border-color);
}

.essay-link {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 1.5rem;
    padding: 0.9rem 0.5rem;
    margin: 0 -0.5rem;
    text-decoration: none;
    color: inherit;
    border-radius: 6px;
    transition: background 0.2s ease, padding-left 0.25s ease;
}
.essay-link:hover {
    background: var(--hover-bg);
    padding-left: 0.85rem;
}

.essay-title-col { flex: 1; min-width: 0; }

.essay-title {
    font-size: 1rem;
    font-weight: 400;
    letter-spacing: -0.01em;
    line-height: 1.35;
    color: var(--text-primary);
    transition: color 0.2s ease;
}
.essay-link:hover .essay-title { color: var(--text-secondary); }

.essay-desc {
    font-size: 0.82rem;
    font-weight: 300;
    color: var(--text-tertiary);
    line-height: 1.5;
    margin-top: 0.2rem;
    max-width: 420px;
}

.essay-meta {
    font-family: var(--mono);
    font-size: 0.67rem;
    color: var(--text-tertiary);
    white-space: nowrap;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-shrink: 0;
}

.essay-tag {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Helvetica', sans-serif;
    font-size: 0.6rem;
    font-weight: 500;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: var(--text-tertiary);
    background: var(--bg-elevated);
    padding: 0.18rem 0.5rem;
    border-radius: 3px;
    white-space: nowrap;
}

.essay-date {
    font-family: var(--mono);
    font-size: 0.67rem;
    color: var(--text-tertiary);
}

/* ============================================
   HOME — BOOKMARKS (row list)
   ============================================ */

.bookmarks-section {
    max-width: var(--measure);
    margin: 0 auto;
    padding: 3rem 2rem 3rem;
    border-top: 1px solid var(--border-color);
}

.bookmarks-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 1.25rem;
}

.bookmarks-star {
    font-size: 0.85rem;
    color: var(--text-tertiary);
}

.bookmarks-label-text {
    font-size: 0.7rem;
    font-weight: 500;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--text-tertiary);
}

.bookmarks-label-sub {
    font-size: 0.78rem;
    color: var(--text-tertiary);
    font-weight: 300;
    margin-left: auto;
}

.bookmark-list { list-style: none; }

.bookmark-row { border-top: 1px solid var(--border-color); }
.bookmark-row:last-child { border-bottom: 1px solid var(--border-color); }

.bookmark-link {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 1.5rem;
    padding: 0.85rem 0.5rem;
    margin: 0 -0.5rem;
    text-decoration: none;
    color: inherit;
    border-radius: 6px;
    transition: background 0.2s ease, padding-left 0.25s ease;
}
.bookmark-link:hover {
    background: var(--hover-bg);
    padding-left: 0.85rem;
}

.bookmark-title-col { flex: 1; min-width: 0; }

.bookmark-title {
    font-size: 0.92rem;
    font-weight: 400;
    color: var(--text-primary);
    line-height: 1.35;
    transition: color 0.2s ease;
}
.bookmark-link:hover .bookmark-title { color: var(--text-secondary); }

.bookmark-excerpt {
    font-size: 0.79rem;
    font-weight: 300;
    color: var(--text-tertiary);
    line-height: 1.5;
    margin-top: 0.2rem;
    max-width: 420px;
}

.bookmark-right {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-shrink: 0;
}

.bookmark-source {
    font-family: var(--mono);
    font-size: 0.65rem;
    color: var(--text-tertiary);
    white-space: nowrap;
}

.bookmark-tag-pill {
    font-size: 0.6rem;
    font-weight: 500;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: var(--text-tertiary);
    background: var(--bg-elevated);
    padding: 0.18rem 0.5rem;
    border-radius: 3px;
    white-space: nowrap;
}

.bookmark-arrow {
    font-size: 0.75rem;
    color: var(--text-tertiary);
    opacity: 0.4;
    transition: opacity 0.2s ease, transform 0.2s ease;
}
.bookmark-link:hover .bookmark-arrow {
    opacity: 0.7;
    transform: translate(2px, -2px);
}

/* ============================================
   FOOTER
   ============================================ */

.site-footer {
    max-width: var(--wide);
    margin: 0 auto;
    padding: 1.5rem 2rem 2.5rem;
    border-top: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.site-footer p {
    font-size: 0.78rem;
    color: var(--text-tertiary);
    font-weight: 300;
}

.site-footer a {
    color: var(--text-tertiary);
    text-decoration: underline;
    text-decoration-color: var(--border-color);
    text-underline-offset: 2px;
    transition: text-decoration-color 0.2s ease;
}
.site-footer a:hover { text-decoration-color: var(--text-tertiary); }

/* ============================================
   ARTICLE PAGE — HEADER + META
   ============================================ */

.post-content {
    max-width: var(--measure);
    margin: 0 auto;
    padding: 3rem 2rem 1rem;
}

.post-header {
    margin-bottom: 2.5rem;
    padding-bottom: 2rem;
    border-bottom: 1px solid var(--border-color);
}

/* Category pills in article header */
.article-cats {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    margin-bottom: 1rem;
}

.article-cat {
    font-size: 0.62rem;
    font-weight: 500;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--text-tertiary);
    background: var(--bg-elevated);
    padding: 0.18rem 0.5rem;
    border-radius: 3px;
}

.post-title-full {
    font-size: clamp(1.8rem, 5vw, 2.4rem);
    font-weight: 200;
    letter-spacing: -0.03em;
    line-height: 1.15;
    margin-bottom: 1.1rem;
    color: var(--text-primary);
}

.post-header-meta {
    font-family: var(--mono);
    font-size: 0.75rem;
    color: var(--text-tertiary);
    font-weight: 400;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.meta-dot {
    width: 3px; height: 3px;
    background: var(--text-tertiary);
    border-radius: 50%;
    display: inline-block;
    flex-shrink: 0;
}

/* ============================================
   ARTICLE BODY
   ============================================ */

.post-body {
    font-size: 1.05rem;
    line-height: 1.85;
    color: var(--text-primary);
    margin-bottom: 2rem;
}

/* Drop cap on first paragraph */
.post-body.drop-cap > p:first-of-type::first-letter {
    font-size: 3.5rem;
    font-weight: 200;
    float: left;
    line-height: 0.78;
    margin-right: 0.1em;
    margin-top: 0.1em;
    color: var(--text-primary);
    letter-spacing: -0.04em;
}

.post-body p {
    margin-bottom: 1.6rem;
    color: var(--text-primary);
}

.post-body h2 {
    font-size: 1.4rem;
    font-weight: 300;
    letter-spacing: -0.02em;
    line-height: 1.3;
    margin-top: 3rem;
    margin-bottom: 1.1rem;
    color: var(--text-primary);
}

.post-body h3 {
    font-size: 1.15rem;
    font-weight: 400;
    letter-spacing: -0.01em;
    margin-top: 2.5rem;
    margin-bottom: 0.9rem;
    color: var(--text-primary);
}

.post-body h4 {
    font-size: 1rem;
    font-weight: 500;
    margin-top: 2rem;
    margin-bottom: 0.75rem;
    color: var(--text-primary);
}

/* * * * section divider */
.post-body hr {
    border: none;
    text-align: center;
    margin: 3rem 0;
}
.post-body hr::after {
    content: '* * *';
    font-size: 0.85rem;
    color: var(--text-tertiary);
    letter-spacing: 0.5em;
}

/* Blockquote — left border, italic, no fill */
.post-body blockquote {
    margin: 2.5rem 0;
    padding: 0 0 0 1.5rem;
    border-left: 2px solid var(--blockquote-border);
    background: none;
}
.post-body blockquote p {
    font-style: italic;
    font-weight: 300;
    color: var(--text-secondary);
    margin-bottom: 0;
}

/* Links */
.post-body a {
    color: var(--text-primary);
    text-decoration: underline;
    text-decoration-color: var(--border-color);
    text-underline-offset: 3px;
    transition: text-decoration-color 0.2s ease;
}
.post-body a:hover { text-decoration-color: var(--text-primary); }

/* Lists */
.post-body ul,
.post-body ol {
    margin: 1.5rem 0;
    padding-left: 2rem;
}
.post-body li {
    margin-bottom: 0.6rem;
    color: var(--text-primary);
}

/* Inline code */
.post-body code {
    font-family: var(--mono);
    font-size: 0.86em;
    background: var(--code-bg);
    color: var(--code-text);
    padding: 0.15em 0.4em;
    border-radius: 3px;
}

/* Code blocks */
.post-body pre {
    background: var(--bg-elevated);
    color: var(--text-primary);
    padding: 1.5rem 1.75rem;
    border-radius: 6px;
    overflow-x: auto;
    margin: 2rem 0;
    border: 1px solid var(--border-color);
    font-family: var(--mono);
    font-size: 0.83rem;
    line-height: 1.7;
}
.post-body pre code {
    background: none;
    padding: 0;
    border-radius: 0;
    font-size: inherit;
    color: inherit;
}

.post-body strong {
    font-weight: 600;
    color: var(--text-primary);
}
.post-body em { font-style: italic; }

/* ============================================
   IMAGES IN ARTICLES
   ============================================ */

.post-body figure {
    margin: 3.5rem 0;
    text-align: center;
    position: relative;
}

.post-body .image-wrapper {
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
    margin: 3.5rem auto;
    max-width: 88%;
}

.post-body .image-wrapper.loading {
    min-height: 300px;
    background: linear-gradient(
        90deg,
        var(--bg-secondary) 0%,
        var(--bg-elevated) 25%,
        var(--bg-secondary) 50%,
        var(--bg-elevated) 75%,
        var(--bg-secondary) 100%
    );
    background-size: 200% 100%;
    animation: shimmer 1.8s ease-in-out infinite;
    border-radius: 8px;
    border: 1px solid var(--border-color);
}

.post-body .image-wrapper.loading img {
    opacity: 0;
    transition: opacity 0.5s ease, transform 0.35s ease, box-shadow 0.35s ease;
}

.post-body .image-wrapper img {
    opacity: 1;
    background: transparent;
    border: none;
    transition: opacity 0.2s ease, transform 0.1s ease, box-shadow 0.1s ease;
}

.post-body img {
    max-width: 100%;
    height: auto;
    margin: 0 auto;
    display: block;
    border-radius: 8px;
    border: 1px solid var(--border-color);
    box-shadow: 0 4px 20px var(--shadow-sm);
    transition: transform 0.35s ease, box-shadow 0.35s ease;
    cursor: zoom-in;
}

.post-body img:hover {
    transform: translateY(-3px) scale(1.005);
    box-shadow: 0 10px 36px var(--shadow-md);
}

.post-body img:not(.image-wrapper img) {
    max-width: 88%;
    margin: 3.5rem auto;
}

.post-body figcaption {
    margin-top: 1rem;
    font-size: 0.85rem;
    color: var(--text-tertiary);
    font-style: italic;
    line-height: 1.55;
    max-width: 88%;
    margin-left: auto;
    margin-right: auto;
}

@keyframes shimmer {
    0%   { background-position: -200% 0; }
    100% { background-position:  200% 0; }
}

/* Image zoom overlay (Medium-style) */
.image-zoom-overlay {
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background: rgba(0, 0, 0, 0.92);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.35s ease, visibility 0.35s ease;
    cursor: zoom-out;
    backdrop-filter: blur(6px);
}
.image-zoom-overlay.active {
    opacity: 1;
    visibility: visible;
}
.image-zoom-overlay img {
    max-width: 90%;
    max-height: 90vh;
    width: auto;
    height: auto;
    border-radius: 8px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    transform: scale(0.93);
    transition: transform 0.4s ease;
    cursor: zoom-out;
    border: none;
}
.image-zoom-overlay.active img { transform: scale(1); }

.image-zoom-close {
    position: absolute;
    top: 24px; right: 24px;
    width: 32px; height: 32px;
    background: none;
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: rgba(255, 255, 255, 0.5);
    font-size: 24px;
    font-weight: 200;
    line-height: 1;
    transition: color 0.2s ease;
}
.image-zoom-close:hover {
    color: rgba(255, 255, 255, 0.9);
}

/* ============================================
   ARTICLE — FOOTER (prev/next nav)
   ============================================ */

.post-footer {
    margin-top: 3rem;
    padding-top: 2rem;
    border-top: 1px solid var(--border-color);
    max-width: var(--measure);
    margin-left: auto;
    margin-right: auto;
    padding-left: 2rem;
    padding-right: 2rem;
    margin-bottom: 4rem;
}

.post-nav {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

.end-nav-item {
    padding: 1rem 1.2rem;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    text-decoration: none;
    color: inherit;
    transition: background 0.2s ease, border-color 0.2s ease;
    display: block;
}
.end-nav-item:hover {
    background: var(--hover-bg);
    border-color: var(--accent);
}
.end-nav-item:only-child {
    grid-column: 1;
}

.end-nav-label {
    font-family: var(--mono);
    font-size: 0.65rem;
    font-weight: 400;
    color: var(--text-tertiary);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    margin-bottom: 0.4rem;
}

.end-nav-title {
    font-size: 0.92rem;
    font-weight: 400;
    line-height: 1.35;
    letter-spacing: -0.01em;
    color: var(--text-primary);
}

.end-nav-right { text-align: right; }

/* ============================================
   THEME TRANSITIONS (applied after page load)
   ============================================ */

body.theme-transitions-enabled,
body.theme-transitions-enabled .site-header,
body.theme-transitions-enabled .site-name,
body.theme-transitions-enabled .site-nav .nav-link,
body.theme-transitions-enabled .theme-toggle,
body.theme-transitions-enabled .intro,
body.theme-transitions-enabled .intro-label,
body.theme-transitions-enabled .intro-desc,
body.theme-transitions-enabled .section-label,
body.theme-transitions-enabled .essays-year,
body.theme-transitions-enabled .essay-item,
body.theme-transitions-enabled .essay-desc,
body.theme-transitions-enabled .essay-meta,
body.theme-transitions-enabled .essay-tag,
body.theme-transitions-enabled .essay-date,
body.theme-transitions-enabled .bookmarks-section,
body.theme-transitions-enabled .bookmarks-star,
body.theme-transitions-enabled .bookmarks-label-text,
body.theme-transitions-enabled .bookmarks-label-sub,
body.theme-transitions-enabled .bookmark-row,
body.theme-transitions-enabled .bookmark-excerpt,
body.theme-transitions-enabled .bookmark-source,
body.theme-transitions-enabled .bookmark-tag-pill,
body.theme-transitions-enabled .site-footer,
body.theme-transitions-enabled .site-footer p,
body.theme-transitions-enabled .site-footer a,
body.theme-transitions-enabled .post-content,
body.theme-transitions-enabled .post-header,
body.theme-transitions-enabled .post-title-full,
body.theme-transitions-enabled .post-header-meta,
body.theme-transitions-enabled .article-cat,
body.theme-transitions-enabled .post-body,
body.theme-transitions-enabled .post-body p,
body.theme-transitions-enabled .post-body h2,
body.theme-transitions-enabled .post-body h3,
body.theme-transitions-enabled .post-body blockquote,
body.theme-transitions-enabled .post-body blockquote p,
body.theme-transitions-enabled .post-body code,
body.theme-transitions-enabled .post-body pre,
body.theme-transitions-enabled .post-footer,
body.theme-transitions-enabled .end-nav-label,
body.theme-transitions-enabled .end-nav-title,
body.theme-transitions-enabled .meta-dot,
body.theme-transitions-enabled .skip-link {
    transition: background-color 0.3s ease, border-color 0.3s ease, color 0.3s ease;
}

/* ============================================
   RESPONSIVE
   ============================================ */

@media (max-width: 640px) {
    html { font-size: 15px; }

    .site-header { padding: 1.5rem 1.25rem 0; }
    .intro { padding: 3.5rem 1.25rem 2.5rem; }
    .intro-desc { font-size: 1.15rem; }
    .essays-section { padding: 0 1.25rem 1.5rem; }
    .bookmarks-section { padding: 2.5rem 1.25rem; }
    .site-footer { padding: 1.25rem 1.25rem 2rem; flex-direction: column; gap: 0.4rem; text-align: center; }

    /* Essay list: stack on mobile */
    .essay-link { flex-direction: column; gap: 0.3rem; }
    .essay-meta { margin-top: 0.1rem; }

    /* Bookmark rows: stack on mobile */
    .bookmark-link { flex-direction: column; gap: 0.3rem; }
    .bookmark-right { margin-top: 0.1rem; }
    .bookmarks-label-sub { display: none; }

    /* Article */
    .post-content { padding: 2.5rem 1.25rem 1rem; }
    .post-header { margin-bottom: 2rem; padding-bottom: 1.5rem; }
    .post-title-full { font-size: 1.7rem; }
    .post-body { font-size: 1rem; }
    .post-body h2 { font-size: 1.25rem; margin-top: 2.5rem; }
    .post-body h3 { font-size: 1.05rem; }
    .post-body .image-wrapper,
    .post-body img:not(.image-wrapper img) { max-width: 100%; }
    .post-body figcaption { max-width: 100%; }
    .post-body.drop-cap > p:first-of-type::first-letter { font-size: 3rem; }

    .post-footer { padding: 1.5rem 1.25rem 3rem; margin-top: 2rem; }
    .post-nav { grid-template-columns: 1fr; }
    .end-nav-right { text-align: left; }
}


/* ===========================================
   Article Components for Inflation Article
   Include this CSS on pages that render this article.
   Requires: Chart.js loaded globally for canvas charts.
   =========================================== */

/* Chart wrapper */
.chart-wrapper {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: 10px;
  padding: 1.5rem;
  margin: 2rem 0;
}

.chart-label {
  font-family: system-ui, -apple-system, sans-serif;
  font-size: 14px;
  font-weight: 500;
  color: var(--text-primary);
  margin-bottom: 4px;
}

.chart-sublabel {
  font-family: system-ui, -apple-system, sans-serif;
  font-size: 12px;
  color: var(--text-tertiary);
  margin-bottom: 1rem;
}

.chart-source {
  font-family: system-ui, -apple-system, sans-serif;
  font-size: 11px;
  color: var(--text-tertiary);
  margin-top: 8px;
  line-height: 1.6;
}

/* Cantillon table */
.cantillon-table {
  width: 100%;
  border-collapse: collapse;
  font-family: system-ui, -apple-system, sans-serif;
  font-size: 14px;
}

.cantillon-table th {
  text-align: left;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-tertiary);
  padding: 0 0 10px;
  border-bottom: 1px solid var(--border-color);
  font-weight: 500;
}

.cantillon-table td {
  padding: 12px 12px 12px 0;
  vertical-align: top;
  border-bottom: 1px solid var(--border-color);
  color: var(--text-primary);
  line-height: 1.5;
}

.cantillon-table tr:last-child td {
  border-bottom: none;
}

.order-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  font-size: 12px;
  font-weight: 500;
}

.order-1 { background: #e1f5ee; color: #0f6e56; }
.order-2 { background: #e6f1fb; color: #3266ad; }
.order-3 { background: #faeeda; color: #854f0b; }
.order-4 { background: #fcebeb; color: #a32d2d; }

/* Stats row */
.stats-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 12px;
  margin: 2rem 0;
}

.stat-card {
  background: var(--bg-elevated);
  border-radius: 8px;
  padding: 1rem;
  text-align: center;
}

.stat-value {
  font-size: 28px;
  font-weight: 500;
  color: var(--text-primary);
}

.stat-label {
  font-family: system-ui, -apple-system, sans-serif;
  font-size: 12px;
  color: var(--text-tertiary);
  margin-top: 2px;
}

/* Crisis comparison grid */
.crisis-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin: 2rem 0;
}

@media (max-width: 520px) {
  .crisis-grid {
    grid-template-columns: 1fr;
  }
}

.crisis-card {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 1.25rem;
}

.crisis-country {
  font-family: system-ui, -apple-system, sans-serif;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-primary);
  margin-bottom: 4px;
}

.crisis-stat {
  font-size: 24px;
  font-weight: 500;
  color: #c94444;
}

.crisis-detail {
  font-family: system-ui, -apple-system, sans-serif;
  font-size: 12px;
  color: var(--text-tertiary);
  margin-top: 4px;
  line-height: 1.45;
}

/* Mental model pills */
.model-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 1.5rem 0;
}

.model-pill {
  font-family: system-ui, -apple-system, sans-serif;
  font-size: 13px;
  padding: 6px 14px;
  border-radius: 20px;
  background: #eeedfe;
  color: #534ab7;
  font-weight: 500;
}

/* Practical toolkit */
.toolkit {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: 10px;
  padding: 1.75rem;
  margin: 2rem 0;
}

.toolkit-title {
  font-family: system-ui, -apple-system, sans-serif;
  font-size: 14px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #b85c38;
  margin-bottom: 1rem;
}

.toolkit-item {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  padding: 10px 0;
  border-bottom: 1px solid var(--border-color);
  font-family: system-ui, -apple-system, sans-serif;
  font-size: 15px;
  line-height: 1.5;
  color: var(--text-primary);
}

.toolkit-item:last-child {
  border-bottom: none;
}

.toolkit-check {
  width: 20px;
  height: 20px;
  border-radius: 4px;
  background: #e1f5ee;
  color: #0f6e56;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-size: 12px;
  font-weight: 500;
  margin-top: 1px;
}
/* Dark mode overrides for hardcoded colors */
[data-theme="dark"] .order-1 { background: #0f6e5622; color: #5ec2a3; }
[data-theme="dark"] .order-2 { background: #3266ad22; color: #6ba1ff; }
[data-theme="dark"] .order-3 { background: #854f0b22; color: #d4a05a; }
[data-theme="dark"] .order-4 { background: #a32d2d22; color: #e87070; }

[data-theme="dark"] .model-pill {
  background: #534ab722;
  color: #a99ef0;
}

[data-theme="dark"] .toolkit-title {
  color: #d4875a;
}

[data-theme="dark"] .toolkit-check {
  background: #0f6e5622;
  color: #5ec2a3;
}

[data-theme="dark"] .crisis-stat {
  color: #e87070;
}

/* ===========================================
   End of Article Components for Inflation Article
   =========================================== */
