/* بسم الله الرحمن الرحيم
// Bismillah Hir Rahman Nir Raheem
// In the name of Allah, The Most Gracious, The Most Merciful
*/


/* Main Content */
.main-content {
    max-width: 900px;
    margin: 0 auto;
    padding: 3rem 1rem;
}

.content-wrapper {
    position: relative;
}

/* Table of Contents */
.toc-section {
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 1rem;
    margin-bottom: 2rem;
    overflow: hidden;
    transition: all 0.3s ease;
}

.toc-header {
    padding: 1rem 1.5rem;
    background: rgba(139, 92, 246, 0.2);
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: background 0.3s ease;
}

.toc-header:hover {
    background: rgba(139, 92, 246, 0.3);
}

.toc-title {
    font-size: 1.125rem;
    font-weight: 600;
    color: white;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.toc-icon {
    transition: transform 0.3s ease;
}

.toc-section.expanded .toc-icon {
    transform: rotate(180deg);
}

.toc-content {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
}

.toc-section.expanded .toc-content {
    max-height: 500px;
}

.toc-list {
    padding: 1rem 1.5rem;
}

.toc-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 0;
    color: rgba(255, 255, 255, 0.8);
    text-decoration: none;
    transition: color 0.3s ease;
    border-radius: 0.375rem;
    padding-left: 1rem;
}

.toc-item:hover {
    color: #a78bfa;
    background: rgba(139, 92, 246, 0.1);
}

.toc-item h2 {
    font-size: 0.875rem;
    font-weight: 500;
}

.toc-item h3 {
    font-size: 0.75rem;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.6);
    margin-left: 1rem;
}

/* Featured Image */
.featured-image {
    width: 100%;
    height: 400px;
    background: linear-gradient(135deg, #8b5cf6, #f43f5e);
    border-radius: 1rem;
    margin-bottom: 2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 4rem;
    color: white;
    opacity: 0.9;
    position: relative;
    overflow: hidden;
}

.post-meta {
    display: flex;
    gap: 2rem;
    margin-bottom: 2rem;
    font-size: 0.875rem;
    color: rgba(255, 255, 255, 0.6);
}

.post-meta-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.post-title {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 1.5rem;
    line-height: 1.2;
    color: white;

}

.post-content {
    font-size: 1.125rem;
    line-height: 1.8;
    margin-bottom: 3rem;
    color: rgba(255, 255, 255, 0.9);
}

.post-content p {
    margin-bottom: 1.5rem;
}

.post-content h2 {
    font-size: 1.875rem;
    font-weight: 600;
    margin: 2.5rem 0 1rem;
    color: #a78bfa;
    position: relative;
    padding-left: 1rem;
}

.post-content h2::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 3px;
    background: linear-gradient(135deg, #8b5cf6, #f43f5e);
    border-radius: 3px;
}

.post-content h3 {
    font-size: 1.5rem;
    font-weight: 600;
    margin: 1.5rem 0 0.75rem;
    color: #f472b6;
}

.post-content ul {
    margin: 1rem 0 1.5rem 1.5rem;
}

.post-content li {
    margin-bottom: 0.5rem;
    color: rgba(255, 255, 255, 0.8);
}

/* Related News Section */
.related-news {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 1rem;
    padding: 2rem;
    margin-bottom: 3rem;
}

.section-title {
    font-size: 1.875rem;
    font-weight: 700;
    margin-bottom: 1.5rem;
    color: white;
}

.news-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.5rem;
}

.news-card {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 0.75rem;
    padding: 1.5rem;
    transition: all 0.3s ease;
}

.news-card:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(139, 92, 246, 0.3);
    transform: translateY(-2px);
}

.news-source {
    color: #8b5cf6;
    font-size: 0.75rem;
    font-weight: 500;
    margin-bottom: 0.5rem;
}

.news-title {
    font-size: 1.125rem;
    font-weight: 600;
    margin-bottom: 0.75rem;
    line-height: 1.3;
    color: white
}

.news-description {
    color: rgba(255, 255, 255, 0.7);
    font-size: 0.875rem;
    line-height: 1.5;
    margin-bottom: 1rem;
}

.news-link {
    color: #a78bfa;
    text-decoration: none;
    font-size: 0.875rem;
    display: flex;
    align-items: center;
    gap: 0.25rem;
    transition: color 0.3s ease;
}

.news-link:hover {
    color: #f43f5e;
}

/* Recommended Posts */
.recommended-posts {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 1rem;
    padding: 2rem;
    margin-bottom: 3rem;
}

.post-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
}

.recommended-card {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 0.75rem;
    text-decoration: none;
    color: white;
    transition: all 0.3s ease;
    display: block;
}

.recommended-card:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(139, 92, 246, 0.3);
    transform: translateY(-2px);
}

.recommended-image {
    width: 100%;
    height: 150px;
    background: linear-gradient(135deg, #8b5cf6, #f43f5e);
    border-radius: 0.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    color: white;
    opacity: 0.8;
    margin-bottom: 1rem;
}

.recommended-category {
    display: inline-block;
    padding: 0.125rem 0.5rem;
    background: rgba(139, 92, 246, 0.2);
    color: #a78bfa;
    border-radius: 9999px;
    font-size: 0.625rem;
    font-weight: 500;
    margin-bottom: 0.5rem;
}

.recommended-title {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    line-height: 1.3;
}

.recommended-description {
    color: rgba(255, 255, 255, 0.7);
    font-size: 0.75rem;
    line-height: 1.4;
    padding: 0 0.75rem;
}


/* Mobile optimizations */
@media (max-width: 768px) {
    .main-content {
        padding: 2rem 1rem;
    }

    .featured-image {
        height: 250px;
    }

    .post-title {
        font-size: 2rem;
    }

    .news-grid {
        grid-template-columns: 1fr;
    }

    .post-grid {
        grid-template-columns: 1fr;
    }

    .footer {
        margin: 2rem 1rem;
        padding: 2rem 1.5rem;
    }

    .footer-links {
        gap: 1rem;
    }

    .post-meta {
        flex-wrap: wrap;
        gap: 1rem;
    }
}

/* Performance */
@media (prefers-reduced-motion: reduce) {
    * {
        transition: none !important;
        animation: none !important;
    }
}

@media (max-width: 768px) {
    .toc-section {
        position: relative;
        top: 0;
        margin-top: 1rem;
    }

    .content-wrapper {
        flex-direction: column;
        margin-top: 80px;
        /* Adjust for mobile header height */
    }

    .sidebar-toc {
        flex: 1;
        position: relative;
    }
}

/* Fix TOC positioning to account for fixed header */
/* Fix TOC positioning to account for header height */
.toc-section {
    margin-top: 4rem;
    /* Space below the fixed header */
    position: relative;
    /* Ensures proper stacking context */
    z-index: 100;
}

/* Ensure headings don't get hidden behind header */
.post-content h1,
.post-content h2,
.post-content h3,
.post-content h4,
.post-content h5,
.post-content h6 {
    scroll-margin-top: 140px;
    /* Should be header height + padding */
}

/* Fix header z-index to stay on top */
.header {
    z-index: 10000;
}

/* Optional: Add offset to main content wrapper */
.content-wrapper {
    margin-top: 2rem;
}