/* css/components/viewer/text-content.css */

.text-content-wrapper { margin: 0 auto; padding: 40px 24px; direction: rtl; text-align: right; }
#footnotes-pane, .study-guide-content { direction: rtl; text-align: right; box-sizing: border-box; }
.footnote-number { direction: ltr; display: inline-block; }

.text-content-wrapper h1 { font-family: 'Playfair Display', serif; font-size: 38px; text-align: center; margin: 0 0 40px 0; direction: rtl; }
.text-content-wrapper p sup { font-family: 'Inter', sans-serif; color: var(--accent-blue); font-weight: 600; cursor: pointer; line-height: 0; padding: 2px 4px; border-radius: 4px; transition: background-color 0.2s, color 0.2s; }
.text-content-wrapper p sup.active { background-color: var(--accent-blue); color: white; }

#footnotes-pane p { margin-bottom: 24px; font-size: 15px; line-height: 1.6; border-radius: 6px; transition: background-color 0.2s, border-left-color 0.2s; border-left: 3px solid transparent; }
#footnotes-pane p.active { background-color: var(--accent-blue-light); }
/* #footnotes-pane p.synced-active { border-left-color: var(--accent-blue); } */

.study-guide-content { line-height: 1.7; font-size: 17px; }
.study-guide-content h2, .study-guide-content h3 { font-family: 'Playfair Display', serif; margin-top: 2em; }



/* --- NEW ADDITIONS FOR MARKDOWN STUDY GUIDE --- */

/* 
   Override the default RTL (set above) ONLY when the element has dir="ltr".
   This happens when you switch the guide language to English/Spanish/etc.
*/
.study-guide-content[dir="ltr"] {
    direction: ltr;
    text-align: left;
}

/* Ensure images fit within the side panel */
.study-guide-content img {
    max-width: 100%;
    height: auto;
    border-radius: 4px;
    margin: 1em 0;
}

/* Markdown Header Styling (Scaled down for side panel) */
.study-guide-content h1 {
    font-size: 1.5em; 
    border-bottom: 1px solid var(--border-color); 
    padding-bottom: 8px;
    margin-top: 0; /* Remove top margin for the very first title */
}

.study-guide-content h2 {
    font-size: 1.3em;
    margin-top: 1.5em;
    margin-bottom: 0.5em;
}

.study-guide-content h3 {
    font-size: 1.1em; 
    font-weight: 600;
    margin-top: 1.2em;
    margin-bottom: 0.5em;
}

/* Markdown Lists */
.study-guide-content ul, 
.study-guide-content ol {
    padding-inline-start: 24px; /* Works for both LTR and RTL */
    margin-bottom: 1em;
}

.study-guide-content li {
    margin-bottom: 0.5em;
}

/* Markdown Bold/Emphasis */
.study-guide-content strong {
    font-weight: 600;
    color: var(--primary-text);
}

.study-guide-content em {
    font-style: italic;
}

/* Markdown Blockquotes */
.study-guide-content blockquote {
    margin: 1em 0;
    padding-inline-start: 16px;
    border-inline-start: 4px solid var(--accent-blue);
    color: var(--secondary-text);
    font-style: italic;
    background-color: var(--background-color);
    padding: 12px;
    border-radius: 4px;
}

/* Markdown Links */
.study-guide-content a {
    color: var(--accent-blue);
    text-decoration: underline;
    text-underline-offset: 2px;
}