/**
 * ExamUttoron Editorial & Reading Design System
 * Clean, distraction-free reading experience inspired by LearnCBSE & Medium
 * Color Theme: Crisp White & Royal Blue (#1d4ed8) with Slate typography
 */

.ej-page {
    --ej-ink: #0f172a;
    --ej-muted: #64748b;
    --ej-blue: #1d4ed8;
    --ej-blue-dark: #1e40af;
    --ej-blue-light: #eff6ff;
    --ej-line: #e2e8f0;
    --ej-paper: #ffffff;
    --ej-bg: #f8fafc;
    color: var(--ej-ink);
    max-width: 1240px;
    padding-top: 24px;
    padding-bottom: 72px;
}

.ej-page a {
    color: inherit;
    text-decoration: none;
    transition: color 0.15s ease;
}

.ej-page a:hover {
    color: var(--ej-blue);
}

.ej-page :is(a, button, input, summary):focus-visible {
    outline: 3px solid var(--ej-blue);
    outline-offset: 4px;
}

.ej-page button {
    font: inherit;
}

.ej-page [hidden] {
    display: none !important;
}

/* Breadcrumb */
.ej-breadcrumb {
    display: flex;
    gap: 10px;
    align-items: center;
    font-size: 13px;
    font-weight: 500;
    color: var(--ej-muted);
    margin-bottom: 24px;
}

.ej-breadcrumb a:hover {
    color: var(--ej-blue);
}

.ej-breadcrumb [aria-current] {
    color: var(--ej-ink);
    font-weight: 600;
}

/* Eyebrows & Tags */
.ej-eyebrow {
    font-size: 12px;
    font-weight: 750;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--ej-blue);
    margin: 0 0 12px;
    line-height: 1.5;
}

.ej-dot {
    width: 6px;
    height: 6px;
    background: var(--ej-blue);
    border-radius: 50%;
    display: inline-block;
    margin-right: 6px;
}

/* Header for Index/Archive */
.ej-index-header {
    display: flex;
    justify-content: space-between;
    gap: 40px;
    align-items: center;
    padding: 10px 0 32px;
}

.ej-index-header h1 {
    font-size: clamp(34px, 4.2vw, 48px);
    font-weight: 800;
    line-height: 1.15;
    letter-spacing: -0.035em;
    margin: 0 0 12px;
    color: var(--ej-ink);
}

.ej-index-header h1 span {
    color: var(--ej-blue);
}

.ej-header-description {
    font-size: 15px;
    line-height: 1.7;
    color: var(--ej-muted);
    margin: 0;
}

.ej-header-side {
    padding: 16px 24px 16px 28px;
    border-left: 1px solid var(--ej-line);
}

.ej-header-symbol {
    display: inline-flex;
    font-size: 32px;
    color: var(--ej-blue);
    margin-bottom: 10px;
}

.ej-header-side p {
    font-size: 18px;
    line-height: 1.4;
    font-weight: 600;
    margin-bottom: 14px;
    color: var(--ej-ink);
}

.ej-header-side a {
    font-size: 13px;
    font-weight: 650;
    color: var(--ej-blue);
    display: flex;
    gap: 8px;
    align-items: center;
}

/* Search Box */
.ej-discovery {
    padding: 0 0 24px;
}

.ej-search {
    display: flex;
    align-items: center;
    gap: 12px;
    background: #ffffff;
    border: 1.5px solid var(--ej-line);
    border-radius: 10px;
    padding: 6px 6px 6px 16px;
    min-height: 52px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.03);
    transition: all 0.2s ease;
}

.ej-search:focus-within {
    border-color: var(--ej-blue);
    box-shadow: 0 0 0 3px rgba(29, 78, 216, 0.12);
}

.ej-search > i {
    color: #94a3b8;
    font-size: 16px;
}

.ej-search input {
    width: 100%;
    min-width: 0;
    border: 0;
    background: transparent;
    padding: 6px 0;
    color: var(--ej-ink);
    font-size: 15px;
    outline: none;
}

.ej-search button {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    border: 0;
    border-radius: 8px;
    padding: 9px 18px;
    background: var(--ej-blue);
    color: #ffffff;
    font-size: 14px;
    font-weight: 650;
    cursor: pointer;
    transition: background 0.15s ease;
}

.ej-search button:hover {
    background: var(--ej-blue-dark);
}

/* Category Filter Strip */
.ej-filter-strip {
    display: flex;
    align-items: center;
    gap: 8px;
    overflow-x: auto;
    padding: 16px 0 6px;
    scrollbar-width: thin;
    scroll-behavior: smooth;
    -webkit-overflow-scrolling: touch;
}

.ej-filter-strip a {
    flex-shrink: 0;
    display: inline-flex;
    gap: 8px;
    align-items: center;
    font-size: 13px;
    font-weight: 600;
    border: 1px solid var(--ej-line);
    background: #ffffff;
    padding: 7px 14px;
    border-radius: 20px;
    white-space: nowrap;
    color: #475569;
    transition: all 0.15s ease;
}

.ej-filter-strip a:hover {
    background: var(--ej-blue-light);
    border-color: #bfdbfe;
    color: var(--ej-blue);
    transform: translateY(-1px);
}

.ej-filter-strip a[aria-current] {
    background: var(--ej-blue) !important;
    color: #ffffff !important;
    border-color: var(--ej-blue) !important;
    box-shadow: 0 2px 6px rgba(29, 78, 216, 0.25) !important;
}

.ej-filter-strip a span {
    background: rgba(0, 0, 0, 0.05);
    padding: 1px 6px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 700;
}

.ej-filter-strip a[aria-current] span {
    background: rgba(255, 255, 255, 0.25);
    color: #ffffff;
}

/* Section Headings */
.ej-section-heading {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    gap: 20px;
    margin-bottom: 22px;
}

.ej-section-heading .ej-eyebrow {
    margin-bottom: 6px;
}

.ej-section-heading h2 {
    font-size: 24px;
    font-weight: 750;
    letter-spacing: -0.025em;
    margin: 0;
    color: var(--ej-ink);
}

.ej-results-count {
    font-size: 13px;
    color: var(--ej-muted);
}

/* Clean 3-Column / 4-Column Card Grid */
.ej-card-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 22px;
}

.ej-story-card {
    background: #ffffff;
    border: 1px solid var(--ej-line);
    border-radius: 12px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.03);
    transition: all 0.2s ease;
}

.ej-story-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 22px rgba(0, 0, 0, 0.06);
    border-color: #cbd5e1;
}

.ej-card-art {
    aspect-ratio: 16 / 9;
    height: auto;
    position: relative;
    overflow: hidden;
    background: #f1f5f9;
}

.ej-card-art > img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.25s ease;
}

.ej-story-card:hover .ej-card-art > img {
    transform: scale(1.02);
}

.ej-card-body {
    padding: 18px 20px 14px;
    display: flex;
    flex-direction: column;
    flex: 1;
}

.ej-card-category {
    font-size: 12px;
    color: var(--ej-blue);
    font-weight: 700;
    letter-spacing: 0.03em;
    margin-bottom: 8px;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.ej-card-body h3 {
    font-size: 17px;
    line-height: 1.45;
    letter-spacing: -0.02em;
    font-weight: 750;
    margin: 0 0 10px;
    color: var(--ej-ink);
}

.ej-card-body h3 a {
    color: var(--ej-ink);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.ej-card-body h3 a:hover {
    color: var(--ej-blue);
}

.ej-card-body > p {
    font-size: 13px;
    line-height: 1.65;
    color: var(--ej-muted);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    margin-bottom: 14px;
}

.ej-card-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    margin-top: auto;
    padding-top: 12px;
    border-top: 1px solid #f1f5f9;
    font-size: 12px;
    color: var(--ej-muted);
}

.ej-card-footer a {
    color: var(--ej-blue);
    font-weight: 650;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

/* =============================================================
   2. READING ROOM (SINGLE ARTICLE VIEW)
   ============================================================= */
.ej-reading-progress {
    height: 3px;
    position: fixed;
    inset: 0 0 auto;
    z-index: 1100;
    pointer-events: none;
}

.ej-reading-progress span {
    display: block;
    height: 100%;
    background: var(--ej-blue);
    width: 0;
    transition: width 0.1s linear;
}

.ej-article-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 280px;
    gap: 36px;
    align-items: start;
}

.ej-article {
    min-width: 0;
    background: #ffffff;
    border: 1px solid var(--ej-line);
    border-radius: 14px;
    padding: 36px 42px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.03);
}

.ej-article-labels {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
}

.ej-article-header h1 {
    font-size: clamp(28px, 3.2vw, 40px);
    line-height: 1.25;
    font-weight: 800;
    letter-spacing: -0.03em;
    color: var(--ej-ink);
    margin: 0 0 22px;
}

.ej-article-byline {
    display: flex;
    align-items: center;
    gap: 12px;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--ej-line);
    margin-bottom: 24px;
}

.ej-author-avatar {
    width: 42px;
    height: 42px;
    background: var(--ej-blue-light);
    border: 1px solid #bfdbfe;
    display: grid;
    place-items: center;
    font-size: 16px;
    color: var(--ej-blue);
    border-radius: 50%;
    font-weight: 750;
    flex-shrink: 0;
}

.ej-article-byline strong {
    font-size: 14px;
    display: block;
    font-weight: 700;
    color: var(--ej-ink);
}

.ej-article-byline .ej-meta {
    font-size: 12px;
    color: var(--ej-muted);
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 2px;
}

.ej-article-cover {
    margin: 0 0 28px;
    background: #f8fafc;
    border-radius: 10px;
    overflow: hidden;
    border: 1px solid var(--ej-line);
}

.ej-article-cover img {
    display: block;
    width: 100%;
    max-height: 460px;
    object-fit: cover;
}

/* Takeaway / Quick Note */
.ej-takeaway {
    padding: 18px 22px;
    background: var(--ej-blue-light);
    border: 1px solid #dbeafe;
    border-left: 4px solid var(--ej-blue);
    border-radius: 0 10px 10px 0;
    margin-bottom: 28px;
}

.ej-takeaway .ej-eyebrow {
    margin-bottom: 6px;
    font-size: 12px;
}

.ej-takeaway > p:last-child {
    font-size: 14px;
    line-height: 1.75;
    color: #1e3a8a;
    margin: 0;
}

/* =============================================================
   3. PROSE (MEDIUM-STYLE READING TYPOGRAPHY)
   ============================================================= */
.ej-prose {
    font-size: 18px;
    line-height: 1.85;
    letter-spacing: -0.008em;
    color: #334155;
    overflow-wrap: anywhere;
}

.ej-prose :is(h1, h2, h3, h4) {
    color: var(--ej-ink);
    font-weight: 750;
    letter-spacing: -0.025em;
    scroll-margin-top: 90px;
}

.ej-prose h2 {
    font-size: 1.5rem;
    margin: 2.2rem 0 1rem;
    line-height: 1.35;
    border-left: 4px solid var(--ej-blue);
    padding-left: 14px;
}

.ej-prose h3 {
    font-size: 1.25rem;
    margin: 1.8rem 0 0.8rem;
    line-height: 1.4;
}

.ej-prose p {
    margin: 0 0 1.4rem;
}

.ej-prose :is(ul, ol) {
    padding-left: 1.5em;
    margin-bottom: 1.4em;
}

.ej-prose li {
    margin-bottom: 0.5em;
    line-height: 1.8;
}

.ej-prose li::marker {
    color: var(--ej-blue);
}

.ej-prose a {
    color: var(--ej-blue);
    text-decoration: underline;
    text-underline-offset: 3px;
    font-weight: 500;
}

.ej-prose a:hover {
    color: var(--ej-blue-dark);
}

.ej-prose img {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    margin: 1.5em 0;
    border: 1px solid var(--ej-line);
}

.ej-prose blockquote {
    padding: 18px 24px;
    border-left: 4px solid var(--ej-blue);
    background: #f8fafc;
    color: #334155;
    margin: 1.8em 0;
    border-radius: 0 8px 8px 0;
    font-style: italic;
}

.ej-prose table {
    display: table;
    width: 100%;
    max-width: 100%;
    overflow-x: auto;
    border-collapse: collapse;
    font-size: 0.95em;
    margin: 1.6em 0;
    border-radius: 8px;
    border: 1px solid var(--ej-line);
}

.ej-prose :is(th, td) {
    border: 1px solid var(--ej-line);
    padding: 12px 16px;
    min-width: 120px;
}

.ej-prose th {
    background: #f1f5f9;
    color: var(--ej-ink);
    font-weight: 700;
}

/* =============================================================
   4. STRUCTURED STUDY COMPONENTS (Q&A, FORMULAS, PDF, TIPS, COMMUNITY)
   ============================================================= */
.ut-qa-box {
    background: #ffffff;
    border: 1px solid var(--ej-line);
    border-left: 4px solid var(--ej-blue);
    border-radius: 10px;
    padding: 18px 20px;
    margin: 22px 0;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.03);
}

.ut-qa-box:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

.ut-qa-q {
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--ej-ink);
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
    margin-bottom: 12px;
    line-height: 1.5;
}

.ut-qa-badge {
    background: var(--ej-blue);
    color: #ffffff;
    font-size: 0.75rem;
    font-weight: 800;
    padding: 3px 8px;
    border-radius: 5px;
    letter-spacing: 0.03em;
    flex-shrink: 0;
}

.ut-qa-marks {
    margin-left: auto;
    background: #f1f5f9;
    color: #475569;
    border: 1px solid #cbd5e1;
    font-size: 0.75rem;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 12px;
}

.ut-qa-a {
    background: #f8fafc;
    border-radius: 8px;
    padding: 14px 16px;
    font-size: 1rem;
    line-height: 1.8;
    color: #334155;
    border: 1px solid #edf2f7;
}

/* Formula Box */
.ut-formula-box {
    background: #eff6ff;
    border: 1px solid #bfdbfe;
    border-left: 4px solid var(--ej-blue);
    border-radius: 10px;
    padding: 20px 22px;
    margin: 22px 0;
}

.ut-formula-title {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 0.95rem;
    font-weight: 800;
    color: #1e40af;
    letter-spacing: 0.03em;
    margin-bottom: 10px;
}

.ut-formula-math {
    background: #ffffff;
    border: 1px dashed #93c5fd;
    border-radius: 8px;
    padding: 14px 18px;
    margin: 10px 0;
    text-align: center;
    font-size: 1.25rem;
    color: var(--ej-ink);
    overflow-x: auto;
}

.ut-formula-desc {
    font-size: 0.92rem;
    color: #475569;
    margin-top: 8px;
    line-height: 1.6;
}

/* PDF Card */
.ut-pdf-card {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    background: #fff1f2;
    border: 1px solid #fecdd3;
    border-left: 4px solid #e11d48;
    border-radius: 10px;
    padding: 18px 22px;
    margin: 24px 0;
}

.ut-pdf-info {
    display: flex;
    align-items: center;
    gap: 14px;
}

.ut-pdf-info i {
    font-size: 2.2rem;
    color: #e11d48;
    flex-shrink: 0;
}

.ut-pdf-info strong {
    display: block;
    font-size: 1rem;
    color: #881337;
    margin-bottom: 2px;
}

.ut-pdf-info small {
    display: block;
    color: #9f1239;
    font-size: 0.85rem;
}

.ut-pdf-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: #e11d48;
    color: #ffffff !important;
    font-weight: 700;
    font-size: 0.9rem;
    padding: 10px 20px;
    border-radius: 25px;
    text-decoration: none !important;
    transition: background 0.15s ease;
}

.ut-pdf-btn:hover {
    background: #be123c;
}

/* Exam Tip */
.ut-exam-tip {
    background: #fffbeb;
    border: 1px solid #fde68a;
    border-left: 4px solid #d97706;
    border-radius: 10px;
    padding: 16px 20px;
    margin: 20px 0;
}

.ut-exam-tip-title {
    font-size: 0.95rem;
    font-weight: 800;
    color: #b45309;
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 6px;
}

.ut-exam-tip p {
    margin: 0;
    font-size: 0.95rem;
    color: #78350f;
    line-height: 1.65;
}

/* Blueprint Table */
.ut-table-wrapper {
    overflow-x: auto;
    margin: 22px 0;
    border-radius: 10px;
    border: 1px solid var(--ej-line);
}

.ut-blueprint-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.95rem;
    text-align: left;
    margin: 0 !important;
}

.ut-blueprint-table th {
    background: #f1f5f9;
    color: var(--ej-ink);
    font-weight: 700;
    padding: 12px 16px;
    border-bottom: 2px solid #cbd5e1;
}

.ut-blueprint-table td {
    padding: 12px 16px;
    border-bottom: 1px solid var(--ej-line);
    color: #334155;
}

.ut-blueprint-table tr:hover td {
    background: #f8fafc;
}

/* Community Join Box */
.ut-community-box {
    background: #0f172a;
    color: #ffffff;
    border-radius: 12px;
    padding: 20px 24px;
    margin: 28px 0;
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
}

.ut-community-box h4 {
    color: #ffffff;
    font-size: 1.1rem;
    font-weight: 750;
    margin-bottom: 4px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.ut-community-box p {
    color: #94a3b8;
    font-size: 0.9rem;
    margin: 0;
}

.ut-community-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.ut-btn-telegram {
    background: #0088cc;
    color: #ffffff !important;
    padding: 9px 18px;
    border-radius: 20px;
    font-weight: 700;
    font-size: 0.9rem;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.ut-btn-whatsapp {
    background: #25d366;
    color: #ffffff !important;
    padding: 9px 18px;
    border-radius: 20px;
    font-weight: 700;
    font-size: 0.9rem;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

/* =============================================================
   5. SIDEBAR (TOC & RELATED)
   ============================================================= */
.ej-sidebar-sticky {
    position: sticky;
    top: 85px;
}

.ej-toc {
    border: 1px solid var(--ej-line);
    border-radius: 12px;
    padding: 20px 22px;
    background: #ffffff;
}

.ej-toc h2 {
    font-size: 16px;
    font-weight: 750;
    letter-spacing: -0.02em;
    margin: 0 0 14px;
    color: var(--ej-ink);
}

.ej-toc ol {
    list-style: none;
    margin: 0;
    padding: 0;
    max-height: 320px;
    overflow-y: auto;
}

.ej-toc a {
    font-size: 13px;
    line-height: 1.5;
    display: block;
    padding: 7px 10px;
    border-left: 2px solid #e2e8f0;
    color: var(--ej-muted);
    transition: all 0.15s ease;
}

.ej-toc a:hover,
.ej-toc a[aria-current] {
    color: var(--ej-blue);
    background: var(--ej-blue-light);
    border-left-color: var(--ej-blue);
    font-weight: 600;
}

/* Responsive */
@media (max-width: 991px) {
    .ej-article-layout {
        grid-template-columns: minmax(0, 1fr);
    }
    .ej-reader-sidebar {
        display: none;
    }
    .ej-card-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 767px) {
    .ej-article {
        padding: 22px 18px;
    }
    .ej-prose {
        font-size: 16px;
    }
    .ej-card-grid {
        grid-template-columns: 1fr;
    }
}

/* =============================================================
   5. CODE BLOCK CARD (Syntax Styling & 1-Click Copy)
   ============================================================= */
.we-code-card {
    position: relative;
    background: #0f172a;
    color: #e2e8f0;
    border-radius: 12px;
    margin: 1.8rem 0;
    border: 1px solid #334155;
    box-shadow: 0 4px 16px rgba(15, 23, 42, 0.15);
    overflow: hidden;
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
    font-size: 0.92rem;
    line-height: 1.65;
}

.we-code-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 14px;
    background: #1e293b;
    border-bottom: 1px solid #334155;
    user-select: none;
}

.we-code-dots {
    display: flex;
    gap: 6px;
    align-items: center;
}

.we-code-dots span {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    display: inline-block;
}

.we-code-dots .dot-red { background: #ef4444; }
.we-code-dots .dot-yellow { background: #f59e0b; }
.we-code-dots .dot-green { background: #10b981; }

.we-code-lang {
    font-size: 0.72rem;
    font-weight: 800;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: #94a3b8;
    background: rgba(255, 255, 255, 0.08);
    padding: 2px 8px;
    border-radius: 4px;
}

.we-code-copy-btn {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.15);
    color: #f1f5f9;
    font-size: 0.75rem;
    font-weight: 600;
    padding: 4px 10px;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s;
}

.we-code-copy-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    color: #ffffff;
}

.we-code-copy-btn.copied {
    background: #10b981;
    color: #ffffff;
    border-color: #10b981;
}

.we-code-card pre {
    margin: 0 !important;
    padding: 16px 18px !important;
    overflow-x: auto;
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
    color: inherit !important;
}

.we-code-card code {
    color: inherit !important;
    font-family: inherit !important;
    background: transparent !important;
    border: none !important;
    padding: 0 !important;
}

/* Inline Code */
.ej-prose :not(pre) > code {
    background: #f1f5f9;
    color: #be185d;
    padding: 2px 6px;
    border-radius: 6px;
    font-size: 0.88em;
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
    border: 1px solid #e2e8f0;
}

/* =============================================================
   6. IN-ARTICLE AD SLIDE & PROMOTION CAROUSEL
   ============================================================= */
.in-article-ad-slide {
    margin: 2.2rem 0;
}

.in-article-ad-slide .in-article-swiper {
    width: 100%;
}

.in-article-ad-slide .swiper-pagination-bullet {
    background: #1d4ed8;
    opacity: 0.3;
}

.in-article-ad-slide .swiper-pagination-bullet-active {
    opacity: 1;
    width: 18px;
    border-radius: 8px;
}

/* =============================================================
   7. PROFESSIONAL PRINT & PDF CONVERSION ENGINE
   Only the article is printed. Non-article elements hidden.
   Watermark behind text, official header & footer included.
   ============================================================= */
.print-only-header,
.print-only-footer,
.print-watermark {
    display: none;
}

@media print {
    /* 1. Page margin and orientation */
    @page {
        margin: 1.5cm 1.5cm 2cm 1.5cm;
        size: A4 portrait;
    }

    /* 2. Hide ALL non-article website chrome */
    header, footer, nav, aside,
    .ut-header, .site-header, .site-footer, .we-footer, .we-contest-banner,
    .ut-desktop-nav, .ut-mobile-nav, .ej-breadcrumb, .breadcrumb,
    .ej-reader-sidebar, .ej-reader-tools, .ej-reading-progress,
    .ej-share-links, .ut-community-box, .ej-takeaway, .ej-toc,
    .ej-tags, .ej-article-footer, .ej-related, .in-article-ad-slide,
    .btn, button, .ej-icon-button, .card-footer,
    .alert, .modal {
        display: none !important;
    }

    /* 3. Full-width clean container */
    body, .ej-page, .ej-reader-page, .container, .ej-article-layout, .ej-article {
        display: block !important;
        width: 100% !important;
        max-width: 100% !important;
        margin: 0 !important;
        padding: 0 !important;
        border: none !important;
        box-shadow: none !important;
        background: #ffffff !important;
        color: #000000 !important;
    }

    /* 4. Elegant Faint Behind-The-Text Watermark */
    .print-watermark {
        display: flex !important;
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        align-items: center;
        justify-content: center;
        z-index: -100;
        pointer-events: none;
        opacity: 0.06;
    }

    .print-watermark span {
        font-size: 5.5rem;
        font-weight: 900;
        letter-spacing: 0.18em;
        text-transform: uppercase;
        color: #000000;
        transform: rotate(-35deg);
        white-space: nowrap;
    }

    /* 5. Official Print Header */
    .print-only-header {
        display: flex !important;
        align-items: center;
        justify-content: space-between;
        border-bottom: 2pt solid #1d4ed8;
        padding-bottom: 8pt;
        margin-bottom: 18pt;
    }

    .print-header-brand {
        display: flex;
        flex-direction: column;
    }

    .print-header-title {
        font-size: 15pt;
        font-weight: 900;
        color: #1d4ed8;
        letter-spacing: -0.02em;
    }

    .print-header-sub {
        font-size: 7.5pt;
        color: #64748b;
        text-transform: uppercase;
        letter-spacing: 0.05em;
    }

    .print-header-meta {
        font-size: 8pt;
        color: #334155;
        text-align: right;
    }

    /* 6. Official Print Footer */
    .print-only-footer {
        display: block !important;
        margin-top: 24pt;
        padding-top: 8pt;
        border-top: 1pt solid #cbd5e1;
        font-size: 8pt;
        color: #64748b;
        text-align: center;
        page-break-before: auto;
    }

    /* 7. High-legibility typography for print */
    .ej-article-header h1 {
        font-size: 22pt !important;
        line-height: 1.25 !important;
        color: #000000 !important;
        margin-bottom: 8pt !important;
    }

    .ej-article-byline {
        border-bottom: 1pt solid #e2e8f0;
        padding-bottom: 8pt;
        margin-bottom: 12pt;
        font-size: 9pt !important;
    }

    .article-content, .ej-prose {
        font-size: 11pt !important;
        line-height: 1.6 !important;
        color: #111111 !important;
    }

    .article-content p {
        margin-bottom: 10pt !important;
    }

    .article-content h2, .article-content h3 {
        page-break-after: avoid;
        color: #000000 !important;
    }

    .article-content table {
        width: 100% !important;
        border-collapse: collapse !important;
        page-break-inside: avoid;
    }

    .article-content th, .article-content td {
        border: 1pt solid #94a3b8 !important;
        padding: 6pt 8pt !important;
        font-size: 9pt !important;
    }

    .article-content th {
        background-color: #f1f5f9 !important;
    }

    .we-code-card {
        background: #f8fafc !important;
        color: #000000 !important;
        border: 1pt solid #cbd5e1 !important;
        page-break-inside: avoid;
    }

    .we-code-card .we-code-header {
        background: #e2e8f0 !important;
    }

    .we-code-card .we-code-copy-btn {
        display: none !important;
    }

    .we-code-card pre {
        color: #000000 !important;
        font-size: 9pt !important;
    }
}

/* =============================================================
   SXO ENHANCEMENT: KaTeX Math Formula One-Click Copy & Active Recall
   ============================================================= */
.we-math-copy-btn {
    position: absolute;
    top: 6px;
    right: 8px;
    background: rgba(255, 255, 255, 0.92);
    border: 1px solid rgba(203, 213, 225, 0.8);
    border-radius: 6px;
    padding: 3px 8px;
    font-size: 0.72rem;
    font-weight: 600;
    color: #475569;
    opacity: 0;
    transition: opacity 0.2s ease, background-color 0.2s ease, color 0.2s ease;
    cursor: pointer;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
    z-index: 10;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.katex-display {
    position: relative;
    padding: 10px 0;
}

.katex-display:hover .we-math-copy-btn,
.katex-display:focus-within .we-math-copy-btn {
    opacity: 1;
}

.we-math-copy-btn:hover {
    background: #2563eb;
    color: #ffffff;
    border-color: #2563eb;
}

/* Active Recall / Solution Reveal Accordion for SAQ / LAQ & Chapter Problems */
details.ej-solution-reveal {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    margin: 1.25rem 0;
    overflow: hidden;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

details.ej-solution-reveal[open] {
    background: #ffffff;
    border-color: #93c5fd;
    box-shadow: 0 4px 14px -3px rgba(37, 99, 235, 0.1);
}

details.ej-solution-reveal summary.ej-solution-trigger {
    padding: 12px 18px;
    font-size: 0.92rem;
    font-weight: 600;
    color: #1e40af;
    cursor: pointer;
    user-select: none;
    list-style: none;
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: #eff6ff;
    transition: background-color 0.2s ease;
}

details.ej-solution-reveal summary.ej-solution-trigger::-webkit-details-marker {
    display: none;
}

details.ej-solution-reveal summary.ej-solution-trigger:hover {
    background: #dbeafe;
}

details.ej-solution-reveal .ej-solution-body {
    padding: 18px;
    border-top: 1px solid #e2e8f0;
    font-size: 0.96rem;
    line-height: 1.75;
    color: #1e293b;
}

.ej-reading-progress {
    height: 3.5px;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1200;
    pointer-events: none;
    background: transparent;
}

.ej-reading-progress span {
    display: block;
    height: 100%;
    background: linear-gradient(90deg, #2563eb, #38bdf8);
    width: 0%;
    transition: width 0.08s ease-out;
}

/* ==============================================================
   ELEGANT ARTICLE CONTENT & CARD SPACING (Eliminate excessive gaps)
   ============================================================== */

/* 1. Sections inside blog article: smooth, compact spacing */
.blog-content-body section,
.ej-prose section {
    margin-bottom: 2rem !important;
}

.blog-content-body section:last-child,
.ej-prose section:last-child {
    margin-bottom: 1rem !important;
}

/* 2. Section headings: cancel redundant top margin so heading sits near section */
.blog-content-body section > :is(h2, h3, h4):first-child,
.ej-prose section > :is(h2, h3, h4):first-child {
    margin-top: 0.5rem !important;
    margin-bottom: 1rem !important;
}

/* 3. Cards inside blog content: seamless, flat, editorial flow (no box/block borders) */
.blog-content-body .card,
.ej-prose .card {
    background: transparent !important;
    border: none !important;
    border-left: none !important;
    border-radius: 0 !important;
    box-shadow: none !important;
    margin-top: 0 !important;
    margin-bottom: 1rem !important;
    padding: 0 !important;
    transition: none !important;
}

.blog-content-body .card:hover,
.ej-prose .card:hover {
    box-shadow: none !important;
    border-color: transparent !important;
    transform: none !important;
}

.blog-content-body .card:last-child,
.ej-prose .card:last-child {
    margin-bottom: 0 !important;
}

/* 4. Card body internal spacing: seamless editorial flow */
.blog-content-body .card-body,
.ej-prose .card-body {
    padding: 0 !important;
}

.blog-content-body .card .card-body :is(h4, h5, h6):first-child,
.ej-prose .card .card-body :is(h4, h5, h6):first-child {
    margin-top: 0 !important;
    margin-bottom: 0.5rem !important;
    font-size: 1.05rem !important;
    font-weight: 700 !important;
    line-height: 1.45 !important;
    color: #0f172a !important;
}

.blog-content-body .card .card-body p,
.ej-prose .card .card-body p {
    margin-bottom: 0.75rem !important;
    font-size: 1rem !important;
    line-height: 1.75 !important;
    color: #334155 !important;
}

/* Crucial: Eliminate the trailing paragraph margin inside cards */
.blog-content-body .card .card-body p:last-child,
.ej-prose .card .card-body p:last-child,
.blog-content-body .card .card-body > *:last-child,
.ej-prose .card .card-body > *:last-child {
    margin-bottom: 0 !important;
}

/* 5. Dark Mode Styling for Cards inside Blog Body */
:is(html[data-site-theme="dark"], html[data-bs-theme="dark"], html.dark) .blog-content-body .card,
:is(html[data-site-theme="dark"], html[data-bs-theme="dark"], html.dark) .ej-prose .card {
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
}

:is(html[data-site-theme="dark"], html[data-bs-theme="dark"], html.dark) .blog-content-body .card .card-body :is(h4, h5, h6):first-child,
:is(html[data-site-theme="dark"], html[data-bs-theme="dark"], html.dark) .ej-prose .card .card-body :is(h4, h5, h6):first-child {
    color: #f1f5f9 !important;
}

:is(html[data-site-theme="dark"], html[data-bs-theme="dark"], html.dark) .blog-content-body .card .card-body p,
:is(html[data-site-theme="dark"], html[data-bs-theme="dark"], html.dark) .ej-prose .card .card-body p {
    color: #cbd5e1 !important;
}

/* 6. Current Affairs & Editorial Typography — Light & Dark Mode Contrast Rules */
.current-affairs-article .ca-news-item {
    border-bottom: 1px solid #f1f5f9;
    padding-bottom: 1.25rem;
    margin-bottom: 1.25rem;
}

.current-affairs-article .ca-news-item:last-child {
    border-bottom: none !important;
    margin-bottom: 0 !important;
    padding-bottom: 0 !important;
}

:is(html[data-site-theme="dark"], html[data-bs-theme="dark"], html.dark) .blog-content-body :is(h1, h2, h3, h4, h5, h6),
:is(html[data-site-theme="dark"], html[data-bs-theme="dark"], html.dark) .blog-content-body .text-dark {
    color: #f8fafc !important;
}

:is(html[data-site-theme="dark"], html[data-bs-theme="dark"], html.dark) .blog-content-body p,
:is(html[data-site-theme="dark"], html[data-bs-theme="dark"], html.dark) .blog-content-body li {
    color: #cbd5e1 !important;
}

:is(html[data-site-theme="dark"], html[data-bs-theme="dark"], html.dark) .blog-content-body .text-secondary {
    color: #94a3b8 !important;
}

:is(html[data-site-theme="dark"], html[data-bs-theme="dark"], html.dark) .blog-content-body .bg-light {
    background-color: #172338 !important;
    color: #f1f5f9 !important;
    border-color: #334155 !important;
}

:is(html[data-site-theme="dark"], html[data-bs-theme="dark"], html.dark) .blog-content-body .border-bottom,
:is(html[data-site-theme="dark"], html[data-bs-theme="dark"], html.dark) .current-affairs-article .ca-news-item {
    border-color: #334155 !important;
}

/* ==========================================================
   NCERT GUIDE & COMPACT FAQ ACCORDION
   ========================================================== */
.ncert-guide-wrap {
    color: #1e293b;
    font-size: 1rem;
    line-height: 1.7;
}

.ncert-section-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 18px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 8px 8px 0 0;
    margin-bottom: 0 !important;
}

.ncert-section-heading h2,
.ncert-section-heading h3 {
    margin: 0 !important;
    font-size: 1.05rem !important;
    font-weight: 700 !important;
    color: #0f172a !important;
}

.ncert-table-card {
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    overflow: hidden;
    margin-bottom: 2rem;
    background: #ffffff;
}

.ncert-table-card .table {
    margin-bottom: 0;
    font-size: 0.92rem;
}

.ncert-table-card .table thead th {
    background: #f1f5f9;
    color: #334155;
    font-weight: 600;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    padding: 10px 14px;
    border-bottom: 1px solid #e2e8f0;
}

.ncert-table-card .table tbody td {
    padding: 10px 14px;
    vertical-align: middle;
    border-bottom: 1px solid #f1f5f9;
    color: #334155;
}

.ncert-table-card .table tbody tr:last-child td {
    border-bottom: none;
}

.ncert-table-card .table tbody tr:hover td {
    background-color: #f8fafc;
}

/* Compact Sleek FAQ Accordion */
.ncert-faq-wrap {
    margin: 1.5rem 0;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    background: #ffffff;
    overflow: hidden;
}

.ncert-faq-item {
    border-bottom: 1px solid #e2e8f0;
}

.ncert-faq-item:last-child {
    border-bottom: none;
}

.ncert-faq-item summary {
    padding: 12px 16px;
    cursor: pointer;
    list-style: none;
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 0.95rem;
    font-weight: 600;
    color: #0f172a;
    background: #ffffff;
    transition: background-color 0.15s ease, color 0.15s ease;
}

.ncert-faq-item summary::-webkit-details-marker {
    display: none;
}

.ncert-faq-item summary:hover {
    background: #f8fafc;
    color: #2563eb;
}

.ncert-faq-item[open] summary {
    background: #f8fafc;
    color: #1d4ed8;
    border-bottom: 1px solid #f1f5f9;
}

.ncert-faq-item summary .faq-toggle-icon {
    font-size: 1.1rem;
    font-weight: 700;
    color: #94a3b8;
    transition: transform 0.2s ease, color 0.2s ease;
    flex-shrink: 0;
    margin-left: 12px;
}

.ncert-faq-item[open] summary .faq-toggle-icon {
    transform: rotate(45deg);
    color: #2563eb;
}

.ncert-faq-body {
    padding: 12px 16px;
    font-size: 0.9rem;
    line-height: 1.6;
    color: #475569;
    background: #ffffff;
}

/* Dark mode adjustments */
:is(html[data-site-theme="dark"], html[data-bs-theme="dark"], html.dark) .ncert-table-card,
:is(html[data-site-theme="dark"], html[data-bs-theme="dark"], html.dark) .ncert-faq-wrap {
    background: #111827 !important;
    border-color: #374151 !important;
}

:is(html[data-site-theme="dark"], html[data-bs-theme="dark"], html.dark) .ncert-section-heading {
    background: #1f2937 !important;
    border-color: #374151 !important;
}

:is(html[data-site-theme="dark"], html[data-bs-theme="dark"], html.dark) .ncert-section-heading h2,
:is(html[data-site-theme="dark"], html[data-bs-theme="dark"], html.dark) .ncert-section-heading h3 {
    color: #f9fafb !important;
}

:is(html[data-site-theme="dark"], html[data-bs-theme="dark"], html.dark) .ncert-table-card .table thead th {
    background: #1f2937 !important;
    color: #9ca3af !important;
    border-bottom-color: #374151 !important;
}

:is(html[data-site-theme="dark"], html[data-bs-theme="dark"], html.dark) .ncert-table-card .table tbody td {
    color: #e5e7eb !important;
    border-bottom-color: #1f2937 !important;
}

:is(html[data-site-theme="dark"], html[data-bs-theme="dark"], html.dark) .ncert-table-card .table tbody tr:hover td {
    background-color: #1f2937 !important;
}

:is(html[data-site-theme="dark"], html[data-bs-theme="dark"], html.dark) .ncert-faq-item {
    border-bottom-color: #374151 !important;
}

:is(html[data-site-theme="dark"], html[data-bs-theme="dark"], html.dark) .ncert-faq-item summary {
    background: #111827 !important;
    color: #f3f4f6 !important;
}

:is(html[data-site-theme="dark"], html[data-bs-theme="dark"], html.dark) .ncert-faq-item[open] summary,
:is(html[data-site-theme="dark"], html[data-bs-theme="dark"], html.dark) .ncert-faq-item summary:hover {
    background: #1f2937 !important;
    color: #60a5fa !important;
}

:is(html[data-site-theme="dark"], html[data-bs-theme="dark"], html.dark) .ncert-faq-body {
    background: #111827 !important;
    color: #d1d5db !important;
}

/* ==========================================================
   BUTTON CONTRAST & READABILITY FIX FOR PROSE & TABLES
   ========================================================== */
.ej-prose .btn,
.blog-content-body .btn,
.ncert-table-card .btn {
    text-decoration: none !important;
    white-space: nowrap !important;
    font-weight: 600 !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 6px !important;
    border-radius: 6px !important;
    padding: 7px 16px !important;
    font-size: 0.85rem !important;
    line-height: 1.25 !important;
    transition: all 0.15s ease-in-out !important;
}

.ej-prose .btn-primary,
.blog-content-body .btn-primary,
.ncert-table-card .btn-primary {
    background-color: #1d4ed8 !important;
    border-color: #1d4ed8 !important;
    color: #ffffff !important;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05) !important;
}

.ej-prose .btn-primary:hover,
.blog-content-body .btn-primary:hover,
.ncert-table-card .btn-primary:hover {
    background-color: #1e40af !important;
    border-color: #1e40af !important;
    color: #ffffff !important;
}

.ej-prose .btn-outline-primary,
.blog-content-body .btn-outline-primary,
.ncert-table-card .btn-outline-primary {
    background-color: #eff6ff !important;
    border-color: #bfdbfe !important;
    color: #1d4ed8 !important;
}

.ej-prose .btn-outline-primary:hover,
.blog-content-body .btn-outline-primary:hover,
.ncert-table-card .btn-outline-primary:hover {
    background-color: #1d4ed8 !important;
    border-color: #1d4ed8 !important;
    color: #ffffff !important;
}

/* Dark mode button contrast */
:is(html[data-site-theme="dark"], html[data-bs-theme="dark"], html.dark) .ncert-table-card .btn-primary {
    background-color: #2563eb !important;
    border-color: #2563eb !important;
    color: #ffffff !important;
}

:is(html[data-site-theme="dark"], html[data-bs-theme="dark"], html.dark) .ncert-table-card .btn-outline-primary {
    background-color: #1e293b !important;
    border-color: #3b82f6 !important;
    color: #93c5fd !important;
}


