/**
 * Blog Detail Page Styles
 * Modern article layout with reading progress
 * Integrated with main.css design system
 */

/* Article Hero Section */
.article-hero {
    padding: 120px 0 80px;
    background: linear-gradient(135deg, #f8fafc 0%, #ffffff 100%);
    position: relative;
    overflow: hidden;
}

/* Background decoration */
.article-hero::before {
    content: '';
    position: absolute;
    top: -10%;
    right: -5%;
    width: 600px;
    height: 600px;
    background: radial-gradient(circle, rgba(96, 165, 250, 0.08) 0%, rgba(14, 165, 233, 0.04) 40%, transparent 70%);
    border-radius: 50%;
    pointer-events: none;
    z-index: 0;
}

.article-hero::after {
    content: '';
    position: absolute;
    bottom: -20%;
    left: -10%;
    width: 500px;
    height: 500px;
    background: radial-gradient(circle, rgba(59, 130, 246, 0.06) 0%, rgba(96, 165, 250, 0.03) 50%, transparent 70%);
    border-radius: 50%;
    pointer-events: none;
    z-index: 0;
}

.article-header {
    max-width: 900px;
    margin: 0 auto;
    text-align: center;
    position: relative;
    z-index: 1;
}

.article-category {
    display: inline-flex;
    padding: 8px 20px;
    border-radius: 50px;
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 24px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

.article-title {
    font-size: 56px;
    font-weight: 800;
    line-height: 1.15;
    margin-bottom: 28px;
    color: #0f172a;
    letter-spacing: -0.02em;
}

.article-meta {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: 20px;
    font-size: 14px;
    color: #64748b;
    margin-bottom: 40px;
}

.article-meta-item {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 14px;
    background: rgba(255,255,255,0.8);
    border-radius: 20px;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(226,232,240,0.8);
}

.article-meta-item svg {
    opacity: 0.7;
}

.article-featured-image {
    max-width: 1200px;
    margin: 0 auto;
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 25px 70px -15px rgba(0,0,0,0.15);
    position: relative;
    z-index: 1;
}

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

/* Article Content Layout */
.article-layout {
    max-width: 1200px;
    margin: 80px auto;
    padding: 0 24px;
    display: grid;
    grid-template-columns: 1fr 340px;
    gap: 80px;
}

.article-content {
    max-width: 820px;
}

/* Article Body Typography */
.article-body {
    font-size: 19px;
    line-height: 1.75;
    color: #334155;
}

.article-body h2 {
    font-size: 36px;
    font-weight: 800;
    margin: 56px 0 28px;
    color: #0f172a;
    letter-spacing: -0.02em;
    line-height: 1.3;
}

.article-body h3 {
    font-size: 28px;
    font-weight: 700;
    margin: 44px 0 20px;
    color: #1e293b;
    letter-spacing: -0.01em;
    line-height: 1.35;
}

.article-body p {
    margin-bottom: 28px;
    line-height: 1.8;
}

.article-body ul,
.article-body ol {
    margin: 28px 0;
    padding-left: 28px;
}

.article-body li {
    margin-bottom: 14px;
    line-height: 1.75;
}

.article-body img {
    max-width: 100%;
    height: auto;
    border-radius: 16px;
    margin: 40px 0;
    box-shadow: 0 10px 40px rgba(0,0,0,0.1);
}

.article-body blockquote {
    border-left: 5px solid #3b82f6;
    padding: 24px 28px;
    margin: 40px 0;
    font-size: 21px;
    font-style: italic;
    color: #475569;
    background: #f8fafc;
    border-radius: 0 12px 12px 0;
}

.article-body a {
    color: #3b82f6;
    text-decoration: none;
    border-bottom: 2px solid rgba(59, 130, 246, 0.3);
    transition: all 0.2s;
}

.article-body a:hover {
    color: #1e40af;
    border-bottom-color: #1e40af;
}

.article-body code {
    background: #f1f5f9;
    padding: 3px 10px;
    border-radius: 6px;
    font-family: 'Monaco', 'Consolas', 'Courier New', monospace;
    font-size: 17px;
    color: #e11d48;
}

.article-body pre {
    background: #1e293b;
    color: #e2e8f0;
    padding: 28px;
    border-radius: 16px;
    overflow-x: auto;
    margin: 40px 0;
    box-shadow: 0 10px 30px rgba(0,0,0,0.15);
}

.article-body pre code {
    background: none;
    padding: 0;
    color: #e2e8f0;
    font-size: 15px;
}

/* Article Tags */
.article-tags {
    margin: 60px 0 40px;
    padding: 32px 0;
    border-top: 2px solid #e2e8f0;
}

.article-tags h4 {
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 20px;
    color: #1e293b;
}

.tags-list {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

.tag-item {
    padding: 10px 20px;
    background: #f1f5f9;
    border-radius: 50px;
    font-size: 14px;
    font-weight: 600;
    color: #475569;
    text-decoration: none;
    transition: all 0.3s;
    border: 2px solid transparent;
}

.tag-item:hover {
    background: #3b82f6;
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
}

/* Article Sidebar */
.article-sidebar {
    position: sticky;
    top: 120px;
    height: fit-content;
}

.sidebar-box {
    background: white;
    padding: 28px;
    border-radius: 20px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.08);
    margin-bottom: 28px;
    border: 1px solid #f1f5f9;
}

.sidebar-box h3 {
    font-size: 19px;
    font-weight: 700;
    margin-bottom: 20px;
    color: #1e293b;
}

.author-box {
    text-align: center;
}

.author-avatar {
    width: 90px;
    height: 90px;
    border-radius: 50%;
    background: linear-gradient(135deg, #3b82f6, #1e40af);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 36px;
    font-weight: 700;
    margin: 0 auto 20px;
    box-shadow: 0 8px 24px rgba(59, 130, 246, 0.3);
}

.author-name {
    font-size: 22px;
    font-weight: 700;
    margin-bottom: 8px;
    color: #0f172a;
}

.author-role {
    font-size: 15px;
    color: #64748b;
}

/* Popular Posts List */
.popular-posts-list {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.popular-post-item {
    display: flex;
    gap: 14px;
    text-decoration: none;
    padding: 12px;
    border-radius: 12px;
    transition: all 0.3s;
    border: 1px solid transparent;
}

.popular-post-item:hover {
    background: #f8fafc;
    border-color: #e2e8f0;
    transform: translateX(4px);
}

.popular-post-thumb {
    width: 90px;
    height: 90px;
    border-radius: 12px;
    overflow: hidden;
    flex-shrink: 0;
    background: linear-gradient(135deg, #f1f5f9, #e2e8f0);
}

.popular-post-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s;
}

.popular-post-item:hover .popular-post-thumb img {
    transform: scale(1.1);
}

.popular-post-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.popular-post-title {
    font-size: 15px;
    font-weight: 600;
    color: #1e293b;
    line-height: 1.4;
    margin-bottom: 8px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.popular-post-meta {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: #64748b;
}

.popular-post-meta span {
    line-height: 1;
}

.share-buttons {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.share-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 14px 18px;
    border-radius: 12px;
    text-decoration: none;
    font-weight: 600;
    font-size: 15px;
    transition: all 0.3s;
}

.share-btn-facebook {
    background: #1877f2;
    color: white;
}

.share-btn-twitter {
    background: #1da1f2;
    color: white;
}

.share-btn-whatsapp {
    background: #25d366;
    color: white;
}

.share-btn-linkedin {
    background: #0077b5;
    color: white;
}

.share-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(0,0,0,0.2);
}

.share-btn svg {
    flex-shrink: 0;
}

/* Related Posts Section */
.related-posts {
    max-width: 1200px;
    margin: 100px auto 80px;
    padding: 80px 24px;
    border-top: 2px solid #e2e8f0;
}

.related-posts h2 {
    font-size: 40px;
    font-weight: 800;
    margin-bottom: 48px;
    text-align: center;
    color: #0f172a;
    letter-spacing: -0.02em;
}

.related-posts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 36px;
}

.blog-card {
    background: white;
    border-radius: 20px;
    overflow: hidden;
    transition: all 0.3s;
    border: 1px solid #f1f5f9;
}

.blog-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 20px 50px rgba(0,0,0,0.12) !important;
}

.blog-card-image,
.blog-card-image-placeholder {
    border-radius: 0 !important;
}

.blog-card-title a {
    color: #1e293b;
    text-decoration: none;
    transition: color 0.2s;
}

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

/* Reading Progress Bar */
.reading-progress {
    position: fixed;
    top: 0;
    left: 0;
    width: 0%;
    height: 4px;
    background: linear-gradient(90deg, #3b82f6, #60a5fa);
    z-index: 9999;
    transition: width 0.1s ease;
}

/* Animations */
.fade-in {
    animation: fadeInUp 0.6s ease-out;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Table Styling */
.article-body table {
    width: 100%;
    border-collapse: collapse;
    margin: 32px 0;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
}

.article-body table th {
    background: #f1f5f9;
    padding: 14px 18px;
    text-align: left;
    font-weight: 700;
    color: #1e293b;
    border-bottom: 2px solid #e2e8f0;
}

.article-body table td {
    padding: 12px 18px;
    border-bottom: 1px solid #f1f5f9;
}

.article-body table tr:hover {
    background: #f8fafc;
}

/* Strong and Emphasis */
.article-body strong {
    font-weight: 700;
    color: #1e293b;
}

.article-body em {
    font-style: italic;
    color: #475569;
}

/* Responsive Design */
@media (max-width: 1024px) {
    .article-layout {
        grid-template-columns: 1fr;
        gap: 50px;
    }

    .article-sidebar {
        position: static;
        display: grid;
        grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
        gap: 24px;
    }
}

@media (max-width: 768px) {
    .article-hero {
        padding: 100px 0 60px;
    }

    .article-title {
        font-size: 32px;
    }

    .article-meta {
        gap: 12px;
    }

    .article-layout {
        margin: 50px auto;
        padding: 0 20px;
    }

    .article-body {
        font-size: 17px;
    }

    .article-body h2 {
        font-size: 28px;
    }

    .article-body h3 {
        font-size: 22px;
    }

    .related-posts {
        padding: 60px 20px;
    }

    .related-posts h2 {
        font-size: 32px;
    }

    .related-posts-grid {
        grid-template-columns: 1fr;
        gap: 24px;
    }

    .article-sidebar {
        grid-template-columns: 1fr;
    }
}
