/*
 * Education Mirror Journal
 * Tokens mirror DESIGN.md. Sections in order:
 * tokens · base · header · cards · blocks · home · footer · forms
 * (appended later: phone · article · archive · ticker · wpDiscuz)
 */

/* ---------- Tokens ---------- */
:root {
	--em-page: #F5F6FA;
	--em-surface: #FFFFFF;
	--em-text: #1B2233;
	--em-text-2: #5A6275;
	--em-heading: #0A2159;
	--em-navy: #0A2159;
	--em-red: #D71920;
	--em-label: #D71920;
	--em-link: #0A2159;
	--em-line: #E3E6EE;
	--em-mark: #FFF1B8;
	--em-btn: #0A2159;
	--em-btn-text: #FFFFFF;
	--em-glass: rgba(255, 255, 255, .8);
	--em-glass-strong: rgba(255, 255, 255, .94);
	--em-glass-edge: rgba(255, 255, 255, .9);
	--em-shadow: 0 8px 30px rgba(10, 33, 89, .14);
	--em-font: "Mukta", system-ui, "Noto Sans Devanagari", sans-serif;
	--em-font-mark: "Noto Serif", Georgia, serif;
	--em-r-card: 16px;
	--em-r-img: 14px;
	--em-r-ctl: 10px;
	--em-max: 1240px;
	--em-measure: 680px;
	color-scheme: light;
}
:root[data-theme="dark"] {
	--em-page: #0B1330;
	--em-surface: #131C3D;
	--em-text: #E9ECF4;
	--em-text-2: #AEB6C8;
	--em-heading: #F2F4FA;
	--em-label: #FF7A7E;
	--em-link: #A9BEFF;
	--em-line: rgba(255, 255, 255, .12);
	--em-mark: #5A4A00;
	--em-btn: #A9BEFF;
	--em-btn-text: #0B1330;
	--em-glass: rgba(19, 28, 61, .8);
	--em-glass-strong: rgba(19, 28, 61, .94);
	--em-glass-edge: rgba(255, 255, 255, .14);
	--em-shadow: 0 8px 30px rgba(0, 0, 0, .45);
	color-scheme: dark;
}
@media (prefers-color-scheme: dark) {
	:root:not([data-theme]) {
		--em-page: #0B1330;
		--em-surface: #131C3D;
		--em-text: #E9ECF4;
		--em-text-2: #AEB6C8;
		--em-heading: #F2F4FA;
		--em-label: #FF7A7E;
		--em-link: #A9BEFF;
		--em-line: rgba(255, 255, 255, .12);
		--em-mark: #5A4A00;
		--em-btn: #A9BEFF;
		--em-btn-text: #0B1330;
		--em-glass: rgba(19, 28, 61, .8);
		--em-glass-strong: rgba(19, 28, 61, .94);
		--em-glass-edge: rgba(255, 255, 255, .14);
		--em-shadow: 0 8px 30px rgba(0, 0, 0, .45);
		color-scheme: dark;
	}
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: 96px; }
body { margin: 0; background: var(--em-page); color: var(--em-text); font: 400 17px/1.7 var(--em-font); -webkit-font-smoothing: antialiased; overflow-wrap: break-word; }
img, svg, video, iframe, embed { max-width: 100%; }
img, video { height: auto; }
a { color: var(--em-link); text-underline-offset: .2em; }
a:hover { color: var(--em-label); }
h1, h2, h3, h4, h5, h6 { margin: 0 0 .5em; font-family: var(--em-font); font-weight: 700; line-height: 1.35; color: var(--em-heading); overflow-wrap: anywhere; }
p { margin: 0 0 1em; }
mark { background: var(--em-mark); color: inherit; padding: 0 .1em; border-radius: 3px; }
:focus-visible { outline: 3px solid #2F6BFF; outline-offset: 2px; }
.is-latin { letter-spacing: -.01em; }
.screen-reader-text { position: absolute !important; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.em-skip { position: absolute; left: 12px; top: -80px; z-index: 100; padding: 10px 18px; border-radius: 999px; background: #fff; color: #0A2159; font-weight: 700; }
.em-skip:focus { top: 12px; }
.em-container { width: 100%; max-width: var(--em-max); margin-inline: auto; padding-inline: 16px; }
.em-main { display: block; padding-bottom: 56px; }
.em-main:focus { outline: none; }
/* Page grids get shrinkable columns so one long URL in a widget or comment cannot widen the page. */
.em-home, .em-single, .em-after, .em-footer__grid, .em-page-head { grid-template-columns: minmax(0, 1fr); }
.em-footer__copy, .em-footer__nav, .em-byline__text { min-width: 0; }
.em-icon { width: 22px; height: 22px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.em-only-tablet { display: none !important; }
html:not(.em-js) [data-em-theme-toggle] { display: none; }
@media (min-width: 768px) { .em-container { padding-inline: 24px; } }
@media (min-width: 768px) and (max-width: 1023px) { .em-only-tablet { display: inline-flex !important; } }
@media (max-width: 767px) { .em-only-desktop { display: none !important; } }
@media (prefers-reduced-motion: reduce) {
	*, *::before, *::after { transition: none !important; animation: none !important; scroll-behavior: auto !important; }
}

/* ---------- Header (always light: the red wordmark stays on white) ---------- */
.em-header-widgets { padding-top: 12px; }
.em-header { position: sticky; top: 0; z-index: 50; padding-block: 12px; transition: transform .25s ease; }
.em-header.is-hidden { transform: translateY(-110%); }
.em-masthead { display: flex; align-items: center; gap: 16px; padding: 8px 10px 8px 12px; background: #fff; color: #0A2159; border: 1px solid #E3E6EE; border-radius: 999px; transition: background-color .2s, box-shadow .2s; }
.em-header.is-scrolled .em-masthead { background: rgba(255, 255, 255, .82); -webkit-backdrop-filter: blur(18px) saturate(1.8); backdrop-filter: blur(18px) saturate(1.8); border-color: rgba(255, 255, 255, .9); box-shadow: 0 8px 30px rgba(10, 33, 89, .16); }
@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
	.em-header.is-scrolled .em-masthead { background: #fff; }
}
@media (prefers-reduced-transparency: reduce) {
	.em-header.is-scrolled .em-masthead { background: #fff; -webkit-backdrop-filter: none; backdrop-filter: none; }
}
.em-brand { display: flex; align-items: center; gap: 10px; min-width: 0; text-decoration: none; }
.em-brand__emblem { width: 40px; height: 40px; border-radius: 10px; object-fit: cover; flex: none; }
.em-brand__text { display: flex; flex-direction: column; min-width: 0; line-height: 1.1; }
.em-brand__name { font: 700 22px/1.1 var(--em-font-mark); color: #D71920; white-space: nowrap; }
.em-brand__tag { margin-top: 3px; font-size: 12px; color: #0A2159; white-space: nowrap; }
.em-brand__tag b { color: #D71920; }
.em-header.is-scrolled .em-brand__tag { display: none; }
.em-nav { flex: 1; min-width: 0; }
.em-nav__list { display: flex; justify-content: center; gap: 2px; margin: 0; padding: 0; list-style: none; overflow-x: auto; scrollbar-width: none; }
.em-nav__list a { display: block; padding: 8px 12px; border-radius: 999px; color: #0A2159; font-size: 15px; font-weight: 500; text-decoration: none; white-space: nowrap; }
.em-nav__list a:hover { background: #F0F2F8; color: #0A2159; }
.em-nav__list .current-menu-item > a::before, .em-nav__list .current-cat > a::before { content: ""; display: inline-block; width: 6px; height: 6px; margin-right: 6px; border-radius: 50%; background: #D71920; vertical-align: middle; }
.em-masthead__actions { display: flex; gap: 6px; margin-left: auto; }
.em-iconbtn { display: inline-flex; align-items: center; justify-content: center; width: 44px; height: 44px; padding: 0; border: 1px solid #E3E6EE; border-radius: 999px; background: #fff; color: #0A2159; cursor: pointer; text-decoration: none; }
.em-iconbtn:hover { background: #F0F2F8; color: #0A2159; }
.em-when-dark { display: none; }
[data-theme="dark"] .em-when-dark { display: inline-flex; }
[data-theme="dark"] .em-when-light { display: none; }
.em-subnav__list { display: flex; flex-wrap: wrap; justify-content: center; gap: 4px 16px; margin: 8px 0 0; padding: 0; list-style: none; font-size: 14px; }
.em-subnav__list a { color: var(--em-heading); text-decoration: none; }
@media (max-width: 1023px) { .em-nav { display: none; } }
@media (max-width: 767px) {
	.em-header { padding-block: 8px; }
	.em-masthead { padding: 6px 8px; }
	.em-brand__emblem { width: 32px; height: 32px; border-radius: 8px; }
	.em-brand__name { font-size: 19px; }
	.em-brand__tag { display: none; }
}

/* ---------- Cards ---------- */
.em-card { display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.em-card__media { display: block; aspect-ratio: 16 / 9; overflow: hidden; border-radius: var(--em-r-img); background: var(--em-line); }
.em-card__media img { display: block; width: 100%; height: 100%; object-fit: cover; transition: transform .3s ease; }
.em-card:hover .em-card__media img { transform: scale(1.02); }
.em-card__ph { display: block; width: 100%; height: 100%; background: #0A2159 url(../img/emblem-192.png) center / 48px no-repeat; }
.em-card__body { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.em-card__title { margin: 0; font-size: 19px; font-weight: 700; line-height: 1.4; }
.em-card__title a { color: var(--em-heading); text-decoration: none; }
.em-card__title a:hover { color: var(--em-label); }
.em-card__excerpt { display: -webkit-box; margin: 0; overflow: hidden; color: var(--em-text-2); font-size: 16px; line-height: 1.65; -webkit-line-clamp: 3; -webkit-box-orient: vertical; }
.em-label { display: flex; align-items: center; gap: 8px; margin: 0; color: var(--em-label); font-size: 13px; font-weight: 600; }
.em-label::before { content: ""; width: 18px; height: 2px; background: currentColor; }
.em-label a { color: inherit; text-decoration: none; }
.em-meta { margin: 0; color: var(--em-text-2); font-size: 13px; }
.em-card--lead { gap: 0; overflow: hidden; background: var(--em-surface); border: 1px solid var(--em-line); border-radius: var(--em-r-card); }
.em-card--lead .em-card__media { border-radius: 0; }
.em-card--lead .em-card__body { gap: 10px; padding: 20px 22px 24px; }
.em-card--lead .em-card__title { font-size: clamp(24px, 3vw, 34px); font-weight: 800; line-height: 1.3; }
.em-card--lead .em-card__excerpt { font-size: 17px; -webkit-line-clamp: 4; }
.em-card--feature .em-card__title { font-size: 22px; font-weight: 800; }
.em-card--compact { flex-direction: row; align-items: flex-start; gap: 12px; }
.em-card--compact .em-card__media { width: 72px; flex: none; aspect-ratio: 1; border-radius: 10px; }
.em-card--compact .em-card__title { display: -webkit-box; overflow: hidden; font-size: 16px; line-height: 1.45; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
@media (min-width: 640px) {
	.em-card--feature { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.3fr); align-items: center; gap: 20px; }
}
@media (min-width: 900px) {
	.em-card--lead { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr); align-items: stretch; }
	.em-card--lead .em-card__media { aspect-ratio: auto; height: 100%; min-height: 340px; }
	.em-card--lead .em-card__body { justify-content: center; }
}

/* ---------- Widget blocks ---------- */
.em-area { display: grid; gap: 24px; min-width: 0; }
.em-area > .widget, .em-rail > .widget { min-width: 0; padding: 20px; background: var(--em-surface); border: 1px solid var(--em-line); border-radius: var(--em-r-card); }
.em-area > .widget.mh_slider_hp { padding: 0; background: none; border: 0; }
.em-rail > .widget + .widget { margin-top: 24px; }
.widget-title { display: flex; align-items: center; gap: 8px; margin: 0 0 14px; font-size: 18px; font-weight: 700; color: var(--em-heading); }
.widget-title::before { content: ""; width: 8px; height: 8px; flex: none; border-radius: 50%; background: var(--em-red); }
.widget-title a { color: inherit; text-decoration: none; }
.em-block__head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 16px; padding-bottom: 10px; border-bottom: 1px solid var(--em-line); }
.em-block__head .widget-title { margin: 0; }
.em-more { flex: none; color: var(--em-label); font-size: 14px; font-weight: 600; text-decoration: none; white-space: nowrap; }
.em-block__lead + .em-list { margin-top: 16px; }
.em-list { display: grid; margin: 0; padding: 0; list-style: none; }
.em-list > li { padding-block: 12px; border-top: 1px solid var(--em-line); }
.em-list > li:first-child { padding-top: 0; border-top: 0; }
.em-list > li:last-child { padding-bottom: 0; }
.widget ul:not(.em-list):not(.em-nip):not(.em-chips) { margin: 0; padding: 0; list-style: none; }
.widget ul:not(.em-list):not(.em-nip):not(.em-chips) > li { padding: 8px 0; border-bottom: 1px solid var(--em-line); }
.em-nip { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin: 0; padding: 0; list-style: none; }
.em-nip img { display: block; width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 10px; }
.em-swipe { display: grid; grid-auto-flow: column; grid-auto-columns: 100%; gap: 16px; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: thin; }
.em-swipe > * { scroll-snap-align: start; }
.em-swipe--cards { grid-auto-columns: minmax(220px, 45%); }

/* ---------- Home ---------- */
.em-home { display: grid; align-items: start; gap: 24px; padding-top: 8px; }
.em-home__main, .em-home__rail { display: grid; gap: 24px; min-width: 0; }
.em-row { display: grid; gap: 24px; }
@media (min-width: 640px) {
	.em-row--2, .em-row--3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (min-width: 1180px) {
	.em-row--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (min-width: 1024px) {
	.em-home.has-rail { grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); gap: 32px; }
	.em-home__wide { grid-column: 1 / -1; }
	.em-home__rail { position: sticky; top: 96px; max-height: calc(100vh - 112px); overflow-y: auto; padding-bottom: 8px; scrollbar-width: thin; }
}

/* ---------- Footer ---------- */
.em-footer { margin-top: 48px; padding: 48px 0 32px; background: #0A2159; color: #E9ECF4; }
[data-theme="dark"] .em-footer { background: #070F28; }
.em-footer a { color: #fff; }
.em-footer__grid { display: grid; gap: 32px; }
.em-footer .widget-title, .em-footer .em-card__title a { color: #fff; }
.em-footer .em-block__head, .em-footer .em-list > li { border-color: rgba(255, 255, 255, .14); }
.em-footer .em-meta, .em-footer .em-card__excerpt { color: #B9C3DA; }
.em-footer .em-more { color: #FF9EA1; }
.em-footer__bar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 16px; margin-top: 40px; padding-top: 24px; border-top: 1px solid rgba(255, 255, 255, .14); }
.em-footer__brand { display: inline-flex; align-items: center; gap: 10px; padding: 6px 16px 6px 6px; background: #fff; border-radius: 999px; text-decoration: none; }
.em-footer__brand .em-brand__emblem { width: 32px; height: 32px; }
.em-footer__brand .em-brand__name { font-size: 18px; }
.em-footer__list { display: flex; flex-wrap: wrap; gap: 8px 16px; margin: 0; padding: 0; list-style: none; }
.em-footer__copy { margin: 0; color: #B9C3DA; font-size: 13px; }
@media (min-width: 640px) { .em-footer__grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 1024px) { .em-footer__grid { grid-template-columns: repeat(4, minmax(0, 1fr)); } }

/* ---------- Forms and buttons (comments, Mailchimp, WPForms, widgets) ---------- */
input[type="text"], input[type="email"], input[type="url"], input[type="search"], input[type="tel"], textarea, select {
	max-width: 100%; padding: 10px 12px; border: 1px solid var(--em-line); border-radius: var(--em-r-ctl); background: var(--em-surface); color: var(--em-text); font: inherit;
}
button, input[type="submit"], .em-btn, .wpforms-submit {
	min-height: 44px; padding: 0 22px; border: 0; border-radius: 999px; background: var(--em-btn); color: var(--em-btn-text); font: 600 16px/1 var(--em-font); cursor: pointer;
}
.em-iconbtn { font: inherit; }

/* ---------- Search form ---------- */
.em-search { display: flex; align-items: center; gap: 8px; padding: 4px 4px 4px 18px; background: var(--em-surface); border: 2px solid var(--em-navy); border-radius: 999px; }
[data-theme="dark"] .em-search { border-color: var(--em-text-2); }
.em-search:focus-within { box-shadow: 0 0 0 3px rgba(47, 107, 255, .35); }
.em-search__input { flex: 1; min-width: 0; padding: 8px 0; border: 0 !important; background: none !important; color: var(--em-text); font: 400 17px/1.4 var(--em-font); outline: none; }
.em-search__btn { display: inline-flex; align-items: center; justify-content: center; width: 44px; height: 44px; padding: 0; border-radius: 999px; background: var(--em-navy); color: #fff; }
[data-theme="dark"] .em-search__btn { background: #A9BEFF; color: #0B1330; }

/* ---------- Sheets (dialogs) ---------- */
.em-sheet { position: fixed; inset: 0; z-index: 80; display: none; align-items: flex-end; justify-content: center; background: rgba(7, 15, 40, .45); }
.em-sheet.is-open, html:not(.em-js) .em-sheet:target { display: flex; }
.em-sheet__panel { width: 100%; max-width: 640px; max-height: 85vh; overflow-y: auto; padding: 20px 20px calc(24px + env(safe-area-inset-bottom)); background: var(--em-glass-strong); -webkit-backdrop-filter: blur(18px) saturate(1.8); backdrop-filter: blur(18px) saturate(1.8); border: 1px solid var(--em-glass-edge); border-radius: 24px 24px 0 0; box-shadow: var(--em-shadow); }
@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) { .em-sheet__panel { background: var(--em-surface); } }
@media (prefers-reduced-transparency: reduce) { .em-sheet__panel { background: var(--em-surface); -webkit-backdrop-filter: none; backdrop-filter: none; } }
.em-sheet__head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.em-sheet__title { margin: 0; font-size: 20px; }
.em-sheet .em-iconbtn { background: var(--em-surface); color: var(--em-heading); border-color: var(--em-line); }
.em-sheet__hint { margin: 18px 0 8px; color: var(--em-text-2); font-size: 14px; }
.em-sheet__list { margin: 0; padding: 0; list-style: none; }
.em-sheet__list li { display: flex; align-items: center; justify-content: space-between; gap: 8px; border-bottom: 1px solid var(--em-line); color: var(--em-text-2); font-size: 14px; }
.em-sheet__list a { display: block; flex: 1; padding: 12px 4px; color: var(--em-heading); font-size: 17px; font-weight: 500; text-decoration: none; }
.em-sheet__list + .em-sheet__list { margin-top: 12px; }
body.em-sheet-open { overflow: hidden; }
@media (min-width: 768px) {
	.em-sheet { align-items: flex-start; padding-top: 10vh; }
	.em-sheet__panel { border-radius: 24px; }
}

/* ---------- Chips (top categories) ---------- */
.em-chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 0; padding: 0; list-style: none; }
.em-chips a { display: inline-flex; align-items: center; gap: 6px; min-height: 40px; padding: 6px 14px; background: var(--em-surface); border: 1px solid var(--em-line); border-radius: 999px; color: var(--em-heading); font-weight: 500; text-decoration: none; }
.em-chips span { color: var(--em-text-2); font-size: 13px; }

/* ---------- Phone: tab bar and swipe rows ---------- */
.em-tabbar { display: none; }
@media (max-width: 767px) {
	.em-footer { padding-bottom: calc(112px + env(safe-area-inset-bottom)); }
	#wpd-bubble-wrapper { bottom: calc(96px + env(safe-area-inset-bottom)) !important; }
	.em-tabbar { position: fixed; left: 12px; right: 12px; bottom: calc(12px + env(safe-area-inset-bottom)); z-index: 60; display: flex; justify-content: space-around; padding: 6px; background: var(--em-glass); -webkit-backdrop-filter: blur(18px) saturate(1.8); backdrop-filter: blur(18px) saturate(1.8); border: 1px solid var(--em-glass-edge); border-radius: 999px; box-shadow: var(--em-shadow); }
	.em-tab { display: flex; flex: 1; flex-direction: column; align-items: center; justify-content: center; gap: 2px; min-height: 48px; border-radius: 999px; color: var(--em-heading); font: 500 12px/1 var(--em-font); text-decoration: none; }
	.em-tab[aria-current="page"] { color: var(--em-label); }
	.em-typing .em-tabbar, .em-sheet-open .em-tabbar { display: none; }
	.em-area > .widget, .em-rail > .widget { padding: 16px; }
	.em-home .em-list { display: flex; gap: 12px; margin-inline: -16px; padding: 4px 16px 8px; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; }
	.em-home .em-list > li { flex: 0 0 72%; max-width: 260px; padding: 0; border: 0; scroll-snap-align: start; }
	.em-home .em-list .em-card--compact { flex-direction: column; }
	.em-home .em-list .em-card--compact .em-card__media { width: 100%; aspect-ratio: 16 / 9; border-radius: var(--em-r-img); }
}
@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
	.em-tabbar { background: var(--em-surface); }
}
@media (prefers-reduced-transparency: reduce) {
	.em-tabbar { background: var(--em-surface); -webkit-backdrop-filter: none; backdrop-filter: none; }
}

/* ---------- Article ---------- */
.em-progress { position: fixed; top: 0; left: 0; right: 0; z-index: 70; height: 3px; pointer-events: none; }
.em-progress__bar { height: 100%; background: var(--em-red); transform: scaleX(0); transform-origin: 0 50%; }
.em-single { display: grid; gap: 40px; padding-top: 16px; }
.em-article { width: 100%; max-width: var(--em-measure); min-width: 0; margin-inline: auto; }
.em-single--full .em-article { max-width: 1040px; }
.em-article__head { margin-bottom: 24px; }
.em-article__title { margin: 10px 0 16px; font-size: clamp(26px, 4.2vw, 36px); font-weight: 800; line-height: 1.3; }
.em-byline { display: flex; align-items: center; gap: 12px; }
.em-byline__avatar { border-radius: 50%; }
.em-byline__text { display: flex; flex-direction: column; margin: 0; color: var(--em-text-2); font-size: 14px; line-height: 1.5; }
.em-byline__author { color: var(--em-heading); font-weight: 600; text-decoration: none; }
.em-article__media { margin: 0 0 28px; }
.em-article__media img { display: block; width: 100%; border-radius: var(--em-r-img); }
.em-article__media figcaption { margin-top: 8px; color: var(--em-text-2); font-size: 13px; }
.em-article .em-area { margin-block: 24px; }
.em-prose { font-size: 17px; line-height: 1.8; overflow-wrap: break-word; }
.em-prose > * { margin-block: 0 1.1em; }
.em-prose h2 { margin-top: 1.6em; font-size: 1.45em; }
.em-prose h3 { margin-top: 1.4em; font-size: 1.2em; }
.em-prose h4 { margin-top: 1.2em; font-size: 1.05em; }
.em-prose a { color: var(--em-link); text-decoration: underline; overflow-wrap: anywhere; }
.em-prose img { border-radius: 10px; }
.em-prose blockquote { margin: 1.6em 0; padding: 4px 0 4px 20px; border-left: 3px solid var(--em-red); border-radius: 0; color: var(--em-heading); font-weight: 500; }
.em-prose ul, .em-prose ol { padding-left: 1.4em; }
.em-prose li + li { margin-top: .3em; }
.em-prose figure { max-width: 100%; margin-inline: 0; }
.em-prose .wp-caption { max-width: 100%; }
.em-prose figcaption, .em-prose .wp-caption-text { color: var(--em-text-2); font-size: 14px; text-align: center; }
.em-prose table { display: block; max-width: 100%; overflow-x: auto; border-collapse: collapse; font-size: 16px; }
.em-prose th, .em-prose td { padding: 8px 10px; border: 1px solid var(--em-line); }
.em-prose pre { max-width: 100%; overflow-x: auto; }
.em-prose iframe, .em-prose embed, .em-prose video, .em-prose object { max-width: 100%; }
.em-prose .alignleft { float: left; margin: 0 1em 1em 0; }
.em-prose .alignright { float: right; margin: 0 0 1em 1em; }
.em-prose .aligncenter { display: block; margin-inline: auto; }
.em-prose .ngg-galleryoverview, .em-prose .ngg-imagebrowser { max-width: 100%; overflow: hidden; }
.em-divider { display: flex; align-items: center; gap: 10px; margin: 36px 0 28px; }
.em-divider::before, .em-divider::after { content: ""; flex: 1; height: 1px; background: var(--em-red); }
.em-divider span { width: 7px; height: 7px; border-radius: 50%; background: var(--em-red); }
.em-tags { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 28px; padding: 0; list-style: none; }
.em-tags a { display: inline-flex; min-height: 36px; align-items: center; padding: 4px 14px; background: var(--em-surface); border: 1px solid var(--em-line); border-radius: 999px; color: var(--em-heading); font-size: 14px; text-decoration: none; }
.em-author { display: flex; gap: 16px; margin-bottom: 32px; padding: 20px; background: var(--em-surface); border: 1px solid var(--em-line); border-radius: var(--em-r-card); }
.em-author img { border-radius: 50%; }
.em-author__name { margin: 0 0 4px; font-size: 18px; }
.em-author__name a { color: var(--em-heading); text-decoration: none; }
.em-author__bio { margin: 0; color: var(--em-text-2); font-size: 16px; }
.em-after { display: grid; gap: 48px; padding-top: 24px; }
.em-related__grid { display: grid; gap: 24px; }
.em-comments-wrap { width: 100%; max-width: var(--em-measure); margin-inline: auto; }
.em-comments .comment-list, .em-comments .children { margin: 0; padding: 0; list-style: none; }
.em-comments .children { padding-left: 20px; border-left: 2px solid var(--em-line); }
.em-comments .comment-body { padding: 16px 0; border-bottom: 1px solid var(--em-line); }
.em-comments .comment-form input:not([type="submit"]):not([type="checkbox"]), .em-comments .comment-form textarea { width: 100%; }
@media (min-width: 700px) { .em-related__grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (min-width: 768px) { .em-prose { font-size: 19px; } }
@media (max-width: 600px) { .em-prose .alignleft, .em-prose .alignright { float: none; display: block; margin: 0 auto 1em; } }
@media (min-width: 1200px) {
	.em-single.has-rail { grid-template-columns: minmax(0, 1fr) 320px; align-items: start; }
	.em-single.has-rail .em-rail { position: sticky; top: 96px; }
}

/* ---------- wpDiscuz bridge ---------- */
#wpdcom { max-width: var(--em-measure); margin-inline: auto; color: var(--em-text); font-family: var(--em-font) !important; }
#wpdcom .wpd-comment-text, #wpdcom .wpd-comment-text p { color: var(--em-text) !important; font-size: 17px !important; line-height: 1.75 !important; }
#wpdcom .wpd-comment-author, #wpdcom .wpd-comment-author a { color: var(--em-heading) !important; }
#wpdcom .wpd-thread-head, #wpdcom .wpd-thread-info, #wpdcom .wpd-comment .wpd-comment-wrap { border-color: var(--em-line) !important; }
#wpdcom textarea, #wpdcom input[type="text"], #wpdcom input[type="email"], #wpdcom input[type="url"], #wpdcom .ql-container, #wpdcom .ql-editor { background: var(--em-surface) !important; color: var(--em-text) !important; border-color: var(--em-line) !important; }
#wpdcom .wc_comm_submit, #wpdcom .wpd-prim-button, #wpdcom input.wc_comm_submit { min-height: 44px; padding: 0 22px !important; background: var(--em-btn) !important; color: var(--em-btn-text) !important; border-radius: 999px !important; font-family: var(--em-font) !important; }
#wpdcom .wpd-thread-filter .wpdf-active { color: var(--em-label) !important; border-bottom-color: var(--em-label) !important; }
[data-theme="dark"] #wpdcom .ql-toolbar { background: var(--em-surface) !important; border-color: var(--em-line) !important; }
[data-theme="dark"] #wpdcom .ql-toolbar button svg * { stroke: var(--em-text) !important; }
[data-theme="dark"] #wpdcom .wpd-comment-right, [data-theme="dark"] #wpdcom .wpd-form-wrap, [data-theme="dark"] #wpdcom .wpd-thread-list { background: transparent !important; }
.wpd-rating-title, #wpdcom .wpd-sbs-title, #wpdcom .wpd-thread-info, #wpdcom .wpd-editor-char-counter, #wpdcom .wpd-thread-info * { color: var(--em-text-2) !important; }

/* ---------- Archive, search, 404 ---------- */
.em-archive { padding-top: 8px; }
.em-page-head { display: grid; gap: 10px; margin-bottom: 28px; padding: 16px 0 24px; border-bottom: 1px solid var(--em-line); }
.em-page-title { margin: 0; font-size: clamp(28px, 4vw, 40px); font-weight: 800; }
.em-page-desc { max-width: var(--em-measure); color: var(--em-text-2); }
.em-page-desc p { margin: 0; }
.em-count { margin: 0; color: var(--em-text-2); font-size: 14px; }
.em-page-head .em-search { max-width: 640px; }
.em-grid { display: grid; gap: 24px; }
.em-grid > .em-card--standard { padding: 12px 12px 18px; background: var(--em-surface); border: 1px solid var(--em-line); border-radius: var(--em-r-card); }
.em-grid > .em-card--feature { padding: 16px; background: var(--em-surface); border: 1px solid var(--em-line); border-radius: var(--em-r-card); }
@media (min-width: 700px) {
	.em-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
	.em-grid > .em-card--feature { grid-column: 1 / -1; }
}
.navigation.pagination { margin-top: 40px; }
.nav-links { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; }
.page-numbers { display: inline-flex; align-items: center; justify-content: center; min-width: 44px; height: 44px; padding: 0 14px; background: var(--em-surface); border: 1px solid var(--em-line); border-radius: 999px; color: var(--em-heading); font-weight: 600; text-decoration: none; }
.page-numbers.current { background: var(--em-btn); border-color: var(--em-btn); color: var(--em-btn-text); }
.page-numbers.dots { background: none; border: 0; }
.em-empty { display: grid; gap: 12px; justify-items: start; padding: 24px 0; }
.em-empty__title { margin: 0; font-size: 24px; }

/* ---------- Trending strip ---------- */
.em-ticker { display: flex; align-items: center; gap: 12px; margin-block: 0 12px; font-size: 14px; }
.em-ticker__label { display: flex; flex: none; align-items: center; gap: 6px; margin: 0; color: var(--em-label); font-size: 14px; font-weight: 700; }
.em-ticker__label::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.em-ticker__list { display: flex; gap: 24px; min-width: 0; margin: 0; padding: 4px 0; overflow-x: auto; list-style: none; scroll-snap-type: x proximity; scrollbar-width: thin; }
.em-ticker__list li { flex: none; scroll-snap-align: start; }
.em-ticker__list a { color: var(--em-text); text-decoration: none; white-space: nowrap; }
.em-ticker__list a:hover { color: var(--em-label); }
