/* Blog Specific Styles - Distinct "Journal" Look */

:root {
    --blog-bg: #f0f0f0;
    --blog-paper: #ffffff;
    --blog-text: #1a1a1a;
    --blog-text-secondary: #555555;
    --blog-accent: #FFC107; /* Warm Yellow to match main site */
    --blog-line: #e0e0e0;
    --blog-font-serif: var(--font-family);
}

body.blog-page {
    background-color: var(--blog-bg);
    color: var(--blog-text);
    --bg-color: var(--blog-bg); /* Override main variables */
    --text-primary: var(--blog-text);
    --border-color: var(--blog-line);
}

/* Override Header for Light Mode */
.blog-page .site-header {
    background: rgba(255, 255, 255, 0.8);
    border-bottom: 1px solid var(--blog-line);
}

.blog-page .logo {
    color: var(--blog-text);
    background-color: #222;
    padding: 6px 12px;
    border-radius: 6px;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.blog-page .logo-text-svg {
    background-color: transparent;
    padding: 0;
    height: 32px;
    width: auto;
}

.blog-page .main-nav a {
    color: var(--blog-line);
}

.blog-page .main-nav a:hover {
    color: var(--blog-accent);
}

/* Blog Layout */
.blog-hero {
    padding: 120px 0 60px;
    text-align: center;
    background-image: radial-gradient(var(--blog-line) 1px, transparent 1px);
    background-size: 20px 20px;
    border-bottom: 1px solid var(--blog-line);
}

.blog-hero h1 {
    font-family: var(--blog-font-serif);
    font-size: 4rem;
    margin-bottom: 16px;
    letter-spacing: -0.03em;
}

.blog-hero p {
    color: var(--blog-text-secondary);
    font-size: 1.2rem;
    max-width: 600px;
    margin: 0 auto;
}

.blog-grid {
    display: grid;
    grid-template-columns: repeat(12, 1fr);
    gap: 40px;
    padding: 60px 0;
}

/* Featured Post (Spans full width) */
.post-card.featured {
    grid-column: span 12;
    display: grid;
    grid-template-columns: 1.5fr 1fr;
    gap: 40px;
    background: var(--blog-paper);
    border: 1px solid var(--blog-line);
    padding: 40px;
    align-items: center;
    box-shadow: 5px 5px 0px rgba(0,0,0,0.05);
    transition: transform 0.2s;
}

.post-card.featured:hover {
    transform: translateY(-2px);
    box-shadow: 8px 8px 0px rgba(0,0,0,0.1);
}

/* Regular Posts */
.post-card {
    grid-column: span 4;
    background: var(--blog-paper);
    border: 1px solid var(--blog-line);
    display: flex;
    flex-direction: column;
    transition: all 0.2s;
    cursor: pointer;
}

.post-card:not(.featured):hover {
    border-color: var(--blog-text);
    box-shadow: 5px 5px 0px rgba(0,0,0,0.05);
    transform: translateY(-2px);
}

.post-image {
    position: relative;
}

.post-image .post-image__img {
    position: relative;
    width: 100%;
    aspect-ratio: 16/9;
    background: #ddd;
    border-bottom: 1px solid var(--blog-line);
    filter: grayscale(100%);
    transition: filter 0.3s;
    display: block;
    position: relative;
}


.post-card:hover .post-image::after {
    inset: 0;
    position: absolute;
    /* filter: grayscale(0%) sepia(100%) brightness(90%); */
    content: ''; 
    background-color: rgba(var(--highlight-color), 0.5);
    /* background-blend-mode: multiply; */
    /* pointer-events: none; */
    /* opacity: 0.6; */
}

.post-card [role="img"] {
    position: relative;
}

.post-content {
    padding: 24px;
    display: flex;
    flex-direction: column;
    flex: 1;
}

.post-meta {
    font-size: 0.8rem;
    color: var(--blog-text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.post-tag {
    color: var(--blog-accent);
    font-weight: 600;
}

.post-title {
    font-family: var(--blog-font-serif);
    font-size: 1.5rem;
    margin-bottom: 12px;
    line-height: 1.3;
}

.post-title a {
    color: var(--blog-text);
    text-decoration: none;
}

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

.read-more {
    font-weight: 500;
    color: var(--blog-text);
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-top: auto;
}

.read-more:hover {
    color: var(--blog-accent);
}

/* Footer Override */
.blog-page .site-footer {
    background: #e5e5e5;
    border-top: 1px solid var(--blog-line);
}

.blog-page .footer-brand p, 
.blog-page .footer-links a {
    color: var(--blog-text-secondary);
}

.blog-page .footer-links a:hover {
    color: var(--blog-accent);
}

@media (max-width: 900px) {
    .post-card.featured {
        grid-template-columns: 1fr;
    }
    .post-card {
        grid-column: span 6;
    }
}

@media (max-width: 600px) {
    .post-card {
        grid-column: span 12;
    }
    .blog-hero h1 {
        font-size: 2.5rem;
    }
}

/* Blog Detail Page Styles */
.blog-cover-image {
    width: 100%;
    max-width: 100%;
    height: auto;
    margin-bottom: 40px;
    border-radius: 8px;
}

.blog-article-content {
    color: var(--blog-text);
    line-height: 1.8;
}

.blog-article-content h1,
.blog-article-content h2,
.blog-article-content h3,
.blog-article-content h4,
.blog-article-content h5,
.blog-article-content h6 {
    margin-top: 32px;
    margin-bottom: 16px;
    color: var(--blog-text);
}

.blog-article-content h1:first-child {
    margin-top: 0;
}

.blog-article-content p {
    margin-bottom: 16px;
    color: var(--blog-text);
}

.blog-article-content a {
    color: var(--highlight-color);
    text-decoration: none;
}

.blog-article-content a:hover {
    text-decoration: underline;
}

.blog-article-content code {
    background-color: rgba(255, 193, 7, 0.05);
    border: 1px solid rgba(255, 193, 7, 0.1);
    border-radius: 4px;
    padding: 2px 6px;
    font-family: 'Menlo', 'Monaco', 'Courier New', monospace;
    font-size: 0.9em;
    color: var(--blog-text);
}

.blog-article-content pre {
    background: #111;
    border: 1px solid var(--blog-line);
    border-radius: 8px;
    padding: 16px;
    overflow-x: auto;
    margin-bottom: 16px;
}

.blog-article-content pre code {
    background: none;
    border: none;
    padding: 0;
    font-size: 0.9rem;
    color: #e6e6e6;
}

.blog-article-content blockquote {
    border-left: 4px solid var(--blog-accent);
    padding-left: 16px;
    margin-left: 0;
    margin-bottom: 16px;
    color: var(--blog-text-secondary);
    font-style: italic;
}

.blog-article-content ul,
.blog-article-content ol {
    margin-left: 20px;
    margin-bottom: 16px;
}

.blog-article-content li {
    margin-bottom: 8px;
    color: var(--blog-text);
}

.blog-article-content img {
    max-width: 100%;
    height: auto;
    margin-bottom: 16px;
    border-radius: 8px;
}

.blog-footer {
    margin-top: 60px;
    padding-top: 40px;
    border-top: 1px solid var(--blog-line);
    color: var(--blog-text-secondary);
}

.blog-footer a {
    color: var(--highlight-color);
    text-decoration: none;
}

.blog-footer a:hover {
    text-decoration: underline;
}

/* Enhanced TOC Navigation Styling */
.blog-detail-toc ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.blog-detail-toc li {
    margin: 0;
    padding: 0;
}

.blog-detail-toc a {
    display: block;
    padding: 10px 14px;
    color: var(--blog-text-secondary);
    text-decoration: none;
    font-size: 0.95rem;
    border-left: 3px solid transparent;
    transition: all 0.3s;
    position: relative;
}

.blog-detail-toc a:hover {
    color: var(--blog-accent);
    border-left-color: var(--blog-accent);
    padding-left: 20px;
}

.blog-detail-toc a.active {
    color: var(--blog-accent);
    border-left-color: var(--blog-accent);
    background: rgba(255, 193, 7, 0.05);
    font-weight: 600;
}

/* View Transitions for Blog Posts */
/* Assign view-transition-name to the card on the blog overview page */
.post-card .post-image__img {
    view-transition-name: blog-image;
}

.post-card .post-title {
    view-transition-name: blog-title;
    width: fit-content;
}

/* Assign matching view-transition-name to elements on the blog detail page */
.blog-cover-image {
    view-transition-name: blog-image;
}

.blog-article-header h1 {
    view-transition-name: blog-title;
    width: fit-content;
}

/* Custom animation */
::view-transition-group(blog-image),
::view-transition-group(blog-title) {
    animation-duration: 0.4s;
    animation-timing-function: cubic-bezier(0.2, 0, 0.2, 1);
}
