/* public/css/blog.css */

/* Fonts & Base Styles */
.blog-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem 1.5rem;
    font-family: 'Geist', 'Poppins', sans-serif;
    color: #1e293b;
    line-height: 1.6;
}

/* Headings */
.blog-h1 {
    font-size: 3rem;
    font-weight: 800;
    text-align: center;
    color: #0b1a2a;
    margin: 2rem 0 3rem;
    position: relative;
}

.blog-h1::after {
    content: '';
    display: block;
    width: 60px;
    height: 4px;
    background: #f21b42;
    margin: 0.75rem auto 0;
    border-radius: 2px;
}

/* Featured Blog Post Card */
.featured-post-card {
    background: #ffffff;
    border-radius: 16px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.05);
    overflow: hidden;
    margin-bottom: 4rem;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    border: 1px solid #f1f5f9;
}

.featured-post-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.08);
}

.featured-flex {
    display: flex;
    flex-direction: row;
}

.featured-image-wrapper {
    flex: 1.2;
    position: relative;
    overflow: hidden;
    min-height: 380px;
}

.featured-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.featured-post-card:hover .featured-image {
    transform: scale(1.03);
}

.featured-content {
    flex: 1;
    padding: 3rem;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.featured-tag {
    display: inline-block;
    background: rgba(242, 27, 66, 0.1);
    color: #f21b42;
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
    align-self: flex-start;
    margin-bottom: 1.25rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.featured-title {
    font-size: 2.25rem;
    font-weight: 700;
    color: #0b1a2a;
    line-height: 1.3;
    margin-bottom: 1rem;
    transition: color 0.2s ease;
}

.featured-title a {
    color: inherit;
    text-decoration: none;
}

.featured-title a:hover {
    color: #f21b42;
}

.featured-excerpt {
    font-size: 1.05rem;
    color: #64748b;
    margin-bottom: 2rem;
}

.post-meta-row {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.author-avatar {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: #f1f5f9;
    object-fit: cover;
}

.meta-details {
    display: flex;
    flex-direction: column;
}

.meta-author {
    font-weight: 600;
    color: #334155;
    font-size: 0.95rem;
}

.meta-date {
    color: #94a3b8;
    font-size: 0.85rem;
}

/* Blog Grid section */
.blog-section-title {
    font-size: 1.75rem;
    font-weight: 700;
    color: #0b1a2a;
    margin-bottom: 2rem;
    border-left: 4px solid #f21b42;
    padding-left: 0.75rem;
}

.blog-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 2.5rem;
    margin-bottom: 4rem;
}

.blog-card {
    background: #ffffff;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.03);
    overflow: hidden;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    border: 1px solid #f1f5f9;
    display: flex;
    flex-direction: column;
    height: 100%;
}

.blog-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.07);
}

.blog-card-image-wrapper {
    position: relative;
    height: 220px;
    overflow: hidden;
    background: #f8fafc;
}

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

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

.blog-card-content {
    padding: 1.75rem;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}

.blog-card-title {
    font-size: 1.35rem;
    font-weight: 700;
    color: #0b1a2a;
    line-height: 1.4;
    margin-bottom: 0.75rem;
    transition: color 0.2s ease;
}

.blog-card-title a {
    color: inherit;
    text-decoration: none;
}

.blog-card-title a:hover {
    color: #f21b42;
}

.blog-card-excerpt {
    font-size: 0.95rem;
    color: #64748b;
    margin-bottom: 1.5rem;
    flex-grow: 1;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.blog-card-meta {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    border-top: 1px solid #f1f5f9;
    padding-top: 1.25rem;
}

.blog-card-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: #f1f5f9;
}

/* Detail Page Layout */
.blog-details-layout {
    display: grid;
    grid-template-columns: 280px 1fr;
    gap: 3rem;
    margin-top: 2rem;
}

/* Table of Contents */
.toc-sidebar {
    position: sticky;
    top: 100px;
    align-self: start;
    background: #f8fafc;
    padding: 1.5rem;
    border-radius: 12px;
    border: 1px solid #e2e8f0;
}

.toc-title {
    font-size: 1.15rem;
    font-weight: 700;
    color: #0b1a2a;
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid #e2e8f0;
}

.toc-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.toc-item {
    margin-bottom: 0.75rem;
    line-height: 1.4;
}

.toc-item.level-3 {
    padding-left: 1rem;
}

.toc-link {
    color: #64748b;
    text-decoration: none;
    font-size: 0.92rem;
    transition: color 0.2s ease, font-weight 0.2s ease;
    display: block;
}

.toc-link:hover, .toc-link.active {
    color: #f21b42;
    font-weight: 600;
}

/* Main Article Section */
.blog-article {
    background: #ffffff;
    border-radius: 16px;
    padding: 1rem 0;
}

.article-header {
    margin-bottom: 2rem;
}

.article-title {
    font-size: 2.75rem;
    font-weight: 800;
    color: #0b1a2a;
    line-height: 1.25;
    margin-bottom: 1.25rem;
}

.article-meta {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    border-bottom: 1px solid #e2e8f0;
    padding-bottom: 1.5rem;
}

.article-image-container {
    width: 100%;
    height: 480px;
    border-radius: 12px;
    overflow: hidden;
    margin-bottom: 2.5rem;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.05);
}

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

/* Article Content HTML styling */
.article-body {
    font-size: 1.15rem;
    color: #1e293b;
    line-height: 1.8;
}

.article-body h2 {
    font-size: 1.85rem;
    font-weight: 700;
    color: #0b1a2a;
    margin: 2.5rem 0 1.25rem;
    padding-bottom: 0.35rem;
    scroll-margin-top: 100px;
}

.article-body h3 {
    font-size: 1.45rem;
    font-weight: 700;
    color: #0b1a2a;
    margin: 2rem 0 1rem;
    scroll-margin-top: 100px;
}

.article-body p {
    margin-bottom: 1.5rem;
}

.article-body code {
    background: #f1f5f9;
    padding: 0.2rem 0.4rem;
    border-radius: 4px;
    font-family: 'Geist Mono', monospace;
    font-size: 0.95em;
    color: #f21b42;
}

.article-body ul, .article-body ol {
    margin-bottom: 1.5rem;
    padding-left: 1.5rem;
}

.article-body li {
    margin-bottom: 0.5rem;
}

/* Author Section at bottom */
.author-bio-card {
    display: flex;
    flex-direction: row;
    gap: 1.5rem;
    background: #f8fafc;
    border-radius: 12px;
    padding: 2rem;
    margin: 4rem 0;
    border: 1px solid #e2e8f0;
}

.author-bio-avatar {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    object-fit: cover;
    background: #e2e8f0;
    flex-shrink: 0;
}

.author-bio-info {
    display: flex;
    flex-direction: column;
}

.author-bio-title {
    font-size: 0.85rem;
    color: #94a3b8;
    text-transform: uppercase;
    font-weight: 600;
    letter-spacing: 1px;
    margin-bottom: 0.25rem;
}

.author-bio-name {
    font-size: 1.25rem;
    font-weight: 700;
    color: #0b1a2a;
    margin-bottom: 0.5rem;
}

.author-bio-text {
    font-size: 0.95rem;
    color: #64748b;
    margin: 0;
}

/* Related blogs section */
.related-blogs-container {
    border-top: 1px solid #e2e8f0;
    padding-top: 3rem;
    margin-top: 3rem;
}

/* Responsive Queries */
@media (max-width: 1024px) {
    .blog-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 2rem;
    }
}

@media (max-width: 768px) {
    .blog-h1 {
        font-size: 2.25rem;
        margin: 1.5rem 0 2rem;
    }
    
    .featured-flex {
        flex-direction: column;
    }
    
    .featured-image-wrapper {
        min-height: 250px;
    }
    
    .featured-content {
        padding: 2rem;
    }
    
    .featured-title {
        font-size: 1.75rem;
    }
    
    .blog-grid {
        grid-template-columns: 1fr;
        gap: 2rem;
    }
    
    .blog-details-layout {
        grid-template-columns: 1fr;
        gap: 2rem;
    }
    
    .toc-sidebar {
        position: static;
        width: 100%;
        margin-bottom: 1.5rem;
    }
    
    .article-title {
        font-size: 2rem;
    }
    
    .article-image-container {
        height: 280px;
    }
    
    .author-bio-card {
        flex-direction: column;
        align-items: center;
        text-align: center;
        padding: 1.5rem;
    }
}

/* Search & Filter section */
.blog-filter-section {
    max-width: 800px;
    margin: 0 auto 3.5rem;
    background: #ffffff;
    padding: 1.5rem;
    border-radius: 16px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.04);
    border: 1px solid #f1f5f9;
}

.blog-filter-form {
    width: 100%;
}

.filter-inputs-wrapper {
    display: flex;
    gap: 1rem;
    align-items: center;
    width: 100%;
}

.search-input-group {
    position: relative;
    flex: 2;
}

.blog-search-input {
    width: 100%;
    padding: 0.85rem 3rem 0.85rem 1.25rem;
    font-size: 1rem;
    border: 2px solid #e2e8f0;
    border-radius: 30px;
    background: #f8fafc;
    color: #1e293b;
    outline: none;
    transition: all 0.3s ease;
}

.blog-search-input:focus {
    border-color: #f21b42;
    background: #ffffff;
    box-shadow: 0 4px 15px rgba(242, 27, 66, 0.05);
}

.blog-search-btn-icon {
    position: absolute;
    right: 15px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    cursor: pointer;
    color: #94a3b8;
    transition: color 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.blog-search-btn-icon:hover {
    color: #f21b42;
}

.category-select-group {
    position: relative;
    flex: 1.2;
}

.blog-category-select {
    width: 100%;
    padding: 0.85rem 2.5rem 0.85rem 1.25rem;
    font-size: 0.95rem;
    font-weight: 500;
    border: 2px solid #e2e8f0;
    border-radius: 30px;
    background: #f8fafc;
    color: #475569;
    outline: none;
    appearance: none; /* remove default arrow */
    -webkit-appearance: none;
    -moz-appearance: none;
    cursor: pointer;
    transition: all 0.3s ease;
}

.blog-category-select:focus {
    border-color: #f21b42;
    background: #ffffff;
    color: #1e293b;
    box-shadow: 0 4px 15px rgba(242, 27, 66, 0.05);
}

.select-arrow-icon {
    position: absolute;
    right: 15px;
    top: 50%;
    transform: translateY(-50%);
    pointer-events: none;
    color: #94a3b8;
    display: flex;
    align-items: center;
}

.blog-reset-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.85rem 1.5rem;
    background: #f1f5f9;
    color: #64748b;
    border-radius: 30px;
    text-decoration: none;
    font-weight: 600;
    font-size: 0.95rem;
    transition: all 0.2s ease;
    border: 2px solid #e2e8f0;
    white-space: nowrap;
}

.blog-reset-btn:hover {
    background: #f21b42;
    color: #ffffff;
    border-color: #f21b42;
    box-shadow: 0 4px 12px rgba(242, 27, 66, 0.2);
}

.no-posts-found {
    text-align: center;
    padding: 4rem 2rem;
    background: #f8fafc;
    border-radius: 12px;
    border: 1px solid #e2e8f0;
    max-width: 600px;
    margin: 2rem auto;
}

.no-posts-title {
    font-size: 1.5rem;
    color: #0b1a2a;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.no-posts-text {
    color: #64748b;
    margin-bottom: 1.5rem;
}

.clear-search-btn {
    display: inline-block;
    padding: 0.5rem 1.25rem;
    background: #0b1a2a;
    color: #ffffff;
    border-radius: 20px;
    text-decoration: none;
    font-weight: 600;
    font-size: 0.9rem;
    transition: background 0.2s ease;
}

.clear-search-btn:hover {
    background: #f21b42;
}

/* Responsive styles for filters */
@media (max-width: 768px) {
    .blog-filter-section {
        padding: 1rem;
        margin-bottom: 2.5rem;
    }

    .filter-inputs-wrapper {
        flex-direction: column;
        align-items: stretch;
        gap: 0.75rem;
    }

    .search-input-group, .category-select-group {
        width: 100%;
        flex: none;
    }
    .blog-reset-btn {
        width: 100%;
    }
}

/* Card Category Tag */
.blog-card-tag {
    display: inline-block;
    background: rgba(15, 23, 42, 0.05);
    color: #475569;
    padding: 0.2rem 0.6rem;
    border-radius: 4px;
    font-size: 0.8rem;
    font-weight: 600;
    align-self: flex-start;
    margin-bottom: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Featured Card Read More button */
.featured-read-more-wrapper {
    margin-top: auto;
}

.featured-read-more-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.85rem 1.75rem;
    background: #f21b42;
    color: #ffffff;
    border-radius: 30px;
    text-decoration: none;
    font-weight: 600;
    font-size: 0.95rem;
    transition: all 0.2s ease;
    border: none;
    box-shadow: 0 4px 12px rgba(242, 27, 66, 0.15);
}

.featured-read-more-btn:hover {
    background: #0b1a2a;
    color: #ffffff;
    box-shadow: 0 4px 15px rgba(11, 26, 42, 0.2);
    transform: translateY(-2px);
}

/* Regular Card Footer and Read Link */
.blog-card-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-top: 1px solid #f1f5f9;
    padding-top: 1.25rem;
    margin-top: auto;
}

/* Override existing card meta padding/border because it is now inside card footer */
.blog-card-footer .blog-card-meta {
    border-top: none;
    padding-top: 0;
    margin-top: 0;
}

.blog-card-read-link {
    color: #f21b42;
    text-decoration: none;
    font-weight: 700;
    font-size: 0.9rem;
    display: inline-flex;
    align-items: center;
    transition: color 0.2s ease, transform 0.2s ease;
}

.blog-card-read-link:hover {
    color: #0b1a2a;
    transform: translateX(3px);
}
