/* Universal Static Blog - Modern Responsive CSS */

:root {
    --primary: #2563eb;
    --primary-hover: #1d4ed8;
    --secondary: #0f172a;
    --bg-page: #f8fafc;
    --bg-surface: #ffffff;
    --text-main: #0f172a;
    --text-muted: #64748b;
    --border-color: #e2e8f0;
    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 16px;
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.06);
    --shadow-md: 0 4px 12px rgba(0,0,0,0.06);
    --shadow-lg: 0 10px 25px rgba(0,0,0,0.08);
    --font-sans: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    --font-mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
}

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

body.site-body {
    font-family: var(--font-sans);
    font-size: 16px;
    line-height: 1.65;
    color: var(--text-main);
    background-color: var(--bg-page);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

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

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

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

/* Containers */
.header-container,
.content-container,
.footer-container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

.article-container {
    width: 100%;
    max-width: 840px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Header */
.site-header {
    background-color: var(--bg-surface);
    border-bottom: 1px solid var(--border-color);
    position: sticky;
    top: 0;
    z-index: 50;
    backdrop-filter: blur(8px);
}

.header-container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 70px;
}

.site-branding {
    display: flex;
    align-items: center;
    gap: 12px;
}

.brand-link {
    display: flex;
    align-items: center;
    text-decoration: none;
}

.site-logo {
    max-height: 40px;
    width: auto;
}

.site-title {
    font-size: 20px;
    font-weight: 700;
    color: var(--secondary);
    letter-spacing: -0.02em;
}

.site-tagline {
    font-size: 13px;
    color: var(--text-muted);
    border-left: 1px solid var(--border-color);
    padding-left: 12px;
    display: none;
}

@media (min-width: 768px) {
    .site-tagline { display: inline-block; }
}

.site-nav .nav-list {
    display: flex;
    list-style: none;
    gap: 24px;
}

.nav-link {
    font-size: 15px;
    font-weight: 500;
    color: var(--text-main);
    padding: 6px 0;
    border-bottom: 2px solid transparent;
}

.nav-link:hover {
    color: var(--primary);
    border-bottom-color: var(--primary);
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

.btn-search-trigger {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 14px;
    background: var(--bg-page);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    color: var(--text-muted);
    font-size: 14px;
    cursor: pointer;
    transition: all 0.15s ease;
}

.btn-search-trigger:hover {
    background: #eef2f6;
    color: var(--text-main);
    border-color: #cbd5e1;
}

.btn-mobile-menu {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    color: var(--text-main);
    padding: 6px;
}

/* Main */
.site-main {
    flex: 1 0 auto;
    padding: 40px 0;
}

/* Hero Section */
.hero-featured-section {
    margin-bottom: 48px;
}

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

.featured-card {
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    overflow: hidden;
    display: grid;
    grid-template-columns: 1fr;
    box-shadow: var(--shadow-sm);
    transition: box-shadow 0.2s ease;
}

.featured-card:hover {
    box-shadow: var(--shadow-md);
}

@media (min-width: 840px) {
    .featured-card {
        grid-template-columns: 1.2fr 1fr;
    }
}

.featured-media {
    position: relative;
    min-height: 280px;
    background: #0f172a;
}

.featured-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.featured-body {
    padding: 36px 32px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.card-meta {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 14px;
}

.badge-category {
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    background: #eff6ff;
    color: var(--primary);
    padding: 4px 10px;
    border-radius: 12px;
}

.meta-date {
    font-size: 13px;
    color: var(--text-muted);
}

.featured-title {
    font-size: 28px;
    font-weight: 800;
    line-height: 1.3;
    margin-bottom: 14px;
    color: var(--secondary);
}

.featured-title a {
    color: inherit;
}

.featured-title a:hover {
    color: var(--primary);
}

.featured-excerpt {
    font-size: 16px;
    color: var(--text-muted);
    margin-bottom: 24px;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.featured-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-top: 18px;
    border-top: 1px solid var(--border-color);
}

.author-inline {
    display: flex;
    align-items: center;
    gap: 8px;
}

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

.author-name {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-main);
}

.btn-read-more {
    font-size: 14px;
    font-weight: 600;
    color: var(--primary);
}

/* Articles Grid */
.section-header {
    margin-bottom: 28px;
}

.section-title {
    font-size: 22px;
    font-weight: 700;
    color: var(--secondary);
    margin-bottom: 8px;
}

.section-divider {
    height: 3px;
    width: 40px;
    background: var(--primary);
    border-radius: 2px;
}

.articles-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 28px;
}

.article-card {
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    box-shadow: var(--shadow-sm);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.article-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-md);
}

.card-image-wrap {
    height: 200px;
    overflow: hidden;
    background: #e2e8f0;
}

.card-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

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

.card-content {
    padding: 22px;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.card-title {
    font-size: 19px;
    font-weight: 700;
    line-height: 1.4;
    margin: 8px 0 10px;
    color: var(--secondary);
}

.card-title a {
    color: inherit;
}

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

.card-excerpt {
    font-size: 14px;
    color: var(--text-muted);
    margin-bottom: 18px;
    flex: 1;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.card-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 13px;
    color: var(--text-muted);
    border-top: 1px solid #f1f5f9;
    padding-top: 12px;
}

.link-arrow {
    font-weight: 600;
    color: var(--primary);
}

/* Pagination */
.pagination-nav {
    margin-top: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.page-btn, .page-num {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 8px 14px;
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    color: var(--text-main);
    font-size: 14px;
    font-weight: 500;
}

.page-num.active {
    background: var(--primary);
    color: #ffffff;
    border-color: var(--primary);
}

/* Newsletter Section */
.newsletter-section {
    margin-top: 64px;
}

.newsletter-box {
    background: var(--secondary);
    color: #ffffff;
    border-radius: var(--radius-lg);
    padding: 48px 32px;
    text-align: center;
    max-width: 800px;
    margin: 0 auto;
}

.newsletter-title {
    font-size: 26px;
    font-weight: 700;
    margin-bottom: 10px;
}

.newsletter-desc {
    font-size: 15px;
    color: #94a3b8;
    max-width: 520px;
    margin: 0 auto 24px;
}

.newsletter-form {
    display: flex;
    max-width: 480px;
    margin: 0 auto;
    gap: 10px;
}

.newsletter-input {
    flex: 1;
    padding: 12px 18px;
    border-radius: var(--radius-sm);
    border: 1px solid #334155;
    background: #1e293b;
    color: #ffffff;
    font-size: 14px;
}

.btn-subscribe {
    padding: 12px 24px;
    background: var(--primary);
    color: #ffffff;
    border: none;
    border-radius: var(--radius-sm);
    font-weight: 600;
    cursor: pointer;
}

/* Single Post & Prose Typography */
.single-post-article {
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 40px 0;
    margin-bottom: 40px;
}

.breadcrumb-nav {
    margin-bottom: 24px;
    font-size: 13px;
    color: var(--text-muted);
}

.breadcrumb-list {
    display: flex;
    list-style: none;
    flex-wrap: wrap;
    gap: 8px;
}

.breadcrumb-list .sep {
    color: #cbd5e1;
}

.post-header {
    margin-bottom: 32px;
}

.post-title {
    font-size: 34px;
    font-weight: 800;
    line-height: 1.25;
    color: var(--secondary);
    margin: 12px 0 16px;
}

.post-lead-excerpt {
    font-size: 18px;
    color: var(--text-muted);
    line-height: 1.5;
    margin-bottom: 20px;
}

.post-author-bar {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px 0;
    border-top: 1px solid var(--border-color);
    border-bottom: 1px solid var(--border-color);
}

.author-info-group {
    display: flex;
    align-items: center;
    gap: 12px;
}

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

.author-name-text {
    font-weight: 700;
    font-size: 15px;
}

.date-published-text {
    font-size: 13px;
    color: var(--text-muted);
}

.post-featured-image-wrap {
    margin: 28px 0;
    border-radius: var(--radius-md);
    overflow: hidden;
}

.post-hero-img {
    width: 100%;
    max-height: 480px;
    object-fit: cover;
}

.image-caption {
    display: block;
    font-size: 12px;
    color: var(--text-muted);
    text-align: center;
    margin-top: 6px;
    font-style: italic;
}

/* Prose Styling */
.prose {
    font-size: 17px;
    line-height: 1.8;
    color: #334155;
}

.prose h2 {
    font-size: 26px;
    font-weight: 700;
    margin: 40px 0 16px;
    color: var(--secondary);
}

.prose h3 {
    font-size: 21px;
    font-weight: 700;
    margin: 32px 0 12px;
    color: var(--secondary);
}

.prose h4 {
    font-size: 18px;
    font-weight: 700;
    margin: 24px 0 8px;
    color: var(--secondary);
}

.prose p {
    margin-bottom: 22px;
}

.prose ul, .prose ol {
    margin: 0 0 22px 28px;
}

.prose li {
    margin-bottom: 8px;
}

.prose blockquote {
    border-left: 4px solid var(--primary);
    padding: 12px 20px;
    background: #f1f5f9;
    font-style: italic;
    color: #475569;
    margin: 28px 0;
    border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
}

.prose pre {
    background: #0f172a;
    color: #f8fafc;
    padding: 18px;
    border-radius: var(--radius-sm);
    overflow-x: auto;
    font-family: var(--font-mono);
    font-size: 14px;
    margin: 24px 0;
}

.prose code {
    background: #f1f5f9;
    color: #e11d48;
    padding: 2px 6px;
    border-radius: 4px;
    font-family: var(--font-mono);
    font-size: 14px;
}

.prose pre code {
    background: transparent;
    color: inherit;
    padding: 0;
}

.prose hr {
    border: none;
    border-top: 1px solid var(--border-color);
    margin: 36px 0;
}

.prose table {
    width: 100%;
    border-collapse: collapse;
    margin: 28px 0;
}

.prose th, .prose td {
    padding: 10px 14px;
    border: 1px solid var(--border-color);
    text-align: left;
}

.prose th {
    background: #f8fafc;
    font-weight: 600;
}

/* Post Tags Footer */
.post-tags-footer {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-top: 36px;
    padding-top: 24px;
    border-top: 1px solid var(--border-color);
}

.tag-pills-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.tag-pill {
    font-size: 13px;
    padding: 4px 12px;
    background: var(--bg-page);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    color: var(--text-muted);
}

.tag-pill:hover {
    background: #e2e8f0;
    color: var(--text-main);
}

/* Author Bio Box */
.author-bio-box {
    display: flex;
    gap: 20px;
    margin-top: 36px;
    padding: 24px;
    background: #f8fafc;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
}

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

.bio-author-title {
    font-size: 17px;
    font-weight: 700;
    margin-bottom: 6px;
}

.bio-text {
    font-size: 14px;
    color: var(--text-muted);
}

/* Related Posts */
.related-posts-section {
    margin-top: 48px;
    padding-top: 32px;
    border-top: 1px solid var(--border-color);
}

.related-title {
    font-size: 20px;
    font-weight: 700;
    margin-bottom: 20px;
}

.related-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 20px;
}

.related-card {
    background: #f8fafc;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    overflow: hidden;
}

.related-img-link img {
    height: 140px;
    width: 100%;
    object-fit: cover;
}

.related-card-body {
    padding: 14px;
}

.related-card-body h4 {
    font-size: 15px;
    font-weight: 600;
    margin-bottom: 6px;
}

.related-card-body time {
    font-size: 12px;
    color: var(--text-muted);
}

/* Archive Pages */
.archive-header {
    background: var(--bg-surface);
    border-bottom: 1px solid var(--border-color);
    padding: 40px 0;
    margin-bottom: 40px;
    text-align: center;
}

.archive-eyebrow {
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--primary);
}

.archive-title {
    font-size: 32px;
    font-weight: 800;
    margin: 8px 0;
}

.archive-desc {
    font-size: 16px;
    color: var(--text-muted);
    max-width: 600px;
    margin: 0 auto 12px;
}

.archive-count {
    font-size: 13px;
    color: var(--text-muted);
}

/* Author Profile */
.author-profile-card {
    display: flex;
    align-items: center;
    gap: 28px;
    max-width: 800px;
    margin: 0 auto;
}

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

.author-profile-links {
    display: flex;
    gap: 8px;
    margin-top: 12px;
}

.author-link-pill {
    font-size: 12px;
    padding: 4px 10px;
    background: #f1f5f9;
    border-radius: 12px;
    color: var(--text-muted);
}

/* Custom Page */
.custom-page-wrap {
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 48px 0;
}

.page-header {
    margin-bottom: 28px;
}

.page-title {
    font-size: 32px;
    font-weight: 800;
}

.page-header-divider {
    height: 3px;
    width: 48px;
    background: var(--primary);
    margin-top: 12px;
}

/* 404 Page */
.error-content-box {
    text-align: center;
    padding: 60px 20px;
}

.error-code-badge {
    font-size: 72px;
    font-weight: 900;
    color: var(--primary);
    line-height: 1;
}

.error-headline {
    font-size: 28px;
    font-weight: 800;
    margin: 16px 0 10px;
}

.error-message {
    font-size: 16px;
    color: var(--text-muted);
    margin-bottom: 28px;
}

.error-actions-group {
    display: flex;
    justify-content: center;
    gap: 16px;
    margin-bottom: 48px;
}

.btn-primary-action {
    padding: 12px 24px;
    background: var(--primary);
    color: #ffffff;
    border-radius: var(--radius-sm);
    font-weight: 600;
}

.btn-secondary-action {
    padding: 12px 24px;
    background: #e2e8f0;
    color: var(--text-main);
    border: none;
    border-radius: var(--radius-sm);
    font-weight: 600;
    cursor: pointer;
}

/* Footer */
.site-footer {
    background: var(--secondary);
    color: #e2e8f0;
    padding: 56px 0 24px;
    margin-top: auto;
}

.footer-grid {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr;
    gap: 40px;
    margin-bottom: 40px;
}

@media (max-width: 768px) {
    .footer-grid {
        grid-template-columns: 1fr;
    }
}

.footer-heading {
    font-size: 18px;
    font-weight: 700;
    color: #ffffff;
    margin-bottom: 12px;
}

.footer-desc {
    font-size: 14px;
    color: #94a3b8;
    line-height: 1.6;
    margin-bottom: 12px;
}

.footer-subtext {
    font-size: 12px;
    color: #64748b;
}

.footer-subheading {
    font-size: 14px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #94a3b8;
    margin-bottom: 16px;
}

.footer-nav-list {
    list-style: none;
}

.footer-nav-list li {
    margin-bottom: 8px;
}

.footer-nav-list a {
    color: #cbd5e1;
    font-size: 14px;
}

.footer-nav-list a:hover {
    color: #ffffff;
}

.social-links-wrap {
    display: flex;
    gap: 10px;
}

.social-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    background: #1e293b;
    border-radius: 50%;
    color: #cbd5e1;
    transition: background 0.15s ease;
}

.social-btn:hover {
    background: var(--primary);
    color: #ffffff;
}

.footer-bottom {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-top: 24px;
    border-top: 1px solid #1e293b;
    font-size: 13px;
    color: #64748b;
}

.footer-meta-links {
    display: flex;
    gap: 16px;
}

.footer-meta-links a {
    color: #64748b;
}

/* Search Modal */
.search-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: 1000;
}

.search-modal.active {
    display: block;
}

.search-modal-backdrop {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(15, 23, 42, 0.6);
    backdrop-filter: blur(4px);
}

.search-modal-box {
    position: relative;
    max-width: 600px;
    margin: 80px auto;
    background: #ffffff;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    overflow: hidden;
    z-index: 1001;
}

.search-input-header {
    display: flex;
    align-items: center;
    padding: 16px 20px;
    border-bottom: 1px solid var(--border-color);
    gap: 12px;
}

.search-input-header input {
    flex: 1;
    border: none;
    font-size: 16px;
    outline: none;
}

.btn-close-modal {
    background: none;
    border: none;
    font-size: 18px;
    cursor: pointer;
    color: var(--text-muted);
}

.search-results-list {
    max-height: 400px;
    overflow-y: auto;
    padding: 16px;
}

.search-hint {
    text-align: center;
    color: var(--text-muted);
    font-size: 14px;
    padding: 24px 0;
}

.search-item {
    display: block;
    padding: 12px 14px;
    border-radius: var(--radius-sm);
    margin-bottom: 8px;
    text-decoration: none;
    background: #f8fafc;
    border: 1px solid #f1f5f9;
}

.search-item:hover {
    background: #eef2f6;
}

.search-item-title {
    font-size: 15px;
    font-weight: 700;
    color: var(--secondary);
    margin-bottom: 4px;
}

.search-item-meta {
    font-size: 12px;
    color: var(--text-muted);
    display: flex;
    gap: 8px;
}

/* Mobile Responsiveness */
@media (max-width: 768px) {
    .site-nav {
        display: none;
    }
    .site-nav.open {
        display: block;
        position: absolute;
        top: 70px;
        left: 0;
        width: 100%;
        background: #ffffff;
        border-bottom: 1px solid var(--border-color);
        padding: 20px;
    }
    .site-nav.open .nav-list {
        flex-direction: column;
        gap: 16px;
    }
    .btn-mobile-menu {
        display: block;
    }
    .post-title {
        font-size: 26px;
    }
    .featured-title {
        font-size: 22px;
    }
}
