/* ==========================================================
   USTAD (ustadpk.com) - Modern Educational Design System
   Tailwind-Powered Utility Typography & Urdu Nastaliq Engine
   Developed by Muhammad Asim
   ========================================================== */

:root {
    --brand-primary: #1e3a8a;
    --brand-accent: #059669;
    --brand-gold: #d97706;
    --brand-dark: #0f172a;
    --font-en: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    --font-urdu: 'Noto Nastaliq Urdu', 'Jameel Noori Nastaleeq', 'Gulzar', 'Noto Sans Arabic', Tahoma, serif;
}

body {
    font-family: var(--font-en);
    background-color: #f8fafc;
    color: #1e293b;
    -webkit-font-smoothing: antialiased;
}

/* ==========================================================
   URDU TYPOGRAPHY & RTL STYLING
   ========================================================== */
.urdu,
.nastaliq,
[lang="ur"],
.urdu-content {
    font-family: var(--font-urdu) !important;
    direction: rtl;
    text-align: right;
    line-height: 2.3 !important;
    font-size: 1.15rem;
}

[lang="ur"], [dir="rtl"] {
    font-family: var(--font-urdu);
    unicode-bidi: plaintext;
}

.post-content [lang="ur"],
.post-content .urdu-content {
    direction: rtl;
    text-align: right;
    line-height: 2.35;
}

.urdu-title {
    font-family: var(--font-urdu) !important;
    direction: rtl;
    line-height: 2.0 !important;
    font-weight: 700;
}

.urdu-heading {
    font-family: var(--font-urdu) !important;
    direction: rtl;
    line-height: 2.1 !important;
    font-weight: 700;
    border-right: 4px solid #059669;
    padding-right: 12px;
}

/* Reading Progress Bar */
#reading-progress {
    position: fixed;
    top: 0;
    left: 0;
    height: 3.5px;
    background: linear-gradient(90deg, #2563eb, #059669, #f59e0b);
    width: 0%;
    z-index: 9999;
    transition: width 0.1s ease-out;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}
::-webkit-scrollbar-track {
    background: #f1f5f9;
}
::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

/* KaTeX Formula Display */
.katex-display {
    overflow-x: auto;
    overflow-y: hidden;
    padding: 12px 16px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    margin: 16px 0;
}

/* Single Post Content Styling */
.post-content {
    color: #334155;
    font-size: 1.0625rem;
    line-height: 1.85;
}
.post-content h1, 
.post-content h2, 
.post-content h3, 
.post-content h4 {
    color: #0f172a;
    font-weight: 700;
    margin-top: 1.75rem;
    margin-bottom: 0.85rem;
    line-height: 1.4;
}
.post-content h1 { font-size: 1.75rem; }
.post-content h2 { font-size: 1.45rem; border-bottom: 2px solid #e2e8f0; padding-bottom: 0.4rem; }
.post-content h3 { font-size: 1.25rem; }
.post-content h4 { font-size: 1.1rem; }
.post-content p { margin-bottom: 1.25rem; }
.post-content ul, .post-content ol { margin-bottom: 1.25rem; padding-left: 1.5rem; }
.post-content li { margin-bottom: 0.4rem; }
.post-content img { border-radius: 12px; max-width: 100%; height: auto; margin: 1.5rem auto; box-shadow: 0 4px 12px rgba(0,0,0,0.06); }
.post-content table { width: 100%; border-collapse: collapse; margin: 1.5rem 0; font-size: 0.95rem; }
.post-content table th, .post-content table td { border: 1px solid #e2e8f0; padding: 10px 14px; text-align: left; }
.post-content table th { background: #f1f5f9; font-weight: 700; color: #0f172a; }
.post-content blockquote { border-left: 4px solid #3b82f6; background: #eff6ff; padding: 12px 18px; margin: 1.5rem 0; border-radius: 0 8px 8px 0; font-style: italic; }

/* Print Media Optimization */
@media print {
    .no-print, header, nav, footer, .sidebar, #reading-progress, .btn, form {
        display: none !important;
    }
    body {
        background: #ffffff !important;
        color: #000000 !important;
    }
    .print-card {
        border: none !important;
        box-shadow: none !important;
        padding: 0 !important;
    }
}
