/* Cụm thai giáo theo ngày fetal/ (Sóng 4, plan docs/124-data/plan-tailwind-daisyui-2026-12-02.md mục 8.2 C, 05/12/2026):
   _daily4 (Thai giáo hôm nay: /thai-giao theo ngày, nhạc album / view, yoga, ThaigiaoController), _fetal_daily_item (thẻ bài,
   cả ở /search), _popup_thaigiao_lagi (hộp "1 phút để hiểu" in ở footer mọi trang), trang bài /fetal/aditem và /fetal/embed.
   Thay khối <style> nhúng, lưới row/col-*, utility và style= tĩnh trong view. Chỉ token DS (css/mb-ds.css :root), lớp mới
   tiền tố ftp-*; giữ tên lớp JS đọc (fetal-activity-link, activity-check-button, fetal-act-*, hb-tg-day-prev, tg-daily-*).
   Nạp không qua CDN qua partial fetal/_fetalStyles (cờ $GLOBALS['mbFetalPagesCss']). */

/* ================================================================ hộp "1 phút để hiểu" (footer, mọi trang) */

.ftp-guide {
	text-align: left;
}

.ftp-guide__head {
	margin: 0 0 var(--space-sm);
	font-weight: 700;
	text-align: center;
	text-transform: uppercase;
	color: var(--app-red-ink);
}

.ftp-guide__list {
	margin: 0 0 var(--space-sm);
	padding-left: var(--space-xl);
}

.ftp-guide__p {
	margin: 0 0 var(--space-sm);
}

/* Lợi ích: icon đốm màu DS (cùng kiểu Menu / kho nội dung), lưới 3 cột thay row + col-4 */
.ftp-benefits {
	display: grid;
	grid-template-columns: repeat(3, minmax(0, 1fr));
	gap: var(--space-sm) var(--space-sm);
	margin-bottom: var(--space-sm);
	text-align: center;
}

.ftp-benefits .mb-tile__ic {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	margin: 0 auto var(--space-xs);
}

.ftp-benefits .tg-benefit-label {
	display: block;
	font-size: var(--text-2xs);
	line-height: var(--text-2xs-lh);
	color: var(--app-ink);
}

/* ================================================================ Thai giáo hôm nay (_daily4) */

.ftp-day-title {
	margin-bottom: var(--space-xs);
	font-size: var(--text-xl);
	font-weight: 700;
	line-height: var(--text-xl-lh);
	text-align: center;
	color: var(--app-red-ink);
}

.ftp-day-count {
	margin: 0 0 var(--space-sm);
	text-align: center;
	color: var(--app-green-ink);
}

.ftp-day-guide-wrap {
	margin-bottom: var(--space-lg);
	text-align: center;
}

/* Link chữ "Hướng dẫn thai giáo là gì?" (cao 20): vùng bấm 44 */
.tg-daily-guide {
	position: relative;
	display: inline-block;
	font-size: var(--text-sm);
	color: var(--app-ink-sub);
}

.tg-daily-guide::after {
	content: '';
	position: absolute;
	top: calc((var(--control-md) - 100%) / -2);
	bottom: calc((var(--control-md) - 100%) / -2);
	left: 0;
	right: 0;
}

/* mb-seg link (Bài / Video): bỏ gạch chân; máy gập đóng ẩn icon */
.ftp-day-switch.mb-seg {
	width: 100%;
	margin-bottom: var(--space-lg);
}

.ftp-day-switch .mb-seg__btn {
	text-decoration: none;
	gap: var(--space-xs);
}

@media (max-width: 359px) {
	.ftp-day-switch .mb-seg__btn {
		padding: 0 var(--space-sm);
		font-size: var(--text-2xs);
	}

	.ftp-day-switch .mb-seg__btn i {
		display: none;
	}
}

/* Dòng "Mở lại" bài nhạc gần đây */
.hb-tg-day-prev {
	display: flex;
	align-items: center;
	gap: var(--space-sm);
	margin-bottom: var(--space-lg);
}

.hb-tg-day-prev__media {
	position: relative;
	display: block;
	flex-shrink: 0;
	width: var(--icon-hero);
	height: var(--control-lg);
	line-height: 0;
}

.hb-tg-day-prev__thumb {
	width: var(--icon-hero);
	height: var(--control-lg);
	object-fit: cover;
	border-radius: var(--radius-sm);
	background: var(--app-gray-soft);
}

.hb-tg-day-prev__tag {
	position: absolute;
	left: 0;
	top: 0;
	font-size: var(--text-2xs);
	font-weight: 700;
	line-height: var(--text-2xs-lh);
	color: var(--app-on-color);
	padding: 0 var(--space-xs);
	border-radius: var(--radius-sm) 0 var(--radius-sm) 0;
	background: var(--app-ink-sub);
}

.hb-tg-day-prev__title {
	display: -webkit-box;
	-webkit-box-orient: vertical;
	-webkit-line-clamp: 2;
	flex: 1 1 auto;
	min-width: 0;
	overflow: hidden;
	font-size: var(--text-sm);
	font-weight: 700;
	line-height: var(--text-sm-lh);
}

.hb-tg-day-prev__cta {
	flex-shrink: 0;
	white-space: nowrap;
}

/* Lưới thẻ bài: 2 cột (thay row mx-n2 + col-6 px-2 mb-3) */
.ftp-acts {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: var(--space-lg);
	margin-bottom: var(--space-lg);
}

/* Thẻ bài in trong khung flex-wrap của trang khác (search/index: .sr-cols, trước là .row): ô 50% như col-6 px-2 mb-3 cũ */
:not(.ftp-acts) > .ftp-act-cell {
	box-sizing: border-box;
	flex: 0 0 50%;
	max-width: 50%;
	padding: 0 var(--space-sm);
	margin-bottom: var(--space-lg);
}

.ftp-recipe {
	margin-bottom: var(--space-lg);
}

.ftp-recipe__title {
	margin: 0 0 var(--space-sm);
	font-size: var(--text-xl);
	font-weight: 700;
	line-height: var(--text-xl-lh);
	text-align: center;
	text-transform: uppercase;
	color: var(--app-blue-ink);
}

/* ================================================================ thẻ bài (_fetal_daily_item) */

/* Thẻ bài ảnh trên: mb-card chuẩn, bỏ đệm khung để ảnh sát mép */
.ftp-act.mb-card {
	display: flex;
	flex-direction: column;
	height: 100%;
	padding: 0;
	overflow: hidden;
}

.ftp-act__thumb {
	display: block;
}

.ftp-act__body {
	display: flex;
	flex-direction: column;
	flex-grow: 1;
	padding: var(--space-sm);
}

.ftp-act__title-wrap {
	flex-grow: 1;
	margin-bottom: var(--space-sm);
}

.ftp-act__title {
	display: -webkit-box;
	-webkit-box-orient: vertical;
	-webkit-line-clamp: 4;
	min-height: var(--control-sm); /* tiêu đề một dòng vẫn đủ vùng bấm 36 */
	overflow: hidden;
	font-size: var(--text-xs);
	font-weight: 700;
	line-height: var(--text-xs-lh);
	color: var(--app-ink);
}

.ftp-act__foot {
	margin-top: auto;
}

/* Nhãn loại bài: mb-tag prenatal; khoảng cách với tiêu đề */
.ftp-act__type {
	margin-right: var(--space-xs);
	vertical-align: middle;
}

/* Nút Hoàn thành / Đã xong: mb-btn--sm (36), vùng bấm 44; JS mb-site đổi tonal ↔ secondary / primary */
.ftp-act__done.mb-btn {
	position: relative;
	width: 100%;
	margin-bottom: var(--space-sm);
}

.ftp-act__done.mb-btn.is-disabled {
	opacity: 1;
}

.ftp-act__done.mb-btn::after {
	content: '';
	position: absolute;
	top: calc((var(--control-md) - var(--control-sm)) / -2);
	bottom: calc((var(--control-md) - var(--control-sm)) / -2);
	left: 0;
	right: 0;
}

/* Hướng dẫn | Thêm (thay row + col-7 border-right / col-5) */
.ftp-act__links {
	display: grid;
	grid-template-columns: 7fr 5fr;
	padding-top: var(--space-xs);
}

.ftp-act__links--one {
	grid-template-columns: minmax(0, 1fr);
}

/* Cột Hướng dẫn / Thêm: đệm ngang 4; nới dọc 8 mỗi phía để ellipsis (overflow: hidden) của cột không cắt ::after */
.fetal-act-col {
	min-width: 0;
	margin: calc(var(--space-sm) * -1) 0;
	padding: var(--space-sm) var(--space-xs);
	overflow: hidden;
	white-space: nowrap;
	text-overflow: ellipsis;
	text-align: center;
	container-type: inline-size;
}

.fetal-act-col + .fetal-act-col {
	border-left: 1px solid var(--app-line);
}

/* Hướng dẫn / Thêm: dòng 28, vùng bấm 44 */
.fetal-act-link {
	position: relative;
	display: block;
	padding: calc(var(--space-xs) / 2) 0;
	font-size: var(--text-2xs);
	cursor: pointer;
}

.fetal-act-link::after {
	content: '';
	position: absolute;
	top: calc((var(--control-md) - 100%) / -2);
	bottom: calc((var(--control-md) - 100%) / -2);
	left: 0;
	right: 0;
}

.ftp-act__guide {
	color: var(--app-ink-sub);
}

.fetal-guide-icon {
	margin-right: var(--space-xs);
}

/* Thẻ hẹp theo khung chứa (vd. /fetal/aditem 375: cột ~72px) chứ không theo bề rộng màn: bỏ icon để
   "Hướng dẫn" không bị cắt. WebView không có container query (iOS < 16) giữ như cũ. */
@container (max-width: 89px) {
	.fetal-act-link i {
		display: none;
	}
}

/* Máy gập đóng 280: thẻ chỉ ~100px, bỏ icon để "Hướng dẫn" / "Thêm" không bị cắt "…" */
@media (max-width: 359px) {
	.fetal-act-link i {
		display: none;
	}

	.fetal-act-col {
		padding-left: calc(var(--space-xs) / 2);
		padding-right: calc(var(--space-xs) / 2);
	}

	/* Thẻ ~90px không đủ chỗ cho chữ "Hướng dẫn": chỉ để icon ⓘ (tên đọc qua aria-label), chia đôi để
	   vùng bấm icon và "Thêm" đều đủ chỗ (owner chốt 01/12/2026) */
	.fetal-act-link .fetal-guide-icon {
		display: inline-block;
		margin-right: 0;
	}

	.fetal-guide-text {
		display: none;
	}

	.ftp-act__links {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}

	.ftp-act__links--one {
		grid-template-columns: minmax(0, 1fr);
	}

	/* Nhãn loại bài dài ("Học nuôi con", "Truyện tranh") không tràn thẻ ~130px */
	.ftp-act__type {
		max-width: 100%;
		padding: calc(var(--space-xs) / 2) var(--space-xs);
	}

	.ftp-act__done.mb-btn {
		padding: 0 var(--space-xs); /* "Hoàn thành" một dòng ở thẻ ~90px */
		font-size: var(--text-2xs);
	}
}

/* ================================================================ trang bài /fetal/aditem */

body:has(.ftp-aditem) {
	background-color: var(--app-bg);
}

/* Một cột giữa (thay container + row + col-xl-8 col-lg-9 col-md-10 col-sm-12) */
.ftp-aditem {
	box-sizing: border-box;
	width: 100%;
	max-width: calc(var(--page-w-read) + var(--space-2xl));
	margin: 0 auto var(--space-3xl);
	padding: 0 var(--space-lg);
}

@media (min-width: 576px) {
	.ftp-aditem {
		margin-top: var(--space-xl);
	}
}

.ftp-aditem .mb-panel {
	margin-bottom: var(--space-xl);
}

.ftp-aditem .breadcrumb {
	background: transparent;
	padding-left: 0;
}

.ftp-title {
	margin: 0 0 var(--space-lg);
	font-size: var(--text-2xl);
	font-weight: 700;
	line-height: var(--text-2xl-lh);
	color: var(--app-ink);
}

@media (max-width: 575.98px) {
	.ftp-title {
		font-size: var(--text-xl);
		line-height: var(--text-xl-lh);
	}
}

/* Video 16:9 (thay embed-responsive + style= ảnh chờ): ảnh chờ nằm dưới iframe */
.ftp-video {
	position: relative;
	aspect-ratio: 16 / 9;
	overflow: hidden;
	margin-bottom: var(--space-lg);
	border-radius: var(--radius-card);
	box-shadow: var(--shadow-card);
	background: var(--app-gray-soft);
}

.ftp-video__ph,
.ftp-video iframe {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	border: 0;
}

.ftp-video__ph {
	object-fit: cover;
	object-position: top center;
}

.ftp-center {
	margin-bottom: var(--space-xl);
	text-align: center;
}

.ftp-article {
	font-size: var(--text-md);
	line-height: var(--text-prose-lh);
	color: var(--app-ink);
}

.ftp-article img {
	max-width: 100%;
	height: auto;
	border-radius: var(--radius-md);
	margin: var(--space-lg) 0;
	box-shadow: var(--shadow-card);
}

.ftp-article h2,
.ftp-article h3 {
	color: var(--app-grp-prenatal);
	font-weight: 700;
	margin-top: var(--space-xl);
}

/* ================================================================ trang /fetal/embed (GIF nền tối) */

body:has(.ftp-embed-video) {
	height: 100%;
	padding-bottom: 0;
	overflow-x: hidden;
	background: var(--app-scrim);
}

html:has(.ftp-embed-video) {
	height: 100%;
}

/* Chân trang chung (nền trong suốt, chữ mực) cần nền sáng riêng để đọc được (QA 29/11, docs/124) */
body:has(.ftp-embed-video) #footer_container {
	background-color: var(--app-surface);
}

.ftp-embed-video {
	position: absolute;
	top: 0;
	width: 100%;
	height: 100%;
	object-fit: contain;
}

.ftp-embed-back {
	position: fixed;
	top: var(--space-md);
	left: var(--space-md);
	z-index: 10;
	background: var(--app-surface);
	box-shadow: var(--shadow-card);
}

.ftp-embed-back:focus-visible {
	outline: 2px solid var(--app-focus-on-color);
	outline-offset: 2px;
}
