:root {
    --color-bg: #ffffff;
    --color-bg-warm: #fafaf8;
    --color-text: #111827;
    --color-text-secondary: #4b5563;
    --color-text-muted: #9ca3af;
    --color-accent: #fdaaaa;
    --color-accent-hover: #fdaaaa;
    --color-accent-light: #f3f4f6;
    --color-border: #f3f4f6;
    --color-border-strong: #e5e7eb;
    --color-surface: #f9fafb;
    --font-heading: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --font-body: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --max-width-content: 740px;
    --max-width-page: 1140px;
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.04);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 12px 32px rgba(0, 0, 0, 0.08);
    --shadow-hover: 0 8px 24px rgba(0, 0, 0, 0.1);
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

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

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

body {
    font-family: var(--font-body);
    color: var(--color-text);
    background-color: var(--color-bg-warm);
    line-height: 1.7;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

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

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

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

::selection {
    background: #fdaaaa;
    color: #ffffff;
}

.container {
    max-width: var(--max-width-page);
    margin: 0 auto;
    padding: 0 2rem;
}

/* ================================================================
   HEADER
   ================================================================ */
.site-header {
    border-bottom: 1px solid var(--color-border);
    padding: 0;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 100;
    backdrop-filter: blur(12px);
    background: rgba(255, 255, 255, 0.92);
    transform: translateY(-100%);
    transition: transform 0.3s ease;
}

.site-header.visible {
    transform: translateY(0);
}

.site-header .container {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 56px;
}

.nav-logo {
    display: block;
    max-height: 30px;
    width: auto;
}

.site-logo {
    display: block;
    max-height: 50px;
    width: auto;
    margin: 0 auto;
}


/* ================================================================
   MAIN
   ================================================================ */
.site-main {
    flex: 1;
    padding: 3.5rem 0 4rem;
}

/* ================================================================
   BLOG HERO
   ================================================================ */
.blog-hero {
    text-align: center;
    margin-bottom: 4rem;
    padding: 2rem 0 3rem;
}

.blog-hero h1 {
    font-family: var(--font-heading);
    font-size: 3rem;
    font-weight: 800;
    letter-spacing: -0.04em;
    line-height: 1.1;
    margin-bottom: 0.75rem;
    background: linear-gradient(135deg, var(--color-text) 0%, #374151 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.blog-hero .blog-description {
    color: var(--color-text-secondary);
    font-size: 1.2rem;
    font-weight: 400;
    line-height: 1.6;
    max-width: 540px;
    margin: 0 auto;
}

.blog-hero .divider {
    width: 48px;
    height: 3px;
    background: linear-gradient(90deg, var(--color-accent), #8b5cf6);
    border-radius: 2px;
    margin: 1.5rem auto 0;
}

/* ================================================================
   POSTS GRID
   ================================================================ */
.posts-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 2rem;
}

/* Featured post - first in list */
.post-card.featured {
    background: var(--color-bg);
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-md);
    transition: all var(--transition);
    border: 1px solid var(--color-border);
}

.post-card.featured:hover {
    box-shadow: var(--shadow-hover);
    transform: translateY(-2px);
}

.post-card.featured .post-card-image img {
    aspect-ratio: 21 / 9;
    width: 100%;
    object-fit: cover;
}

.post-card.featured .post-card-body {
    padding: 2rem 2.5rem 2.5rem;
}

.post-card.featured .post-card-body h2 {
    font-size: 1.75rem;
}

/* Regular post cards */
.post-card {
    background: var(--color-bg);
    border-radius: var(--radius-md);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    transition: all var(--transition);
    border: 1px solid var(--color-border);
    display: flex;
    flex-direction: column;
}

.post-card:hover {
    box-shadow: var(--shadow-hover);
    transform: translateY(-2px);
    border-color: var(--color-border-strong);
}

.post-card-image {
    display: block;
    overflow: hidden;
}

.post-card-image img {
    aspect-ratio: 16 / 9;
    width: 100%;
    object-fit: cover;
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.post-card:hover .post-card-image img {
    transform: scale(1.03);
}

.post-card-body {
    padding: 1.5rem 1.75rem 1.75rem;
    display: flex;
    flex-direction: column;
    flex: 1;
}

.post-card-meta {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 0.75rem;
}

.post-card-date {
    font-size: 0.8rem;
    color: var(--color-text-muted);
    font-weight: 500;
}

.post-card-reading {
    font-size: 0.8rem;
    color: var(--color-text-muted);
    font-weight: 500;
}

.post-card-meta .dot {
    width: 3px;
    height: 3px;
    border-radius: 50%;
    background: var(--color-text-muted);
    flex-shrink: 0;
}

.post-card-body h2 {
    font-family: var(--font-heading);
    font-size: 1.35rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    line-height: 1.3;
    margin-bottom: 0.5rem;
}

.post-card-body h2 a {
    color: var(--color-text);
    transition: color var(--transition);
}

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

.post-card-excerpt {
    color: var(--color-text-secondary);
    font-size: 0.95rem;
    line-height: 1.65;
    margin-bottom: 1rem;
    flex: 1;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.post-card-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-top: 1rem;
    border-top: 1px solid var(--color-border);
    margin-top: auto;
}

.post-card-author {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.post-card-author-avatar {
    width: 28px;
    height: 28px;
}

img.post-card-author-avatar {
    object-fit: cover;
}

.post-card-author-name {
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--color-text-secondary);
}

.read-more {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--color-accent);
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    transition: gap var(--transition);
}

.read-more:hover {
    gap: 0.6rem;
}

.read-more svg {
    width: 14px;
    height: 14px;
    transition: transform var(--transition);
}

/* Grid layout for non-featured */
@media (min-width: 640px) {
    .posts-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .post-card.featured {
        grid-column: 1 / -1;
    }
}

@media (min-width: 1024px) {
    .posts-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 1.75rem;
    }

    .post-card.featured {
        grid-column: 1 / -1;
        display: grid;
        grid-template-columns: 1.2fr 1fr;
    }

    .post-card.featured .post-card-image img {
        aspect-ratio: auto;
        height: 100%;
    }
}

/* ================================================================
   SINGLE POST
   ================================================================ */
.post-full {
    max-width: var(--max-width-content);
    margin: 0 auto;
}

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

.post-header-meta {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    margin-bottom: 1.25rem;
}

.post-tag {
    display: inline-flex;
    align-items: center;
    padding: 0.3rem 0.85rem;
    background: var(--color-accent-light);
    color: var(--color-accent);
    font-size: 0.78rem;
    font-weight: 600;
    border-radius: 20px;
    letter-spacing: 0.02em;
}

.post-header time {
    font-size: 0.85rem;
    color: var(--color-text-muted);
    font-weight: 500;
}

.post-header h1 {
    font-family: var(--font-heading);
    font-size: 2.75rem;
    font-weight: 800;
    letter-spacing: -0.035em;
    line-height: 1.15;
    margin-bottom: 1.25rem;
    color: var(--color-text);
}

.post-header-author {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
}

.post-header-author-avatar {
    width: 45px;
    height: 45px;
    border-radius: 50%;
}

img.post-header-author-avatar {
    object-fit: cover;
}

.post-header-author-info {
    text-align: left;
    padding-left: 15px;
}

.post-header-author-name {
    font-weight: 600;
    font-size: 0.95rem;
    color: var(--color-text);
}

.post-header-author-role {
    font-size: 0.8rem;
    color: var(--color-text-muted);
}

.post-cover {
    margin: 0 -2rem 3rem;
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-lg);
}

.post-cover img {
    width: 100%;
    aspect-ratio: 2 / 1;
    object-fit: cover;
}

/* Article Content Typography */
.post-content {
    font-size: 1.125rem;
    line-height: 1.85;
    color: var(--color-text);
}

.post-content h2 {
    font-family: var(--font-heading);
    font-size: 1.75rem;
    font-weight: 700;
    margin: 3rem 0 1rem;
    letter-spacing: -0.02em;
    color: var(--color-text);
    position: relative;
    padding-bottom: 0.5rem;
}

.post-content h2::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 32px;
    height: 2px;
    background: linear-gradient(90deg, var(--color-accent), transparent);
    border-radius: 1px;
}

.post-content h3 {
    font-family: var(--font-heading);
    font-size: 1.35rem;
    font-weight: 600;
    margin: 2.5rem 0 0.75rem;
    color: var(--color-text);
}

.post-content p {
    margin-bottom: 1.5rem;
    color: var(--color-text-secondary);
}

.post-content ul,
.post-content ol {
    margin-bottom: 1.5rem;
    padding-left: 1.5rem;
    color: var(--color-text-secondary);
}

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

.post-content li::marker {
    color: var(--color-accent);
}

.post-content blockquote {
    position: relative;
    border: none;
    margin: 2.5rem 0;
    padding: 1.75rem 2rem 1.75rem 2rem;
    background: linear-gradient(135deg, var(--color-accent-light), #f5f3ff);
    border-radius: var(--radius-md);
    color: var(--color-text-secondary);
    font-style: italic;
    font-size: 1.1rem;
}

.post-content blockquote::before {
    content: '\201C';
    position: absolute;
    top: -0.25rem;
    left: 1rem;
    font-size: 4rem;
    font-family: Georgia, serif;
    color: var(--color-accent);
    opacity: 0.3;
    line-height: 1;
}

.post-content img {
    border-radius: var(--radius-md);
    margin: 2.5rem auto;
    box-shadow: var(--shadow-md);
}

.post-content pre {
    background: #1e1e2e;
    color: #cdd6f4;
    padding: 1.75rem;
    border-radius: var(--radius-md);
    overflow-x: auto;
    margin: 2rem 0;
    font-size: 0.875rem;
    line-height: 1.7;
    box-shadow: var(--shadow-md);
}

.post-content code {
    background-color: var(--color-accent-light);
    color: var(--color-accent-hover);
    padding: 0.2em 0.45em;
    border-radius: 5px;
    font-size: 0.88em;
    font-weight: 500;
}

.post-content pre code {
    background: none;
    color: inherit;
    padding: 0;
    font-weight: 400;
}

.post-content a {
    color: var(--color-accent);
    text-decoration: underline;
    text-underline-offset: 3px;
    text-decoration-color: rgba(59, 130, 246, 0.3);
    transition: text-decoration-color var(--transition);
}

.post-content a:hover {
    color: #ffffff;
    background: var(--color-accent);
    text-decoration: none;
    border-radius: 3px;
    padding: 0.1em 0.3em;
    transition: all var(--transition);
}

.post-content hr {
    border: none;
    height: 1px;
    background: var(--color-border-strong);
    margin: 3rem 0;
}

/* Post footer / back link */
.post-footer {
    margin-top: 4rem;
    padding-top: 2rem;
    border-top: 1px solid var(--color-border-strong);
    text-align: center;
}

.post-footer .back-link {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 500;
    font-size: 0.95rem;
    color: var(--color-accent);
    padding: 0.6rem 1.25rem;
    border-radius: var(--radius-sm);
    transition: all var(--transition);
}

.post-footer .back-link:hover {
    color: #ffffff;
    background: #fdaaaa;
}

/* ================================================================
   PAGINATION
   ================================================================ */
.pagination {
    display: flex;
    justify-content: center;
    gap: 0.4rem;
    margin-top: 3.5rem;
    list-style: none;
}

.pagination a,
.pagination span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 2.5rem;
    height: 2.5rem;
    padding: 0 0.5rem;
    border-radius: var(--radius-sm);
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--color-text-secondary);
    background: var(--color-bg);
    border: 1px solid var(--color-border);
    transition: all var(--transition);
    box-shadow: var(--shadow-sm);
}

.pagination a:hover {
    background: var(--color-surface);
    border-color: var(--color-border-strong);
    color: var(--color-text);
    box-shadow: var(--shadow-md);
}

.pagination .active {
    background: var(--color-accent);
    color: white;
    border-color: var(--color-accent);
    box-shadow: 0 2px 8px rgba(59, 130, 246, 0.3);
}

/* ================================================================
   EMPTY STATE
   ================================================================ */
.empty-state {
    text-align: center;
    padding: 5rem 2rem;
    background: var(--color-bg);
    border-radius: var(--radius-lg);
    border: 2px dashed var(--color-border-strong);
}

.empty-state-icon {
    width: 64px;
    height: 64px;
    background: var(--color-accent-light);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1.5rem;
}

.empty-state-icon svg {
    width: 28px;
    height: 28px;
    color: var(--color-accent);
}

.empty-state h2 {
    font-size: 1.35rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    color: var(--color-text);
}

.empty-state p {
    color: var(--color-text-muted);
    font-size: 1rem;
}

/* ================================================================
   AUTHOR PROFILE
   ================================================================ */
.author-profile {
    max-width: var(--max-width-page);
    margin: 0 auto;
}

.author-profile-hero {
    padding: 2rem 0 3rem;
    position: relative;
    max-width: var(--max-width-content);
    margin: 0 auto;
}

.author-profile-hero::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 48px;
    height: 3px;
    background: linear-gradient(90deg, var(--color-accent), #8b5cf6);
    border-radius: 2px;
}

.author-profile-avatar-wrapper {
    margin-bottom: 1.5rem;
}

.author-profile-avatar {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    font-weight: 800;
    color: var(--color-accent);
    box-shadow: var(--shadow-md), 0 0 0 4px var(--color-bg), 0 0 0 6px var(--color-border-strong);
}

img.author-profile-avatar {
    object-fit: cover;
}

.author-profile-name {
    text-align: center;
    font-family: var(--font-heading);
    font-size: 2.25rem;
    font-weight: 800;
    letter-spacing: -0.03em;
    line-height: 1.15;
    margin-bottom: 2rem;
    color: var(--color-text);
}

.author-profile-bio {
    color: var(--color-text-secondary);
    font-size: 1.1rem;
    line-height: 1.65;
    margin: 0 auto 1.5rem;
}

.author-profile-bio a {
    color: var(--color-accent);
    text-decoration: underline;
    text-underline-offset: 3px;
    text-decoration-color: rgba(59, 130, 246, 0.3);
    transition: all var(--transition);
}

.author-profile-bio a:hover {
    color: #ffffff;
    background: var(--color-accent);
    text-decoration: none;
    border-radius: 3px;
    padding: 0.1em 0.3em;
}

.author-profile-stats {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1.5rem;
}

.author-profile-stat {
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.author-profile-stat-value {
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--color-text);
    display: inline-flex;
    align-items: center;
}

.author-profile-stat-value svg {
    color: var(--color-text-muted);
}

.author-profile-stat-label {
    font-size: 0.85rem;
    color: var(--color-text-muted);
    font-weight: 500;
}

.author-profile-stat-divider {
    width: 1px;
    height: 20px;
    background: var(--color-border-strong);
}

.author-profile-posts {
    margin-top: 0.5rem;
}

.author-profile-posts-title {
    font-family: var(--font-heading);
    font-size: 1.35rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    color: var(--color-text);
    margin-bottom: 1.75rem;
}

/* Author link styles (clickable author in cards and post header) */
a.author-link {
    display: flex;
    align-items: center;
    gap: inherit;
    color: inherit;
    text-decoration: none;
    transition: opacity var(--transition);
}

a.author-link:hover {
    opacity: 0.7;
}

/* ================================================================
   FOOTER
   ================================================================ */
.site-footer {
    background: var(--color-bg);
    border-top: 1px solid var(--color-border);
    padding: 2.5rem 0;
    text-align: center;
}

.site-footer p {
    color: var(--color-text-muted);
    font-size: 0.85rem;
}

.site-footer a {
    color: var(--color-text-secondary);
    font-weight: 500;
}

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

/* ================================================================
   RESPONSIVE
   ================================================================ */
@media (max-width: 768px) {
    .container {
        padding: 0 1.25rem;
    }

    .blog-hero h1 {
        font-size: 2.25rem;
    }

    .blog-hero .blog-description {
        font-size: 1.05rem;
    }

    .post-header h1 {
        font-size: 2rem;
    }

    .post-content {
        font-size: 1.05rem;
    }

    .site-main {
        padding: 2.5rem 0 3rem;
    }

    .post-cover {
        margin: 0 -1.25rem 2.5rem;
        border-radius: var(--radius-md);
    }
}

/* — Preview banner — */
.preview-banner {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.75rem 1.25rem;
    background: #fef3c7;
    color: #92400e;
    font-size: 0.85rem;
    font-weight: 500;
    border-radius: var(--radius-md);
    margin-bottom: 2rem;
}

.preview-banner svg {
    flex-shrink: 0;
}

.preview-banner-link {
    margin-left: 0.75rem;
    color: #92400e;
    text-decoration: underline;
    font-weight: 600;
}

.preview-banner-link:hover {
    color: #78350f;
}

@media (max-width: 480px) {
    .blog-hero {
        padding: 1rem 0 2rem;
        margin-bottom: 2.5rem;
    }

    .blog-hero h1 {
        font-size: 1.85rem;
    }

    .post-header h1 {
        font-size: 1.65rem;
    }

}
