﻿/*
Theme Name: miku-cream
Theme URI: https://github.com/zakee/miku-cream
Description: A clean, modern Typecho theme inspired by the Mastercard design system.
Author: zakee
Version: 1.2.0
*/

/* 1. CSS VARIABLES & SYSTEM RESET */
:root {
    --canvas-cream: #F3F0EE;
    --lifted-cream: #FCFBFA;
    --ink-black: #141413;
    --signal-orange: #CF4500;
    --light-signal-orange: #F37338;
    --interactive-accent: #39C5BB;
    --interactive-accent-dark: #269B92;
    --interactive-accent-rgb: 57, 197, 187;
    --white: #FFFFFF;
    --slate-gray: #696969;
    --dust-taupe: #D1CDC7;
    --border-soft: rgba(20, 20, 19, 0.08);
    --font-sans: "Sofia Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    background-color: var(--canvas-cream);
    color: var(--ink-black);
    font-family: var(--font-sans);
    font-weight: 450;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* 2. TYPOGRAPHY RULES */
h1, h2, h3, h4, h5, h6 {
    color: var(--ink-black);
    font-weight: 500;
    letter-spacing: -0.02em;
}

h1 {
    font-size: 3.5rem;
    line-height: 1.1;
}

h2 {
    font-size: 2.25rem;
    line-height: 1.2;
}

h3 {
    font-size: 1.5rem;
    line-height: 1.3;
}

a {
    color: inherit;
    text-decoration: none;
    transition: color 0.2s ease, border-color 0.2s ease;
}

/* 3. BUTTONS & PILLS */
.btn-primary {
    display: inline-flex;
    align-items: center;
    background-color: var(--ink-black);
    color: var(--canvas-cream);
    border: 1.5px solid var(--ink-black);
    border-radius: 20px;
    padding: 8px 24px;
    font-size: 15px;
    font-weight: 500;
    letter-spacing: -0.02em;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.btn-primary:hover {
    background-color: var(--interactive-accent);
    color: var(--ink-black);
    border-color: var(--interactive-accent);
    transform: translateY(-1px);
}

.btn-secondary {
    display: inline-flex;
    align-items: center;
    background-color: var(--white);
    color: var(--ink-black);
    border: 1.5px solid var(--ink-black);
    border-radius: 20px;
    padding: 8px 24px;
    font-size: 15px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-secondary:hover {
    background-color: var(--interactive-accent);
    border-color: var(--interactive-accent);
}

/* 4. CONTAINER & LAYOUT */
.container {
    max-width: 1000px; /* Limit max-width to 1000px for a compact blog look */
    margin: 0 auto;
    padding: 0 24px;
}

.main-content {
    min-height: 70vh;
    padding-top: 12px; /* Reduced from 48px to keep 1/4 spacing below header */
    padding-bottom: 8px; /* Reduced from 12px to keep spacing below pagination tight */
}

/* 5. FLOATING NAVIGATION PILL (DESKTOP) */
#header {
    margin-top: 24px;
    z-index: 100;
    position: relative;
}

.nav-pill {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    background-color: var(--white);
    border-radius: 30px;
    padding: 20px 32px;
    box-shadow: rgba(0, 0, 0, 0.04) 0px 4px 24px 0px;
    border: 1px solid rgba(20, 20, 19, 0.02);
}

/* 5.1 ONION DIVIDER STYLE */
.onion-divider {
    display: flex;
    align-items: center;
    width: 100%;
    height: 30px; /* height of the onion */
    margin: 8px 0 6px;
    overflow: hidden;
}

.onion-left {
    background-image: url('img/left.png');
    background-repeat: no-repeat;
    background-size: contain;
    background-position: right center;
    width: calc(30px * 43 / 100);
    height: 100%;
    flex-shrink: 0;
}

.onion-middle {
    background-image: url('img/middle.png');
    background-repeat: no-repeat;
    background-size: 100% 100%;
    background-position: left center;
    height: 100%;
    flex-grow: 1;
    margin: 0 -1px; /* overlap slightly to prevent subpixel gaps */
}

.onion-right {
    background-image: url('img/right.png');
    background-repeat: no-repeat;
    background-size: contain;
    background-position: left center;
    width: calc(30px * 193 / 100);
    height: 100%;
    flex-shrink: 0;
}

.nav-top-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px; /* reduced from 16px to decrease vertical height */
}

.nav-bottom-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-top: none; /* removed light gray border */
    padding-top: 6px; /* reduced from 12px to decrease vertical height */
}

.site-identity {
    display: flex;
    flex-direction: row;
    align-items: baseline;
    gap: 16px;
    flex-wrap: wrap;
}

.site-logo {
    font-size: 36px;
    font-weight: 700;
    color: var(--ink-black);
    letter-spacing: -0.03em;
    line-height: 1.1;
}

.site-description {
    font-size: 14px;
    color: var(--slate-gray);
    margin-top: 0;
    letter-spacing: 0;
}

/* Desktop Horizontal Categories */
.nav-menu {
    display: flex;
    align-items: center;
    list-style: none;
    gap: 28px;
}

.nav-item {
    position: relative;
}

.nav-link {
    font-size: 16px;
    font-weight: 500;
    color: var(--ink-black);
    padding: 12px 4px;
    display: flex;
    align-items: center;
    gap: 4px;
}

.nav-link:hover, .nav-item.active > .nav-link {
    color: var(--interactive-accent);
}

/* Dropdown Subcategories */
.dropdown-menu {
    display: none;
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    background-color: var(--white);
    border-radius: 20px;
    padding: 16px;
    margin-top: 8px;
    box-shadow: rgba(0, 0, 0, 0.08) 0px 12px 32px;
    list-style: none;
    border: 1px solid rgba(20, 20, 19, 0.04);
    z-index: 110;
    width: max-content;
    max-width: 450px;
}

/* Pseudo-element to bridge hover gap */
.dropdown-menu::after {
    content: '';
    position: absolute;
    top: -12px;
    left: 0;
    right: 0;
    height: 12px;
    background: transparent;
}

.dropdown-menu::before {
    content: '';
    position: absolute;
    top: -6px;
    left: 50%;
    transform: translateX(-50%) rotate(45deg);
    width: 12px;
    height: 12px;
    background-color: var(--white);
    border-left: 1px solid rgba(20, 20, 19, 0.04);
    border-top: 1px solid rgba(20, 20, 19, 0.04);
}

.nav-item:hover .dropdown-menu {
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    gap: 8px;
    animation: fadeIn 0.2s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.nav-item:focus-within .dropdown-menu {
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    gap: 8px;
}

.dropdown-item {
    width: auto;
}

.dropdown-item a {
    display: block;
    padding: 10px 16px;
    color: var(--ink-black);
    font-size: 14px;
    border-radius: 12px;
    font-weight: 450;
    background-color: var(--canvas-cream); /* Default light gray background */
    transition: all 0.2s ease;
}

.dropdown-item a:hover {
    background-color: var(--canvas-cream);
    color: var(--interactive-accent);
    transform: translateY(-1px);
}

/* Header Search Form */
.search-form {
    display: flex;
    align-items: center;
    background-color: var(--canvas-cream);
    border-radius: 999px;
    padding: 6px 16px;
    width: 200px;
    border: 1.5px solid transparent;
    transition: all 0.2s ease;
}

.search-form:focus-within {
    border-color: var(--ink-black);
    background-color: var(--white);
    box-shadow: rgba(0, 0, 0, 0.02) 0px 4px 12px;
}

.search-input {
    border: none;
    background: transparent;
    outline: none;
    font-family: var(--font-sans);
    font-size: 14px;
    color: var(--ink-black);
    width: 100%;
}

.search-btn {
    border: none;
    background: transparent;
    cursor: pointer;
    color: var(--ink-black);
    display: flex;
    align-items: center;
    justify-content: center;
    padding-left: 6px;
    outline: none;
}

.search-btn svg {
    width: 16px;
    height: 16px;
    fill: currentColor;
}

.search-btn:hover {
    color: var(--interactive-accent);
}

/* 6. MOBILE NAVIGATION DRAWER & BUTTON */
.mobile-menu-btn {
    display: flex; /* Always display */
    position: fixed;
    top: 40px; /* Moved up to clear drawer contents */
    left: 24px;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background-color: var(--white);
    border: 1.5px solid var(--ink-black);
    color: var(--ink-black);
    font-size: 22px;
    font-weight: 700;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 1000;
    box-shadow: rgba(0, 0, 0, 0.08) 0px 6px 16px;
    transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
    outline: none;
}

.mobile-menu-btn:hover {
    transform: scale(1.05);
    background-color: var(--interactive-accent);
    border-color: var(--interactive-accent);
}

.mobile-drawer {
    position: fixed;
    top: 0;
    left: -320px;
    width: 300px;
    height: 100%;
    background-color: var(--lifted-cream);
    box-shadow: rgba(0, 0, 0, 0.15) 0px 0px 32px;
    z-index: 999;
    padding: 120px 24px 40px; /* Increased top padding to prevent button overlap */
    transition: left 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    visibility: hidden;
    pointer-events: none;
}

.mobile-drawer.active {
    left: 0;
    visibility: visible;
    pointer-events: auto;
}

.mobile-drawer-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(20, 20, 19, 0.4);
    backdrop-filter: blur(4px);
    z-index: 998;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.mobile-drawer-overlay.active {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

body.menu-open {
    overflow: hidden;
}

/* Mobile Menu Navigation Content */
.mobile-nav-content {
    flex: 1;
    position: relative;
    overflow-x: hidden;
}

.mobile-menu-pane {
    width: 100%;
    transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.3s ease;
}

.mobile-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.mobile-list-item {
    border-bottom: 1px solid rgba(20, 20, 19, 0.06);
}

.mobile-list-item a, .mobile-list-item button {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    padding: 16px 8px;
    color: var(--ink-black);
    text-decoration: none;
    font-size: 17px;
    font-weight: 500;
    background: none;
    border: none;
    text-align: left;
    cursor: pointer;
    outline: none;
    font-family: var(--font-sans);
}

.mobile-list-item a:hover, .mobile-list-item button:hover {
    color: var(--interactive-accent);
}

.mobile-back-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
    padding: 12px 8px;
    color: var(--signal-orange);
    background: none;
    border: none;
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
    margin-bottom: 16px;
    border-bottom: 2px solid rgba(207, 69, 0, 0.15);
    outline: none;
    font-family: var(--font-sans);
}

.mobile-back-btn:hover {
    color: var(--interactive-accent);
}

/* 7. POSTS GRID & CARDS */
.archive-header {
    text-align: center;
    margin-bottom: 48px;
}

.archive-title {
    font-size: 2.25rem;
    font-weight: 500;
    margin-bottom: 8px;
}

.archive-description {
    color: var(--slate-gray);
    font-size: 16px;
}

.post-list {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
    margin-top: 12px; /* Reduced from 24px to shrink gap below header */
    width: 100%;
}

.post-card {
    background-color: var(--white);
    border-radius: 30px;
    padding: 32px 24px;
    box-shadow: rgba(0, 0, 0, 0.04) 0px 4px 24px 0px;
    border: 1px solid rgba(20, 20, 19, 0.02);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    min-height: 320px;
    transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.post-card:hover {
    transform: translateY(-6px);
    box-shadow: rgba(0, 0, 0, 0.08) 0px 20px 40px 0px;
    border-color: rgba(var(--interactive-accent-rgb), 0.18);
}

.post-header {
    margin-bottom: 16px;
}

.post-eyebrow {
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--slate-gray);
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.post-eyebrow::before {
    content: '';
    display: inline-block;
    width: 6px;
    height: 6px;
    background-color: var(--light-signal-orange);
    border-radius: 50%;
}

.post-title {
    font-size: 24px;
    line-height: 1.25;
    margin-bottom: 12px;
    font-weight: 500;
}

.post-title a:hover {
    color: var(--interactive-accent);
}

.post-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    font-size: 13px;
    color: var(--slate-gray);
    list-style: none;
    margin-bottom: 16px;
}

.post-meta li a {
    color: var(--ink-black);
    text-decoration: underline;
}

.post-excerpt {
    font-size: 15px;
    line-height: 1.6;
    color: var(--ink-black);
    margin-bottom: 24px;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
}

.post-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

/* Pagination */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    margin-top: 64px;
    gap: 12px;
}

.pagination ol, .pagination ul {
    list-style: none;
    display: flex;
    gap: 8px;
}

.pagination li a, .pagination li span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 40px;
    height: 40px;
    padding: 0 12px;
    border-radius: 20px;
    font-size: 14px;
    font-weight: 500;
}

.pagination li a {
    background-color: var(--white);
    color: var(--ink-black);
    border: 1px solid rgba(20, 20, 19, 0.08);
}

.pagination li a:hover {
    background-color: var(--interactive-accent);
    color: var(--ink-black);
    border-color: var(--interactive-accent);
}

.pagination li span {
    color: var(--slate-gray);
}

.pagination li.current span, .pagination li.current a {
    background-color: var(--ink-black);
    color: var(--white);
    border: 1px solid var(--ink-black);
}

/* Independent About page presentation */
.about-page {
    max-width: 1120px;
    margin: 32px auto 72px;
    padding: 48px clamp(24px, 4vw, 52px);
    border: 1px solid rgba(20, 20, 19, 0.08);
    border-radius: 34px;
    background: rgba(255, 255, 255, 0.88);
    box-shadow: rgba(20, 20, 19, 0.06) 0 18px 50px;
}

.about-page > header {
    margin-bottom: 42px;
    padding-bottom: 28px;
    border-bottom: 1px solid var(--border-soft);
}

.about-page > header h1 {
    position: relative;
    display: inline-block;
    font-size: clamp(2rem, 3.5vw, 3.2rem);
    line-height: 1;
    letter-spacing: -0.04em;
}

.about-page > header h1::after {
    display: block;
    width: 56px;
    height: 4px;
    margin-top: 12px;
    border-radius: 999px;
    background: var(--interactive-accent);
    content: "";
}

.about-page > [itemprop="articleBody"] {
    color: var(--ink-black);
    font-size: 16px;
    line-height: 1.85;
}

.about-page > [itemprop="articleBody"] > p {
    max-width: 78ch;
    margin: 0 0 24px;
}

.about-page > [itemprop="articleBody"] > p:first-child {
    color: var(--ink-black);
    font-size: 1.08em;
    font-weight: 600;
    line-height: 1.75;
}

.about-page > [itemprop="articleBody"] h2 {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 44px 0 18px;
    color: var(--ink-black);
    font-size: clamp(1.4rem, 2.5vw, 1.8rem);
    line-height: 1.25;
}

.about-page > [itemprop="articleBody"] h2::before {
    display: block;
    width: 8px;
    height: 32px;
    border-radius: 999px;
    background: var(--interactive-accent);
    content: "";
}

.about-page > [itemprop="articleBody"] h3 {
    margin: 0 0 16px;
    color: var(--ink-black);
    font-size: 1.25rem;
    line-height: 1.35;
}

.about-page > [itemprop="articleBody"] blockquote {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 0;
    margin: 28px 0;
    padding: 12px 22px !important;
    border: 1px solid rgba(var(--interactive-accent-rgb), 0.18);
    border-left: 5px solid var(--interactive-accent);
    border-radius: 0 20px 20px 0;
    background: var(--lifted-cream);
    color: var(--ink-black);
    font-weight: 600;
    line-height: 1.55;
    text-align: center;
}

.about-page > [itemprop="articleBody"] blockquote p {
    margin: 0 !important;
    line-height: inherit !important;
}

/* Keep the page content open inside the outer About card. */
.about-page > [itemprop="articleBody"] > div {
    margin: 0 !important;
    padding: 0 !important;
    border: 0 !important;
    border-radius: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
}

/* Existing interest sections are authored with inline styles; keep only those as cards. */
.about-page > [itemprop="articleBody"] > div > div:has(> h3) {
    margin: 24px 0;
    padding: 28px 30px !important;
    border: 1px solid var(--border-soft) !important;
    border-radius: 24px !important;
    background: var(--white) !important;
    box-shadow: rgba(20, 20, 19, 0.04) 0 10px 30px !important;
}

.about-page > [itemprop="articleBody"] p {
    margin: 0 0 18px !important;
    color: var(--ink-black) !important;
    font-size: 15px !important;
    line-height: 1.8 !important;
}

.about-page [style*="display: inline-block"] {
    display: inline-flex !important;
    align-items: center;
    min-height: 30px;
    margin: 4px 6px 4px 0 !important;
    padding: 5px 12px !important;
    border: 1px solid rgba(var(--interactive-accent-rgb), 0.2) !important;
    border-radius: 999px !important;
    background: rgba(var(--interactive-accent-rgb), 0.08) !important;
    color: var(--interactive-accent-dark) !important;
    font-size: 13px !important;
    line-height: 1.2 !important;
}

@media (max-width: 700px) {
    .about-page {
        margin: 20px auto 48px;
        padding: 34px 20px;
        border-radius: 24px;
    }

    .about-page > header {
        margin-bottom: 30px;
        padding-bottom: 22px;
    }

    .about-page > [itemprop="articleBody"] {
        font-size: 16px;
    }

    .about-page > [itemprop="articleBody"] > div > div:has(> h3) {
        padding: 22px 20px !important;
        border-radius: 20px !important;
    }
}

/* 8. SINGLE POST & PAGE VIEW */
.post-container {
    width: 100%;
    margin: 48px auto;
    background-color: var(--white);
    border-radius: 30px;
    padding: 60px 48px;
    box-shadow: rgba(0, 0, 0, 0.04) 0px 4px 24px 0px;
    border: 1px solid rgba(20, 20, 19, 0.02);
}

.post-container .post-header .post-title {
    font-size: 1.8rem;
    line-height: 1.35;
    font-weight: 600;
    color: var(--slate-gray);
    margin-top: 8px;
    margin-bottom: 16px;
}

.post-content h1,
.post-content h2,
.post-content h3,
.post-content h4,
.post-content h5,
.post-content h6 {
    color: var(--ink-black);
    font-weight: 600;
    letter-spacing: -0.02em;
}

.post-content h1 {
    font-size: 2.2rem;
    line-height: 1.3;
    margin-top: 48px;
    margin-bottom: 20px;
}

.post-content h2 {
    font-size: 1.65rem;
    line-height: 1.35;
    margin-top: 40px;
    margin-bottom: 16px;
}

.post-content h3 {
    font-size: 1.35rem;
    line-height: 1.4;
    margin-top: 32px;
    margin-bottom: 16px;
}

.post-content h4 {
    font-size: 1.15rem;
    line-height: 1.45;
    margin-top: 24px;
    margin-bottom: 12px;
}

.post-content h5,
.post-content h6 {
    font-size: 1rem;
    line-height: 1.5;
    margin-top: 20px;
    margin-bottom: 12px;
}

.post-content > *:first-child {
    margin-top: 0 !important;
}

.post-content ul,
.post-content ol {
    margin-top: 12px;
    margin-bottom: 24px;
    padding-left: 24px;
}

.post-content ul {
    list-style-type: disc;
}

.post-content ol {
    list-style-type: decimal;
}

.post-content li {
    margin-bottom: 8px;
    line-height: 1.65;
}

.post-content li:last-child {
    margin-bottom: 0;
}

.post-content li > ul,
.post-content li > ol {
    margin-top: 8px;
    margin-bottom: 8px;
}

.post-content {
    font-size: 16px;
    line-height: 1.7;
    color: var(--ink-black);
}

.post-content p {
    margin-bottom: 24px;
}

.post-content > *:last-child {
    margin-bottom: 0;
}

.post-content strong,
.post-content b {
    font-weight: 700;
}

.post-content em,
.post-content i {
    font-style: italic;
}

.post-content del,
.post-content s {
    color: var(--slate-gray);
    text-decoration-thickness: 1.5px;
}

.post-content mark {
    padding: 0.08em 0.3em;
    border-radius: 4px;
    background: rgba(var(--interactive-accent-rgb), 0.24);
    color: var(--ink-black);
}

.post-content hr {
    height: 1px;
    margin: 40px 0;
    border: 0;
    background: var(--border-soft);
}

.post-content q {
    quotes: "\201C" "\201D" "\2018" "\2019";
}

.post-content kbd {
    display: inline-block;
    padding: 0.1em 0.5em;
    border: 1px solid rgba(20, 20, 19, 0.2);
    border-bottom-width: 2px;
    border-radius: 6px;
    background: var(--lifted-cream);
    color: var(--ink-black);
    font-family: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
    font-size: 0.84em;
    line-height: 1.4;
    white-space: nowrap;
}

.post-content sup,
.post-content sub {
    font-size: 0.75em;
    line-height: 0;
}

.post-content sup a {
    text-decoration: none;
    font-weight: 700;
}

/* Quotes, figures, and media */
.post-content blockquote > :first-child {
    margin-top: 0;
}

.post-content blockquote > :last-child {
    margin-bottom: 0;
}

.post-content figure {
    margin: 32px 0;
}

.post-content figure img {
    margin: 0;
}

.post-content figcaption {
    margin-top: 10px;
    color: var(--slate-gray);
    font-size: 13px;
    line-height: 1.5;
    text-align: center;
}

.post-content video,
.post-content audio,
.post-content iframe {
    display: block;
    max-width: 100%;
    margin: 32px 0;
    border: 0;
    border-radius: 18px;
}

.post-content video,
.post-content iframe {
    width: 100%;
}

.post-content video {
    background: var(--ink-black);
}

/* Task lists generated by common Markdown renderers */
.post-content ul.task-list,
.post-content ul.contains-task-list {
    padding-left: 0;
    list-style: none;
}

.post-content li.task-list-item {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    list-style: none;
}

.post-content li.task-list-item > input[type="checkbox"] {
    flex: 0 0 auto;
    width: 17px;
    height: 17px;
    margin: 0.3em 0 0;
    border: 1.5px solid rgba(20, 20, 19, 0.24);
    border-radius: 5px;
    background: var(--white);
    appearance: none;
    cursor: default;
}

.post-content li.task-list-item > input[type="checkbox"]:checked {
    border-color: var(--interactive-accent);
    background: var(--interactive-accent);
    box-shadow: inset 0 0 0 3px var(--white);
}

/* Footnotes and collapsible Markdown/HTML sections */
.post-content .footnotes,
.post-content section.footnotes {
    margin-top: 48px;
    padding-top: 24px;
    border-top: 1px solid var(--border-soft);
    color: var(--slate-gray);
    font-size: 14px;
}

.post-content .footnotes ol {
    margin-bottom: 0;
}

.post-content .footnote-backref {
    margin-left: 0.35em;
    text-decoration: none;
}

.post-content .footnotes li p {
    display: inline;
    margin: 0;
}

.post-content details {
    margin: 24px 0;
    padding: 16px 20px;
    border: 1px solid var(--border-soft);
    border-radius: 16px;
    background: var(--lifted-cream);
}

.post-content summary {
    color: var(--ink-black);
    font-weight: 600;
    cursor: pointer;
}

.post-content details[open] summary {
    margin-bottom: 12px;
    color: var(--interactive-accent-dark);
}

/* Keep links in article and page content visually distinct from body text. */
.post-content a {
    color: var(--interactive-accent);
    text-decoration-line: underline;
    text-decoration-thickness: 1.5px;
    text-decoration-color: rgba(var(--interactive-accent-rgb), 0.55);
    text-underline-offset: 0.18em;
    overflow-wrap: anywhere;
}

.post-content a:visited {
    color: var(--interactive-accent);
    text-decoration-color: rgba(var(--interactive-accent-rgb), 0.55);
}

.post-content a:hover {
    color: var(--interactive-accent-dark);
    text-decoration-color: currentColor;
}

.post-content a:focus-visible {
    color: var(--interactive-accent-dark);
    outline: 2px solid var(--interactive-accent);
    outline-offset: 3px;
    border-radius: 2px;
}

/* A linked image already provides its own visible click target. */
.post-content a:has(> img) {
    text-decoration: none;
}

.post-content img {
    max-width: 100%;
    border-radius: 20px;
    margin: 24px 0;
    box-shadow: rgba(0,0,0,0.05) 0px 8px 24px;
}

.post-content blockquote {
    border-left: 4px solid var(--light-signal-orange);
    padding-left: 20px;
    margin: 32px 0;
    font-style: italic;
    color: var(--slate-gray);
}

/* Code blocks and inline code */
.post-content pre {
    position: relative;
    margin: 32px 0;
    padding: 24px;
    overflow-x: auto;
    border: 1px solid rgba(20, 20, 19, 0.12);
    border-radius: 18px;
    background: #1B1B1A;
    color: #F5F3EF;
    box-shadow: rgba(0, 0, 0, 0.08) 0 10px 28px;
    font-family: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
    font-size: 14px;
    line-height: 1.7;
    tab-size: 4;
    -webkit-overflow-scrolling: touch;
}

.post-content pre code {
    display: block;
    padding: 0;
    overflow: visible;
    background: transparent;
    color: inherit;
    font: inherit;
    white-space: pre;
}

.post-content pre code.hljs,
.post-content pre .hljs {
    padding: 0;
    background: transparent;
}

.post-content code:not(pre code) {
    padding: 0.15em 0.45em;
    border: 1px solid rgba(var(--interactive-accent-rgb), 0.18);
    border-radius: 6px;
    background: rgba(var(--interactive-accent-rgb), 0.08);
    color: var(--interactive-accent-dark);
    font-family: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
    font-size: 0.9em;
    overflow-wrap: anywhere;
}

/* KaTeX display equations */
.post-content .katex {
    color: var(--ink-black);
    font-size: 1.08em;
}

.post-content .katex-display {
    margin: 32px 0;
    padding: 20px 24px;
    overflow-x: auto;
    border: 1px solid rgba(var(--interactive-accent-rgb), 0.16);
    border-radius: 18px;
    background: var(--lifted-cream);
    -webkit-overflow-scrolling: touch;
}

.post-content .katex-display > .katex {
    min-width: max-content;
}

/* Table Styles */
.post-content table {
    width: 100%;
    margin: 32px 0;
    border-collapse: separate;
    border-spacing: 0;
    font-size: 15px;
    line-height: 1.6;
    border: 1px solid var(--border-soft);
    border-radius: 16px;
    overflow: hidden;
    box-shadow: rgba(0, 0, 0, 0.01) 0px 4px 12px 0px;
}

.post-content table caption {
    caption-side: bottom;
    padding-top: 10px;
    color: var(--slate-gray);
    font-size: 13px;
    line-height: 1.5;
    text-align: center;
}

.post-content th {
    background-color: var(--canvas-cream);
    color: var(--ink-black);
    font-weight: 600;
    padding: 14px 20px;
    border-bottom: 1.5px solid var(--border-soft);
    text-align: left;
    font-size: 14px;
    letter-spacing: -0.01em;
}

.post-content td {
    padding: 14px 20px;
    border-bottom: 1px solid var(--border-soft);
    color: var(--ink-black);
    background-color: var(--white);
    transition: background-color 0.2s ease;
}

.post-content tr:last-child td {
    border-bottom: none;
}

.post-content tr:nth-child(even) td {
    background-color: var(--lifted-cream);
}

.post-content tr:hover td {
    background-color: rgba(var(--interactive-accent-rgb), 0.06);
}

/* Comments Section */
#comments {
    width: 100%;
    margin: 48px auto;
    background-color: var(--white);
    border-radius: 30px;
    padding: 48px;
    box-shadow: rgba(0, 0, 0, 0.04) 0px 4px 24px 0px;
    border: 1px solid rgba(20, 20, 19, 0.02);
}

.comments-title {
    font-size: 20px;
    margin-bottom: 24px;
    border-bottom: 1px solid var(--border-soft);
    padding-bottom: 12px;
}

.comment-list, .comment-list ul {
    list-style: none;
}

.comment-list {
    margin-bottom: 32px;
}

.comment-list li {
    padding: 20px 0;
    border-bottom: 1px solid var(--border-soft);
}

.comment-list li .comment-child {
    margin-left: 32px;
    margin-top: 16px;
    border-left: 2px solid var(--border-soft);
    padding-left: 16px;
}

.comment-author {
    font-weight: 700;
    margin-bottom: 6px;
    font-size: 14px;
}

.comment-meta {
    font-size: 12px;
    color: var(--slate-gray);
    margin-bottom: 12px;
}

.comment-content {
    font-size: 15px;
    line-height: 1.6;
}

.comment-respond {
    margin-top: 32px;
}

.comment-form {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.comment-form input, .comment-form textarea {
    background-color: var(--canvas-cream);
    border: 1.5px solid transparent;
    border-radius: 12px;
    padding: 12px 16px;
    font-family: var(--font-sans);
    font-size: 14px;
    outline: none;
    width: 100%;
}

.comment-form input:focus, .comment-form textarea:focus {
    border-color: var(--ink-black);
    background-color: var(--white);
}

.comment-form-row {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 16px;
}

/* 9. DARK FOOTER */
footer {
    background-color: var(--ink-black);
    color: var(--white);
    padding: 20px 24px 24px; /* Reduced further to shrink vertical height */
    border-top-left-radius: 40px;
    border-top-right-radius: 40px;
    margin-top: 12px; /* Reduced from 24px */
}

.footer-content {
    max-width: 1200px;
    margin: 0 auto;
    text-align: center;
}

.footer-links {
    margin-bottom: 12px; /* Reduced from 32px to shrink footer height */
    font-size: 14px;
    color: rgba(255, 255, 255, 0.7);
    line-height: 1.8;
}

.footer-prefix {
    font-weight: 700;
    color: var(--white);
    margin-right: 4px;
}

.footer-links a {
    color: var(--white);
    text-decoration: none;
    margin: 0 6px;
    border-bottom: 1px dashed rgba(255, 255, 255, 0.4);
    padding-bottom: 2px;
    transition: all 0.2s ease;
}

.footer-links a:hover {
    color: var(--interactive-accent);
    border-bottom-color: var(--interactive-accent);
}

.copyright {
    font-size: 13px;
    color: rgba(255, 255, 255, 0.4);
    letter-spacing: 0.02em;
}

/* 10. ANIMATIONS */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translate(-50%, 10px);
    }
    to {
        opacity: 1;
        transform: translate(-50%, 0);
    }
}

/* 11. RESPONSIVE BEHAVIOR */
@media (max-width: 1024px) {
    .nav-menu {
        gap: 16px;
    }
    .post-list {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    /* Hide desktop nav elements on mobile */
    #header .nav-pill .nav-bottom-row {
        display: none;
    }

    #header .nav-pill {
        border-radius: 30px;
        padding: 16px 24px;
    }

    .nav-top-row {
        margin-bottom: 8px; /* changed from 0 to leave room for the onion */
        width: 100%;
    }

    .onion-divider {
        display: flex; /* keep visible on mobile */
        height: 24px; /* slightly smaller height on mobile for compactness */
        margin: 8px 0 0; /* space above, none below since it's the last element */
    }

    .onion-left {
        width: calc(24px * 43 / 100);
    }

    .onion-right {
        width: calc(24px * 193 / 100);
    }

    .site-identity {
        margin-right: auto;
        padding-left: 56px; /* Leave space for left-top floating button */
    }

    .post-list {
        grid-template-columns: 1fr;
        gap: 24px;
    }

    .post-card {
        padding: 30px;
        border-radius: 30px;
        min-height: 280px;
    }

    .post-container {
        padding: 40px 24px;
        border-radius: 30px;
        margin: 24px auto;
    }

    .post-container .post-header .post-title {
        font-size: 1.4rem;
    }

    .post-content h1 {
        font-size: 1.8rem;
    }

    .post-content h2 {
        font-size: 1.45rem;
    }

    .post-content h3 {
        font-size: 1.20rem;
    }

    .post-content table {
        display: block;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    #comments {
        padding: 30px 24px;
        border-radius: 30px;
    }

    .comment-form-row {
        grid-template-columns: 1fr;
        gap: 12px;
    }
    
    footer {
        padding: 48px 24px 64px;
        border-top-left-radius: 30px;
        border-top-right-radius: 30px;
        margin-top: 64px;
    }
}

