/* ═══════════════════════════════════════════
   BLOG STYLES — Clay Portfolio Theme
   ═══════════════════════════════════════════ */

/* ── Blog Hero ── */
.blog-hero {
    min-height: 50vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: flex-start;
    padding-top: calc(var(--nav-height) + 80px);
}

/* ── Blog Grid ── */
.blog-list {
    padding: 0 clamp(24px, 5vw, 60px) clamp(60px, 8vw, 100px);
    max-width: 1200px;
    width: 100%;
    margin: 0 auto;
    position: relative;
    z-index: 3;
}

.blog-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(380px, 1fr));
    gap: 24px;
}

/* ── Blog Card ── */
.blog-card {
    border-radius: var(--radius-lg);
    background: var(--surface);
    border: 1px solid var(--border-clay);
    overflow: hidden;
    transition: all 0.4s var(--ease-spring);
    box-shadow: var(--shadow-clay);
}

.blog-card:hover {
    transform: translateY(-8px) scale(1.01);
    box-shadow: var(--shadow-deep);
}

.blog-card-link {
    display: block;
    color: inherit;
    text-decoration: none;
}

.blog-card-image {
    width: 100%;
    height: 200px;
    overflow: hidden;
}

.blog-card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.6s var(--ease-out-expo);
}

.blog-card:hover .blog-card-image img {
    transform: scale(1.05);
}

.blog-card-body {
    padding: 28px 30px 30px;
}

.blog-card-meta {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 12px;
    font-size: 0.75rem;
    color: var(--text-muted);
    font-family: var(--font-mono);
}

.read-time {
    padding: 3px 10px;
    background: var(--bg);
    border-radius: var(--radius-pill);
    box-shadow: var(--shadow-inset);
    font-size: 0.68rem;
}

.blog-card h2 {
    font-family: var(--font-display);
    font-size: 1.4rem;
    font-weight: 700;
    margin-bottom: 8px;
    line-height: 1.3;
}

.blog-card p {
    color: var(--text-secondary);
    font-size: 0.9rem;
    line-height: 1.7;
    margin-bottom: 16px;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.blog-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 7px;
}

.blog-tags span {
    padding: 5px 14px;
    background: var(--bg);
    color: var(--tag-text);
    font-size: 0.66rem;
    font-family: var(--font-mono);
    border-radius: var(--radius-pill);
    box-shadow: var(--shadow-inset);
}

/* ── Blog Empty State ── */
.blog-empty {
    text-align: center;
    padding: 80px 40px;
    background: var(--surface);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-clay);
}

.blog-empty .cs-icon {
    font-size: 3rem;
    margin-bottom: 16px;
}

.blog-empty h3 {
    font-family: var(--font-display);
    font-size: 1.6rem;
    margin-bottom: 8px;
}

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

/* ═══════════════════════════════════════════
   BLOG POST PAGE
   ═══════════════════════════════════════════ */
.blog-post-page {
    max-width: 800px;
    width: 100%;
    margin: 0 auto;
    padding: calc(var(--nav-height) + 60px) clamp(24px, 5vw, 40px) 80px;
    position: relative;
    z-index: 3;
}

.back-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--accent);
    margin-bottom: 32px;
    padding: 8px 18px;
    background: var(--surface);
    border-radius: var(--radius-pill);
    box-shadow: var(--shadow-clay-sm);
    transition: all 0.3s var(--ease-spring);
}

.back-link:hover {
    transform: translateX(-4px);
    box-shadow: var(--shadow-clay);
}

.blog-post-header {
    margin-bottom: 40px;
}

.blog-post-meta {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 16px;
    font-size: 0.78rem;
    color: var(--text-muted);
    font-family: var(--font-mono);
}

.blog-post-header h1 {
    font-family: var(--font-display);
    font-size: clamp(2rem, 5vw, 3.2rem);
    font-weight: 700;
    line-height: 1.15;
    letter-spacing: -0.02em;
    margin-bottom: 16px;
    text-shadow:
        1px 1px 0px rgba(255, 255, 255, 0.6),
        2px 2px 4px rgba(0, 0, 0, 0.04);
}

.blog-post-excerpt {
    font-size: 1.1rem;
    color: var(--text-secondary);
    line-height: 1.7;
    margin-bottom: 20px;
}

.blog-post-cover {
    border-radius: var(--radius-lg);
    overflow: hidden;
    margin-bottom: 40px;
    box-shadow: var(--shadow-clay);
}

.blog-post-cover img {
    width: 100%;
    height: auto;
    display: block;
}

/* ── Post Content — Markdown Rendered ── */
.blog-post-content {
    font-size: 1.02rem;
    line-height: 1.85;
    color: var(--text-secondary);
}

.blog-post-content h2 {
    font-family: var(--font-display);
    font-size: 1.8rem;
    font-weight: 700;
    margin-top: 48px;
    margin-bottom: 16px;
    color: var(--text);
}

.blog-post-content h3 {
    font-family: var(--font-display);
    font-size: 1.4rem;
    font-weight: 700;
    margin-top: 36px;
    margin-bottom: 12px;
    color: var(--text);
}

.blog-post-content p {
    margin-bottom: 20px;
}

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

.blog-post-content a:hover {
    text-decoration-color: var(--accent);
}

.blog-post-content code {
    font-family: var(--font-mono);
    font-size: 0.88em;
    padding: 3px 8px;
    background: var(--bg-inset);
    border-radius: 6px;
    box-shadow: var(--shadow-inset);
}

.blog-post-content pre {
    background: var(--bg-inset);
    border-radius: var(--radius-sm);
    padding: 24px;
    overflow-x: auto;
    margin: 24px 0;
    box-shadow: var(--shadow-inset);
}

.blog-post-content pre code {
    padding: 0;
    background: none;
    box-shadow: none;
    font-size: 0.85rem;
    line-height: 1.6;
}

.blog-post-content blockquote {
    border-left: 4px solid var(--accent);
    padding: 16px 24px;
    margin: 24px 0;
    background: var(--surface);
    border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
    box-shadow: var(--shadow-clay-sm);
    color: var(--text);
    font-style: italic;
}

.blog-post-content img {
    max-width: 100%;
    height: auto;
    border-radius: var(--radius);
    margin: 24px 0;
    box-shadow: var(--shadow-clay);
}

.blog-post-content ul,
.blog-post-content ol {
    padding-left: 24px;
    margin-bottom: 20px;
}

.blog-post-content li {
    margin-bottom: 8px;
}

.blog-post-content hr {
    border: none;
    height: 2px;
    background: var(--bg-inset);
    margin: 40px 0;
    border-radius: 1px;
}

/* ── Post Footer ── */
.blog-post-footer {
    margin-top: 60px;
    padding-top: 32px;
    border-top: 2px solid var(--bg-inset);
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 20px;
}

.blog-post-author strong {
    display: block;
    font-size: 1rem;
    margin-bottom: 4px;
}

.blog-post-author span {
    font-size: 0.82rem;
    color: var(--text-muted);
}

/* ═══════════════════════════════════════════
   404 ERROR PAGE
   ═══════════════════════════════════════════ */
.error-page {
    min-height: 80vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    padding: calc(var(--nav-height) + 80px) clamp(24px, 5vw, 80px) 80px;
    position: relative;
    z-index: 3;
}

.error-page h1 {
    font-family: var(--font-display);
    font-size: clamp(6rem, 15vw, 12rem);
    font-weight: 700;
    line-height: 1;
    background: var(--fun-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 16px;
}

.error-page p {
    font-size: 1.1rem;
    color: var(--text-secondary);
    max-width: 400px;
}

/* ═══════════════════════════════════════════
   RESPONSIVE
   ═══════════════════════════════════════════ */
@media (max-width: 768px) {
    .blog-grid {
        grid-template-columns: 1fr;
    }

    .blog-post-footer {
        flex-direction: column;
        align-items: flex-start;
    }
}

/* ═══════════════════════════════════════════
   BLOG — DARK MODE OVERRIDES
   ═══════════════════════════════════════════ */
[data-theme="dark"] .blog-post-header h1 {
    text-shadow:
        1px 1px 0px rgba(0, 0, 0, 0.3),
        2px 2px 4px rgba(0, 0, 0, 0.2);
}

[data-theme="dark"] .blog-post-content pre {
    background: #141210;
    border: 1px solid rgba(255, 255, 255, 0.06);
}

[data-theme="dark"] .blog-post-content code {
    background: #141210;
}

[data-theme="dark"] .blog-post-content blockquote {
    border-left-color: var(--accent);
    background: var(--surface);
}

[data-theme="dark"] .blog-post-footer {
    border-top-color: rgba(255, 255, 255, 0.06);
}

[data-theme="dark"] .blog-post-content hr {
    background: rgba(255, 255, 255, 0.06);
}

[data-theme="dark"] .error-page h1 {
    filter: brightness(1.15);
}
