/*
 * AcadNews layer. Loads after the base magazine styles and only adds:
 * calm defaults, the learning panels, the export page and print rules.
 * Colours follow the Customizer theme colour and the base dark mode.
 */

:root {
	--an-accent: var(--theme-color-red, #FD4F18);
	--an-ink: #1b1f24;
	--an-muted: #5f6b7a;
	--an-line: #e4e7eb;
	--an-soft: #f5f6f8;
	--an-card: #ffffff;
	--an-radius: 8px;
}
body.acadnews_dark_mode {
	--an-ink: #e8eaed;
	--an-muted: #a0a8b3;
	--an-line: #2f3640;
	--an-soft: #1d222a;
	--an-card: #171b21;
}

/* ---------- Quiet defaults ---------- */
html { scroll-behavior: smooth; }
:focus-visible { outline: 2px solid var(--an-accent); outline-offset: 2px; }
::selection { background: color-mix(in srgb, var(--an-accent) 25%, transparent); }
.entry-content img, .entry-content video, .entry-content iframe { max-width: 100%; }
.entry-content img { height: auto; }
.entry-content table { display: block; overflow-x: auto; max-width: 100%; border-collapse: collapse; }
.entry-content th, .entry-content td { border: 1px solid var(--an-line); padding: 8px 12px; }
.entry-content th { background: var(--an-soft); text-align: left; }
@media (prefers-reduced-motion: reduce) {
	html { scroll-behavior: auto; }
	*, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}

/* ---------- Article reading comfort ---------- */
.single .entry-content { font-size: 1.0625rem; line-height: 1.8; }
.single .entry-content p { margin-bottom: 1.25em; }
.single .entry-content h2, .single .entry-content h3 { scroll-margin-top: 96px; line-height: 1.3; margin: 1.6em 0 .5em; }
.single .entry-content blockquote { border-left: 3px solid var(--an-accent); margin: 1.6em 0; padding: .2em 0 .2em 1.1em; color: var(--an-muted); }

/* ---------- Reading progress ---------- */
.acadnews-progress { position: fixed; top: 0; left: 0; right: 0; height: 3px; z-index: 99999; pointer-events: none; }
.admin-bar .acadnews-progress { top: 32px; }
.acadnews-progress span { display: block; height: 100%; width: 0; background: var(--an-accent); }

/* ---------- Learning strip ---------- */
.acadnews-strip { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 16px; margin: 0 0 20px; padding: 10px 0; border-top: 1px solid var(--an-line); border-bottom: 1px solid var(--an-line); font-size: 13px; color: var(--an-muted); }
.acadnews-level { font-size: 11px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; padding: 3px 9px; border-radius: 999px; color: #fff; background: var(--an-muted); }
.acadnews-level.is-beginner { background: #15803d; }
.acadnews-level.is-intermediate { background: #b45309; }
.acadnews-level.is-advanced { background: #b91c1c; }
.acadnews-print { margin-left: auto; background: none; border: 1px solid var(--an-line); color: var(--an-ink); padding: 5px 12px; border-radius: 999px; font: inherit; font-size: 12px; cursor: pointer; }
.acadnews-print:hover { border-color: var(--an-accent); color: var(--an-accent); }

/* ---------- Panels ---------- */
.acadnews-box { background: var(--an-soft); border: 1px solid var(--an-line); border-left: 3px solid var(--an-accent); border-radius: var(--an-radius); padding: 18px 22px; margin: 24px 0; color: var(--an-ink); }
.acadnews-box > h2 { font-size: 13px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; margin: 0 0 10px; color: var(--an-ink); }
.acadnews-box ul, .acadnews-box ol { margin: 0; padding-left: 20px; }
.acadnews-box li { margin: 6px 0; }
.acadnews-box.is-glossary { border-left-color: var(--an-line); background: var(--an-card); }
.acadnews-box.is-glossary dt { font-weight: 700; margin-top: 10px; }
.acadnews-box.is-glossary dd { margin: 2px 0 0; color: var(--an-muted); }
.acadnews-box.is-reading { border-left-color: var(--an-line); background: var(--an-card); }
.acadnews-source { font-size: 13px; color: var(--an-muted); }

/* ---------- Table of contents ---------- */
.acadnews-toc { background: var(--an-card); border: 1px solid var(--an-line); border-radius: var(--an-radius); padding: 12px 18px; margin: 0 0 28px; font-size: 14px; }
.acadnews-toc summary { cursor: pointer; font-weight: 700; font-size: 13px; letter-spacing: .08em; text-transform: uppercase; color: var(--an-ink); }
.acadnews-toc ol { list-style: none; margin: 10px 0 0; padding: 0; }
.acadnews-toc li { margin: 4px 0; }
.acadnews-toc li.is-h3 { padding-left: 16px; font-size: 13px; }
.acadnews-toc a { color: var(--an-muted); text-decoration: none; display: block; padding: 2px 0 2px 10px; border-left: 2px solid transparent; }
.acadnews-toc a:hover { color: var(--an-ink); }
.acadnews-toc a.is-active { color: var(--an-ink); font-weight: 600; border-left-color: var(--an-accent); }

/* ---------- Quiz ---------- */
.acadnews-q { margin: 0 0 18px; }
.acadnews-q__text { font-weight: 600; margin: 0 0 8px; }
.acadnews-q__opts { display: flex; flex-direction: column; gap: 8px; }
.acadnews-q__opts button { text-align: left; background: var(--an-card); color: var(--an-ink); border: 1px solid var(--an-line); border-radius: 6px; padding: 9px 14px; font: inherit; cursor: pointer; }
.acadnews-q__opts button:hover { border-color: var(--an-accent); }
.acadnews-q__opts button.is-right { background: #dcfce7; border-color: #15803d; color: #14532d; }
.acadnews-q__opts button.is-wrong { background: #fee2e2; border-color: #b91c1c; color: #7f1d1d; }
.acadnews-q__result, .acadnews-quiz__score { margin: 6px 0 0; font-size: 13px; font-weight: 600; }

/* ---------- Editor shortcodes ---------- */
.acadnews-callout { border-left: 3px solid var(--an-accent); background: var(--an-soft); border-radius: 0 var(--an-radius) var(--an-radius) 0; padding: 14px 18px; margin: 1.5em 0; }
.acadnews-callout strong { display: block; margin-bottom: 4px; }
.acadnews-callout.is-tip { border-left-color: #15803d; }
.acadnews-callout.is-warning { border-left-color: #b91c1c; }
abbr.acadnews-term { text-decoration: none; border-bottom: 2px dotted var(--an-accent); cursor: help; }

/* ---------- Export page ---------- */
.acadnews-export { max-width: 820px; margin: 0 auto; padding: 8px 0 40px; }
.acadnews-export__bar { display: flex; flex-wrap: wrap; gap: 8px; margin: 20px 0 12px; }
.acadnews-export__bar input, .acadnews-export__bar select { flex: 1 1 200px; min-width: 0; padding: 9px 12px; border: 1px solid var(--an-line); border-radius: 6px; background: var(--an-card); color: var(--an-ink); font: inherit; }
.acadnews-export__bar button, .acadnews-btn { background: var(--an-card); border: 1px solid var(--an-line); color: var(--an-ink); padding: 9px 16px; border-radius: 6px; font: inherit; cursor: pointer; }
.acadnews-btn { background: var(--an-accent); border-color: var(--an-accent); color: #fff; font-weight: 600; }
.acadnews-btn:disabled { opacity: .6; cursor: wait; }
.acadnews-export__list { list-style: none; margin: 0; padding: 0; max-height: 420px; overflow: auto; border: 1px solid var(--an-line); border-radius: var(--an-radius); background: var(--an-card); }
.acadnews-export__list li { border-bottom: 1px solid var(--an-line); }
.acadnews-export__list li:last-child { border-bottom: 0; }
.acadnews-export__list label { display: flex; align-items: center; gap: 12px; padding: 10px 14px; cursor: pointer; }
.acadnews-export__list label span { flex: 1; }
.acadnews-export__list time { font-size: 12px; color: var(--an-muted); white-space: nowrap; }
.acadnews-export__actions { display: flex; flex-wrap: wrap; align-items: center; gap: 16px; margin-top: 16px; }
.acadnews-export__actions fieldset { border: 0; margin: 0; padding: 0; display: flex; gap: 16px; }
.acadnews-export__count, .acadnews-export__status { font-size: 13px; color: var(--an-muted); }

/* ---------- Print: clean article only ---------- */
@media print {
	#masthead, #colophon, .site-header, .site-footer, .secondary-sidebar, .secondary-left-sidebar,
	.acadnews-progress, .acadnews-print, .post-navigation, #comments, .comments-area,
	.acadnews_ovelay_div, #acadnews-scroll-to-top, .scroll-to-top, .tawk-min-container { display: none !important; }
	body { background: #fff !important; color: #000 !important; }
	.primary-content { width: 100% !important; max-width: 100% !important; flex: 0 0 100% !important; }
	.single .entry-content { font-size: 11.5pt; }
	.acadnews-box, .acadnews-toc { break-inside: avoid; background: #fff !important; }
	a { color: #000; text-decoration: underline; }
}
