/**
 * Prime Academic Press — force layer v29.
 * Hard priority mode for OJS rich-text output:
 * - When body has .pap-richtext-source-priority, neutralize theme formatting inside rich-text containers.
 * - Keep rich-text source (inline styles promoted to !important by JS) as highest priority.
 */

/* Rich-text roots that should ignore theme typography/decoration layers */
.pap-richtext-source-priority .cmp_html_content,
.pap-richtext-source-priority .cmp_notification,
.pap-richtext-source-priority .obj_announcement_full,
.pap-richtext-source-priority .obj_announcement_summary,
.pap-richtext-source-priority .journal-description,
.pap-richtext-source-priority .description,
.pap-richtext-source-priority .about_site {
	font: revert !important;
	color: revert !important;
	letter-spacing: revert !important;
	text-transform: revert !important;
}

/* Hard reset all descendants to native semantics to prevent theme bleed-through */
.pap-richtext-source-priority .cmp_html_content :where(*),
.pap-richtext-source-priority .cmp_notification :where(*),
.pap-richtext-source-priority .obj_announcement_full :where(*),
.pap-richtext-source-priority .obj_announcement_summary :where(*),
.pap-richtext-source-priority .journal-description :where(*),
.pap-richtext-source-priority .description :where(*),
.pap-richtext-source-priority .about_site :where(*) {
	all: revert !important;
}

/* Explicit semantic guards for common editor tags */
.pap-richtext-source-priority .cmp_html_content h1,
.pap-richtext-source-priority .cmp_html_content h2,
.pap-richtext-source-priority .cmp_html_content h3,
.pap-richtext-source-priority .cmp_html_content h4,
.pap-richtext-source-priority .cmp_html_content h5,
.pap-richtext-source-priority .cmp_html_content h6,
.pap-richtext-source-priority .cmp_notification h1,
.pap-richtext-source-priority .cmp_notification h2,
.pap-richtext-source-priority .cmp_notification h3,
.pap-richtext-source-priority .cmp_notification h4,
.pap-richtext-source-priority .cmp_notification h5,
.pap-richtext-source-priority .cmp_notification h6 {
	display: block !important;
}

.pap-richtext-source-priority .cmp_html_content ul,
.pap-richtext-source-priority .cmp_html_content ol,
.pap-richtext-source-priority .cmp_notification ul,
.pap-richtext-source-priority .cmp_notification ol {
	display: block !important;
	list-style: revert !important;
	padding-left: revert !important;
	margin-left: revert !important;
}

.pap-richtext-source-priority .cmp_html_content li,
.pap-richtext-source-priority .cmp_notification li {
	display: list-item !important;
	list-style: inherit !important;
}

/* Disable theme-injected title ornaments inside rich-text */
.pap-richtext-source-priority .cmp_html_content h1::before,
.pap-richtext-source-priority .cmp_html_content h1::after,
.pap-richtext-source-priority .cmp_html_content h2::before,
.pap-richtext-source-priority .cmp_html_content h2::after,
.pap-richtext-source-priority .cmp_html_content h3::before,
.pap-richtext-source-priority .cmp_html_content h3::after,
.pap-richtext-source-priority .cmp_notification h1::before,
.pap-richtext-source-priority .cmp_notification h1::after,
.pap-richtext-source-priority .cmp_notification h2::before,
.pap-richtext-source-priority .cmp_notification h2::after,
.pap-richtext-source-priority .cmp_notification h3::before,
.pap-richtext-source-priority .cmp_notification h3::after {
	content: none !important;
	display: none !important;
}

/* Information pages use .page_information .description (not always .cmp_html_content). */
body.pkp_page_information .page.page_information .description,
body.pkp_page_information .page.page_information .description :where(*) {
	all: revert !important;
}

body.pkp_page_information .page.page_information .description h1::before,
body.pkp_page_information .page.page_information .description h1::after,
body.pkp_page_information .page.page_information .description h2::before,
body.pkp_page_information .page.page_information .description h2::after,
body.pkp_page_information .page.page_information .description h3::before,
body.pkp_page_information .page.page_information .description h3::after {
	content: none !important;
	display: none !important;
}

body.pkp_page_information .page.page_information .description h2,
body.pkp_page_information .page.page_information .description h3 {
	display: block !important;
}

body.pkp_page_information .page.page_information .description ul,
body.pkp_page_information .page.page_information .description ol {
	list-style: revert !important;
	padding-left: revert !important;
	margin-left: revert !important;
}

body.pkp_page_information .page.page_information .description li {
	display: list-item !important;
	list-style: inherit !important;
}

/* Semantic size fallback for information rich-text (ensure h2 > h3 > li/p) */
body.pkp_page_information .page.page_information .description {
	line-height: 1.7 !important;
}

body.pkp_page_information .page.page_information .description h2 {
	line-height: 1.3 !important;
	font-weight: 700 !important;
	margin: 0.6em 0 0.45em !important;
}

body.pkp_page_information .page.page_information .description h3 {
	line-height: 1.35 !important;
	font-weight: 600 !important;
	margin: 0.55em 0 0.35em !important;
}

body.pkp_page_information .page.page_information .description p,
body.pkp_page_information .page.page_information .description li {
	line-height: 1.72 !important;
}
