/* ==========================================================================
   Manaazil Journal - Academic Typography & Layout Engine
   ========================================================================== */

:root {
    --academic-navy: #0f172a; /* Deep Slate/Navy */
    --academic-gold: #b45309; /* Deep Amber/Gold */
    --academic-paper: #faf9f7;
    --text-primary: #1f2937;
    --text-secondary: #4b5563;
    --text-muted: #9ca3af;
    --border-subtle: #e5e7eb;
}

body {
    background-color: var(--academic-paper);
    color: var(--text-primary);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* ==========================================================================
   Core English (LTR) Typography
   ========================================================================== */
.article-reading-container {
    font-family: 'Lora', Georgia, serif;
    font-size: 1.15rem;
    line-height: 1.85;
    max-width: 740px;
    margin: 0 auto;
    color: var(--text-primary);
}

.article-reading-container p {
    margin-bottom: 1.75rem;
}

/* Headings */
.article-reading-container h1, 
.article-reading-container h2, 
.article-reading-container h3, 
.article-reading-container h4 {
    font-family: 'Inter', system-ui, sans-serif;
    color: var(--academic-navy);
    line-height: 1.3;
    margin-top: 3rem;
    margin-bottom: 1.25rem;
    font-weight: 700;
}

.article-reading-container h2 { font-size: 1.75rem; border-bottom: 1px solid var(--border-subtle); padding-bottom: 0.5rem; }
.article-reading-container h3 { font-size: 1.5rem; }

/* Quotes & Blocks */
.article-reading-container blockquote {
    border-left: 4px solid var(--academic-gold);
    padding-left: 1.5rem;
    margin: 2rem 0;
    font-style: italic;
    color: var(--text-secondary);
    background: transparent;
}

/* ==========================================================================
   Bidirectional (RTL) Arabic Typography
   ========================================================================== */
/* The ql-direction-rtl class is injected by Quill for right-to-left blocks */
.article-reading-container .ql-direction-rtl,
.article-reading-container [dir="rtl"] {
    direction: rtl;
    text-align: right;
    font-family: 'Amiri', 'Times New Roman', serif;
    font-size: 1.4rem; /* Scaled up for Harakat legibility */
    line-height: 2.1;
    unicode-bidi: isolate; /* Prevent punctuation bleed into English */
}

/* Specific styling for Arabic blockquotes */
.article-reading-container blockquote.ql-direction-rtl,
.article-reading-container blockquote[dir="rtl"] {
    border-left: none;
    border-right: 4px solid var(--academic-gold);
    padding-left: 0;
    padding-right: 1.5rem;
}

/* ==========================================================================
   Footnotes & Citations
   ========================================================================== */
.article-reading-container sup.citation,
.article-reading-container sup.footnote-ref {
    color: var(--academic-gold);
    font-weight: 700;
    cursor: pointer;
    font-size: 0.75rem;
    line-height: 0;
    position: relative;
    vertical-align: baseline;
    top: -0.5em;
    padding: 0 0.15rem;
    transition: color 0.2s ease;
}

.article-reading-container sup.citation:hover,
.article-reading-container sup.footnote-ref:hover {
    color: var(--academic-navy);
    text-decoration: underline;
}

/* Bottom References Block generated by Quill */
.footnotes-bibliography-section {
    margin-top: 4rem;
    padding-top: 2rem;
    border-top: 1px solid var(--border-subtle);
    font-family: 'Inter', system-ui, sans-serif;
}

.footnotes-bibliography-section h3 {
    font-size: 1.25rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--academic-navy);
    margin-bottom: 1.5rem;
    font-weight: 700;
}

.footnotes-bibliography-section ol {
    font-size: 0.95rem;
    line-height: 1.6;
    color: var(--text-secondary);
    padding-left: 2rem;
}

.footnotes-bibliography-section li {
    margin-bottom: 0.75rem;
    padding-left: 0.5rem;
}

.footnotes-bibliography-section li::marker {
    color: var(--academic-gold);
    font-weight: 700;
}

/* Footer Typography Override for Theme Compatibility */
footer h2, footer h2 span {
    color: var(--brand-gold-light, #E8D8B8) !important;
}

/* ==========================================================================
   Print Stylesheet Overrides
   ========================================================================== */
@media print {
    body {
        background-color: transparent !important;
        color: #000 !important;
    }

    .article-reading-container {
        max-width: 100% !important;
        font-size: 11pt;
        line-height: 1.5;
    }

    /* Strip navigational elements and interactive anchors */
    header, footer, .no-print, a[href^="http"]:after {
        display: none !important;
    }

    /* Convert interactive footnote triggers to plain text appearance */
    .article-reading-container sup.citation,
    .article-reading-container sup.footnote-ref {
        color: #000 !important;
        text-decoration: none !important;
    }

    /* Ensure Arabic prints correctly */
    .article-reading-container [dir="rtl"] {
        font-size: 13pt; /* Maintain Arabic scale difference in print */
    }

    /* Avoid page breaks inside critical elements */
    .footnotes-bibliography-section, blockquote {
        page-break-inside: avoid;
    }
}
