/*
 * Shared CMS body styles for .ckeditor-content and .blog-detail-wrap .content.
 * Adding .ckeditor-content is enough to get this sheet.
 * 1) all:revert strips theme/Bootstrap author styles from descendants
 * 2) Structure/spacing remapped from CKEditor contents.css
 * 3) Font-family and color inherit the client template, not editor chrome
 * Do not apply revert to .blog-detail-wrap itself (page chrome).
 * Source: myadmin/bower_components/ckeditor/contents.css
 */

/* ---- Isolation: ignore site CSS inside CMS HTML ---- */
.blog-detail-wrap .content,
.blog-detail-wrap .content *,
.ckeditor-content,
.ckeditor-content * {
	all: revert;
}

/* Container = editor body + .cke_editable (skip editor chrome margin/white page bg) */
.blog-detail-wrap .content,
.ckeditor-content {
	display: block;
	font-family: inherit;
	font-size: inherit;
	line-height: inherit;
	color: inherit;
	word-wrap: break-word;
	background-color: transparent;
	margin: 0;
	padding: 0;
	max-width: 100%;
	box-sizing: border-box;
}

/* ---- contents.css (scoped) ---- */
.blog-detail-wrap .content blockquote,
.ckeditor-content blockquote {
	font-style: italic;
	font-family: inherit;
	padding: 12px 20px;
	margin: 1em 0;
	border-style: solid;
	border-color: #ccc;
	border-width: 0;
	padding-left: 20px;
	border-left-width: 5px;
	background: #f9f9f9;
}

.blog-detail-wrap .content.cke_contents_rtl blockquote,
.blog-detail-wrap .content[dir="rtl"] blockquote,
.ckeditor-content.cke_contents_rtl blockquote,
.ckeditor-content[dir="rtl"] blockquote {
	padding-left: 8px;
	padding-right: 20px;
	border-left-width: 0;
	border-right-width: 5px;
}

.blog-detail-wrap .content a,
.ckeditor-content a {
	color: inherit;
	text-decoration: underline;
}

.blog-detail-wrap .content ol,
.blog-detail-wrap .content ul,
.blog-detail-wrap .content dl,
.ckeditor-content ol,
.ckeditor-content ul,
.ckeditor-content dl {
	padding: 0 40px;
	margin: 0 0 20px;
}

.blog-detail-wrap .content ul,
.ckeditor-content ul {
	list-style-type: disc;
}

.blog-detail-wrap .content ol,
.ckeditor-content ol {
	list-style-type: decimal;
}

.blog-detail-wrap .content li,
.ckeditor-content li {
	display: list-item;
	margin-bottom: 8px;
}

.blog-detail-wrap .content h1,
.blog-detail-wrap .content h2,
.blog-detail-wrap .content h3,
.blog-detail-wrap .content h4,
.blog-detail-wrap .content h5,
.blog-detail-wrap .content h6,
.ckeditor-content h1,
.ckeditor-content h2,
.ckeditor-content h3,
.ckeditor-content h4,
.ckeditor-content h5,
.ckeditor-content h6 {
	font-weight: normal;
	line-height: 1.2;
}

.blog-detail-wrap .content h2,
.ckeditor-content h2 {
	font-size: 42px;
	margin: 1em 0 0.5em;
}

.blog-detail-wrap .content h3,
.ckeditor-content h3 {
	font-size: 28px;
	margin: 1em 0 0.5em;
}

.blog-detail-wrap .content h4,
.ckeditor-content h4 {
	font-size: 20px;
	margin: 1em 0 0.5em;
}

.blog-detail-wrap .content h5,
.ckeditor-content h5 {
	font-size: 16px;
	margin: 1em 0 0.5em;
}

.blog-detail-wrap .content p,
.ckeditor-content p {
	margin: 0 0 1em;
	line-height: 1.8;
}

.blog-detail-wrap .content strong,
.ckeditor-content strong {
	font-weight: 600;
}

.blog-detail-wrap .content hr,
.ckeditor-content hr {
	border: 0;
	border-top: 1px solid #ccc;
}

.blog-detail-wrap .content img.right,
.ckeditor-content img.right {
	border: 1px solid #ccc;
	float: right;
	margin-left: 15px;
	padding: 5px;
}

.blog-detail-wrap .content img.left,
.ckeditor-content img.left {
	border: 1px solid #ccc;
	float: left;
	margin-right: 15px;
	padding: 5px;
}

.blog-detail-wrap .content pre,
.ckeditor-content pre {
	white-space: pre-wrap;
	word-wrap: break-word;
	-moz-tab-size: 4;
	tab-size: 4;
}

.blog-detail-wrap .content .marker,
.ckeditor-content .marker {
	background-color: Yellow;
}

.blog-detail-wrap .content span[lang],
.ckeditor-content span[lang] {
	font-style: italic;
}

.blog-detail-wrap .content figure,
.ckeditor-content figure {
	text-align: center;
	border: solid 1px #ccc;
	border-radius: 2px;
	background: rgba(0, 0, 0, 0.05);
	padding: 10px;
	margin: 10px 20px;
	display: inline-block;
	max-width: 100%;
}

.blog-detail-wrap .content figure > figcaption,
.ckeditor-content figure > figcaption {
	text-align: center;
	display: block;
}

.blog-detail-wrap .content a > img,
.ckeditor-content a > img {
	padding: 1px;
	margin: 1px;
	border: none;
	outline: 1px solid var(--Primary);
}

.blog-detail-wrap .content .code-featured,
.ckeditor-content .code-featured {
	border: 5px solid red;
}

.blog-detail-wrap .content .math-featured,
.ckeditor-content .math-featured {
	padding: 20px;
	box-shadow: 0 0 2px rgba(200, 0, 0, 1);
	background-color: rgba(255, 0, 0, 0.05);
	margin: 10px;
}

.blog-detail-wrap .content .image-clean,
.ckeditor-content .image-clean {
	border: 0;
	background: none;
	padding: 0;
}

.blog-detail-wrap .content .image-clean > figcaption,
.ckeditor-content .image-clean > figcaption {
	font-size: 0.9em;
	text-align: right;
}

.blog-detail-wrap .content .image-grayscale,
.ckeditor-content .image-grayscale {
	background-color: white;
	color: #666;
}

.blog-detail-wrap .content .image-grayscale img,
.blog-detail-wrap .content img.image-grayscale,
.ckeditor-content .image-grayscale img,
.ckeditor-content img.image-grayscale {
	filter: grayscale(100%);
}

.blog-detail-wrap .content .embed-240p,
.ckeditor-content .embed-240p {
	max-width: 426px;
	max-height: 240px;
	margin: 0 auto;
}

.blog-detail-wrap .content .embed-360p,
.ckeditor-content .embed-360p {
	max-width: 640px;
	max-height: 360px;
	margin: 0 auto;
}

.blog-detail-wrap .content .embed-480p,
.ckeditor-content .embed-480p {
	max-width: 854px;
	max-height: 480px;
	margin: 0 auto;
}

.blog-detail-wrap .content .embed-720p,
.ckeditor-content .embed-720p {
	max-width: 1280px;
	max-height: 720px;
	margin: 0 auto;
}

.blog-detail-wrap .content .embed-1080p,
.ckeditor-content .embed-1080p {
	max-width: 1920px;
	max-height: 1080px;
	margin: 0 auto;
}

/*
 * After all:revert, HTML border/cellpadding behave like the CKEditor iframe.
 * Explicit table[border] rules keep borders consistent across browsers.
 */
.blog-detail-wrap .content table,
.ckeditor-content table {
	width: 100%;
	border-collapse: collapse;
	border-spacing: 0;
	empty-cells: show;
	margin: 24px 0;
	max-width: 100%;
}

.blog-detail-wrap .content table[border]:not([border="0"]),
.ckeditor-content table[border]:not([border="0"]) {
	border: 1px solid #000;
}

.blog-detail-wrap .content table[border]:not([border="0"]) td,
.blog-detail-wrap .content table[border]:not([border="0"]) th,
.ckeditor-content table[border]:not([border="0"]) td,
.ckeditor-content table[border]:not([border="0"]) th {
	border: 1px solid #000;
}

.blog-detail-wrap .content th,
.blog-detail-wrap .content td,
.ckeditor-content th,
.ckeditor-content td {
	padding: 10px 12px;
	vertical-align: top;
}

.blog-detail-wrap .content table[cellpadding="0"] td,
.blog-detail-wrap .content table[cellpadding="0"] th,
.ckeditor-content table[cellpadding="0"] td,
.ckeditor-content table[cellpadding="0"] th {
	padding: 0;
}

.blog-detail-wrap .content table[cellpadding="1"] td,
.blog-detail-wrap .content table[cellpadding="1"] th,
.ckeditor-content table[cellpadding="1"] td,
.ckeditor-content table[cellpadding="1"] th {
	padding: 1px;
}

.blog-detail-wrap .content table[cellpadding="2"] td,
.blog-detail-wrap .content table[cellpadding="2"] th,
.ckeditor-content table[cellpadding="2"] td,
.ckeditor-content table[cellpadding="2"] th {
	padding: 2px;
}

.blog-detail-wrap .content table[cellpadding="3"] td,
.blog-detail-wrap .content table[cellpadding="3"] th,
.ckeditor-content table[cellpadding="3"] td,
.ckeditor-content table[cellpadding="3"] th {
	padding: 3px;
}

.blog-detail-wrap .content table[cellpadding="4"] td,
.blog-detail-wrap .content table[cellpadding="4"] th,
.ckeditor-content table[cellpadding="4"] td,
.ckeditor-content table[cellpadding="4"] th {
	padding: 4px;
}

.blog-detail-wrap .content table[cellpadding="5"] td,
.blog-detail-wrap .content table[cellpadding="5"] th,
.ckeditor-content table[cellpadding="5"] td,
.ckeditor-content table[cellpadding="5"] th {
	padding: 5px;
}

.blog-detail-wrap .content table[cellspacing="1"],
.ckeditor-content table[cellspacing="1"] {
	border-spacing: 1px;
}

.blog-detail-wrap .content img,
.blog-detail-wrap .content iframe,
.blog-detail-wrap .content video,
.blog-detail-wrap .content embed,
.blog-detail-wrap .content object,
.ckeditor-content img,
.ckeditor-content iframe,
.ckeditor-content video,
.ckeditor-content embed,
.ckeditor-content object {
	max-width: 100%;
	height: auto;
}

.blog-detail-wrap .content iframe[src*="youtube"],
.blog-detail-wrap .content iframe[src*="youtu.be"],
.ckeditor-content iframe[src*="youtube"],
.ckeditor-content iframe[src*="youtu.be"] {
	width: 100%;
	min-height: 315px;
	aspect-ratio: 16 / 9;
}

@media (max-width: 767px) {
	.blog-detail-wrap .content,
	.ckeditor-content {
		font-size: inherit;
		line-height: inherit;
		overflow-x: auto;
		-webkit-overflow-scrolling: touch;
	}

	.blog-detail-wrap .content p,
	.ckeditor-content p {
		margin-bottom: 12px;
	}

	.blog-detail-wrap .content h2,
	.ckeditor-content h2 {
		font-size: 28px;
	}

	.blog-detail-wrap .content h3,
	.ckeditor-content h3 {
		font-size: 22px;
	}

	.blog-detail-wrap .content h4,
	.ckeditor-content h4 {
		font-size: 18px;
	}

	.blog-detail-wrap .content ul,
	.blog-detail-wrap .content ol,
	.ckeditor-content ul,
	.ckeditor-content ol {
		padding-left: 20px;
	}

	.blog-detail-wrap .content table,
	.blog-detail-wrap .content iframe,
	.blog-detail-wrap .content img,
	.blog-detail-wrap .content video,
	.blog-detail-wrap .content embed,
	.blog-detail-wrap .content object,
	.ckeditor-content table,
	.ckeditor-content iframe,
	.ckeditor-content img,
	.ckeditor-content video,
	.ckeditor-content embed,
	.ckeditor-content object {
		max-width: 100% !important;
	}

	.blog-detail-wrap .content iframe,
	.ckeditor-content iframe {
		width: 100% !important;
	}
}

/* ---- Client template typography wins over copied CKEditor contents.css ---- */
.blog-detail-wrap .content,
.blog-detail-wrap .content :where(p, span, li, td, th, h1, h2, h3, h4, h5, h6, a, blockquote, strong, em, b, i, u, div, figcaption, dt, dd, label),
.ckeditor-content,
.ckeditor-content :where(p, span, li, td, th, h1, h2, h3, h4, h5, h6, a, blockquote, strong, em, b, i, u, div, figcaption, dt, dd, label) {
	font-family: inherit;
	color: inherit;
}

/* ---- Legal page heading sizes (tighter than generic 42px h2) ---- */
.legal-page-body.ckeditor-content h2 {
	font-size: 25px;
	line-height: 1.35;
	font-weight: 600;
	margin: 38px 0 14px;
}

.legal-page-body.ckeditor-content h3 {
	font-size: 18px;
	line-height: 1.5;
	font-weight: 600;
	margin: 25px 0 10px;
}

.legal-page-body.ckeditor-content h4 {
	font-size: 16px;
	line-height: 1.5;
	font-weight: 600;
	margin: 22px 0 8px;
}

.legal-page-body.ckeditor-content h5 {
	font-size: 14px;
	line-height: 1.5;
	font-weight: 600;
	margin: 20px 0 8px;
}

@media (max-width: 767px) {
	.legal-page-body.ckeditor-content h2 {
		font-size: 22px;
	}

	.legal-page-body.ckeditor-content h3 {
		font-size: 17px;
	}

	.legal-page-body.ckeditor-content h4 {
		font-size: 15px;
	}
}

/* ---- CKEditor Biểu mẫu: restore current form chrome after all:revert ---- */
.blog-detail-wrap .content form,
.ckeditor-content form {
	display: flex;
	flex-direction: column;
	gap: 16px;
	max-width: 100%;
	margin: 1em 0;
	padding: 0;
	border: 0;
	box-sizing: border-box;
}

.blog-detail-wrap .content form p,
.ckeditor-content form p {
	margin: 0;
}

.blog-detail-wrap .content fieldset,
.ckeditor-content fieldset {
	border: 0;
	padding: 0;
	margin: 0;
	min-width: 0;
	width: 100%;
}

.blog-detail-wrap .content label,
.ckeditor-content label {
	display: block;
	font-family: inherit;
	font-size: inherit;
	color: inherit;
	margin: 0 0 8px;
}

.blog-detail-wrap .content label:has(input[type="checkbox"]),
.blog-detail-wrap .content label:has(input[type="radio"]),
.ckeditor-content label:has(input[type="checkbox"]),
.ckeditor-content label:has(input[type="radio"]) {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	margin-bottom: 0;
}

.blog-detail-wrap .content input[type="hidden"],
.ckeditor-content input[type="hidden"] {
	display: none;
}

.blog-detail-wrap .content input:not([type]),
.blog-detail-wrap .content input[type="text"],
.blog-detail-wrap .content input[type="password"],
.blog-detail-wrap .content input[type="datetime"],
.blog-detail-wrap .content input[type="datetime-local"],
.blog-detail-wrap .content input[type="date"],
.blog-detail-wrap .content input[type="month"],
.blog-detail-wrap .content input[type="time"],
.blog-detail-wrap .content input[type="week"],
.blog-detail-wrap .content input[type="number"],
.blog-detail-wrap .content input[type="email"],
.blog-detail-wrap .content input[type="url"],
.blog-detail-wrap .content input[type="search"],
.blog-detail-wrap .content input[type="tel"],
.blog-detail-wrap .content input[type="color"],
.blog-detail-wrap .content textarea,
.blog-detail-wrap .content select,
.ckeditor-content input:not([type]),
.ckeditor-content input[type="text"],
.ckeditor-content input[type="password"],
.ckeditor-content input[type="datetime"],
.ckeditor-content input[type="datetime-local"],
.ckeditor-content input[type="date"],
.ckeditor-content input[type="month"],
.ckeditor-content input[type="time"],
.ckeditor-content input[type="week"],
.ckeditor-content input[type="number"],
.ckeditor-content input[type="email"],
.ckeditor-content input[type="url"],
.ckeditor-content input[type="search"],
.ckeditor-content input[type="tel"],
.ckeditor-content input[type="color"],
.ckeditor-content textarea,
.ckeditor-content select {
	display: block;
	box-sizing: border-box;
	width: 100%;
	max-width: 100%;
	font-family: inherit;
	font-size: 16px;
	line-height: 26px;
	font-weight: 400;
	color: var(--Secondary);
	background: var(--White);
	border: 2px solid var(--line);
	border-radius: 8px;
	outline: 0;
	box-shadow: none;
	padding: 11px 16px;
}

.blog-detail-wrap .content input:not([type]):focus,
.blog-detail-wrap .content input[type="text"]:focus,
.blog-detail-wrap .content input[type="password"]:focus,
.blog-detail-wrap .content input[type="datetime"]:focus,
.blog-detail-wrap .content input[type="datetime-local"]:focus,
.blog-detail-wrap .content input[type="date"]:focus,
.blog-detail-wrap .content input[type="month"]:focus,
.blog-detail-wrap .content input[type="time"]:focus,
.blog-detail-wrap .content input[type="week"]:focus,
.blog-detail-wrap .content input[type="number"]:focus,
.blog-detail-wrap .content input[type="email"]:focus,
.blog-detail-wrap .content input[type="url"]:focus,
.blog-detail-wrap .content input[type="search"]:focus,
.blog-detail-wrap .content input[type="tel"]:focus,
.blog-detail-wrap .content input[type="color"]:focus,
.blog-detail-wrap .content textarea:focus,
.blog-detail-wrap .content select:focus,
.ckeditor-content input:not([type]):focus,
.ckeditor-content input[type="text"]:focus,
.ckeditor-content input[type="password"]:focus,
.ckeditor-content input[type="datetime"]:focus,
.ckeditor-content input[type="datetime-local"]:focus,
.ckeditor-content input[type="date"]:focus,
.ckeditor-content input[type="month"]:focus,
.ckeditor-content input[type="time"]:focus,
.ckeditor-content input[type="week"]:focus,
.ckeditor-content input[type="number"]:focus,
.ckeditor-content input[type="email"]:focus,
.ckeditor-content input[type="url"]:focus,
.ckeditor-content input[type="search"]:focus,
.ckeditor-content input[type="tel"]:focus,
.ckeditor-content input[type="color"]:focus,
.ckeditor-content textarea:focus,
.ckeditor-content select:focus {
	border-color: var(--line);
}

.blog-detail-wrap .content input::placeholder,
.blog-detail-wrap .content textarea::placeholder,
.ckeditor-content input::placeholder,
.ckeditor-content textarea::placeholder {
	color: var(--Secondary);
	opacity: 1;
}

.blog-detail-wrap .content textarea,
.ckeditor-content textarea {
	height: 112px;
	resize: none;
}

.blog-detail-wrap .content select,
.ckeditor-content select {
	cursor: pointer;
	padding: 7px 40px 7px 16px;
	border-radius: 8px;
	-webkit-appearance: none;
	appearance: none;
	background-color: var(--White);
	background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='%23552f01' d='M1 1.5L6 6.5L11 1.5'/%3E%3C/svg%3E");
	background-repeat: no-repeat;
	background-position: right 16px center;
	background-size: 12px 8px;
}

.blog-detail-wrap .content select:hover,
.ckeditor-content select:hover {
	border-color: var(--Onsurface);
}

.blog-detail-wrap .content input[type="checkbox"],
.blog-detail-wrap .content input[type="radio"],
.ckeditor-content input[type="checkbox"],
.ckeditor-content input[type="radio"] {
	-webkit-appearance: none;
	appearance: none;
	display: inline-block;
	vertical-align: text-bottom;
	box-sizing: border-box;
	flex-shrink: 0;
	width: 20px;
	height: 20px;
	min-width: 20px;
	max-width: 20px;
	margin: 0 8px 0 0;
	padding: 0;
	border: 1px solid var(--Secondary2, var(--Secondary));
	background-color: transparent;
	background-image: none;
	background-repeat: no-repeat;
	background-position: center;
	cursor: pointer;
	outline: 0;
	box-shadow: none;
}

.blog-detail-wrap .content label:has(input[type="checkbox"]) input[type="checkbox"],
.blog-detail-wrap .content label:has(input[type="radio"]) input[type="radio"],
.ckeditor-content label:has(input[type="checkbox"]) input[type="checkbox"],
.ckeditor-content label:has(input[type="radio"]) input[type="radio"] {
	margin: 0;
}

.blog-detail-wrap .content input[type="checkbox"],
.ckeditor-content input[type="checkbox"] {
	border-radius: 3px;
}

.blog-detail-wrap .content input[type="radio"],
.ckeditor-content input[type="radio"] {
	border-radius: 50%;
}

.blog-detail-wrap .content input[type="checkbox"]:checked,
.ckeditor-content input[type="checkbox"]:checked {
	border-color: var(--Onsurface);
	background-color: var(--Onsurface);
	background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='10' viewBox='0 0 10 10'%3E%3Cpath fill='none' stroke='%23ffffff' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round' d='M2 5.2l2.1 2.1 3.9-4.6'/%3E%3C/svg%3E");
	background-size: 10px 10px;
}

.blog-detail-wrap .content input[type="radio"]:checked,
.ckeditor-content input[type="radio"]:checked {
	border-color: var(--Onsurface);
	background-color: var(--White);
	background-image: radial-gradient(circle at center, var(--Onsurface) 0 4px, transparent 4.5px);
	background-size: 20px 20px;
	box-shadow: none;
}

.blog-detail-wrap .content input[type="submit"],
.blog-detail-wrap .content input[type="button"],
.blog-detail-wrap .content input[type="reset"],
.blog-detail-wrap .content button,
.ckeditor-content input[type="submit"],
.ckeditor-content input[type="button"],
.ckeditor-content input[type="reset"],
.ckeditor-content button {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	box-sizing: border-box;
	width: max-content;
	max-width: 100%;
	height: 48px;
	padding: 0 20px;
	border: 0;
	border-radius: 10px;
	background-color: var(--Onsurface);
	color: var(--White);
	font-family: inherit;
	font-size: 16px;
	line-height: 26px;
	font-weight: 400;
	cursor: pointer;
	outline: 0;
	transition: all 0.5s cubic-bezier(0.165, 0.84, 0.44, 1);
}

.blog-detail-wrap .content input[type="submit"]:hover,
.blog-detail-wrap .content input[type="button"]:hover,
.blog-detail-wrap .content input[type="reset"]:hover,
.blog-detail-wrap .content button:hover,
.ckeditor-content input[type="submit"]:hover,
.ckeditor-content input[type="button"]:hover,
.ckeditor-content input[type="reset"]:hover,
.ckeditor-content button:hover {
	background-color: var(--Primary);
	color: var(--White);
	box-shadow: 0 8px 30px 0 rgba(0, 0, 0, 0.15);
	transform: translate3d(0, -2px, 0);
}
