/**
 * 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.
 */

/*--------------------------------------------------------------
# Font (đặt sẵn trong theme, không tải từ Google)
# Baloo 2 và Be Vietnam Pro, giấy phép SIL OFL: xem assets/fonts/OFL-*.txt
--------------------------------------------------------------*/
@font-face {
	font-family: "Baloo 2";
	font-style: normal;
	font-weight: 700 800;
	font-display: swap;
	src: url("../fonts/baloo2-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: "Baloo 2";
	font-style: normal;
	font-weight: 700 800;
	font-display: swap;
	src: url("../fonts/baloo2-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: "Baloo 2";
	font-style: normal;
	font-weight: 700 800;
	font-display: swap;
	src: url("../fonts/baloo2-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: 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: #fffaf2;
	--c-surface: #fff;
	--c-text: #1f1d33;
	--c-muted: #5f5b76;
	--c-line: #ece4d6;
	--c-primary: #5b3fd9;
	--c-primary-dark: #4329b5;
	--c-primary-soft: #f0ebff;
	--grad-brand: linear-gradient(135deg, #7257f7 0%, #4527b8 100%);
	--grad-brand-hover: linear-gradient(135deg, #6447ea 0%, #3a1f9e 100%);
	--c-accent: #ffd54f;
	--c-accent-soft: #fff6d6;
	--c-accent-line: #f0c419;
	--c-ok: #1f7a45;
	--c-ok-soft: #e6f6ec;
	--c-err: #c62f3a;
	--c-err-soft: #fdeaea;
	--c-info: #1d64a8;
	--c-info-soft: #e5f0fb;
	--c-warn: #a14d0a;
	--c-warn-soft: #fff1e3;

	--font-body: "Be Vietnam Pro", system-ui, -apple-system, "Segoe UI", roboto, "Helvetica Neue", arial, sans-serif;
	--font-display: "Baloo 2", "Be Vietnam Pro", system-ui, -apple-system, "Segoe UI", roboto, sans-serif;

	--radius: 14px;
	--radius-sm: 8px;
	--shadow-sm: 0 1px 2px rgba(31, 29, 51, 0.06);
	--shadow: 0 1px 2px rgba(31, 29, 51, 0.05), 0 8px 24px rgba(31, 29, 51, 0.08);
}

/*--------------------------------------------------------------
# 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.25rem 0 2rem;
	padding: 1.75rem 1.25rem 1.15rem;
	background: var(--c-surface);
	border: 2px solid var(--c-primary);
	border-radius: var(--radius);
	box-shadow: 0 6px 0 var(--c-primary-soft);
}

.wp-block-group.is-style-tra-loi-nhanh::before {
	content: "Trả lời nhanh";
	position: absolute;
	top: 0;
	left: 1rem;
	padding: 0.1rem 0.8rem;
	background: var(--c-accent);
	border: 2px solid #fff;
	border-radius: 6px;
	box-shadow: var(--shadow-sm);
	color: var(--c-text);
	font-family: var(--font-display);
	font-size: 1rem;
	font-weight: 800;
	line-height: 1.5;
	transform: translateY(-55%) rotate(-2deg);
}

/*--------------------------------------------------------------
# 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: 2px 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: #6b4f00;
	font-family: var(--font-display);
	font-size: 1.1rem;
	font-weight: 800;
	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 #f2892a;
	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;
}

/* Cột đầu của bảng so sánh là tên hàng (Nghĩa, Từ loại...). */
figure.wp-block-table:not(.is-style-dung-sai) tbody td:first-child {
	color: var(--c-text);
	font-weight: 700;
	white-space: nowrap;
}

/* 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: #8f1f28;
}

figure.wp-block-table.is-style-dung-sai tbody td:nth-child(2) {
	background: #f6fcf8;
	color: #145a32;
	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;
	}

	figure.wp-block-table:not(.is-style-dung-sai) tbody td:first-child {
		white-space: normal;
	}
}

/*--------------------------------------------------------------
# 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ỗ khác nhau, gạch từ sai
--------------------------------------------------------------*/
mark:not([style]) {
	padding: 0;
	background: linear-gradient(transparent 58%, var(--c-accent) 58%, var(--c-accent) 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;
}

/*--------------------------------------------------------------
# Trích dẫn & ảnh
--------------------------------------------------------------*/
.wp-block-quote {
	margin: 1.75rem 0;
	padding: 0.25rem 0 0.25rem 1.25rem;
	border-left: 4px solid var(--c-primary);
	color: var(--c-text);
}

.wp-block-quote cite {
	color: var(--c-muted);
	font-size: 0.9em;
	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);
}
