/* ==========================================================================
   ExamLearn - Current affairs (builds on exams.css tokens, hero, cards, buttons)
   ========================================================================== */

/* section tabs */
.ca-tabs { display: flex; gap: 4px; padding: 5px; margin-bottom: 18px; overflow-x: auto; scrollbar-width: none; background: var(--ex-surface); border: 1px solid var(--ex-border); border-radius: 14px; box-shadow: 0 4px 14px rgba(15, 23, 42, .05); }
.ca-tabs::-webkit-scrollbar { display: none; }
.ca-tabs a { flex: 0 0 auto; display: inline-flex; align-items: center; gap: 7px; padding: 9px 14px; border-radius: 10px; font-size: 13.5px; font-weight: 600; color: var(--ex-muted); text-decoration: none; white-space: nowrap; }
.ca-tabs a:hover { color: var(--ex-ink); background: var(--ex-soft); }
.ca-tabs a.active { background: var(--t-600, #4f46e5); color: #fff; }
.ca-tab-count { font-size: 11px; font-weight: 700; padding: 0 7px; border-radius: 999px; background: var(--ex-accent-soft); color: var(--ex-accent); }
.ca-tabs a.active .ca-tab-count { background: rgba(255, 255, 255, .22); color: #fff; }

/* date / period strip */
.ca-dates { display: flex; gap: 8px; overflow-x: auto; padding: 2px 2px 10px; margin-bottom: 10px; scrollbar-width: thin; }
.ca-date { flex: 0 0 auto; min-width: 78px; display: flex; flex-direction: column; align-items: center; padding: 9px 12px; border-radius: 12px; text-decoration: none; background: var(--ex-surface); border: 1px solid var(--ex-border); transition: all .15s ease; }
.ca-date b { font-size: 13.5px; color: var(--ex-ink); white-space: nowrap; }
.ca-date small { font-size: 11px; color: var(--ex-muted); white-space: nowrap; }
.ca-date:hover { border-color: var(--ex-accent); }
.ca-date.active { background: var(--t-600, #4f46e5); border-color: var(--t-600, #4f46e5); box-shadow: 0 4px 12px rgba(var(--t-600-rgb, 79, 70, 229), .25); }
.ca-date.active b, .ca-date.active small { color: #fff; }
.ca-date-wide { min-width: 140px; }

/* article rows */
.ca-list { display: flex; flex-direction: column; gap: 10px; }
.ca-row { position: relative; display: flex; gap: 14px; align-items: flex-start; padding: 14px; border-radius: 16px; background: var(--ex-surface); border: 1px solid var(--ex-border); transition: border-color .15s ease, box-shadow .15s ease, transform .15s ease; }
.ca-row:hover { border-color: rgba(var(--t-500-rgb, 99, 102, 241), .45); box-shadow: 0 10px 24px rgba(15, 23, 42, .07); transform: translateY(-1px); }
.ca-row-link { position: absolute; inset: 0; border-radius: 16px; z-index: 1; }
.ca-row-body { flex: 1; min-width: 0; }
.ca-row h3 { font-size: 15.5px; font-weight: 700; line-height: 1.4; color: var(--ex-ink); margin: 6px 0 4px; }
.ca-row p { font-size: 13.5px; line-height: 1.55; color: var(--ex-muted); margin: 0; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.ca-thumb { width: 116px; height: 84px; border-radius: 12px; object-fit: cover; flex-shrink: 0; background: var(--ex-soft); }
.ca-thumb-ph { display: flex; align-items: center; justify-content: center; font-size: 26px; background: var(--tone-soft); color: var(--tone); }
.ca-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px; font-size: 12px; color: var(--ex-muted); }
.ca-meta i { margin-right: 3px; }
.ca-chip { position: relative; z-index: 2; display: inline-flex; align-items: center; gap: 5px; font-size: 11.5px; font-weight: 700; padding: 3px 9px; border-radius: 999px; background: var(--tone-soft, var(--ex-soft)); color: var(--tone, var(--ex-ink-2)); text-decoration: none; }
.ca-chip i { margin: 0; }
.ca-chip-top { background: #fef3c7; color: #b45309; }
[data-bs-theme="dark"] .ca-chip-top, html.dark-theme .ca-chip-top { background: rgba(251, 191, 36, .14); color: #fcd34d; }
.ca-save { position: relative; z-index: 2; width: 36px; height: 36px; flex-shrink: 0; border-radius: 10px; display: inline-flex; align-items: center; justify-content: center; background: var(--ex-soft); border: 1px solid var(--ex-border); color: var(--ex-muted); cursor: pointer; transition: all .15s ease; }
.ca-save:hover { color: var(--ex-accent); border-color: var(--ex-accent); }
.ca-save.is-on { color: #d97706; border-color: #f59e0b; background: #fef3c7; }
[data-bs-theme="dark"] .ca-save.is-on, html.dark-theme .ca-save.is-on { background: rgba(251, 191, 36, .14); }

/* feature (top story) */
.ca-feature { position: relative; display: grid; grid-template-columns: 1.1fr 1fr; gap: 0; border-radius: 18px; overflow: hidden; background: var(--ex-surface); border: 1px solid var(--ex-border); margin-bottom: 8px; transition: box-shadow .15s ease; }
.ca-feature:hover { box-shadow: 0 14px 30px rgba(15, 23, 42, .09); }
.ca-feature-img { width: 100%; height: 100%; min-height: 220px; border-radius: 0; font-size: 56px; }
.ca-feature-body { padding: 22px; display: flex; flex-direction: column; gap: 8px; }
.ca-feature h2 { font-size: 21px; font-weight: 800; line-height: 1.3; color: var(--ex-ink); margin: 4px 0 0; letter-spacing: -.01em; }
.ca-feature p { font-size: 14px; color: var(--ex-muted); line-height: 1.6; margin: 0; }
.ca-read { margin-top: auto; font-size: 13.5px; font-weight: 700; color: var(--ex-accent); }
.ca-feature .ca-save { position: absolute; top: 12px; right: 12px; }

/* capsule / roundup */
.ca-tiles { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 10px; margin-bottom: 16px; }
.ca-tile { display: flex; flex-direction: column; gap: 2px; padding: 12px; border-radius: 14px; background: var(--ex-surface); border: 1px solid var(--ex-border); text-decoration: none; min-width: 0; }
.ca-tile i { color: var(--tone); font-size: 15px; margin-bottom: 4px; }
.ca-tile b { font-size: 20px; font-weight: 800; color: var(--ex-ink); line-height: 1.1; }
.ca-tile span { font-size: 11.5px; color: var(--ex-muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
a.ca-tile:hover { border-color: var(--tone); }
.ca-tile-total { background: var(--t-600, #4f46e5); border-color: var(--t-600, #4f46e5); }
.ca-tile-total b, .ca-tile-total span { color: #fff; }
.ca-group { margin-bottom: 18px; }
.ca-group-title { display: flex; align-items: center; gap: 10px; font-size: 15px; font-weight: 800; color: var(--ex-ink); margin: 6px 0 10px; }
.ca-group-title .ex-emblem { width: 32px; height: 32px; font-size: 14px; border-radius: 9px; }
.ca-group-title .ct { font-size: 11.5px; font-weight: 700; padding: 1px 8px; border-radius: 999px; background: var(--ex-soft); color: var(--ex-muted); border: 1px solid var(--ex-border); }
.ca-stepper { display: flex; gap: 8px; }
.ca-stepper .ex-btn { background: rgba(255, 255, 255, .12); color: #fff; border-color: rgba(255, 255, 255, .25); }
.ca-stepper .ex-btn:hover { background: rgba(255, 255, 255, .22); color: #fff; }

.ca-bars { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 6px; height: 180px; align-items: end; }
.ca-bar { display: flex; flex-direction: column; align-items: center; justify-content: flex-end; height: 100%; gap: 4px; text-decoration: none; }
.ca-bar .b { width: 100%; max-width: 34px; min-height: 3px; border-radius: 6px 6px 0 0; background: var(--t-500, #6366f1); transition: background .15s ease; }
.ca-bar:hover .b { background: var(--t-700, #4338ca); }
.ca-bar.is-zero .b { background: var(--ex-track); }
.ca-bar .v { font-size: 11.5px; font-weight: 700; color: var(--ex-ink); min-height: 16px; }
.ca-bar .l { font-size: 11px; color: var(--ex-muted); }
[data-bs-theme="dark"] .ca-bar .b, html.dark-theme .ca-bar .b { background: var(--t-400, #7c7ff5); }

.ca-promo { display: flex; align-items: center; gap: 12px; padding: 14px 16px; border-radius: 14px; text-decoration: none; background: var(--ex-surface); border: 1px solid var(--ex-border); color: var(--ex-ink); transition: all .15s ease; }
.ca-promo:hover { border-color: var(--tone); transform: translateY(-1px); color: var(--ex-ink); }
.ca-promo b { display: block; font-size: 14px; color: var(--ex-ink); }
.ca-promo small { font-size: 12.5px; color: var(--ex-muted); }
.ca-promo > i { color: var(--ex-muted); }

/* quiz */
.ca-quiz-hero { display: flex; flex-direction: column; gap: 4px; height: 100%; padding: 18px; border-radius: 16px; text-decoration: none; background: var(--ex-surface); border: 1px solid var(--ex-border); transition: all .15s ease; }
.ca-quiz-hero:hover { border-color: var(--tone); transform: translateY(-2px); box-shadow: 0 12px 26px rgba(15, 23, 42, .08); }
.ca-quiz-hero .ex-emblem { margin-bottom: 8px; }
.ca-quiz-hero b { font-size: 16px; color: var(--ex-ink); }
.ca-quiz-hero small { font-size: 13px; color: var(--ex-muted); line-height: 1.5; }
.ca-quiz-hero .go { margin-top: auto; padding-top: 10px; font-size: 13.5px; font-weight: 700; color: var(--ex-accent); }
.ca-quiz { display: flex; align-items: center; gap: 12px; padding: 14px; border-radius: 14px; text-decoration: none; background: var(--ex-surface); border: 1px solid var(--ex-border); }
.ca-quiz:hover { border-color: var(--ex-accent); }
.ca-quiz b { display: block; font-size: 14.5px; color: var(--ex-ink); }
.ca-quiz small { font-size: 12.5px; color: var(--ex-muted); }
.ca-quiz .ex-btn { height: 36px; font-size: 13px; }

/* sidebar */
.ca-cats { display: flex; flex-direction: column; gap: 2px; }
.ca-cat { display: flex; align-items: center; gap: 10px; padding: 7px 8px; border-radius: 10px; text-decoration: none; font-size: 13.5px; }
.ca-cat .ex-emblem { width: 30px; height: 30px; font-size: 13px; border-radius: 9px; }
.ca-cat .nm { flex: 1; color: var(--ex-ink-2); font-weight: 500; }
.ca-cat .ct { font-size: 11.5px; font-weight: 700; color: var(--ex-muted); background: var(--ex-soft); border: 1px solid var(--ex-border); border-radius: 999px; padding: 0 8px; }
.ca-cat:hover { background: var(--ex-soft); }
.ca-cat.active { background: var(--ex-accent-soft); }
.ca-cat.active .nm { color: var(--ex-accent); font-weight: 700; }
.ca-cat.is-empty { opacity: .55; }
.ca-rank { list-style: none; padding: 0; margin: 0; }
.ca-rank a { display: flex; gap: 12px; align-items: flex-start; padding: 9px 0; border-bottom: 1px dashed var(--ex-border); text-decoration: none; }
.ca-rank li:last-child a { border-bottom: 0; }
.ca-rank .r { width: 26px; height: 26px; border-radius: 8px; display: inline-flex; align-items: center; justify-content: center; font-size: 12px; font-weight: 800; background: var(--ex-accent-soft); color: var(--ex-accent); flex-shrink: 0; }
.ca-rank b { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; font-size: 13px; line-height: 1.4; color: var(--ex-ink); }
.ca-rank small { font-size: 11.5px; color: var(--ex-muted); }
.ca-rank a:hover b { color: var(--ex-accent); }

/* article */
.ca-article-hero h1 { font-size: 30px; line-height: 1.25; }
.ca-dek { font-size: 16px !important; max-width: 820px !important; }
.ca-byline { display: flex; flex-wrap: wrap; gap: 6px 18px; margin-top: 14px; font-size: 13px; color: rgba(255, 255, 255, .8); }
.ca-byline i { margin-right: 4px; }
.ca-article { padding: 26px 30px; }
.ca-hero-img { width: 100%; max-height: 420px; object-fit: cover; border-radius: 14px; margin-bottom: 20px; }
.ca-keypoints { padding: 16px 18px; border-radius: 14px; background: var(--ex-accent-soft); border: 1px solid color-mix(in srgb, var(--ex-accent) 30%, transparent); margin-bottom: 22px; }
.ca-keypoints h2 { font-size: 15px; font-weight: 800; color: var(--ex-accent); margin: 0 0 8px; display: flex; gap: 8px; align-items: center; }
.ca-keypoints ul { margin: 0; padding-left: 20px; }
.ca-keypoints li { font-size: 14.5px; line-height: 1.6; color: var(--ex-ink); margin-bottom: 4px; }
.ca-body { font-size: 16px; line-height: 1.8; color: var(--ex-ink-2); overflow-wrap: anywhere; }
.ca-body h2, .ca-body h3, .ca-body h4 { color: var(--ex-ink); font-weight: 800; margin: 24px 0 10px; line-height: 1.35; }
.ca-body h2 { font-size: 21px; } .ca-body h3 { font-size: 18px; } .ca-body h4 { font-size: 16px; }
.ca-body p { margin-bottom: 14px; }
.ca-body ul, .ca-body ol { padding-left: 22px; margin-bottom: 14px; }
.ca-body li { margin-bottom: 6px; }
.ca-body strong, .ca-body b { color: var(--ex-ink); }
.ca-body a { color: var(--ex-accent); }
.ca-body img { max-width: 100%; height: auto; border-radius: 12px; }
.ca-body blockquote { border-left: 4px solid var(--ex-accent); padding: 8px 16px; margin: 16px 0; background: var(--ex-soft); border-radius: 0 10px 10px 0; color: var(--ex-ink); }
.ca-body table { width: 100%; border-collapse: collapse; margin: 14px 0; font-size: 14px; display: block; overflow-x: auto; }
.ca-body th, .ca-body td { border: 1px solid var(--ex-border); padding: 8px 10px; text-align: left; }
.ca-body th { background: var(--ex-soft); color: var(--ex-ink); }
.ca-tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 20px; padding-top: 16px; border-top: 1px dashed var(--ex-border); }
.ca-tags .ex-tag { text-decoration: none; }
.ca-tags .ex-tag:hover { border-color: var(--ex-accent); color: var(--ex-accent); }
.ca-source { font-size: 13px; color: var(--ex-muted); margin: 14px 0 0; }
.ca-prevnext { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 16px; }
.ca-prevnext a { display: flex; align-items: center; gap: 12px; padding: 14px 16px; border-radius: 14px; text-decoration: none; background: var(--ex-surface); border: 1px solid var(--ex-border); min-width: 0; }
.ca-prevnext a:hover { border-color: var(--ex-accent); }
.ca-prevnext a > i { color: var(--ex-accent); }
.ca-prevnext span { min-width: 0; }
.ca-prevnext small { display: block; font-size: 11.5px; font-weight: 600; text-transform: uppercase; letter-spacing: .05em; color: var(--ex-muted); }
.ca-prevnext b { display: block; font-size: 13.5px; color: var(--ex-ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ca-prevnext .nx { justify-content: flex-end; text-align: right; grid-column: 2; }

/* responsive */
@media (max-width: 1199.98px) { .ca-tiles { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 767.98px) {
    .ca-feature { grid-template-columns: 1fr; }
    .ca-feature-img { min-height: 170px; height: 170px; }
    .ca-feature-body { padding: 16px; }
    .ca-feature h2 { font-size: 18px; }
    .ca-thumb { width: 84px; height: 70px; }
    .ca-row { padding: 12px; gap: 12px; }
    .ca-row h3 { font-size: 14.5px; }
    .ca-article { padding: 18px 16px; }
    .ca-article-hero h1 { font-size: 22px; }
    .ca-dek { font-size: 14.5px !important; }
    .ca-body { font-size: 15px; }
    .ca-bars { height: 150px; gap: 3px; }
    .ca-bar .l { font-size: 10px; }
    .ca-prevnext { grid-template-columns: 1fr; }
    .ca-prevnext .nx { grid-column: auto; }
    .ca-stepper { width: 100%; }
    .ca-stepper .ex-btn { flex: 1; }
}
@media (max-width: 420px) { .ca-row p { display: none; } .ca-tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

/* keep text clear of the bookmark button on the top story; compact key points in the sidebar */
.ca-feature-body { padding-right: 62px; }
.ex-side .ca-keypoints { margin-bottom: 20px; }
.ex-side .ca-keypoints li { font-size: 13.5px; }
@media (max-width: 767.98px) { .ca-feature-body { padding-right: 16px; } }
@media (max-width: 767.98px) { .ca-feature .ca-thumb { width: 100%; height: 170px; } }
