/* Fonts */
@import url('https://fonts.googleapis.com/css2?family=Cardo:ital,wght@0,400;0,700;1,400&family=Cinzel:wght@400;700&display=swap');

:root {
    --bg-color: #fcfbf7;
    /* Ancient paper */
    --text-color: #1a1a1a;
    /* Ink black */
    --accent-color: #4a4a4a;
    /* Graphite */
    --border-color: #d1d1cf;
    --header-font: 'Cinzel', serif;
    --body-font: 'Cardo', serif;
}

[data-theme="dark"] {
    --bg-color: #1a1a1c;
    /* Dark slate */
    --text-color: #e0e0e0;
    --accent-color: #a0a0a0;
    --border-color: #333;
}

body {
    background-color: var(--bg-color);
    color: var(--text-color);
    font-family: var(--body-font);
    margin: 0;
    padding: 0;
    line-height: 1.6;
    transition: background-color 0.3s ease, color 0.3s ease;
}

/* Compact Header Styles */
/* Header Styles */
/* Header Styles */
/* Header Styles */
.site-header {
    position: relative;
    width: 100%;
    height: 250px;
    /* Space to show the watercolor */
    margin-bottom: 3rem;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    border-bottom: 1px solid var(--border-color);
}

.header-bg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
}

.header-bg-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0.6;
    /* Soften the painting */
    filter: grayscale(40%) brightness(0.9);
    /* Subtle monochromatic touch */
}

.header-split-container {
    position: relative;
    z-index: 2;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1.5rem;
    max-width: 1100px;
    width: 100%;
    margin: 0 auto;
}

.network-nav {
    position: absolute;
    top: -4.5rem;
    left: 2rem;
}

.network-link {
    font-family: var(--header-font);
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 2px;
    color: var(--text-color);
    text-decoration: none;
    border: none !important;
    opacity: 0.6;
    transition: all 0.3s ease;
}

.network-link:hover {
    opacity: 1;
    letter-spacing: 3px;
}

.flourish-part {
    height: 60px;
    /* Adjust for banner height */
    width: auto;
    max-width: 350px;
    object-fit: contain;
    opacity: 0.9;
}

[data-theme="dark"] .flourish-part {
    filter: invert(1);
}

h1.site-title {
    font-family: var(--header-font);
    font-size: 3rem;
    text-transform: uppercase;
    letter-spacing: 4px;
    margin: 0;
    line-height: 1;
    white-space: nowrap;
    background-color: rgba(252, 251, 247, 0.8);
    /* Semi-transparent paper mask */
    padding: 0.5rem 1.5rem;
    border: 1px solid var(--border-color);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.05);
}

[data-theme="dark"] h1.site-title {
    background-color: rgba(26, 26, 28, 0.8);
}

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

[data-theme="dark"] h1.site-title a {
    color: var(--text-color) !important;
}

h1.page-title {
    font-family: var(--header-font);
    font-size: 2rem;
    text-align: center;
    margin-bottom: 1rem;
}

.container {
    max-width: 800px;
    margin: 0 auto;
    padding: 0 20px;
}

article {
    margin-bottom: 4rem;
}

/* Typography */
p {
    font-size: 1.2rem;
    margin-bottom: 1.2rem;
}

blockquote {
    border-left: 4px solid var(--accent-color);
    padding: 0.5rem 0 0.5rem 1.5rem;
    margin: 2rem 0;
    font-style: italic;
    color: var(--accent-color);
}


a {
    color: var(--accent-color);
    text-decoration: none;
    border-bottom: 1px dotted var(--accent-color);
    transition: border-bottom 0.2s;
}

a:hover {
    border-bottom: 1px solid var(--accent-color);
}

.meta {
    font-size: 0.9rem;
    color: #666;
    text-align: center;
    font-style: italic;
    margin-bottom: 2rem;
}

[data-theme="dark"] .meta {
    color: #aaa;
}

/* Toggle Switch */
.theme-toggle {
    position: absolute;
    top: 10px;
    right: 20px;
    background: none;
    border: 1px solid var(--border-color);
    color: var(--text-color);
    padding: 0.5rem;
    cursor: pointer;
    font-family: var(--header-font);
    font-size: 0.8rem;
    z-index: 10;
}

/* Post list */
.post-list {
    list-style: none;
    padding: 0;
}

.post-item {
    padding: 1rem 0;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: baseline;
}

.post-item a {
    font-family: var(--header-font);
    font-size: 1.4rem;
    border: none;
}

/* Markdown Content Styling (Prose) */
.content {
    animation: fadeInUp 1s ease-out;
}

.content h1,
.content h2,
.content h3,
.content h4 {
    font-family: var(--header-font);
    color: var(--text-color);
    margin-top: 3.5rem;
    margin-bottom: 1.5rem;
    line-height: 1.1;
    letter-spacing: 0.05em;
}

.content h2 {
    font-size: 2.2rem;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 0.8rem;
}

.content h3 {
    font-size: 1.6rem;
}

.content p {
    margin-bottom: 2rem;
    font-size: 1.25rem;
    line-height: 1.8;
    color: var(--text-color);
    opacity: 0.9;
}

.content ul,
.content ol {
    margin-bottom: 2rem;
    padding-left: 2rem;
}

.content li {
    margin-bottom: 0.8rem;
    font-size: 1.2rem;
}

/* Inline Code (Modern touch for Phil site) */
.content :not(pre)>code {
    font-family: monospace;
    background: rgba(0, 0, 0, 0.05);
    color: var(--accent-color);
    padding: 0.2rem 0.4rem;
    border-radius: 4px;
    font-size: 0.9em;
}

[data-theme="dark"] .content :not(pre)>code {
    background: rgba(255, 255, 255, 0.1);
}

/* Copy Button */
.copy-button {
    position: absolute;
    top: 0.8rem;
    right: 0.8rem;
    padding: 0.4rem 0.8rem;
    background: rgba(0, 0, 0, 0.03);
    border: 1px solid var(--border-color);
    color: var(--text-color);
    font-family: var(--header-font);
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 2px;
    border-radius: 4px;
    cursor: pointer;
    opacity: 0;
    transition: all 0.3s ease;
    z-index: 10;
}

[data-theme="dark"] .copy-button {
    background: rgba(255, 255, 255, 0.05);
}

div:hover>.copy-button {
    opacity: 0.7;
}

.copy-button:hover {
    opacity: 1 !important;
    background: var(--text-color);
    color: var(--bg-color);
}

.copy-button.copied {
    background: #4a7a4a;
    border-color: #4a7a4a;
    color: white;
    opacity: 1 !important;
}

/* Code Blocks */
.content pre {
    margin: 3rem 0;
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid var(--border-color);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    background: #0d1117;
    width: 100%;
}


[data-theme="light"] .content pre {
    background: #f6f8fa;
}

.content pre code {
    font-family: monospace;
    font-size: 1rem;
    line-height: 1.6;
    display: block;
    padding: 1.5rem;
}

/* Blockquotes */
.content blockquote {
    margin: 3.5rem 0;
    padding: 2rem 3rem;
    border-left: 3px double var(--accent-color);
    background: rgba(0, 0, 0, 0.02);
    font-style: italic;
    font-size: 1.4rem;
    line-height: 1.6;
}

[data-theme="dark"] .content blockquote {
    background: rgba(255, 255, 255, 0.03);
}

.content blockquote p {
    margin-bottom: 0;
    color: var(--accent-color);
}

/* Images */
.content img {
    max-width: 100%;
    height: auto;
    border-radius: 4px;
    margin: 3rem 0;
    border: 1px solid var(--border-color);
    box-shadow: 0 5px 25px rgba(0, 0, 0, 0.1);
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Table of Contents */
.table-of-contents {
    margin: 2rem 0 3rem 0;
    padding: 1.5rem 2rem;
    background: rgba(0, 0, 0, 0.02);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    font-size: 1rem;
}

[data-theme="dark"] .table-of-contents {
    background: rgba(255, 255, 255, 0.03);
}

.table-of-contents h3 {
    font-family: var(--header-font);
    font-size: 1.2rem;
    text-transform: uppercase;
    letter-spacing: 2px;
    margin-top: 0;
    margin-bottom: 1rem;
    color: var(--accent-color);
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 0.5rem;
}

.table-of-contents nav ul {
    list-style: none;
    padding-left: 0;
    margin: 0;
}

.table-of-contents nav li {
    margin-bottom: 0.5rem;
    line-height: 1.4;
}

.table-of-contents a {
    text-decoration: none;
    border-bottom: none;
    color: var(--text-color);
    opacity: 0.8;
    transition: opacity 0.2s, color 0.2s;
}

.table-of-contents a:hover {
    opacity: 1;
    color: var(--accent-color);
    border-bottom: 1px solid var(--accent-color);
}

.toc-level-2 {
    margin-left: 0;
    font-weight: 700;
}


/* Collapsible Code Blocks */
pre.collapsed {
    max-height: 300px;
    overflow: hidden;
    mask-image: linear-gradient(to bottom, black 50%, transparent 100%);
    -webkit-mask-image: linear-gradient(to bottom, black 50%, transparent 100%);
    border-bottom: none;
    border-bottom-left-radius: 0;
    border-bottom-right-radius: 0;
}

.expand-button {
    display: block;
    width: 100%;
    padding: 0.8rem;
    background: var(--bg-color);
    border: 1px solid var(--border-color);
    color: var(--accent-color);
    text-align: center;
    cursor: pointer;
    font-family: var(--header-font);
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    transition: all 0.3s ease;
    border-radius: 0 0 8px 8px;
    margin-top: -1px;
}

.expand-button:hover {
    background: var(--accent-color);
    color: var(--bg-color);
}