/* Article Hero */
.article-hero {
    position: relative;
    min-height: 420px;
    display: flex;
    align-items: flex-end;
    overflow: hidden;
}

.article-hero-bg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    z-index: 1;
}

.article-hero-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(to top, rgba(45, 62, 80, 0.95) 0%, rgba(45, 62, 80, 0.5) 50%, rgba(45, 62, 80, 0.3) 100%);
    z-index: 2;
}

.article-hero-content {
    position: relative;
    z-index: 3;
    width: 100%;
    padding: 3rem 0;
}

.article-category {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    border-radius: var(--radius-xl);
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
    color: var(--bg-white);
    margin-bottom: 1rem;
    text-decoration: none;
    transition: opacity var(--transition-fast);
}

.article-category:hover {
    opacity: 0.9;
    color: var(--bg-white);
}

.article-hero h1 {
    font-size: clamp(1.75rem, 5vw, 2.75rem);
    font-weight: 800;
    color: var(--bg-white);
    margin-bottom: 1.25rem;
    max-width: 800px;
    line-height: 1.2;
}

.article-hero-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 1.5rem;
    color: rgba(255, 255, 255, 0.8);
    font-size: 0.9rem;
}

.article-hero-meta span {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.article-hero-meta i {
    color: var(--accent-light);
}

.article-hero-meta a {
    color: rgba(255, 255, 255, 0.9);
    text-decoration: none;
}

.article-hero-meta a:hover {
    color: var(--accent-light);
}

.author-avatar {
    width: 32px;
    height: 32px;
    border-radius: var(--radius-full);
    object-fit: cover;
    margin-right: 0.25rem;
    border: 2px solid var(--accent-light);
}

/* Breadcrumb */
.breadcrumb-nav {
    background: var(--bg-white);
    padding: 0.875rem 0;
    border-bottom: 1px solid var(--border-light);
}

.breadcrumb-nav .breadcrumb {
    margin-bottom: 0;
    font-size: 0.875rem;
}

.breadcrumb-nav .breadcrumb-item a {
    color: var(--text-secondary);
    text-decoration: none;
}

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

.breadcrumb-nav .breadcrumb-item.active {
    color: var(--primary);
    font-weight: 500;
}

/* ============================================
   TOC HORIZONTAL (Mobile only)
   ============================================ */
.toc-horizontal {
    background: var(--bg-white);
    padding: 0.875rem 0;
    border-bottom: 1px solid var(--border-light);
    position: sticky;
    top: 56px;
    z-index: 990;
    box-shadow: 0 2px 4px rgba(0,0,0,0.04);
    margin-left: calc(-50vw + 50%);
    margin-right: calc(-50vw + 50%);
    width: 100vw;
}

.toc-scroll {
    display: flex;
    gap: 0.5rem;
    overflow-x: auto;
    scrollbar-width: none;
    -ms-overflow-style: none;
    padding: 0 1rem;
    max-width: 1140px;
    margin: 0 auto;
}

.toc-scroll::-webkit-scrollbar {
    display: none;
}

.toc-scroll a {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.5rem 1rem;
    background: var(--bg-light);
    border-radius: 50px;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-secondary);
    white-space: nowrap;
    transition: all 0.2s ease;
    border: 1px solid transparent;
    text-decoration: none;
}

.toc-scroll a:hover,
.toc-scroll a.active {
    background: var(--primary);
    color: #fff;
    border-color: var(--primary);
}

.toc-scroll a i {
    font-size: 0.9rem;
}

/* Hide horizontal TOC on desktop */
@media (min-width: 992px) {
    .toc-horizontal {
        display: none;
    }
}

@media (max-width: 767.98px) {
    .toc-scroll {
        padding: 0 0.75rem;
    }

    .toc-scroll a {
        padding: 0.4rem 0.875rem;
        font-size: 0.8rem;
    }
}

/* ============================================
   TOC VERTICAL SIDEBAR (Desktop only)
   ============================================ */
.sidebar-toc {
    margin-bottom: 1.5rem;
}

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

.sidebar-toc-list li {
    padding: 0.5rem 0;
    border-bottom: 1px solid var(--border-light);
}

.sidebar-toc-list li:last-child {
    border-bottom: none;
}

.sidebar-toc-list a {
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.9rem;
    color: var(--text-primary);
    transition: all 0.2s ease;
    text-decoration: none;
}

.sidebar-toc-list a:hover {
    color: var(--primary);
    padding-left: 0.5rem;
}

.sidebar-toc-list a i {
    color: var(--primary);
    font-size: 0.85rem;
}

/* Hide vertical TOC on mobile */
@media (max-width: 991.98px) {
    .sidebar-toc {
        display: none;
    }
}

/* Article Content */
.article-content {
    background: var(--bg-white);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-lg);
    padding: 2.5rem;
    margin-bottom: 2rem;
    box-shadow: var(--shadow-sm);
}

.article-content h2 {
    font-size: 1.75rem;
    font-weight: 700;
    margin-top: 2.5rem;
    margin-bottom: 1rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border-light);
    color: var(--secondary);
}

.article-content h2:first-child {
    margin-top: 0;
    padding-top: 0;
    border-top: none;
}

.article-content h3 {
    font-size: 1.35rem;
    font-weight: 600;
    margin-top: 2rem;
    margin-bottom: 0.75rem;
    color: var(--secondary-light);
}

.article-content p {
    line-height: 1.8;
    color: var(--text-primary);
    margin-bottom: 1.25rem;
}

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

.article-content li {
    line-height: 1.8;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

.article-content img {
    max-width: 100%;
    height: auto;
    border-radius: var(--radius-md);
    margin: 1.5rem 0;
    box-shadow: var(--shadow-sm);
}

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

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

.article-content blockquote {
    border-left: 4px solid var(--accent);
    padding: 1rem 1.5rem;
    margin: 1.5rem 0;
    font-style: italic;
    background: var(--bg-light);
    border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
    color: var(--text-secondary);
}

.article-content code {
    background: var(--bg-light);
    padding: 0.2rem 0.4rem;
    border-radius: var(--radius-xs);
    font-size: 0.9em;
    color: var(--accent-dark);
}

.article-content pre {
    background: var(--secondary);
    color: var(--bg-white);
    padding: 1.25rem;
    border-radius: var(--radius-md);
    overflow-x: auto;
    margin: 1.5rem 0;
}

.article-content pre code {
    background: transparent;
    color: inherit;
    padding: 0;
}

/* Article Tags */
.article-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border-light);
    margin-top: 2rem;
}

.article-tags a {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0.5rem 1rem;
    background: var(--bg-light);
    border-radius: var(--radius-xl);
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.85rem;
    transition: all var(--transition-fast);
}

.article-tags a:hover {
    background: var(--primary);
    color: var(--bg-white);
}

/* Author Box */
.author-box {
    background: var(--bg-white);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-lg);
    padding: 2rem;
    margin-bottom: 2rem;
    display: flex;
    gap: 1.5rem;
    box-shadow: var(--shadow-sm);
}

@media (max-width: 576px) {
    .author-box {
        flex-direction: column;
        text-align: center;
        align-items: center;
    }
}

.author-box-avatar {
    width: 100px;
    height: 100px;
    border-radius: var(--radius-full);
    object-fit: cover;
    flex-shrink: 0;
    border: 3px solid var(--accent-light);
    box-shadow: var(--shadow-sm);
}

.author-box-info h3 {
    font-size: 1.25rem;
    margin-bottom: 0.25rem;
    color: var(--secondary);
}

.author-box-info h3 a {
    color: inherit;
    text-decoration: none;
}

.author-box-info h3 a:hover {
    color: var(--primary);
}

.author-box-title {
    color: var(--primary);
    font-weight: 600;
    font-size: 0.9rem;
    margin-bottom: 0.75rem;
}

.author-box-bio {
    color: var(--text-secondary);
    font-size: 0.95rem;
    line-height: 1.7;
    margin-bottom: 1rem;
}

.author-box-links {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
}

@media (max-width: 576px) {
    .author-box-links {
        justify-content: center;
    }
}

.author-box-links a {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--primary);
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 500;
}

.author-box-links a:hover {
    color: var(--primary-dark);
}

/* FAQ Section */
.faq-section {
    background: var(--bg-white);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-lg);
    padding: 2rem;
    margin-bottom: 2rem;
    box-shadow: var(--shadow-sm);
}

.faq-section h2 {
    font-size: 1.5rem;
    margin-bottom: 1.5rem;
    color: var(--secondary);
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid var(--accent);
}

.faq-section h2 i {
    color: var(--accent);
}

.faq-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.faq-item {
    border: 1px solid var(--border-light);
    border-radius: var(--radius-md);
    overflow: hidden;
    transition: all var(--transition-fast);
}

.faq-item:hover {
    border-color: var(--primary-light);
}

.faq-question {
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 1.25rem;
    background: var(--bg-light);
    border: none;
    color: var(--secondary);
    font-weight: 600;
    font-size: 1rem;
    text-align: left;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.faq-question:hover {
    background: linear-gradient(135deg, var(--bg-light) 0%, var(--bg-soft) 100%);
}

.faq-question[aria-expanded="true"] {
    background: var(--gradient-primary);
    color: var(--bg-white);
}

.faq-question[aria-expanded="true"] i {
    transform: rotate(180deg);
}

.faq-question i {
    transition: transform var(--transition-fast);
    flex-shrink: 0;
    margin-left: 1rem;
}

.faq-answer {
    padding: 1.25rem;
    color: var(--text-primary);
    line-height: 1.8;
    background: var(--bg-white);
}

/* Related Posts */
.related-posts {
    margin-bottom: 2rem;
}

.related-posts h2 {
    font-size: 1.5rem;
    margin-bottom: 1.5rem;
    color: var(--secondary);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.related-posts h2 i {
    color: var(--accent);
}

.related-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.5rem;
}

@media (max-width: 992px) {
    .related-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 576px) {
    .related-grid {
        grid-template-columns: 1fr;
    }
}

.related-card {
    background: var(--bg-white);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-md);
    overflow: hidden;
    transition: all var(--transition-base);
}

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

.related-card-image {
    height: 140px;
    overflow: hidden;
    background: var(--bg-soft);
}

.related-card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform var(--transition-slow);
}

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

.related-card-body {
    padding: 1rem;
}

.related-card-title {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    line-height: 1.4;
    color: var(--secondary);
}

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

.related-card-title a:hover {
    color: var(--primary);
}

.related-card-meta {
    font-size: 0.8rem;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 0.35rem;
}

.related-card-meta i {
    color: var(--primary);
}

/* Sidebar Sticky (like reviews) */
.blog-sidebar-sticky {
    position: sticky;
    top: 80px;
}

/* Sidebar */
.blog-sidebar-card {
    background: var(--bg-white);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    box-shadow: var(--shadow-sm);
}

.blog-sidebar-card h3 {
    font-size: 1.1rem;
    margin-bottom: 1rem;
    padding-bottom: 0.75rem;
    border-bottom: 2px solid var(--accent);
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--secondary);
}

.blog-sidebar-card h3 i {
    color: var(--accent);
}

/* Recent Posts in Sidebar */
.recent-post-item {
    display: flex;
    gap: 1rem;
    padding: 0.75rem 0;
    border-bottom: 1px solid var(--border-light);
}

.recent-post-item:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.recent-post-item:first-child {
    padding-top: 0;
}

.recent-post-image {
    width: 70px;
    height: 50px;
    flex-shrink: 0;
    border-radius: var(--radius-sm);
    overflow: hidden;
    background: var(--bg-soft);
}

.recent-post-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.recent-post-title {
    font-size: 0.9rem;
    font-weight: 600;
    margin-bottom: 0.25rem;
    line-height: 1.4;
    color: var(--secondary);
}

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

.recent-post-title a:hover {
    color: var(--primary);
}

.recent-post-meta {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin: 0;
}

/* Share Buttons */
.share-buttons {
    display: flex;
    gap: 0.5rem;
}

.share-buttons .btn {
    flex: 1;
    padding: 0.75rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Responsive */
@media (max-width: 767.98px) {
    .article-hero {
        min-height: 350px;
    }

    .article-hero h1 {
        font-size: 1.5rem;
    }

    .article-content {
        padding: 1.5rem;
    }

    .article-content h2 {
        font-size: 1.5rem;
    }
}
