/* ==========================================================================
   Ink Harmony Theme
   A warm, literary theme for comfortable reading
   ========================================================================== */

/* --------------------------------------------------------------------------
   CSS Variables - The color palette
   -------------------------------------------------------------------------- */
:root {
    /* Warm cream/parchment background */
    --color-bg: #FAF6F1;
    --color-bg-alt: #F4EDE4;
    
    /* Deep warm browns for text */
    --color-text: #3D352C;
    --color-text-secondary: #6B5E52;
    --color-text-tertiary: #8F7F6F;
    
    /* Accent colors - warm tan/terracotta */
    --color-accent: #A67C52;
    --color-accent-hover: #8B6344;
    
    /* Borders and dividers */
    --color-border: #E2D9CE;
    --color-border-light: #EDE6DD;
    
    /* Typography */
    --font-serif: 'Georgia', 'Times New Roman', serif;
    --font-sans: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    
    /* Sizing */
    --content-width: 680px;
    --wide-width: 1000px;
    --gap: 2rem;
}

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

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

body {
    margin: 0;
    padding: 0;
    font-family: var(--font-serif);
    font-size: 1rem;
    line-height: 1.7;
    color: var(--color-text);
    background: var(--color-bg);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

a {
    color: var(--color-accent);
    text-decoration: none;
    transition: color 0.2s ease;
}

a:hover {
    color: var(--color-accent-hover);
}

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

/* --------------------------------------------------------------------------
   Site Header
   -------------------------------------------------------------------------- */
.site-header {
    padding: 1.5rem var(--gap);
    border-bottom: 1px solid var(--color-border-light);
}

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

.site-brand {
    flex-shrink: 0;
}

.site-logo img {
    height: 50px;
    width: auto;
}

.site-title {
    font-family: var(--font-serif);
    font-size: 1.5rem;
    font-weight: 400;
    color: var(--color-text);
    letter-spacing: -0.01em;
}

.site-nav {
    flex: 1;
    display: flex;
    justify-content: center;
}

.site-nav ul {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    gap: 2rem;
    flex-wrap: wrap;
    justify-content: center;
}

.site-nav a {
    font-family: var(--font-sans);
    font-size: 0.9rem;
    color: var(--color-text-secondary);
    text-transform: lowercase;
    letter-spacing: 0.03em;
}

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

.header-actions {
    display: flex;
    gap: 1rem;
    align-items: center;
}

.nav-link {
    font-family: var(--font-sans);
    font-size: 0.85rem;
    color: var(--color-text-secondary);
}

.subscribe-link {
    padding: 0.5rem 1rem;
    background: var(--color-accent);
    color: var(--color-bg) !important;
    border-radius: 3px;
}

.subscribe-link:hover {
    background: var(--color-accent-hover);
}

/* --------------------------------------------------------------------------
   Main Content
   -------------------------------------------------------------------------- */
.site-main {
    flex: 1;
    padding: var(--gap);
    max-width: var(--wide-width);
    margin: 0 auto;
    width: 100%;
}

/* --------------------------------------------------------------------------
   Home Page - Post List
   -------------------------------------------------------------------------- */
.home-container {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.post-card {
    padding-bottom: 2rem;
    border-bottom: 1px solid var(--color-border-light);
}

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

/* Featured (latest) post */
.featured-post {
    padding-bottom: 3rem;
    margin-bottom: 1rem;
}

.featured-post .post-card-title {
    font-size: 2rem;
}

.featured-post .post-card-excerpt {
    font-size: 1.1rem;
}

.post-label {
    display: inline-block;
    font-family: var(--font-sans);
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--color-text-tertiary);
    margin-bottom: 0.75rem;
}

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

.post-card-image {
    width: 100%;
    border-radius: 4px;
}

.post-card-title {
    font-family: var(--font-serif);
    font-size: 1.5rem;
    font-weight: 400;
    line-height: 1.3;
    margin: 0 0 0.75rem 0;
}

.post-card-title a {
    color: var(--color-text);
}

.post-card-title a:hover {
    color: var(--color-accent);
}

.post-card-excerpt {
    color: var(--color-text-secondary);
    margin: 0 0 1rem 0;
    line-height: 1.6;
}

.post-card-meta {
    font-family: var(--font-sans);
    font-size: 0.85rem;
    color: var(--color-text-tertiary);
    display: flex;
    gap: 1rem;
}

/* --------------------------------------------------------------------------
   Post List (Tag/Author pages)
   -------------------------------------------------------------------------- */
.tag-header,
.author-header {
    text-align: center;
    padding-bottom: 2rem;
    margin-bottom: 2rem;
    border-bottom: 1px solid var(--color-border-light);
}

.tag-name,
.author-name {
    font-family: var(--font-serif);
    font-size: 2.5rem;
    font-weight: 400;
    margin: 0 0 0.5rem 0;
}

.tag-description,
.author-bio {
    color: var(--color-text-secondary);
    max-width: var(--content-width);
    margin: 0 auto 0.5rem;
}

.tag-count {
    font-family: var(--font-sans);
    font-size: 0.85rem;
    color: var(--color-text-tertiary);
}

.author-image {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    margin: 0 auto 1.5rem;
    object-fit: cover;
}

.author-location {
    font-family: var(--font-sans);
    font-size: 0.85rem;
    color: var(--color-text-tertiary);
}

.post-list {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

/* --------------------------------------------------------------------------
   Single Post
   -------------------------------------------------------------------------- */
.post-full,
.page {
    max-width: var(--content-width);
    margin: 0 auto;
}

.post-header,
.page-header {
    text-align: center;
    margin-bottom: 2.5rem;
}

.post-tag {
    display: inline-block;
    font-family: var(--font-sans);
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--color-accent);
    margin-bottom: 1rem;
}

.post-title,
.page-title {
    font-family: var(--font-serif);
    font-size: 2.5rem;
    font-weight: 400;
    line-height: 1.2;
    margin: 0 0 1rem 0;
    letter-spacing: -0.01em;
}

.post-meta {
    font-family: var(--font-sans);
    font-size: 0.9rem;
    color: var(--color-text-tertiary);
    display: flex;
    gap: 1.5rem;
    justify-content: center;
}

/* Feature image */
.post-feature-image,
.page-feature-image {
    margin: 0 0 2.5rem 0;
}

.post-feature-image img,
.page-feature-image img {
    width: 100%;
    border-radius: 4px;
}

.post-feature-image figcaption {
    font-family: var(--font-sans);
    font-size: 0.85rem;
    color: var(--color-text-tertiary);
    text-align: center;
    margin-top: 0.75rem;
}

/* Post content - the reading experience */
.post-content,
.page-content {
    font-size: 1.1rem;
    line-height: 1.8;
}

.post-content h1,
.post-content h2,
.post-content h3,
.post-content h4,
.page-content h1,
.page-content h2,
.page-content h3,
.page-content h4 {
    font-family: var(--font-serif);
    font-weight: 400;
    line-height: 1.3;
    margin: 2.5rem 0 1rem 0;
}

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

.post-content h3,
.page-content h3 {
    font-size: 1.4rem;
}

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

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

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

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

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

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

.post-content code,
.page-content code {
    font-family: 'SFMono-Regular', Consolas, 'Liberation Mono', Menlo, monospace;
    font-size: 0.9em;
}

.post-content :not(pre) > code,
.page-content :not(pre) > code {
    background: var(--color-bg-alt);
    padding: 0.2em 0.4em;
    border-radius: 3px;
}

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

.post-content figcaption,
.page-content figcaption {
    font-family: var(--font-sans);
    font-size: 0.85rem;
    color: var(--color-text-tertiary);
    text-align: center;
    margin-top: 0.75rem;
}

/* Post footer */
.post-footer {
    margin-top: 3rem;
    padding-top: 2rem;
    border-top: 1px solid var(--color-border-light);
}

.post-tags {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.post-tags a {
    font-family: var(--font-sans);
    font-size: 0.85rem;
    color: var(--color-text-tertiary);
    padding: 0.3rem 0.75rem;
    background: var(--color-bg-alt);
    border-radius: 3px;
}

.post-tags a:hover {
    color: var(--color-text);
    background: var(--color-border-light);
}

/* Subscribe CTA - understated */
.post-subscribe {
    max-width: var(--content-width);
    margin: 3rem auto 0;
    padding: 2rem;
    background: var(--color-bg-alt);
    border-radius: 6px;
    text-align: center;
}

.post-subscribe h3 {
    font-family: var(--font-serif);
    font-size: 1.25rem;
    font-weight: 400;
    margin: 0 0 0.5rem 0;
}

.post-subscribe p {
    color: var(--color-text-secondary);
    margin: 0 0 1.25rem 0;
    font-size: 1rem;
}

.subscribe-button {
    display: inline-block;
    padding: 0.75rem 1.5rem;
    background: var(--color-accent);
    color: var(--color-bg) !important;
    border-radius: 4px;
    font-family: var(--font-sans);
    font-size: 0.9rem;
}

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

/* Comments */
.post-comments {
    max-width: var(--content-width);
    margin: 3rem auto 0;
}

/* --------------------------------------------------------------------------
   Pagination
   -------------------------------------------------------------------------- */
.pagination {
    display: flex;
    justify-content: center;
    gap: 2rem;
    padding: 2rem 0;
    font-family: var(--font-sans);
    font-size: 0.9rem;
}

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

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

.page-number {
    color: var(--color-text-tertiary);
}

/* --------------------------------------------------------------------------
   Error Page
   -------------------------------------------------------------------------- */
.error-page {
    text-align: center;
    padding: 4rem 0;
}

.error-code {
    font-family: var(--font-serif);
    font-size: 6rem;
    font-weight: 400;
    color: var(--color-text-tertiary);
    margin: 0 0 1rem 0;
    line-height: 1;
}

.error-message {
    font-size: 1.25rem;
    color: var(--color-text-secondary);
    margin: 0 0 2rem 0;
}

.error-link {
    font-family: var(--font-sans);
    font-size: 0.9rem;
}

/* --------------------------------------------------------------------------
   Site Footer
   -------------------------------------------------------------------------- */
.site-footer {
    padding: 2rem var(--gap);
    border-top: 1px solid var(--color-border-light);
    background: var(--color-bg-alt);
}

.footer-inner {
    max-width: var(--wide-width);
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
}

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

.footer-nav a {
    font-family: var(--font-sans);
    font-size: 0.85rem;
    color: var(--color-text-tertiary);
}

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

.footer-meta {
    font-family: var(--font-sans);
    font-size: 0.85rem;
    color: var(--color-text-tertiary);
    display: flex;
    gap: 1.5rem;
    align-items: center;
}

.footer-subscribe {
    color: var(--color-accent);
}

/* --------------------------------------------------------------------------
   Responsive Design
   -------------------------------------------------------------------------- */
@media (max-width: 768px) {
    html {
        font-size: 16px;
    }
    
    :root {
        --gap: 1.25rem;
    }
    
    .header-inner {
        flex-direction: column;
        gap: 1rem;
    }
    
    .site-nav {
        order: 3;
        width: 100%;
    }
    
    .site-nav ul {
        gap: 1rem;
    }
    
    .post-title,
    .page-title {
        font-size: 2rem;
    }
    
    .featured-post .post-card-title {
        font-size: 1.75rem;
    }
    
    .tag-name,
    .author-name {
        font-size: 2rem;
    }
    
    .footer-inner {
        flex-direction: column;
        text-align: center;
    }
    
    .footer-nav ul {
        justify-content: center;
    }
}

@media (max-width: 480px) {
    .post-meta,
    .post-card-meta {
        flex-direction: column;
        gap: 0.25rem;
    }
    
    .header-actions {
        width: 100%;
        justify-content: center;
    }
}

/* --------------------------------------------------------------------------
   Ghost-specific card styles
   -------------------------------------------------------------------------- */
.kg-card {
    margin: 1.5rem 0;
}

.kg-image-card img {
    width: 100%;
}

.kg-width-wide {
    margin-left: calc(-1 * var(--gap));
    margin-right: calc(-1 * var(--gap));
    max-width: calc(100% + var(--gap) * 2);
}

.kg-width-full {
    margin-left: calc(-50vw + 50%);
    margin-right: calc(-50vw + 50%);
    max-width: 100vw;
}

.kg-bookmark-card {
    background: var(--color-bg-alt);
    border-radius: 6px;
    overflow: hidden;
}

.kg-bookmark-container {
    display: flex;
    text-decoration: none;
    color: inherit;
}

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

.kg-bookmark-title {
    font-family: var(--font-serif);
    font-size: 1rem;
    font-weight: 400;
    margin: 0 0 0.5rem 0;
    color: var(--color-text);
}

.kg-bookmark-description {
    font-size: 0.9rem;
    color: var(--color-text-secondary);
    margin: 0 0 0.75rem 0;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.kg-bookmark-metadata {
    font-family: var(--font-sans);
    font-size: 0.8rem;
    color: var(--color-text-tertiary);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.kg-bookmark-icon {
    width: 16px;
    height: 16px;
}

.kg-bookmark-thumbnail {
    width: 200px;
    min-height: 160px;
}

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

@media (max-width: 600px) {
    .kg-bookmark-container {
        flex-direction: column-reverse;
    }
    
    .kg-bookmark-thumbnail {
        width: 100%;
        min-height: 120px;
    }
}

/* Gallery cards */
.kg-gallery-container {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.kg-gallery-row {
    display: flex;
    gap: 0.75rem;
}

.kg-gallery-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Callout cards */
.kg-callout-card {
    display: flex;
    gap: 1rem;
    padding: 1.25rem;
    background: var(--color-bg-alt);
    border-radius: 6px;
}

.kg-callout-emoji {
    font-size: 1.25rem;
}

.kg-callout-text {
    margin: 0;
}

/* Button cards */
.kg-button-card {
    text-align: center;
}

.kg-btn {
    display: inline-block;
    padding: 0.75rem 1.5rem;
    background: var(--color-accent);
    color: var(--color-bg) !important;
    border-radius: 4px;
    font-family: var(--font-sans);
    font-size: 0.9rem;
    text-decoration: none;
}

.kg-btn:hover {
    background: var(--color-accent-hover);
}

/* Toggle/Accordion cards */
.kg-toggle-card {
    background: var(--color-bg-alt);
    border-radius: 6px;
    overflow: hidden;
}

.kg-toggle-heading {
    padding: 1rem 1.25rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.kg-toggle-heading-text {
    font-weight: 400;
    margin: 0;
}

.kg-toggle-content {
    padding: 0 1.25rem 1rem;
}

.kg-toggle-content p:last-child {
    margin-bottom: 0;
}
