/* --- BLOG STYLES --- */

/* Blog Header/Hero */
.blog-hero {
    padding: 120px 5vw 80px;
    text-align: center;
    background-color: var(--bg-color);
}

.blog-title {
    font-size: 4rem;
    color: var(--text-main);
    margin-bottom: 20px;
    letter-spacing: -1px;
}

.blog-subtitle {
    font-size: 1.5rem;
    color: var(--text-muted);
    max-width: 600px;
    margin: 0 auto;
}

/* Blog Grid */
.blog-section {
    padding: 40px 5vw 120px;
    background-color: var(--bg-color);
}

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

/* Blog Card */
.blog-card {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    overflow: hidden;
    transition: transform 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease;
    display: flex;
    flex-direction: column;
    /* ensure full width content */
    position: relative;
    /* Make it a positioning context for the stretched link */
    cursor: pointer;
    /* Indicate it's clickable */
}

.blog-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    border-color: var(--text-muted);
}

.card-image-wrapper {
    width: 100%;
    height: 220px;
    overflow: hidden;
    position: relative;
}

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

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

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

.blog-meta {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-bottom: 15px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.blog-card-title {
    font-size: 1.5rem;
    color: var(--text-main);
    margin-bottom: 15px;
    line-height: 1.3;
    width: 100%;
    /* Ensure title takes full width to avoid early wrapping if constrained */
}

.blog-excerpt {
    font-size: 1rem;
    color: var(--text-muted);
    line-height: 1.6;
    margin-bottom: 25px;
    flex-grow: 1;
}

.read-more-link {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-main);
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: gap 0.3s ease;
}

/* Stretched Link: Makes the whole card clickable */
.read-more-link::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;

}

.read-more-link:hover {
    gap: 12px;
}

/* --- LIGHT MODE OVERRIDES --- */
[data-theme="light"] .blog-hero,
[data-theme="light"] .blog-section {
    background-color: #F9FAFB;
}

[data-theme="light"] .blog-title {
    color: #111827;
}

[data-theme="light"] .blog-card {
    background: #ffffff;
    border-color: rgba(0, 0, 0, 0.1);
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

[data-theme="light"] .blog-card:hover {
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.1);
    border-color: var(--accent);
}

[data-theme="light"] .blog-card-title {
    color: #111827;
}

/* --- BLOG POST PAGE --- */
.article-container {
    max-width: 1200px;
    /* Wide container for Header & Image */
    margin: 0 auto;
    padding: 150px 5vw 100px;
}

.article-header {
    text-align: left;
    margin-bottom: 60px;
    max-width: 100%;
}

.article-title {
    font-size: 3.5rem;
    line-height: 1.2;
    margin-bottom: 20px;
    color: var(--text-main);
}

.article-meta {
    color: var(--text-muted);
    font-size: 1rem;
    display: flex;
    gap: 20px;
    justify-content: flex-start;
}

.article-featured-image {
    width: 100%;
    height: auto;
    max-height: 500px;
    object-fit: cover;
    border-radius: 12px;
    margin-bottom: 60px;
}

.article-content {
    font-size: 1.15rem;
    line-height: 1.8;
    color: #d1d5db;
    max-width: 800px;
    /* Constrain text for readability */
    margin: 0 auto;
    /* Center the text block */
}

.article-content p {
    margin-bottom: 30px;
}

.article-content h2 {
    font-size: 2rem;
    margin: 50px 0 20px;
    color: var(--text-main);
}

.back-btn-container {
    margin-top: 80px;
    padding-top: 40px;
    border-top: 1px solid var(--border-color);
    max-width: 800px;
    margin-left: auto;
    margin-right: auto;
}

.back-link {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    color: var(--text-muted);
    font-weight: 500;
    transition: color 0.3s;
}

.back-link:hover {
    color: var(--text-main);
}

/* Light Mode Article */
[data-theme="light"] .article-title,
[data-theme="light"] .article-content h2 {
    color: #111827;
}

[data-theme="light"] .article-content {
    color: #374151;
}