/* ------------------------------------------------------------------ *
 * Kiểu chữ cho bài viết
 *
 * Chỉ nạp ở trang bài viết đơn (single.php). Mọi thứ đều nằm dưới lớp
 * .froga-bai để không rơi vào trang sản phẩm hay trang thiết kế.
 *
 * Không có @media ở đây — bề rộng và cỡ chữ đi bằng clamp(), đúng luật
 * chung của site: site.css và các tệp kiểu khác không được có breakpoint,
 * chỉ dieu-huong.css mới được.
 * ------------------------------------------------------------------ */

.froga-bai {
	max-width: 760px;
	margin: 0 auto;
	padding: clamp(24px, 4.5vw, 44px) clamp(16px, 4vw, 24px) clamp(48px, 7vw, 80px);
}

/* --- Đầu bài -------------------------------------------------------- */

.froga-bai-duong {
	font-family: 'Be Vietnam Pro', sans-serif;
	font-size: 13px;
	font-weight: 700;
	color: #5F6B58;
	margin: 0 0 14px;
}

.froga-bai-duong a {
	color: #23773C;
	text-decoration: none;
}

.froga-bai-duong a:hover {
	text-decoration: underline;
}

.froga-bai h1 {
	font-family: 'Be Vietnam Pro', sans-serif;
	font-weight: 700;
	font-size:clamp(23px,5vw,42px);
	line-height: 1.16;
	letter-spacing: -0.01em;
	color: #1E3B27;
	margin: 0 0 12px;
}

.froga-bai-ngay {
	font-family: 'Be Vietnam Pro', sans-serif;
	font-size: 13.5px;
	font-weight: 700;
	color: #5F6B58;
	margin: 0 0 clamp(22px, 3.5vw, 32px);
	padding-bottom: clamp(18px, 3vw, 26px);
	border-bottom: 1px solid #E4DDC9;
}

/* --- Thân bài ------------------------------------------------------- */

.froga-bai-than {
	font-family: 'Be Vietnam Pro', sans-serif;
	font-size:clamp(15px,1.6vw,17.5px);
	line-height: 1.78;
	color: #384A36;
}

.froga-bai-than p {
	margin: 0 0 1.15em;
}

.froga-bai-than h2 {
	font-family: 'Be Vietnam Pro', sans-serif;
	font-weight: 700;
	font-size:clamp(18px,3vw,27px);
	line-height: 1.25;
	color: #1E3B27;
	margin: clamp(34px, 5vw, 48px) 0 14px;
}

.froga-bai-than h3 {
	font-family: 'Be Vietnam Pro', sans-serif;
	font-weight: 700;
	font-size:clamp(15.5px,2.2vw,20.5px);
	line-height: 1.3;
	color: #23773C;
	margin: clamp(26px, 4vw, 34px) 0 10px;
}

.froga-bai-than a {
	color: #23773C;
	font-weight: 700;
	text-decoration: underline;
	text-underline-offset: 3px;
	text-decoration-thickness: 1.5px;
	text-decoration-color: #BBD9B9;
}

.froga-bai-than a:hover {
	text-decoration-color: #23773C;
}

.froga-bai-than strong {
	font-weight: 700;
	color: #1E3B27;
}

.froga-bai-than ul,
.froga-bai-than ol {
	margin: 0 0 1.25em;
	padding-left: 1.35em;
}

.froga-bai-than li {
	margin-bottom: 0.55em;
	padding-left: 0.2em;
}

.froga-bai-than li::marker {
	color: #23773C;
	font-weight: 700;
}

/* --- Khối trả lời ngắn ---------------------------------------------- *
 * Câu chốt đặt ngay đầu bài. Vừa để người đọc lấy được câu trả lời trong
 * mười giây, vừa để máy tìm kiếm và trợ lý AI trích được một đoạn gọn.
 * ------------------------------------------------------------------- */

.froga-bai-than .froga-tra-loi {
	background: #E7F2E4;
	border-left: 5px solid #23773C;
	border-radius: 0 14px 14px 0;
	padding: clamp(16px, 2.6vw, 22px) clamp(18px, 3vw, 26px);
	margin: 0 0 clamp(28px, 4vw, 38px);
	font-size:clamp(15px,1.6vw,17.5px);
	line-height: 1.68;
	color: #22402A;
}

.froga-bai-than .froga-tra-loi strong:first-child {
	color: #175A2B;
}

/* --- Hình minh hoạ --------------------------------------------------- */

.froga-hinh {
	margin: clamp(26px, 4vw, 38px) 0;
	padding: 0;
}

.froga-hinh svg {
	display: block;
	width: 100%;
	height: auto;
	background: #FBFAF5;
	border: 1px solid #E4DDC9;
	border-radius: 16px;
}

.froga-hinh figcaption {
	font-size: 13.5px;
	line-height: 1.6;
	color: #5F6B58;
	text-align: center;
	margin-top: 10px;
	font-style: italic;
}

/* --- Bảng ------------------------------------------------------------ *
 * Bảng hẹp hơn khung là chuyện thường ở màn hình nhỏ, nên bọc lớp cuộn
 * ngang riêng cho bảng thay vì để cả trang trượt ngang.
 * -------------------------------------------------------------------- */

/* Khung cuộn do froga_bang_cuon() trong cam-nang.php bọc quanh mỗi <table>.
   KHÔNG đặt overflow lên chính <table>: thử rồi, display:block + width:max-content
   làm chính khối bảng nở rộng ra ngoài khung chứ không cuộn bên trong — ở màn
   rộng bảng chui xuống dưới thanh phụ bên phải, ở điện thoại cột cuối cắt cụt
   mà không kéo ngang được. Khung bọc là lớp cuộn, bảng bên trong giữ display
   mặc định để các cột vẫn thẳng hàng. */
.froga-bang-cuon {
	max-width: 100%;
	overflow-x: auto;
	-webkit-overflow-scrolling: touch;
	margin: clamp(24px, 3.6vw, 32px) 0;
	border: 1px solid #E4DDC9;
	border-radius: 14px;
	background: #FFFFFF;
}

.froga-bai-than table,
.froga-bang {
	width: 100%;
	border-collapse: separate;
	border-spacing: 0;
	margin: clamp(24px, 3.6vw, 32px) 0;
	font-size: 15px;
	line-height: 1.6;
	border: 1px solid #E4DDC9;
	border-radius: 14px;
	background: #FFFFFF;
	overflow: hidden;
}

/* Trong khung cuộn thì viền, bo góc và lề do khung lo. min-width chỉ đặt ở
   đây: bảng không nằm trong khung cuộn mà có min-width thì tràn ngang cả
   trang ở điện thoại, không kéo lại được. */
.froga-bang-cuon > table {
	min-width: 520px;
	margin: 0;
	border: 0;
	border-radius: 0;
	background: transparent;
}

.froga-bai-than table thead th,
.froga-bang thead th {
	background: #F2EDDE;
	color: #1E3B27;
	font-size: 12.5px;
	letter-spacing: .6px;
	text-transform: uppercase;
	font-weight: 700;
	font-size: 13.5px;
	letter-spacing: 0.3px;
	text-align: left;
	padding: 13px 18px;
	white-space: nowrap;
	vertical-align: middle;
}

/* Bảng không có <thead>: hàng đầu vẫn là tiêu đề, cho ăn cùng kiểu. */
.froga-bai-than table tr:first-child th,
.froga-bang tr:first-child th {
	background: #23773C;
	color: #FFFFFF;
}

.froga-bai-than table td,
.froga-bai-than table tbody th,
.froga-bang td,
.froga-bang tbody th {
	padding: 13px 18px;
	border-top: 1px solid #EFEADB;
	vertical-align: top;
	text-align: left;
	white-space: normal;
	min-width: 110px;
}

/* Ô đầu mỗi hàng là nhãn (Mỗi tuần, 2 tuần…): in đậm, không gãy dòng. */
.froga-bai-than table tbody td:first-child,
.froga-bang tbody td:first-child {
	font-weight: 700;
	color: #1E3B27;
	white-space: nowrap;
}

/* Cột cuối thường là số đo ngắn ("10 giây", "5 phút thao tác"). Ở màn rộng
   giữ trên một dòng cho khỏi gãy làm đôi như bản cũ. */
@media (min-width: 760px) {
	.froga-bai-than table tbody td:last-child:not(:first-child),
	.froga-bang tbody td:last-child:not(:first-child) {
		white-space: nowrap;
	}
	.froga-bai-than table tbody td:last-child:nth-child(2),
	.froga-bang tbody td:last-child:nth-child(2) {
		white-space: normal;
	}
}

.froga-bai-than table tbody tr:nth-child(even),
.froga-bang tbody tr:nth-child(even) {
	background: #FAF8F2;
}

.froga-bai-than table caption,
.froga-bang caption {
	caption-side: top;
	text-align: left;
	font-weight: 700;
	color: #1E3B27;
	padding: 0 0 10px;
}

/* --- Khối đọc thêm cuối bài ------------------------------------------ */

.froga-bai-them {
	margin-top: clamp(40px, 6vw, 60px);
	padding-top: clamp(24px, 4vw, 32px);
	border-top: 1px solid #E4DDC9;
}

.froga-bai-them h2 {
	font-family: 'Be Vietnam Pro', sans-serif;
	font-weight: 700;
	font-size:clamp(16px,2.4vw,23px);
	color: #1E3B27;
	margin: 0 0 16px;
}

.froga-bai-them ul {
	list-style: none;
	margin: 0;
	padding: 0;
	display: grid;
	gap: 10px;
}

.froga-bai-them a {
	display: block;
	background: #FFFFFF;
	border: 1px solid #E4DDC9;
	border-radius: 14px;
	padding: 14px 18px;
	font-family: 'Be Vietnam Pro', sans-serif;
	font-size: 15.5px;
	font-weight: 700;
	line-height: 1.45;
	color: #1E3B27;
	text-decoration: none;
	transition: border-color .16s, background .16s;
}

.froga-bai-them a:hover {
	border-color: #23773C;
	background: #F3F9F1;
}

/* --- Dải mời mua cuối bài -------------------------------------------- */

.froga-bai-moi {
	margin-top: clamp(32px, 5vw, 44px);
	background: #E7F2E4;
	border-radius: 20px;
	padding: clamp(22px, 4vw, 32px);
	text-align: center;
}

.froga-bai-moi p {
	font-family: 'Be Vietnam Pro', sans-serif;
	font-size:clamp(15.5px,1.6vw,17px);
	line-height: 1.6;
	color: #22402A;
	margin: 0 0 16px;
}

.froga-bai-moi a {
	display: inline-block;
	background: #23773C;
	color: #FFFFFF;
	font-family: 'Be Vietnam Pro', sans-serif;
	font-weight: 700;
	font-size: 16px;
	padding: 13px 30px;
	border-radius: 999px;
	text-decoration: none;
	transition: background .16s;
}

.froga-bai-moi a:hover {
	background: #175A2B;
	color: #FFFFFF;
}

/* ------------------------------------------------------------------ *
 * Các khối do build/khung_bai.py lắp vào mọi bài
 * ------------------------------------------------------------------ */

/* --- Mục lục --------------------------------------------------------- */

.froga-muc-luc {
	background: #F6F4EA;
	border: 1px solid #E4DDC9;
	border-radius: 16px;
	padding: clamp(18px, 3vw, 24px) clamp(20px, 3.4vw, 28px);
	margin: 0 0 clamp(28px, 4vw, 38px);
}

.froga-bai-than .froga-muc-luc h2 {
	font-size:clamp(15px,1.7vw,16.5px);
	font-family: 'Be Vietnam Pro', sans-serif;
	font-weight: 700;
	letter-spacing: 1px;
	text-transform: uppercase;
	color: #5F6B58;
	margin: 0 0 12px;
}

.froga-muc-luc ol {
	margin: 0;
	padding-left: 1.25em;
	font-size: 15.5px;
	line-height: 1.55;
}

.froga-muc-luc li {
	margin-bottom: 7px;
}

.froga-muc-luc a {
	color: #1E3B27;
	text-decoration: none;
	font-weight: 700;
}

.froga-muc-luc a:hover {
	color: #23773C;
	text-decoration: underline;
}

/* Neo tới mục: chừa chỗ cho thanh đầu trang dính, kẻo tiêu đề bị che. */
.froga-bai-than h2[id] {
	scroll-margin-top: 90px;
}

/* --- Hình ------------------------------------------------------------ *
 * Hình nay là <img> trỏ tới tệp .svg, không còn <svg> nội dòng. Nền và
 * viền phải đặt cho <img> chứ không cho svg như bản trước.
 * -------------------------------------------------------------------- */

.froga-hinh img {
	display: block;
	width: 100%;
	height: auto;
	border-radius: 16px;
}

/* --- Khối lưu ý ------------------------------------------------------ */

.froga-luu-y {
	background: #FCF3DC;
	border-left: 5px solid #E0AE2A;
	border-radius: 0 14px 14px 0;
	padding: clamp(14px, 2.4vw, 18px) clamp(16px, 2.8vw, 22px);
	margin: clamp(22px, 3.4vw, 30px) 0;
	font-size: 15.5px;
	line-height: 1.65;
	color: #5B4A1C;
}

.froga-luu-y strong:first-child {
	color: #7A5F22;
}

/* --- Bài liên quan và khối sản phẩm ---------------------------------- */

.froga-lien-quan,
.froga-goi-y {
	border-radius: 18px;
	padding: clamp(18px, 3vw, 26px) clamp(20px, 3.4vw, 28px);
	margin: clamp(30px, 4.5vw, 42px) 0;
}

.froga-lien-quan {
	background: #FFFFFF;
	border: 1px solid #E4DDC9;
}

.froga-goi-y {
	background: #E7F2E4;
	border: 1px solid #BBD9B9;
}

.froga-bai-than .froga-lien-quan h2,
.froga-bai-than .froga-goi-y h2 {
	font-size:clamp(15.5px,2.2vw,21px);
	margin: 0 0 14px;
}

.froga-lien-quan ul,
.froga-goi-y ul {
	list-style: none;
	margin: 0;
	padding: 0;
}

.froga-lien-quan li,
.froga-goi-y li {
	margin: 0 0 10px;
	padding: 0 0 0 26px; /* mũi tên Nunito 800 rộng ~19px, 20px là dính chữ */
	position: relative;
	line-height: 1.55;
}

.froga-lien-quan li::before,
.froga-goi-y li::before {
	content: "→";
	position: absolute;
	left: 0;
	color: #23773C;
	font-weight: 700;
}

.froga-goi-y p {
	margin: 14px 0 0;
	font-size: 14.5px;
	color: #42563F;
}

/* ==========================================================================
   HÌNH MINH HOẠ Ở KHỔ ĐIỆN THOẠI — cho xem đúng cỡ vẽ, đừng bóp
   ==========================================================================
   Đo 06/09/2026: 22 hình của cẩm nang đều vẽ trên khung 720 đơn vị. Ở cột chữ
   396px chúng bị thu còn 55%, nên chữ trong hình tụt xuống 4,7–6,6px — nhỏ
   hơn một nửa ngưỡng đọc được. Hình có nhãn thì nhãn mới là phần mang nghĩa.

   Cách chữa không phải vẽ lại 22 hình trong đêm: ở khổ hẹp cho hình chạy
   TRÀN RA HAI MÉP và giữ đúng bề rộng vẽ (720px), rồi cuộn ngang. Chữ trở về
   đúng cỡ người vẽ định. theme-src/mobile.php tự chèn dòng nhắc "Quẹt ngang"
   vì nó đo được là khối này đang tràn.

   ⚠️ Còn treo: bốn hình (so-do-may, duong-ong-thoat, trao-doi-ion,
   vat-lieu-say) có nhãn 8,5–11,5 đơn vị — nhỏ ngay cả ở cỡ vẽ gốc. Muốn đọc
   thoải mái thì phải vẽ lại, không phải việc của CSS.
   ========================================================================== */
@media (max-width: 700px) {
	.froga-hinh {
		margin-inline: calc(clamp(16px, 4vw, 24px) * -1);
		overflow-x: auto;
		scrollbar-width: none;
		-webkit-overflow-scrolling: touch;
	}
	.froga-hinh::-webkit-scrollbar { display: none; }
	/* Soi 06/09/2026: hình rộng 720px cuộn ngang nhưng không có dấu hiệu gì,
	   trông như hình bị cắt cụt ("Nhiều vùng ở…"). Dòng nhắc dính mép trái. */
	.froga-hinh::before {
		content: "Quẹt ngang để xem hết hình →";
		display: block;
		position: sticky;
		left: 0;
		padding: 0 clamp(16px, 4vw, 24px) 8px;
		font-size: 12px;
		font-weight: 700;
		letter-spacing: .8px;
		text-transform: uppercase;
		color: #5F6B58;
	}
	.froga-hinh img,
	.froga-hinh svg {
		width: 720px;
		max-width: none;
		border-radius: 0;
	}
	.froga-hinh figcaption {
		padding-inline: clamp(16px, 4vw, 24px);
		font-size: 14px;
		position: sticky;
		left: 0;
	}
}

/* --- Khối câu hỏi thường gặp cuối bài (23/09/2026) ------------------- */

.froga-bai-hoi {
	margin: clamp(30px, 4.5vw, 42px) 0;
}

.froga-bai-than .froga-bai-hoi h2 {
	font-size:clamp(15.5px,2.2vw,21px);
	margin: 0 0 14px;
}

.froga-bai-hoi-o {
	background: #FBFDF9;
	border: 1px solid #E3EADF;
	border-radius: 14px;
	padding: 15px 18px;
	margin: 0 0 10px;
}

.froga-bai-than .froga-bai-hoi-cau {
	margin: 0 0 6px;
	font-weight: 700;
	font-size: 16.5px;
	line-height: 1.45;
	color: #14401F;
}

.froga-bai-than .froga-bai-hoi-dap {
	margin: 0;
	font-size: 16px;
	line-height: 1.66;
	color: #33403A;
}
