/* ============================================
   ARTICLE PAGES — DARK THEME
   Overrides base.css and question.css for
   article pages to match the course aesthetic.
   ============================================ */

/* ---- Page-level overrides (from base.css) ---- */

body {
    background-color: #09090B;
    color: #FAFAFA;
    font-family: 'Inter', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

header {
    background-color: #18181B;
    box-shadow: 0 1px 0 #27272A;
}

.nav-links a {
    color: #E4E4E7;
}

.nav-links a:hover {
    color: #FAFAFA;
}

main {
    max-width: 720px;
}

footer {
    background-color: #18181B;
    border-top: 1px solid #27272A;
}

.footer-section h3 {
    border-bottom-color: #3B82F6;
}

.footer-section a {
    color: #A1A1AA;
}

.footer-section a:hover {
    color: #3B82F6;
}

.footer-bottom {
    border-top-color: #27272A;
}

/* Mobile nav overlay */
@media (max-width: 768px) {
    .nav-links {
        background-color: #18181B;
    }
}


/* ---- Article content ---- */

h1, h2 {
    margin-top: 2em;
    color: #FAFAFA;
}

main p {
    color: #E4E4E7;
}

main strong {
    color: #FAFAFA;
}

main a {
    color: #3B82F6;
}

main a:hover {
    color: #60A5FA;
}

main ul, main ol {
    margin: 1em 0;
    padding-left: 2em;
}

main li {
    margin-bottom: 0.75em;
    line-height: 2;
    padding: 0.3em 0;
    min-height: 1.5em;
    color: #E4E4E7;
}

/* Display math - centered equations on their own line */
main mjx-container[display="true"] {
    margin: 1.25em 0 !important;
    font-size: 1.15em;
}

/* Formula paragraphs - standalone equations that need emphasis */
p.formula {
    text-align: center;
    margin: 1.5em 0;
    padding: 0.5em 0;
}

/* List items containing MathJax need extra height to prevent cutoff.
   Alignment is baseline, not middle: `middle` anchors the math's centre to the
   baseline + half the x-height, and since the math box is taller than the
   surrounding text it ends up hanging about half a character low. Cutoff is
   handled by the min-height/padding/overflow rules on `main ul li` below. */
main li mjx-container {
    display: inline-block;
    vertical-align: baseline;
    padding: 0.2em 0;
}

/* Extra spacing for list items with fractions or tall expressions */
main ul li, main ol li {
    min-height: 2.5em;
    padding: 0.5em 0;
    overflow: visible;
    line-height: 2.2;
}

/* Spaced list - extra room for MathJax content */
.spaced-list li {
    margin-bottom: 1em;
    padding: 0.6em 0;
    min-height: 2.8em;
    line-height: 2.4;
}

/* MathJax — force light color on dark background */
mjx-container {
    color: #FAFAFA !important;
}

mjx-container[display="true"] {
    color: #FAFAFA !important;
}


/* ---- Article-specific elements ---- */

.article_questions {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    width: fit-content;
    background: #3B82F6;
    color: #FAFAFA;
    text-decoration: none;
    padding: 0.75rem 1.75rem;
    border-radius: 8px;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s;
    margin: 2.5rem auto;
}

.article_questions:hover {
    background: #2563EB;
    color: #FAFAFA;
    transform: none;
}

.article_questions svg {
    flex-shrink: 0;
}

.article_questions.disabled {
    background: #27272A;
    color: #52525B;
    pointer-events: none;
    cursor: not-allowed;
}

.article_questions.disabled svg {
    opacity: 0.5;
}

/* Key concept box */
.key-concept {
    background: #18181B;
    border-left: 4px solid #3B82F6;
    border-radius: 0 8px 8px 0;
    padding: 1.25em 1.5em;
    margin: 1.5em 0;
}

.key-concept p {
    margin: 0;
    font-size: 1.05em;
    color: #E4E4E7;
}


/* ---- Question card overrides (from question.css) ---- */

.question-card {
    margin-top: 15px;
    background: #18181B;
    border: 1px solid #27272A;
    border-radius: 12px;
    box-shadow: none;
    padding: 1.75rem;
}

.question-card:hover {
    transform: none;
    box-shadow: none;
}

.question-image-container {
    background: #09090B;
    border: 1px solid #27272A;
    border-radius: 10px;
}

.question-image {
    box-shadow: none;
}

.question-image:hover {
    transform: none;
}

.question-text {
    background: #09090B;
    border-left: 3px solid #3B82F6;
    border-radius: 10px;
    color: #FAFAFA;
}

.question-text p {
    color: #FAFAFA;
}

.options-container {
    gap: 0.6rem;
}

.option {
    padding: 0.85rem 1rem;
    border: 1px solid #27272A;
    border-radius: 10px;
    background: #09090B;
    color: #E4E4E7;
    transition: all 0.15s;
}

.option:hover {
    border-color: #3F3F46;
    background: #18181B;
}

.option.selected {
    border-color: #3B82F6;
    background: rgba(59, 130, 246, 0.08);
}

.option.correct-answer {
    border-color: #22C55E;
    background: rgba(34, 197, 94, 0.1);
}

.option-label {
    color: #3B82F6;
    font-size: 0.8rem;
    font-weight: 700;
}

.btn {
    background: #3B82F6;
    color: #FAFAFA;
    border: none;
    border-radius: 8px;
    padding: 0.75rem 1.5rem;
    font-weight: 600;
    font-size: 0.9rem;
    box-shadow: none;
    cursor: pointer;
    transition: background 0.15s;
}

.btn:hover {
    background: #2563EB;
    transform: none;
    box-shadow: none;
}

#exitBtn {
    background: transparent;
    color: #52525B;
    border: 1px solid #27272A;
}

#exitBtn:hover {
    color: #A1A1AA;
    border-color: #3F3F46;
    background: transparent;
}

#feedback {
    border-radius: 8px;
    font-weight: 600;
    font-size: 0.9rem;
}

.feedback-correct {
    background: rgba(34, 197, 94, 0.1);
    color: #4ADE80;
    border: 1px solid rgba(34, 197, 94, 0.25);
}

.feedback-incorrect {
    background: rgba(239, 68, 68, 0.1);
    color: #F87171;
    border: 1px solid rgba(239, 68, 68, 0.25);
}

/* Progress bar (if used on article pages) */
.progress-container {
    background: #18181B;
    border: 1px solid #27272A;
    box-shadow: none;
}

.progress-info {
    color: #A1A1AA;
}

.progress-bar {
    background: #27272A;
}

.progress-value {
    background: #3B82F6;
}

.section-title h2 {
    color: #FAFAFA;
    border-bottom-color: #3B82F6;
}


/* ---- Mobile adjustments ---- */

@media (max-width: 768px) {
    .question-card {
        padding: 1.25rem;
    }

    .actions {
        flex-direction: column;
        gap: 0.75rem;
        align-items: stretch;
    }

    .btn {
        width: 100%;
        text-align: center;
    }
}
