/**
 * Màu sắc, font và giao diện các khối trong bài viết.
 *
 * File này dùng chung cho trang web và trình soạn thảo (Gutenberg),
 * nên bài viết trong lúc soạn trông giống hệt khi đăng.
 *
 * Màu lấy cảm hứng từ tranh Đông Hồ: son (đỏ cam), chàm (xanh lam đậm), vàng hoè, nền giấy điệp.
 */

/*--------------------------------------------------------------
# Font (đặt sẵn trong theme, không tải từ Google)
# Lora (tiêu đề, câu trích) và Be Vietnam Pro (chữ thường), giấy phép SIL OFL: xem assets/fonts/OFL-*.txt
--------------------------------------------------------------*/
@font-face {
	font-family: Lora;
	font-style: normal;
	font-weight: 400 700;
	font-display: swap;
	src: url("../fonts/lora-vietnamese-wght-normal.woff2") format("woff2");
	unicode-range: U+0102-0103, U+0110-0111, U+0128-0129, U+0168-0169, U+01A0-01A1, U+01AF-01B0, U+0300-0301, U+0303-0304, U+0308-0309, U+0323, U+0329, U+1EA0-1EF9, U+20AB;
}

@font-face {
	font-family: Lora;
	font-style: normal;
	font-weight: 400 700;
	font-display: swap;
	src: url("../fonts/lora-latin-wght-normal.woff2") format("woff2");
	unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
	font-family: Lora;
	font-style: normal;
	font-weight: 400 700;
	font-display: swap;
	src: url("../fonts/lora-latin-ext-wght-normal.woff2") format("woff2");
	unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

@font-face {
	font-family: Lora;
	font-style: italic;
	font-weight: 400 700;
	font-display: swap;
	src: url("../fonts/lora-vietnamese-wght-italic.woff2") format("woff2");
	unicode-range: U+0102-0103, U+0110-0111, U+0128-0129, U+0168-0169, U+01A0-01A1, U+01AF-01B0, U+0300-0301, U+0303-0304, U+0308-0309, U+0323, U+0329, U+1EA0-1EF9, U+20AB;
}

@font-face {
	font-family: Lora;
	font-style: italic;
	font-weight: 400 700;
	font-display: swap;
	src: url("../fonts/lora-latin-wght-italic.woff2") format("woff2");
	unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
	font-family: Lora;
	font-style: italic;
	font-weight: 400 700;
	font-display: swap;
	src: url("../fonts/lora-latin-ext-wght-italic.woff2") format("woff2");
	unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

@font-face {
	font-family: "Be Vietnam Pro";
	font-style: normal;
	font-weight: 400;
	font-display: swap;
	src: url("../fonts/bevietnampro-400-vietnamese.woff2") format("woff2");
	unicode-range: U+0102-0103, U+0110-0111, U+0128-0129, U+0168-0169, U+01A0-01A1, U+01AF-01B0, U+0300-0301, U+0303-0304, U+0308-0309, U+0323, U+0329, U+1EA0-1EF9, U+20AB;
}

@font-face {
	font-family: "Be Vietnam Pro";
	font-style: normal;
	font-weight: 400;
	font-display: swap;
	src: url("../fonts/bevietnampro-400-latin.woff2") format("woff2");
	unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
	font-family: "Be Vietnam Pro";
	font-style: normal;
	font-weight: 400;
	font-display: swap;
	src: url("../fonts/bevietnampro-400-latin-ext.woff2") format("woff2");
	unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

@font-face {
	font-family: "Be Vietnam Pro";
	font-style: normal;
	font-weight: 700;
	font-display: swap;
	src: url("../fonts/bevietnampro-700-vietnamese.woff2") format("woff2");
	unicode-range: U+0102-0103, U+0110-0111, U+0128-0129, U+0168-0169, U+01A0-01A1, U+01AF-01B0, U+0300-0301, U+0303-0304, U+0308-0309, U+0323, U+0329, U+1EA0-1EF9, U+20AB;
}

@font-face {
	font-family: "Be Vietnam Pro";
	font-style: normal;
	font-weight: 700;
	font-display: swap;
	src: url("../fonts/bevietnampro-700-latin.woff2") format("woff2");
	unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
	font-family: "Be Vietnam Pro";
	font-style: normal;
	font-weight: 700;
	font-display: swap;
	src: url("../fonts/bevietnampro-700-latin-ext.woff2") format("woff2");
	unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

/*--------------------------------------------------------------
# Biến màu & font
--------------------------------------------------------------*/
:root {
	--c-bg: #faf6ee;
	--c-paper: #f4ecdd;
	--c-surface: #fffdf9;
	--c-text: #2b2420;
	--c-muted: #6b5f56;
	--c-line: #e8ddcc;
	--c-line-strong: #d8c9b2;

	/* Chàm: link, viền chọn. */
	--c-primary: #1f5c66;
	--c-primary-dark: #164650;
	--c-primary-soft: #e2eff0;

	/* Son: thương hiệu, nhãn, nút chính (cùng màu biểu tượng). */
	--c-seal: #c8442b;
	--c-seal-dark: #a5341f;
	--c-seal-soft: #fbe9e3;
	--grad-brand: linear-gradient(135deg, #dc5a35 0%, #a5341f 100%);
	--grad-brand-hover: linear-gradient(135deg, #cb4b28 0%, #8c2a17 100%);

	/* Vàng hoè: tô sáng, mẹo nhớ. */
	--c-accent: #f0b429;
	--c-accent-soft: #fdf3d6;
	--c-accent-line: #e0a21a;

	--c-ok: #2f6b3a;
	--c-ok-soft: #e5f2e6;
	--c-err: #b42335;
	--c-err-soft: #fbe8ea;
	--c-warn: #8f4a0c;
	--c-warn-soft: #fdf0e1;

	--font-body: "Be Vietnam Pro", system-ui, -apple-system, "Segoe UI", roboto, "Helvetica Neue", arial, sans-serif;
	--font-display: lora, georgia, "Times New Roman", serif;

	--radius: 14px;
	--radius-sm: 8px;
	--shadow-sm: 0 1px 2px rgba(43, 36, 32, 0.06);
	--shadow: 0 1px 2px rgba(43, 36, 32, 0.05), 0 10px 28px rgba(43, 36, 32, 0.08);
	--shadow-lg: 0 2px 4px rgba(43, 36, 32, 0.05), 0 22px 48px rgba(43, 36, 32, 0.13);
}

/*--------------------------------------------------------------
# Hộp "Trả lời nhanh" (Nhóm → Kiểu: Trả lời nhanh)
--------------------------------------------------------------*/
.wp-block-group.is-style-tra-loi-nhanh {
	position: relative;
	margin: 2.5rem 0 2rem;
	padding: 1.9rem 1.3rem 1.2rem;
	background: var(--c-surface);
	border: 1px solid var(--c-line);
	border-top: 4px solid var(--c-seal);
	border-radius: var(--radius);
	box-shadow: var(--shadow);
}

/* Nhãn như con dấu son: chữ màu giấy, viền mảnh bên trong. */
.wp-block-group.is-style-tra-loi-nhanh::before {
	content: "Trả lời nhanh";
	position: absolute;
	top: 0;
	left: 1rem;
	padding: 0.2rem 0.8rem 0.25rem;
	background: var(--c-seal);
	border-radius: 5px;
	outline: 1px solid rgba(255, 248, 236, 0.6);
	outline-offset: -4px;
	box-shadow: 0 0 0 3px var(--c-surface);
	color: #fff8ec;
	font-family: var(--font-display);
	font-size: 0.98rem;
	font-weight: 700;
	line-height: 1.5;
	transform: translateY(-62%) rotate(-2deg);
}

.wp-block-group.is-style-tra-loi-nhanh strong {
	color: var(--c-primary-dark);
}

/*--------------------------------------------------------------
# Hộp "Mẹo nhớ" và "Lưu ý"
--------------------------------------------------------------*/
.wp-block-group.is-style-meo-nho {
	margin: 1.75rem 0;
	padding: 1.1rem 1.25rem;
	background: var(--c-accent-soft);
	border: 1.5px dashed var(--c-accent-line);
	border-radius: var(--radius);
}

.wp-block-group.is-style-meo-nho::before {
	content: "💡 Mẹo nhớ";
	display: block;
	margin-bottom: 0.5rem;
	color: #6e4a00;
	font-family: var(--font-display);
	font-size: 1.15rem;
	font-weight: 700;
	line-height: 1.4;
}

.wp-block-group.is-style-luu-y {
	margin: 1.75rem 0;
	padding: 1rem 1.25rem;
	background: var(--c-warn-soft);
	border-left: 5px solid #e2832c;
	border-radius: var(--radius-sm);
}

.wp-block-group.is-style-luu-y::before {
	content: "⚠️ Lưu ý";
	display: block;
	margin-bottom: 0.35rem;
	color: var(--c-warn);
	font-weight: 700;
}

.wp-block-group.is-style-tra-loi-nhanh > *,
.wp-block-group.is-style-meo-nho > *,
.wp-block-group.is-style-luu-y > * {
	margin-top: 0;
	margin-bottom: 0.75em;
}

.wp-block-group.is-style-tra-loi-nhanh > :last-child,
.wp-block-group.is-style-meo-nho > :last-child,
.wp-block-group.is-style-luu-y > :last-child {
	margin-bottom: 0;
}

/*--------------------------------------------------------------
# Bảng
--------------------------------------------------------------*/
figure.wp-block-table {
	margin: 1.5rem 0;
	overflow-x: auto;
}

figure.wp-block-table table {
	width: 100%;
	border-collapse: separate;
	border-spacing: 0;
	border: 1px solid var(--c-line);
	border-radius: var(--radius);
	background: var(--c-surface);
	font-size: 0.95em;
	line-height: 1.55;
}

figure.wp-block-table thead {
	border: 0;
}

figure.wp-block-table th,
figure.wp-block-table td {
	padding: 0.7rem 0.85rem;
	border: 0;
	border-bottom: 1px solid var(--c-line);
	text-align: left;
	vertical-align: top;
}

figure.wp-block-table th + th,
figure.wp-block-table td + td {
	border-left: 1px solid var(--c-line);
}

figure.wp-block-table thead th {
	background: var(--c-primary-soft);
	color: var(--c-primary-dark);
	font-weight: 700;
}

figure.wp-block-table thead th:first-child {
	border-top-left-radius: calc(var(--radius) - 1px);
}

figure.wp-block-table thead th:last-child {
	border-top-right-radius: calc(var(--radius) - 1px);
}

figure.wp-block-table tbody tr:last-child td {
	border-bottom: 0;
}

figure.wp-block-table tbody tr:nth-child(even) td {
	background: #fdf9f2;
}

/* Cột đầu là tên hàng (chữ, vế câu, tiêu chí...). */
figure.wp-block-table:not(.is-style-dung-sai) tbody td:first-child {
	color: var(--c-text);
	font-weight: 700;
}

/* Bảng "Sai / Đúng": cột 1 đỏ, cột 2 xanh. */
figure.wp-block-table.is-style-dung-sai thead th:nth-child(1) {
	background: var(--c-err-soft);
	color: var(--c-err);
}

figure.wp-block-table.is-style-dung-sai thead th:nth-child(2) {
	background: var(--c-ok-soft);
	color: var(--c-ok);
}

figure.wp-block-table.is-style-dung-sai tbody td:nth-child(1) {
	background: #fff7f7;
	color: #8f1f2b;
}

figure.wp-block-table.is-style-dung-sai tbody td:nth-child(2) {
	background: #f5fbf5;
	color: #22512b;
	font-weight: 700;
}

figure.wp-block-table.is-style-dung-sai tbody td:nth-child(3) {
	color: var(--c-muted);
}

@media (max-width: 600px) {

	figure.wp-block-table th,
	figure.wp-block-table td {
		padding: 0.55rem 0.6rem;
	}
}

/*--------------------------------------------------------------
# Khối "Chi tiết" (đáp án bài tập)
--------------------------------------------------------------*/
.wp-block-details {
	margin: 1.25rem 0;
	padding: 0.85rem 1.1rem;
	background: var(--c-surface);
	border: 2px solid var(--c-ok-soft);
	border-radius: var(--radius);
}

.wp-block-details summary {
	display: flex;
	gap: 0.6rem;
	align-items: center;
	color: var(--c-ok);
	font-weight: 700;
	cursor: pointer;
	list-style: none;
}

.wp-block-details summary::-webkit-details-marker {
	display: none;
}

.wp-block-details summary::before {
	content: "";
	flex: none;
	width: 0.5em;
	height: 0.5em;
	border-right: 2px solid currentcolor;
	border-bottom: 2px solid currentcolor;
	transform: rotate(-45deg);
	transition: transform 0.2s;
}

.wp-block-details[open] summary {
	margin-bottom: 0.75rem;
}

.wp-block-details[open] summary::before {
	transform: rotate(45deg);
}

.wp-block-details > :last-child {
	margin-bottom: 0;
}

/*--------------------------------------------------------------
# Chữ trong bài: tô sáng chữ cần nhớ, gạch chữ sai
--------------------------------------------------------------*/
mark:not([style]) {
	padding: 0;
	background: linear-gradient(transparent 58%, rgba(240, 180, 41, 0.75) 58%, rgba(240, 180, 41, 0.75) 92%, transparent 92%);
	color: inherit;
}

.wp-block-group s,
.wp-block-table s,
.wp-block-list s,
p s,
del {
	color: var(--c-err);
	text-decoration-thickness: 2px;
}

/*--------------------------------------------------------------
# Khổ thơ ca dao, trích dẫn, ảnh
--------------------------------------------------------------*/

/* Đoạn in nghiêng có xuống dòng (<p><em>dòng 1<br>dòng 2</em></p>): theme tự gắn lớp "tho",
   hoặc chọn Đoạn văn → Kiểu: Khổ thơ. */
p.tho,
p.is-style-tho {
	margin: 1.6rem 0;
	padding: 1rem 1.25rem 1rem 1.35rem;
	background: var(--c-paper);
	border-left: 4px solid var(--c-seal);
	border-radius: 0 var(--radius) var(--radius) 0;
	color: #3a2f29;
	font-family: var(--font-display);
	font-size: 1.12em;
	line-height: 1.8;
}

p.is-style-tho {
	font-style: italic;
}

.wp-block-quote {
	margin: 1.75rem 0;
	padding: 0.9rem 1.25rem 0.9rem 1.35rem;
	background: var(--c-paper);
	border-left: 4px solid var(--c-seal);
	border-radius: 0 var(--radius) var(--radius) 0;
	color: #3a2f29;
	font-family: var(--font-display);
	font-size: 1.08em;
	font-style: italic;
}

.wp-block-quote > :last-child {
	margin-bottom: 0;
}

.wp-block-quote cite {
	color: var(--c-muted);
	font-family: var(--font-body);
	font-size: 0.85em;
	font-style: normal;
}

.wp-block-image img {
	border-radius: var(--radius);
}

/* Ảnh thẻ ghi nhớ dọc 1080×1350 (Ảnh → Kiểu: Thẻ ghi nhớ): hiện giữa, không chiếm hết bề ngang. */
.wp-block-image.is-style-the-ghi-nho {
	max-width: 460px;
	margin: 1.75rem auto;
}

.wp-block-image.is-style-the-ghi-nho img {
	display: block;
	width: 100%;
	height: auto;
	box-shadow: var(--shadow);
}
