/* blog.css
   Blog listing and blog post.
   Not loaded anywhere yet: add it to $pageStyles in includes/header.php
   when the blog pages go live. */

/* ===== BLOG LISTING ===== */
.blog-section {
    padding: 100px 0;
}

.blog-filters {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin-bottom: 50px;
    flex-wrap: wrap;
}

.filter-btn {
    padding: 10px 20px;
    background: var(--light);
    border: 1px solid var(--border);
    border-radius: 25px;
    color: var(--text-secondary);
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.3s ease, color 0.3s ease, border-color 0.3s ease;
}

.filter-btn.active,
.filter-btn:hover {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

.featured-post {
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.2);
    margin-bottom: 60px;
}

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

.featured-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 40px;
    padding: 50px;
}

/* Used by the blog listing and blog post (merged from two definitions) */
.featured-image {
    width: 100%;
    max-height: 500px;
    object-fit: cover;
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
}

.featured-image img {
    width: 100%;
    height: 300px;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.featured-post:hover .featured-image img {
    transform: scale(1.05);
}

.featured-text h3 {
    font-size: 2rem;
    font-weight: 800;
    margin-bottom: 20px;
    color: var(--text-primary);
}

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

/* Used by the blog listing and blog post (merged from two definitions) */
.post-meta {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 20px;
    color: var(--text-muted);
    font-size: 0.9rem;
    margin-bottom: 40px;
}

.meta-item {
    display: flex;
    align-items: center;
    gap: 5px;
}

.blog-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 350px), 1fr));
    gap: clamp(25px, 3vw, 40px);
}

.blog-card {
    border-radius: 15px;
    overflow: hidden;
    height: 100%;
}

.blog-card:hover {
    transform: translateY(-10px);
}

.blog-image {
    height: 200px;
    overflow: hidden;
}

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

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

.blog-content {
    padding: 25px;
}

.blog-category,
.related-category {
    display: inline-block;
    background: rgba(var(--primary-light-rgb), 0.2);
    color: var(--primary);
    padding: 5px 12px;
    border-radius: 15px;
    font-size: 0.8rem;
    font-weight: 600;
    margin-bottom: 15px;
}

.blog-title {
    font-size: 1.3rem;
    font-weight: 700;
    margin-bottom: 15px;
    color: var(--text-primary);
    line-height: 1.4;
}

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

.blog-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: var(--text-muted);
    font-size: 0.85rem;
}

.read-more {
    color: var(--primary);
    text-decoration: none;
    font-weight: 600;
    transition: color 0.3s ease;
}

.read-more:hover {
    color: var(--primary-light);
}

/* ===== BLOG POST ===== */
.blog-post {
    padding-top: 140px;
}

.post-header {
    background: linear-gradient(135deg, var(--darker) 0%, var(--dark) 50%, var(--light) 100%);
    padding: 80px 0;
    position: relative;
    overflow: hidden;
}

.post-header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background:
        radial-gradient(circle at 20% 80%, rgba(var(--primary-light-rgb), 0.1) 0%, transparent 50%),
        radial-gradient(circle at 80% 20%, rgba(30, 64, 175, 0.08) 0%, transparent 50%);
    animation: float 8s ease-in-out infinite;
    z-index: 1;
}

.breadcrumb {
    margin-bottom: 30px;
    font-size: 0.9rem;
    color: var(--text-secondary);
}

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

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

.post-title {
    font-size: clamp(2.5rem, 5vw, 3.5rem);
    font-weight: 800;
    line-height: 1.2;
    margin-bottom: 30px;
    color: var(--text-primary);
}

.author-name {
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 5px;
}

.post-date {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.meta-stats {
    display: flex;
    gap: 20px;
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.meta-stat {
    display: flex;
    align-items: center;
    gap: 5px;
}

.post-content {
    max-width: 800px;
    margin: 0 auto;
    font-size: 1.1rem;
    line-height: 1.8;
    color: var(--text-secondary);
}

.post-content h2 {
    font-size: 2rem;
    font-weight: 700;
    margin: 60px 0 20px 0;
    color: var(--text-primary);
    line-height: 1.3;
    text-align: left;
}

.post-content h3 {
    font-size: 1.5rem;
    font-weight: 600;
    margin: 40px 0 15px 0;
    color: var(--text-primary);
}

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

.post-content ul,
.post-content ol {
    margin: 25px 0;
    padding-left: 30px;
}

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

.post-content blockquote {
    border-left: 4px solid var(--primary);
    padding-left: 25px;
    margin: 40px 0;
    font-style: italic;
    color: var(--text-secondary);
    font-size: 1.2rem;
}

.code-block {
    background: var(--darker);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 25px;
    margin: 30px 0;
    overflow-x: auto;
}

.code-block pre {
    margin: 0;
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.tip-box {
    background: rgba(var(--secondary-rgb), 0.1);
    border: 1px solid var(--secondary);
    border-radius: 10px;
    padding: 25px;
    margin: 30px 0;
}

.tip-box h4 {
    color: var(--secondary);
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.post-actions {
    border-top: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
    padding: 40px 0;
    margin: 60px 0;
}

.social-share {
    display: flex;
    align-items: center;
    gap: 20px;
    flex-wrap: wrap;
}

.social-share span {
    font-weight: 600;
    color: var(--text-primary);
}

.share-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    background: var(--light);
    border: 1px solid var(--border);
    border-radius: 25px;
    color: var(--text-secondary);
    text-decoration: none;
    transition: background-color 0.3s ease, color 0.3s ease, border-color 0.3s ease;
    font-size: 0.9rem;
}

.share-btn:hover {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

.author-bio {
    display: flex;
    gap: 25px;
    align-items: flex-start;
    background: var(--light);
    border-radius: 15px;
    padding: 40px;
    margin: 60px 0;
    border: 1px solid var(--border);
}

.author-bio h3 {
    font-size: 1.3rem;
    margin-bottom: 10px;
    color: var(--text-primary);
}

.author-bio p {
    color: var(--text-secondary);
    line-height: 1.6;
    margin: 0;
}

.related-posts {
    margin-top: 80px;
}

.related-posts h2 {
    font-size: 2.2rem;
    font-weight: 700;
    margin-bottom: 40px;
    color: var(--text-primary);
    text-align: center;
}

.related-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 350px), 1fr));
    gap: 30px;
}

.related-card {
    border-radius: 15px;
    overflow: hidden;
}

.related-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.3);
}

.related-image {
    height: 180px;
    overflow: hidden;
}

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

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

.related-content {
    padding: 25px;
}

.related-category {
    padding: 4px 12px;
    margin-bottom: 12px;
}

.related-title {
    font-size: 1.2rem;
    font-weight: 700;
    margin-bottom: 10px;
    color: var(--text-primary);
    line-height: 1.4;
}

.related-meta {
    color: var(--text-muted);
    font-size: 0.85rem;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 768px) {
    .featured-content {
        grid-template-columns: 1fr;
        padding: 30px;
    }

    .featured-image img {
        height: 200px;
    }

    .post-meta {
        flex-direction: column;
        align-items: flex-start;
        gap: 15px;
    }

    .author-bio {
        flex-direction: column;
        text-align: center;
    }

    .social-share {
        justify-content: center;
        text-align: center;
    }
}

@media (max-width: 480px) {
    .blog-content,
    .featured-content,
    .related-content {
        padding: 20px;
    }

    .author-bio,
    .post-actions {
        padding: 25px;
    }

    .post-header {
        padding: 60px 0;
    }
}
