/* ================= NỘI DUNG BÀI VIẾT ================= */
.post-content {
	--pc-orange: #f26a1f;
	--pc-orange-soft: #fdebd9;
	--pc-navy: #1c2b4a;
	--pc-num: 30px;
	--pc-gap: 16px;
	--pc-indent: calc(var(--pc-num) + var(--pc-gap) * 2 + 4px);
	font-family: "Helvetica Neue", Helvetica, Arial, sans-serif !important;
	counter-reset: h2;
	padding-left: var(--pc-indent);
	color: #4b5563;
}
.post-content p { font-size: 16px !important; line-height: 1.7; margin-bottom: .8rem; }
.post-content p:has(img) { text-align: center; }
.post-content img { max-width: 100%; height: auto; border-radius: 8px; }

/* ---- H2: vòng số cam + vạch dọc cam ---- */
.post-content h2 {
	counter-reset: h3;
	counter-increment: h2;
	position: relative;
	display: block;
	margin: 28px 0 10px calc(var(--pc-indent) * -1);
	padding: 12px 0 12px var(--pc-indent);
	min-height: var(--pc-num);
	font-size: 1.4rem !important;
	font-weight: 700 !important;
	line-height: 1.3;
	color: var(--pc-navy);
	scroll-margin-top: 90px;
	background: linear-gradient(var(--pc-orange), var(--pc-orange)) no-repeat
	            calc(var(--pc-num) + var(--pc-gap)) center / 4px 36px;
}
.post-content h2 strong { font-weight: 700 !important; }
.post-content h2::before {
	content: counter(h2);
	position: absolute; left: 0; top: 50%;
	transform: translateY(-50%);
	width: var(--pc-num); height: var(--pc-num);
	border-radius: 50%;
	display: flex; align-items: center; justify-content: center;
	font-size: calc(var(--pc-num) * .5); font-weight: 700; color: #fff;
	background: radial-gradient(circle at 30% 25%, #ff9a4d, var(--pc-orange) 70%);
	box-shadow: 0 0 0 7px rgba(242,106,31,.15), 0 6px 14px rgba(242,106,31,.3);
}
.post-content h2 ~ h2 { margin-top: 44px; }
.post-content h2 ~ h2::after {
	content: ""; position: absolute; left: 0; right: 0; top: -2px;
	height: 1px; background: #eceff3;
}

/* ---- H3: vòng số cam nhạt + kẻ ngang ---- */
.post-content h3 {
	display: flex; align-items: center; gap: 14px;
	font-size: 18px !important; font-weight: 700 !important;
	color: var(--pc-navy); margin: 20px 0 10px !important;
	scroll-margin-top: 90px;
}
.post-content h3::before {
	counter-increment: h3;
	content: counter(h2) "." counter(h3);
	flex: 0 0 auto;
	min-width: 42px; height: 42px; padding: 0 8px;
	border-radius: 50%;
	display: flex; align-items: center; justify-content: center;
	background: var(--pc-orange-soft); color: var(--pc-orange);
	font-size: 15px; font-weight: 700;
}
.post-content h3::after {
	content: ""; flex: 1 1 auto; height: 1px; background: #e5e7eb; margin-left: 6px;
}

/* ---- Bảng ---- */
.post-content table { width: 100% !important; border-collapse: collapse; margin: 1rem 0; font-size: .95rem; background: #fff; border-radius: 8px; overflow: hidden; box-shadow: 0 1px 3px rgba(0,0,0,.08); }
.post-content th, .post-content td { padding: 10px 14px; text-align: left; border: 1px solid #eaeaea; }
.post-content th { background: #f7f7f7; color: #333; font-weight: 600; text-transform: uppercase; letter-spacing: .5px; }
.post-content tr:nth-child(even) td { background: #fafafa; }

/* ================= MỤC LỤC ================= */
.post-content #main-toc {
	position: relative;
	overflow: hidden;
	margin: 0 0 28px calc(var(--pc-indent) * -1);
	padding: 22px 28px 16px;
	border: 1px solid #c9dcf7;
	border-radius: 16px;
	background: linear-gradient(120deg, #f7fbff 0%, #eef5ff 55%, #e1edff 100%);
	box-shadow: 0 6px 18px rgba(37, 99, 235, .07);
}
/* Quả địa cầu + con trỏ ở góc trên phải */
.post-content #main-toc::after {
	content: "";
	position: absolute;
	top: 14px;
	right: 22px;
	width: 120px;
	height: 110px;
	background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 120 110' fill='none'%3E%3Ccircle cx='52' cy='50' r='40' fill='%23dbeafe' stroke='%2393c5fd' stroke-width='3'/%3E%3Cellipse cx='52' cy='50' rx='17' ry='40' stroke='%2393c5fd' stroke-width='3'/%3E%3Cpath d='M12 50h80M18 30h68M18 70h68M52 10v80' stroke='%2393c5fd' stroke-width='3'/%3E%3Cpath d='M78 60l32 13-14 4 10 15-7 5-10-15-10 10z' fill='%23bfdbfe' stroke='%2360a5fa' stroke-width='2.5' stroke-linejoin='round'/%3E%3C/svg%3E") no-repeat center / contain;
	opacity: .75;
	pointer-events: none;
}

.pc-toc-head {
	position: relative;
	z-index: 1;
	display: flex;
	align-items: center;
	gap: 18px;
	margin-bottom: 16px;
}
.pc-toc-head .ic {
	display: flex;
	align-items: center;
	justify-content: center;
	flex: 0 0 64px;
	width: 64px;
	height: 64px;
	border-radius: 50%;
	background: linear-gradient(135deg, #3b82f6, #1d4ed8);
	color: #fff;
	font-size: 26px;
	box-shadow: 0 6px 16px rgba(29, 78, 216, .3);
}
.pc-toc-head .t {
	color: #0f172a;
	font-size: 1.6rem;
	font-weight: 800;
	line-height: 1.2;
}
.pc-toc-head .s {
	margin-top: 2px;
	color: #475569;
	font-size: .95rem;
}

.pc-toc-list {
	position: relative;
	z-index: 1;
	column-count: 2;
	column-gap: 56px;
	column-rule: 1px solid #c7d7f0;
	padding-left: 4px;
}
.pc-toc-list > div {
	display: flex;
	align-items: center;
	gap: 16px;
	margin: 0 !important;
	padding: 6px 4px;
	border-radius: 10px;
	break-inside: avoid;
	-webkit-column-break-inside: avoid;
	transition: background .2s;
}
.pc-toc-list > div:hover { background: rgba(242, 106, 31, .06); }
.pc-toc-list .num {
	display: flex;
	align-items: center;
	justify-content: center;
	flex: 0 0 44px;
	width: 44px;
	height: 44px;
	border-radius: 50%;
	background: #ffe6d3;
	color: #f97316;
	font-size: 18px;
	font-weight: 700;
}
.pc-toc-list a {
	color: #1d4ed8;
	font-size: 1.08rem;
	font-weight: 400;
	line-height: 1.45;
	text-decoration: none;
}
.pc-toc-list a:hover { color: var(--pc-orange); text-decoration: none; }

/* Mục con (h3) */
.pc-toc-list > div.lv3 { padding-left: 16px; }
.pc-toc-list > div.lv3 .num { flex-basis: 38px; width: 38px; height: 38px; font-size: 14px; }
.pc-toc-list > div.lv3 a { font-size: 1rem; }

/* ================= MOBILE ================= */
@media (max-width: 576px) {
	.post-content { --pc-num: 30px; --pc-gap: 10px; padding-left: 0; }
	.post-content p { text-align: justify; }
	.post-content h2 { margin-left: 0; font-size: 1.25rem !important; background-size: 3px 26px; }
	.post-content h2::before { box-shadow: 0 0 0 4px rgba(242,106,31,.15); }
	.post-content h3 { font-size: 16px !important; gap: 10px; }
	.post-content h3::before { min-width: 36px; height: 36px; font-size: 13px; }

	.post-content #main-toc { margin-left: 0; padding: 14px 12px 10px; border-radius: 14px; }
	.post-content #main-toc::after { top: 10px; right: 10px; width: 64px; height: 60px; opacity: .6; }
	.pc-toc-head { gap: 12px; margin-bottom: 10px; padding-right: 60px; }
	.pc-toc-head .ic { flex-basis: 46px; width: 46px; height: 46px; font-size: 19px; }
	.pc-toc-head .t { font-size: 1.25rem; }
	.pc-toc-head .s { font-size: .8rem; }
	.pc-toc-list { column-count: 1; padding-left: 0; }
	.pc-toc-list > div { gap: 12px; padding: 5px 2px; }
	.pc-toc-list .num { flex-basis: 34px; width: 34px; height: 34px; font-size: 15px; }
	.pc-toc-list a { font-size: 15px; }
	.pc-toc-list > div.lv3 { padding-left: 10px; }
	.pc-toc-list > div.lv3 .num { flex-basis: 30px; width: 30px; height: 30px; font-size: 12px; }
}