/* Utterance Theme - Dark & Contemplative */

:root {
    /* Dark mode (default) - midnight tones */
    --bg: #0d1117;
    --bg-alt: #161b22;
    --text: #e6edf3;
    --text-muted: #8b949e;
    --accent: #58a6ff;
    --border: #21262d;
    --font-body: var(--gh-font-body, 'Lora', Georgia, 'Times New Roman', serif);
    --font-heading: var(--gh-font-heading, 'Lora', Georgia, 'Times New Roman', serif);
    --max-width: 640px;
    --spacing: 2rem;
}

[data-theme="light"] {
    --bg: #fafafa;
    --bg-alt: #f0f0f0;
    --text: #1a1a1a;
    --text-muted: #666666;
    --accent: #0066cc;
    --border: #e0e0e0;
}

/* Reset */
*, *::before, *::after {
    box-sizing: border-box;
}

/* Base */
html {
    font-size: 18px;
    line-height: 1.8;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    font-family: var(--font-body);
    background: var(--bg);
    color: var(--text);
    margin: 0;
    padding: 0;
}

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

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

img {
    max-width: 100%;
    height: auto;
    display: block;
}

/* Layout */
main {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: var(--spacing);
    min-height: 60vh;
}

/* Header */
.site-header {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: calc(var(--spacing) * 2) var(--spacing) var(--spacing);
}

.header-inner {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    flex-wrap: wrap;
    gap: 1rem;
}

.site-title {
    font-family: var(--font-heading);
    font-size: 1.25rem;
    font-weight: 500;
    letter-spacing: 0.02em;
    text-transform: lowercase;
    border-bottom: none;
}

.site-title:hover {
    border-bottom: none;
}

.site-description {
    color: var(--text-muted);
    font-style: italic;
    margin: 1rem 0 0;
    font-size: 0.9rem;
    letter-spacing: 0.01em;
}

/* Navigation */
.site-nav {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    font-size: 0.85rem;
}

.site-nav ul {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    gap: 1.5rem;
}

.site-nav a {
    color: var(--text-muted);
    border-bottom: none;
    transition: color 0.2s;
}

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

/* Theme Toggle */
.theme-toggle {
    background: none;
    border: none;
    padding: 0;
    font-family: inherit;
    font-size: 0.85rem;
    color: var(--text-muted);
    cursor: pointer;
    transition: color 0.2s;
}

.theme-toggle:hover {
    color: var(--text);
}

[data-theme="dark"] .theme-toggle-light {
    display: none;
}

[data-theme="light"] .theme-toggle-dark {
    display: none;
}

/* Post Feed */
.post-feed {
    display: flex;
    flex-direction: column;
    gap: calc(var(--spacing) * 2.5);
}

/* Post Card */
.post-card {
    padding-bottom: calc(var(--spacing) * 2);
    border-bottom: 1px solid var(--border);
}

.post-card:last-child {
    border-bottom: none;
}

.post-card-image-link {
    display: block;
    margin-bottom: 1.5rem;
    border-bottom: none;
}

.post-card-image {
    width: 100%;
    height: auto;
    opacity: 0.9;
    transition: opacity 0.2s;
}

.post-card-image-link:hover .post-card-image {
    opacity: 1;
}

.post-card-title {
    font-family: var(--font-heading);
    font-size: 1.5rem;
    font-weight: 500;
    margin: 0 0 0.75rem;
    line-height: 1.35;
}

.post-card-title a {
    border-bottom: none;
}

.post-card-title a:hover {
    border-bottom: 1px solid var(--text);
}

.post-card-excerpt {
    color: var(--text-muted);
    margin: 0 0 1rem;
    font-size: 0.95rem;
    line-height: 1.7;
}

.post-card-meta {
    font-size: 0.8rem;
    color: var(--text-muted);
    letter-spacing: 0.02em;
}

/* Single Post */
.post-header {
    margin-bottom: calc(var(--spacing) * 2);
    text-align: center;
}

.post-title {
    font-family: var(--font-heading);
    font-size: 2.25rem;
    font-weight: 500;
    margin: 0 0 1rem;
    line-height: 1.25;
}

.post-meta {
    font-size: 0.85rem;
    color: var(--text-muted);
    letter-spacing: 0.02em;
}

.post-author {
    color: var(--text-muted);
    border-bottom: none;
}

.post-author:hover {
    color: var(--text);
}

/* Feature Image */
.post-feature-image,
.page-feature-image {
    margin: 0 0 calc(var(--spacing) * 2);
}

.post-feature-image img,
.page-feature-image img {
    opacity: 0.95;
}

.post-feature-image figcaption,
.page-feature-image figcaption {
    font-size: 0.8rem;
    color: var(--text-muted);
    font-style: italic;
    margin-top: 0.75rem;
    text-align: center;
}

/* Post Content */
.post-content,
.page-content {
    line-height: 1.9;
}

.post-content p,
.page-content p {
    margin: 0 0 1.75rem;
}

.post-content h2,
.page-content h2 {
    font-family: var(--font-heading);
    font-size: 1.5rem;
    margin: 3rem 0 1.25rem;
    font-weight: 500;
}

.post-content h3,
.page-content h3 {
    font-family: var(--font-heading);
    font-size: 1.25rem;
    margin: 2.5rem 0 1rem;
    font-weight: 500;
}

.post-content blockquote,
.page-content blockquote {
    margin: 2rem 0;
    padding: 0 0 0 1.5rem;
    border-left: 2px solid var(--border);
    font-style: italic;
    color: var(--text-muted);
}

.post-content pre,
.page-content pre {
    background: var(--bg-alt);
    padding: 1.25rem;
    overflow-x: auto;
    font-size: 0.85rem;
    margin: 1.75rem 0;
    border-radius: 4px;
}

.post-content code,
.page-content code {
    font-family: 'SF Mono', 'Fira Code', monospace;
    font-size: 0.85em;
}

.post-content ul,
.post-content ol,
.page-content ul,
.page-content ol {
    margin: 0 0 1.75rem;
    padding-left: 1.5rem;
}

.post-content li,
.page-content li {
    margin-bottom: 0.5rem;
}

.post-content img,
.page-content img {
    margin: 2rem 0;
}

.post-content figure,
.page-content figure {
    margin: 2rem 0;
}

.post-content figcaption,
.page-content figcaption {
    font-size: 0.8rem;
    color: var(--text-muted);
    font-style: italic;
    margin-top: 0.75rem;
    text-align: center;
}

.post-content hr,
.page-content hr {
    border: none;
    border-top: 1px solid var(--border);
    margin: 3rem 0;
}

/* Post Footer */
.post-footer {
    margin-top: calc(var(--spacing) * 2);
    padding-top: calc(var(--spacing) * 2);
    border-top: 1px solid var(--border);
}

.author-card {
    display: flex;
    gap: 1.25rem;
    align-items: flex-start;
}

.author-avatar {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    object-fit: cover;
}

.author-info h4 {
    margin: 0 0 0.25rem;
    font-size: 1rem;
    font-weight: 500;
}

.author-info h4 a {
    border-bottom: none;
}

.author-info p {
    margin: 0;
    font-size: 0.9rem;
    color: var(--text-muted);
    line-height: 1.6;
}

/* Page */
.page-header {
    margin-bottom: calc(var(--spacing) * 2);
    text-align: center;
}

.page-title {
    font-family: var(--font-heading);
    font-size: 2.25rem;
    font-weight: 500;
    margin: 0;
    line-height: 1.25;
}

/* Author & Tag Headers */
.author-header,
.tag-header {
    text-align: center;
    margin-bottom: calc(var(--spacing) * 2);
    padding-bottom: calc(var(--spacing) * 2);
    border-bottom: 1px solid var(--border);
}

.author-avatar-large {
    width: 72px;
    height: 72px;
    border-radius: 50%;
    object-fit: cover;
    margin: 0 auto 1.25rem;
}

.author-name,
.tag-name {
    font-family: var(--font-heading);
    font-size: 1.75rem;
    font-weight: 500;
    margin: 0 0 0.5rem;
}

.author-bio,
.tag-description {
    color: var(--text-muted);
    margin: 0;
    font-style: italic;
    max-width: 480px;
    margin-left: auto;
    margin-right: auto;
}

.author-location {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin: 0.75rem 0 0;
}

/* Pagination */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 2rem;
    margin-top: calc(var(--spacing) * 2);
    padding-top: calc(var(--spacing) * 2);
    border-top: 1px solid var(--border);
    font-size: 0.85rem;
}

.pagination a {
    color: var(--text-muted);
    border-bottom: none;
}

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

.pagination-info {
    color: var(--text-muted);
    font-variant-numeric: tabular-nums;
}

/* Error Page */
.error-page {
    text-align: center;
    padding: calc(var(--spacing) * 4) var(--spacing);
}

.error-code {
    font-family: var(--font-heading);
    font-size: 5rem;
    font-weight: 400;
    margin: 0 0 0.5rem;
    color: var(--text-muted);
    opacity: 0.5;
}

.error-message {
    font-size: 1.25rem;
    margin: 0 0 0.5rem;
}

.error-description {
    color: var(--text-muted);
    font-style: italic;
    margin: 0 0 2rem;
}

.error-page a {
    color: var(--text-muted);
}

/* Footer */
.site-footer {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: calc(var(--spacing) * 2) var(--spacing);
    font-size: 0.8rem;
    color: var(--text-muted);
    text-align: center;
}

.site-footer p {
    margin: 0 0 0.25rem;
}

.site-footer a {
    color: var(--text-muted);
    border-bottom: none;
}

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

/* Ghost Content Cards */
.kg-card {
    margin: 2rem 0;
}

/* Wide and Full Width Images */
.kg-width-wide {
    position: relative;
    width: 85vw;
    left: 50%;
    transform: translateX(-50%);
    max-width: 1000px;
}

.kg-width-full {
    position: relative;
    width: 100vw;
    left: 50%;
    transform: translateX(-50%);
}

.kg-width-wide img,
.kg-width-full img {
    width: 100%;
}

.kg-image-card img {
    margin: 0;
}

.kg-gallery-card {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1rem;
}

.kg-bookmark-card {
    background: var(--bg-alt);
    border: 1px solid var(--border);
    border-radius: 4px;
}

.kg-bookmark-container {
    display: flex;
    text-decoration: none;
    color: var(--text);
    border-bottom: none;
}

.kg-bookmark-container:hover {
    border-bottom: none;
}

.kg-bookmark-content {
    flex: 1;
    padding: 1.25rem;
}

.kg-bookmark-title {
    font-weight: 500;
    margin-bottom: 0.5rem;
}

.kg-bookmark-description {
    font-size: 0.9rem;
    color: var(--text-muted);
    line-height: 1.5;
}

.kg-bookmark-metadata {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-top: 0.75rem;
}

.kg-bookmark-thumbnail {
    width: 140px;
}

.kg-bookmark-thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Responsive */
@media (max-width: 600px) {
    html {
        font-size: 16px;
    }

    :root {
        --spacing: 1.5rem;
    }

    .site-header {
        padding-top: var(--spacing);
    }

    .header-inner {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.75rem;
    }

    .post-title,
    .page-title {
        font-size: 1.75rem;
    }

    .post-header,
    .page-header {
        text-align: left;
    }

    .pagination {
        gap: 1rem;
    }
}
