/* ========================================
   COMPREHENSIVE ARTICLE LAYOUT FIXES
   Memperbaiki masalah margin, navbar, dan footer
   ======================================== */

/* ========================================
   NAVBAR IMPROVEMENTS - Fixed Background
   ======================================== */

/* Enhanced navbar with solid background to prevent text overlap */
.glass-effect {
    background: rgba(255, 255, 255, 0.98) !important;
    backdrop-filter: blur(20px) !important;
    -webkit-backdrop-filter: blur(20px) !important;
    border-bottom: 1px solid rgba(0, 0, 0, 0.1) !important;
    box-shadow: 0 2px 20px rgba(0, 0, 0, 0.15) !important;
    z-index: 1000 !important;
    transition: all 0.3s ease !important;
}

.dark .glass-effect {
    background: rgba(17, 24, 39, 0.98) !important;
    border-bottom: 1px solid rgba(255, 255, 255, 0.2) !important;
    box-shadow: 0 2px 20px rgba(0, 0, 0, 0.4) !important;
}

/* Ensure navbar never overlaps with content */
header {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    z-index: 1000 !important;
    min-height: 72px !important;
}

/* Add sufficient padding to prevent content overlap */
main {
    padding-top: 90px !important;
}

/* ========================================
   ARTICLE CONTAINER MARGIN FIXES
   ======================================== */

/* Enhanced container with proper margins and responsive design */
.blog-article-container {
    width: 100% !important;
    max-width: 1200px !important;
    margin: 0 auto !important;
    padding: 2rem 1rem !important;
    box-sizing: border-box !important;
}

/* Progressive enhancement for larger screens */
@media (min-width: 640px) {
    .blog-article-container {
        padding: 2.5rem 2rem !important;
    }
}

@media (min-width: 768px) {
    .blog-article-container {
        padding: 3rem 3rem !important;
    }
}

@media (min-width: 1024px) {
    .blog-article-container {
        padding: 4rem 4rem !important;
    }
}

@media (min-width: 1280px) {
    .blog-article-container {
        padding: 4rem 5rem !important;
    }
}

/* ========================================
   ARTICLE GRID IMPROVEMENTS
   ======================================== */

.article-grid {
    display: grid !important;
    grid-template-columns: 1fr !important;
    gap: 2rem !important;
    width: 100% !important;
    max-width: 100% !important;
    margin: 0 auto !important;
}

@media (min-width: 768px) {
    .article-grid {
        grid-template-columns: 1fr 320px !important;
        gap: 3rem !important;
    }
}

@media (min-width: 1024px) {
    .article-grid {
        gap: 4rem !important;
    }
}

/* ========================================
   ARTICLE CONTENT SPACING ENHANCEMENTS
   ======================================== */

.article-content {
    width: 100% !important;
    max-width: 100% !important;
    padding: 1.5rem 0 !important;
    margin: 0 !important;
    overflow-x: hidden !important;
    box-sizing: border-box !important;
    word-wrap: break-word !important;
    overflow-wrap: break-word !important;
    hyphens: auto !important;
    line-height: 1.7 !important;
}

/* Enhanced spacing for all content elements */
.article-content p {
    margin: 1.75rem 0 !important;
    padding: 0 0.5rem !important;
    line-height: 1.8 !important;
    text-align: justify !important;
}

.article-content h1, 
.article-content h2, 
.article-content h3, 
.article-content h4, 
.article-content h5, 
.article-content h6 {
    margin: 2.5rem 0 1.5rem 0 !important;
    padding: 0 0.5rem !important;
    line-height: 1.3 !important;
}

.article-content h1 {
    margin-top: 1rem !important;
}

.article-content ul, 
.article-content ol {
    margin: 2rem 0 !important;
    padding-left: 2rem !important;
    padding-right: 0.5rem !important;
}

.article-content li {
    margin: 0.75rem 0 !important;
    line-height: 1.6 !important;
}

.article-content blockquote {
    margin: 2.5rem 0 !important;
    padding: 1.5rem !important;
    border-left: 4px solid #2dd4bf !important;
    background: rgba(45, 212, 191, 0.05) !important;
    border-radius: 0 0.5rem 0.5rem 0 !important;
}

.dark .article-content blockquote {
    background: rgba(45, 212, 191, 0.1) !important;
}

/* Enhanced pre and code blocks */
.article-content pre {
    margin: 2.5rem 0 !important;
    padding: 1.5rem !important;
    border-radius: 0.75rem !important;
    overflow-x: auto !important;
    font-size: 0.875rem !important;
    line-height: 1.6 !important;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15) !important;
}

.article-content code {
    padding: 0.2rem 0.4rem !important;
    border-radius: 0.3rem !important;
    font-size: 0.875rem !important;
}

/* ========================================
   FOOTER SPACING IMPROVEMENTS
   ======================================== */

/* Add significant margin between article content and footer */
.blog-article-footer-spacing {
    margin-top: 6rem !important;
    padding-top: 4rem !important;
    position: relative !important;
}

/* Add a subtle separator before footer */
.blog-article-footer-spacing::before {
    content: '';
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 100px;
    height: 2px;
    background: linear-gradient(to right, transparent, #2dd4bf, transparent);
}

/* FOOTER OPTIMIZATION - PROPORSIONAL & SIMETRIS */
footer .blog-article-container {
    padding: 2.5rem 2rem !important; /* Ratio 5:4 - proporsional dan simetris */
    max-width: 1000px !important; /* Optimal width untuk readability */
}

@media (min-width: 640px) {
    footer .blog-article-container {
        padding: 2.5rem 3rem !important; /* Ratio 5:6 - simetris untuk small screens */
    }
}

@media (min-width: 768px) {
    footer .blog-article-container {
        padding: 3rem 4rem !important; /* Ratio 3:4 - golden ratio proporsional */
    }
}

@media (min-width: 1024px) {
    footer .blog-article-container {
        padding: 3rem 5rem !important; /* Ratio 3:5 - optimal untuk desktop */
    }
}

/* GRID OPTIMIZATION - SIMETRIS & PROPORSIONAL */
footer .grid {
    gap: 1.5rem !important; /* Proporsional spacing antar kolom */
}

@media (min-width: 768px) {
    footer .grid {
        gap: 2rem !important; /* Simetris untuk tablet/desktop */
    }
}

/* TYPOGRAPHY SPACING - KONSISTEN & PROPORSIONAL */
footer h3 {
    margin-bottom: 1rem !important; /* Konsisten dengan design system */
    line-height: 1.4 !important; /* Optimal readability */
}

footer p {
    margin-bottom: 1rem !important; /* Simetris dengan heading */
    line-height: 1.6 !important; /* Golden ratio untuk paragraph */
}

footer ul {
    margin: 0 !important; /* Reset margin untuk alignment yang sempurna */
}

footer li {
    margin-bottom: 0.5rem !important; /* Proporsional list spacing */
    line-height: 1.5 !important; /* Optimal untuk links */
}

footer li:last-child {
    margin-bottom: 0 !important; /* Eliminasi margin terakhir untuk simetri */
}

/* CREDIT SECTION - PROPORSIONAL DENGAN BAGIAN ATAS */
footer .border-t {
    margin-top: 2rem !important; /* Simetris dengan gap grid */
    padding-top: 1.5rem !important; /* Golden ratio dengan margin */
    padding-bottom: 0.5rem !important; /* Minimal untuk keseimbangan */
}

/* SOCIAL ICONS - PERFECT ALIGNMENT */
footer .flex.space-x-3 {
    margin-top: 0.5rem !important; /* Fine-tuning alignment */
}

/* ========================================
   SIDEBAR/TABLE OF CONTENTS IMPROVEMENTS
   ======================================== */

.table-of-contents {
    background: rgba(240, 253, 250, 0.8) !important;
    border: 1px solid rgba(167, 243, 208, 0.6) !important;
    backdrop-filter: blur(10px) !important;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05) !important;
    border-radius: 1rem !important;
    padding: 1.5rem !important;
}

.dark .table-of-contents {
    background: rgba(15, 32, 39, 0.8) !important;
    border: 1px solid rgba(45, 212, 191, 0.3) !important;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2) !important;
}

/* ========================================
   RESPONSIVE MOBILE OPTIMIZATIONS
   ======================================== */

@media (max-width: 767px) {
    /* Mobile-specific adjustments */
    .blog-article-container {
        padding: 1.5rem 1rem !important;
    }
    
    .article-content p {
        padding: 0 0.25rem !important;
        font-size: 1rem !important;
        line-height: 1.7 !important;
    }
    
    .article-content h1, 
    .article-content h2, 
    .article-content h3, 
    .article-content h4 {
        padding: 0 0.25rem !important;
        margin: 2rem 0 1rem 0 !important;
    }
    
    .article-content ul, 
    .article-content ol {
        padding-left: 1.5rem !important;
        padding-right: 0.25rem !important;
    }
    
    .blog-article-footer-spacing {
        margin-top: 4rem !important;
        padding-top: 3rem !important;
    }
    
    footer .blog-article-container {
        padding: 2rem 1rem !important;
    }
}

/* ========================================
   ENHANCED VISUAL IMPROVEMENTS
   ======================================== */

/* Add subtle animations and improvements */
.article-content {
    animation: fadeInContent 0.8s ease-out;
}

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

/* Improve reading experience */
.article-content {
    text-rendering: optimizeLegibility !important;
    -webkit-font-smoothing: antialiased !important;
    -moz-osx-font-smoothing: grayscale !important;
}

/* Enhanced focus styles for accessibility */
.article-content a:focus,
.table-of-contents a:focus {
    outline: 2px solid #2dd4bf !important;
    outline-offset: 2px !important;
    border-radius: 0.25rem !important;
}

/* Smooth scroll behavior */
html {
    scroll-behavior: smooth !important;
}

/* Improve contrast for better readability */
.article-content p {
    color: #374151 !important;
}

.dark .article-content p {
    color: #e5e7eb !important;
}

/* Better spacing for images */
.article-content img,
.article-content figure {
    margin: 3rem auto !important;
    border-radius: 0.75rem !important;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1) !important;
    max-width: 100% !important;
    height: auto !important;
}

.dark .article-content img,
.dark .article-content figure {
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3) !important;
}
