/**
 * FileHubKit - Blog & Guides Modern Styling
 */

/* Blog Layout Container */
.blog-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 280px;
    gap: 3rem;
    align-items: start;
    margin-top: 2rem;
}

@media (max-width: 992px) {
    .blog-layout {
        grid-template-columns: 1fr;
        gap: 2rem;
    }
}

/* Post Hero Header */
.blog-hero {
    background: var(--surface-alt);
    border-bottom: 1px solid var(--surface-border);
    padding: 3rem 0 2.5rem;
}

.blog-hero-container {
    max-width: 920px;
    margin: 0 auto;
}

.blog-meta-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background: rgba(37, 99, 235, 0.1);
    color: var(--primary);
    font-size: 0.85rem;
    font-weight: 700;
    padding: 0.35rem 0.85rem;
    border-radius: var(--radius-full);
    margin-bottom: 1.25rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.blog-post-title {
    font-family: var(--font-heading);
    font-size: 2.75rem;
    font-weight: 800;
    line-height: 1.25;
    color: var(--text-primary);
    margin-bottom: 1.25rem;
    letter-spacing: -0.02em;
}

@media (max-width: 768px) {
    .blog-post-title {
        font-size: 2rem;
    }
}

.blog-post-lead {
    font-size: 1.25rem;
    line-height: 1.6;
    color: var(--text-secondary);
    margin-bottom: 1.5rem;
}

.blog-meta-info {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 1.5rem;
    padding-top: 1rem;
    border-top: 1px solid var(--surface-border);
    color: var(--text-muted);
    font-size: 0.9rem;
}

.blog-meta-item {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
}

/* Main Article Content */
.blog-article {
    max-width: 820px;
    color: #334155;
    font-size: 1.1rem;
    line-height: 1.85;
}

.blog-article h2 {
    font-family: var(--font-heading);
    font-size: 1.85rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-top: 2.75rem;
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid var(--surface-border);
    scroll-margin-top: 90px;
}

.blog-article h3 {
    font-family: var(--font-heading);
    font-size: 1.35rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-top: 2rem;
    margin-bottom: 0.75rem;
    scroll-margin-top: 90px;
}

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

.blog-article ul.blog-list,
.blog-article ol.blog-num-list {
    margin-bottom: 1.75rem;
    padding-left: 1.5rem;
}

.blog-article ul.blog-list li,
.blog-article ol.blog-num-list li {
    margin-bottom: 0.65rem;
    line-height: 1.7;
}

.blog-article strong {
    color: var(--text-primary);
    font-weight: 600;
}

.blog-article a {
    color: var(--primary);
    text-decoration: underline;
    text-underline-offset: 3px;
    transition: color 0.15s ease;
}

.blog-article a:hover {
    color: var(--primary-dark);
}

/* Keep action buttons readable inside article content. */
.blog-article a.btn {
    text-decoration: none;
}

.blog-article a.btn-primary,
.blog-article a.btn-primary:hover {
    color: var(--text-inverse);
}

/* Call To Action Box Inside Blog */
.blog-cta-card {
    background: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
    color: #ffffff;
    border-radius: var(--radius-lg);
    padding: 2.5rem;
    margin: 3rem 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 2rem;
    box-shadow: 0 10px 25px -5px rgba(15, 23, 42, 0.15);
    border: 1px solid rgba(255, 255, 255, 0.1);
    position: relative;
    overflow: hidden;
}

.blog-cta-card::before {
    content: "";
    position: absolute;
    top: -50%;
    right: -20%;
    width: 300px;
    height: 300px;
    background: radial-gradient(circle, rgba(37, 99, 235, 0.3) 0%, transparent 70%);
    pointer-events: none;
}

.blog-cta-content h3 {
    color: #ffffff !important;
    font-size: 1.6rem !important;
    font-weight: 700 !important;
    margin: 0 0 0.5rem 0 !important;
    border-bottom: none !important;
    padding-bottom: 0 !important;
}

.blog-cta-content p {
    color: #cbd5e1 !important;
    font-size: 1rem !important;
    margin: 0 !important;
    line-height: 1.6 !important;
}

.blog-cta-card .btn {
    flex-shrink: 0;
    white-space: nowrap;
    box-shadow: 0 4px 14px rgba(37, 99, 235, 0.4);
}

@media (max-width: 768px) {
    .blog-cta-card {
        flex-direction: column;
        align-items: flex-start;
        padding: 2rem 1.5rem;
    }
    .blog-cta-card .btn {
        width: 100%;
        text-align: center;
    }
}

/* FAQ Accordion */
.faq-accordion {
    margin: 2rem 0;
    display: flex;
    flex-direction: column;
    gap: 0.85rem;
}

.faq-card {
    background: var(--surface);
    border: 1px solid var(--surface-border);
    border-radius: var(--radius-md);
    overflow: hidden;
    transition: var(--transition);
}

.faq-card:hover {
    border-color: #cbd5e1;
}

.faq-question-btn {
    width: 100%;
    padding: 1.25rem 1.5rem;
    background: transparent;
    border: none;
    text-align: left;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-family: var(--font-heading);
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-primary);
    cursor: pointer;
    gap: 1rem;
}

.faq-icon {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
    color: var(--text-muted);
    transition: transform 0.25s ease, color 0.25s ease;
}

.faq-card.open .faq-icon {
    transform: rotate(180deg);
    color: var(--primary);
}

.faq-answer-pane {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease, padding 0.3s ease;
    padding: 0 1.5rem;
    color: var(--text-secondary);
    font-size: 1rem;
    line-height: 1.7;
}

.faq-card.open .faq-answer-pane {
    max-height: 500px;
    padding: 0 1.5rem 1.25rem 1.5rem;
}

/* Sticky Table of Contents Sidebar */
.blog-sidebar {
    position: sticky;
    top: 100px;
}

.blog-toc-card {
    background: var(--surface);
    border: 1px solid var(--surface-border);
    border-radius: var(--radius-md);
    padding: 1.5rem;
    margin-bottom: 2rem;
}

.blog-toc-title {
    font-size: 0.85rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.blog-toc-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
}

.blog-toc-item {
    font-size: 0.9rem;
    line-height: 1.4;
}

.blog-toc-item.level-3 {
    padding-left: 1rem;
    font-size: 0.85rem;
}

.blog-toc-link {
    color: var(--text-secondary);
    text-decoration: none;
    transition: color 0.15s ease;
    display: block;
}

.blog-toc-link:hover, .blog-toc-link.active {
    color: var(--primary);
    font-weight: 600;
}

/* Tool Promo Card in Sidebar */
.blog-tool-promo {
    background: linear-gradient(135deg, rgba(37, 99, 235, 0.06) 0%, rgba(2, 132, 199, 0.08) 100%);
    border: 1px solid rgba(37, 99, 235, 0.2);
    border-radius: var(--radius-md);
    padding: 1.5rem;
    text-align: center;
}

.blog-tool-promo h4 {
    font-size: 1.15rem;
    margin-bottom: 0.5rem;
    color: var(--text-primary);
}

.blog-tool-promo p {
    font-size: 0.88rem;
    color: var(--text-secondary);
    margin-bottom: 1.25rem;
    line-height: 1.5;
}

/* Blog Index / Hub */
.blog-index-header {
    text-align: center;
    max-width: 720px;
    margin: 0 auto 3rem;
}

.blog-cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 2rem;
}

.blog-card {
    background: var(--surface);
    border: 1px solid var(--surface-border);
    border-radius: var(--radius-lg);
    padding: 2rem;
    display: flex;
    flex-direction: column;
    text-decoration: none;
    transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.blog-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-md);
    border-color: var(--primary-light);
}

.blog-card-category {
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--primary);
    margin-bottom: 0.75rem;
}

.blog-card-title {
    font-family: var(--font-heading);
    font-size: 1.35rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 0.75rem;
    line-height: 1.35;
}

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

.blog-card-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.85rem;
    color: var(--text-muted);
    border-top: 1px solid var(--surface-border);
    padding-top: 1rem;
}

.blog-read-more {
    color: var(--primary);
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
}
