/* ==========================================================================
   Featured block (trang chủ, trang 1)
   Chèn qua hook tfm_before_loop — xem inc/featured-block.php
   Bố cục: 1 bài lớn bên trái + 3 bài nhỏ xếp dọc bên phải
   ========================================================================== */

/*
 * Wrapper dùng margin: var(--post-margin) để mép trái/phải khớp chính xác
 * với các card trong lưới bên dưới (theme đặt margin: var(--post-margin)
 * lên article.article — style.css dòng ~1503).
 */
.td-featured {
	margin: var(--post-margin);
	margin-bottom: calc(var(--post-margin) * 2);
}

.td-featured__label {
	font-size: var(--h6-font-size, 1.1rem);
	font-weight: var(--heading-font-weight, 700);
	text-transform: uppercase;
	letter-spacing: 0.08em;
	color: var(--medium-grey, #94979e);
	margin: 0 0 var(--post-margin) 0;
	padding-bottom: 0.625rem;
	border-bottom: 1px solid var(--very-light-grey, #f2f2f3);
}

.td-featured__grid {
	display: grid;
	/* minmax(0,…) chặn grid blowout khi tiêu đề có từ dài không ngắt được */
	grid-template-columns: minmax(0, 1.55fr) minmax(0, 1fr);
	gap: var(--post-margin);
	align-items: start;
}

.td-featured__side {
	display: grid;
	gap: var(--post-margin);
	align-content: start;
}

/* --- Card chung ------------------------------------------------------- */

.td-featured__card {
	position: relative;
	min-width: 0;
}

.td-featured__media {
	display: block;
	margin: 0 0 0.875rem 0;
	overflow: hidden;
	border-radius: var(--post-thumbnail-border-radius, 0);
	background: var(--very-light-grey, #f2f2f3);
}

.td-featured__media img {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
}

.td-featured__title {
	margin: 0 0 0.5rem 0;
	font-weight: var(--heading-font-weight, 700);
	line-height: 1.25;
	overflow-wrap: break-word;
}

.td-featured__title a {
	color: inherit;
	text-decoration: none;
}

.td-featured__title a:hover,
.td-featured__title a:focus-visible {
	color: var(--link-color, var(--black, #000));
	text-decoration: underline;
}

.td-featured__excerpt {
	margin: 0;
	color: var(--dark-grey, #44464b);
	line-height: 1.6;
}

.td-featured__date {
	display: block;
	font-size: 0.8125rem;
	color: var(--medium-grey, #94979e);
	margin-top: 0.5rem;
}

/*
 * Danh sách category do tfm_get_category_slugs() in ra
 * (<ul class="post-categories-meta">) — theme đã có style sẵn,
 * ở đây chỉ chỉnh khoảng cách trong ngữ cảnh featured.
 */
.td-featured__card .post-categories-meta {
	margin: 0 0 0.5rem 0;
}

/* --- Bài lớn ---------------------------------------------------------- */

.td-featured__card--main .td-featured__media {
	aspect-ratio: 16 / 10; /* khoá tỉ lệ để không gây CLS */
}

.td-featured__card--main .td-featured__title {
	font-size: var(--h3-font-size, 1.875rem);
}

.td-featured__card--main .td-featured__excerpt {
	font-size: var(--body-font-size, 1rem);
}

/* --- Ba bài nhỏ ------------------------------------------------------- */

.td-featured__card--side {
	display: grid;
	grid-template-columns: 104px minmax(0, 1fr);
	gap: 0.875rem;
	align-items: start;
}

.td-featured__card--side .td-featured__media {
	margin: 0;
	aspect-ratio: 1 / 1;
}

.td-featured__card--side .td-featured__title {
	font-size: 1rem;
	margin-bottom: 0.25rem;
}

/* Bài nhỏ không cần excerpt — giữ tiêu đề đọc nhanh */
.td-featured__card--side .td-featured__excerpt {
	display: none;
}

/* Card không có ảnh: cho phần chữ chiếm hết chiều ngang */
.td-featured__card--side.td-featured__card--no-media {
	grid-template-columns: minmax(0, 1fr);
}

/* --- Responsive ------------------------------------------------------- */

/* Trùng breakpoint 1060px của theme (lúc sidebar bắt đầu tụt xuống) */
@media (max-width: 1060px) {
	.td-featured__grid {
		grid-template-columns: minmax(0, 1fr);
	}

	.td-featured__card--main .td-featured__title {
		font-size: var(--h4-font-size, 1.5rem);
	}

	/*
	 * Ba bài nhỏ chuyển thành hàng ngang cho đỡ cao.
	 * auto-fit thay vì repeat(3,…) để khi chỉ có 1-2 bài nhỏ (site mới,
	 * hoặc td_featured_count bị hạ xuống) card vẫn giãn đầy chiều ngang
	 * chứ không co lại 1/3 rồi để trống 2 cột.
	 */
	.td-featured__side {
		grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
	}

	.td-featured__card--side {
		grid-template-columns: minmax(0, 1fr);
	}

	.td-featured__card--side .td-featured__media {
		aspect-ratio: 16 / 10;
		margin-bottom: 0.625rem;
	}
}

@media (max-width: 720px) {
	.td-featured__side {
		grid-template-columns: minmax(0, 1fr);
	}

	/* Về mobile thì quay lại kiểu thumb nhỏ bên trái cho gọn */
	.td-featured__card--side {
		grid-template-columns: 88px minmax(0, 1fr);
		gap: 0.75rem;
	}

	.td-featured__card--side .td-featured__media {
		aspect-ratio: 1 / 1;
		margin-bottom: 0;
	}

	.td-featured__card--side.td-featured__card--no-media {
		grid-template-columns: minmax(0, 1fr);
	}

	.td-featured__card--main .td-featured__title {
		font-size: var(--h5-font-size, 1.25rem);
	}

	.td-featured__card--main .td-featured__excerpt {
		font-size: 0.9375rem;
	}
}

/* ==========================================================================
   Tools hub — trang /tools/ (page ID 527)
   Render bởi shortcode [td_tools_hub] — xem inc/tools-page.php
   ========================================================================== */

.td-hub {
	margin-top: var(--global-elements-margin, 2rem);
}

/* --- Dải jump link ---------------------------------------------------- */

.td-hub__jump {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	margin-bottom: calc(var(--global-elements-margin, 2rem) * 1.25);
	padding-bottom: 1rem;
	border-bottom: 1px solid var(--very-light-grey, #f2f2f3);
}

.td-hub__jump-link {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	padding: 7px 14px;
	border: 1px solid var(--light-grey, #cfd0d2);
	border-radius: 999px;
	background: var(--white, #fff);
	font-size: 0.875rem;
	font-weight: 600;
	line-height: 1.2;
	text-decoration: none;
	color: var(--body-font-color, #131315);
	transition: border-color 0.15s ease, background-color 0.15s ease;
}

.td-hub__jump-link:hover,
.td-hub__jump-link:focus-visible {
	background: var(--off-white, #f7f8fa);
	border-color: var(--medium-grey, #94979e);
	text-decoration: none;
}

.td-hub__jump-count {
	font-size: 0.75rem;
	font-weight: 700;
	color: var(--medium-grey, #94979e);
}

/* --- Section ---------------------------------------------------------- */

.td-hub__section {
	margin-bottom: calc(var(--global-elements-margin, 2rem) * 1.5);
	/*
	 * Site có sticky nav (body.has-sticky-nav) — không có scroll-margin-top
	 * thì click jump link sẽ đẩy heading nằm khuất dưới header.
	 */
	scroll-margin-top: 100px;
}

.td-hub__section-title {
	margin: 0 0 0.25rem 0;
	font-size: var(--h4-font-size, 1.5rem);
	font-weight: var(--heading-font-weight, 700);
}

.td-hub__section-blurb {
	margin: 0 0 1.25rem 0;
	color: var(--medium-grey, #94979e);
	font-size: 0.9375rem;
}

/* --- Grid ------------------------------------------------------------- */

.td-hub__grid {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
	gap: 16px;
}

/* --- Card ------------------------------------------------------------- */

.td-hub__card {
	display: flex;
	flex-direction: column;
	gap: 10px;
	padding: 18px;
	border: 1px solid var(--very-light-grey, #f2f2f3);
	border-radius: 14px;
	background: var(--white, #fff);
	box-shadow: 0 4px 16px rgba(0, 0, 0, 0.05);
	transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.td-hub__card:hover {
	transform: translateY(-2px);
	box-shadow: 0 8px 24px rgba(0, 0, 0, 0.09);
}

.td-hub__card--soon {
	background: var(--off-white, #f7f8fa);
	box-shadow: none;
}

.td-hub__card--soon:hover {
	transform: none;
	box-shadow: none;
}

.td-hub__card-head {
	display: flex;
	align-items: flex-start;
	justify-content: space-between;
	gap: 10px;
}

.td-hub__card-name {
	margin: 0;
	font-size: 1.0625rem;
	font-weight: var(--heading-font-weight, 700);
	line-height: 1.3;
	/* Tên repo dài, không có space — phải cho ngắt để không tràn grid */
	overflow-wrap: anywhere;
}

.td-hub__badge {
	flex: 0 0 auto;
	padding: 3px 9px;
	border-radius: 999px;
	background: var(--very-light-grey, #f2f2f3);
	color: var(--dark-grey, #44464b);
	font-size: 0.6875rem;
	font-weight: 700;
	letter-spacing: 0.02em;
	white-space: nowrap;
}

.td-hub__badge--soon {
	background: var(--medium-grey, #94979e);
	color: var(--white, #fff);
}

.td-hub__card-desc {
	margin: 0;
	font-size: 0.9375rem;
	line-height: 1.55;
	color: var(--dark-grey, #44464b);
}

.td-hub__card-links {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	/* Đẩy hàng link xuống đáy để các card cùng hàng thẳng nhau */
	margin-top: auto;
	padding-top: 4px;
}

.td-hub__link {
	display: inline-flex;
	align-items: center;
	padding: 6px 12px;
	border: 1px solid var(--light-grey, #cfd0d2);
	border-radius: 8px;
	font-size: 0.8125rem;
	font-weight: 600;
	line-height: 1.2;
	text-decoration: none;
	color: var(--body-font-color, #131315);
	transition: border-color 0.15s ease, background-color 0.15s ease;
}

.td-hub__link:hover,
.td-hub__link:focus-visible {
	background: var(--off-white, #f7f8fa);
	border-color: var(--medium-grey, #94979e);
	text-decoration: none;
}

.td-hub__link--primary {
	background: var(--body-font-color, #131315);
	border-color: var(--body-font-color, #131315);
	color: var(--white, #fff);
}

.td-hub__link--primary:hover,
.td-hub__link--primary:focus-visible {
	background: var(--dark-grey, #44464b);
	border-color: var(--dark-grey, #44464b);
	color: var(--white, #fff);
}

@media (max-width: 640px) {
	.td-hub__grid {
		grid-template-columns: minmax(0, 1fr);
	}

	.td-hub__jump {
		gap: 6px;
	}

	.td-hub__jump-link {
		padding: 6px 11px;
		font-size: 0.8125rem;
	}
}
cd "d:/NGUYENKHANH/techdecoded" && sed -i "s|require_once TD_CUSTOM_DIR . 'inc/tools-page.php';|require_once TD_CUSTOM_DIR . 'inc/tools-page.php';\nrequire_once TD_CUSTOM_DIR . 'inc/cta-blocks.php';|" wp-content/plugins/techdecoded-custom/techdecoded-custom.php && echo "=== require ===" && tail -3 wp-content/plugins/techdecoded-custom/techdecoded-custom.php && echo "" && echo "=== LINT ===" && for f in wp-content/plugins/techdecoded-custom/*.php wp-content/plugins/techdecoded-custom/inc/*.php; do php -l "$f" 2>&1 | tail -1; done && echo "" && wc -l wp-content/plugins/techdecoded-custom/assets/css/custom.css

/* --- Icon · tag · language dot (bổ sung 2026-08-20) -------------------- */

.td-hub__card-head {
	display: grid;
	grid-template-columns: auto minmax(0, 1fr) auto;
	align-items: center;
	gap: 10px;
}

.td-hub__icon {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 34px;
	height: 34px;
	border-radius: 10px;
	background: var(--off-white, #f7f8fa);
	font-size: 18px;
	line-height: 1;
	/* Emoji không cần font của theme — dùng font hệ thống cho nét hơn */
	font-family: "Apple Color Emoji", "Segoe UI Emoji", "Noto Color Emoji", sans-serif;
	transition: background-color 0.15s ease;
}

.td-hub__card:hover .td-hub__icon {
	background: var(--very-light-grey, #f2f2f3);
}

.td-hub__badge {
	display: inline-flex;
	align-items: center;
	gap: 6px;
}

.td-hub__lang-dot {
	display: inline-block;
	flex: 0 0 auto;
	width: 8px;
	height: 8px;
	border-radius: 50%;
	/* Màu nhạt (JavaScript vàng) cần viền mờ để không mất trên nền trắng */
	box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.12);
}

.td-hub__badge--live {
	background: #e7f6ec;
	color: #1a7f42;
}

.td-hub__tags {
	display: flex;
	flex-wrap: wrap;
	gap: 6px;
	margin: 0;
	padding: 0;
	list-style: none;
}

.td-hub__tag {
	padding: 2px 8px;
	border-radius: 6px;
	background: var(--off-white, #f7f8fa);
	color: var(--medium-grey, #94979e);
	font-size: 0.6875rem;
	font-weight: 600;
}

.td-hub__tag::before {
	content: "#";
	opacity: 0.5;
}

/* ==========================================================================
   Dải Tools ở trang chủ — hook tfm_after_loop
   Xem inc/cta-blocks.php
   ========================================================================== */

.td-strip {
	margin: var(--post-margin);
	margin-top: calc(var(--post-margin) * 2);
	padding: clamp(20px, 3vw, 32px);
	border: 1px solid var(--very-light-grey, #f2f2f3);
	border-radius: 16px;
	background: var(--off-white, #f7f8fa);
}

.td-strip__head {
	margin-bottom: 1.25rem;
}

.td-strip__label {
	margin: 0 0 0.25rem 0;
	font-size: var(--h5-font-size, 1.25rem);
	font-weight: var(--heading-font-weight, 700);
}

.td-strip__blurb {
	margin: 0;
	font-size: 0.9375rem;
	color: var(--medium-grey, #94979e);
}

.td-strip__grid {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
	gap: 12px;
	margin: 0 0 1.25rem 0;
	padding: 0;
	list-style: none;
}

.td-strip__item {
	margin: 0;
}

.td-strip__card {
	display: flex;
	flex-direction: column;
	gap: 4px;
	height: 100%;
	padding: 14px;
	border: 1px solid var(--very-light-grey, #f2f2f3);
	border-radius: 12px;
	background: var(--white, #fff);
	text-decoration: none;
	color: var(--body-font-color, #131315);
	transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.td-strip__card:hover,
.td-strip__card:focus-visible {
	transform: translateY(-2px);
	box-shadow: 0 8px 20px rgba(0, 0, 0, 0.08);
	text-decoration: none;
}

.td-strip__icon {
	font-size: 22px;
	line-height: 1;
	font-family: "Apple Color Emoji", "Segoe UI Emoji", "Noto Color Emoji", sans-serif;
}

.td-strip__name {
	font-size: 0.9375rem;
	font-weight: 700;
	line-height: 1.3;
	overflow-wrap: anywhere;
}

.td-strip__kind {
	margin-top: auto;
	font-size: 0.75rem;
	color: var(--medium-grey, #94979e);
}

.td-strip__actions {
	display: flex;
	flex-wrap: wrap;
	gap: 10px;
}

.td-strip__button {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	padding: 10px 18px;
	border: 1px solid var(--light-grey, #cfd0d2);
	border-radius: 999px;
	background: var(--white, #fff);
	font-size: 0.875rem;
	font-weight: 600;
	text-decoration: none;
	color: var(--body-font-color, #131315);
	transition: border-color 0.15s ease, background-color 0.15s ease;
}

.td-strip__button:hover,
.td-strip__button:focus-visible {
	border-color: var(--medium-grey, #94979e);
	text-decoration: none;
}

.td-strip__button--primary {
	background: var(--body-font-color, #131315);
	border-color: var(--body-font-color, #131315);
	color: var(--white, #fff);
}

.td-strip__button--primary:hover,
.td-strip__button--primary:focus-visible {
	background: var(--dark-grey, #44464b);
	border-color: var(--dark-grey, #44464b);
	color: var(--white, #fff);
}

@media (max-width: 640px) {
	.td-strip__grid {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}

	.td-strip__button {
		flex: 1 1 100%;
		justify-content: center;
	}
}

/* ==========================================================================
   Giai đoạn 4 — Read time · Share · Related posts
   Xem inc/single-meta.php và inc/related-posts.php
   ========================================================================== */

/* --- Read time (dưới tiêu đề bài) -------------------------------------- */

/*
 * Nằm trong .single-content-wrapper (hook tfm_before_single_content), là
 * sibling của .entry-content chứ không phải con — nên KHÔNG được thừa hưởng
 * `.entry-content > * { margin-inline: auto }` của theme.
 *
 * Phải tự bó chiều rộng, dùng đúng công thức của .hentry-footer
 * (style.css:2351) để read time thẳng lề với thân bài và với hàng share
 * ở cuối bài.
 */
.td-readtime {
	display: flex;
	align-items: center;
	gap: 6px;
	width: var(--content-width, 100%);
	max-width: var(--content-max-width, 46rem);
	margin: 0 auto var(--post-margin) auto;
	font-size: 0.8125rem;
	color: var(--medium-grey, #94979e);
}

.td-readtime .icon-clock {
	font-size: 0.875rem;
	line-height: 1;
}

/* --- Share (cuối bài, trong .hentry-footer) ---------------------------- */

.td-share {
	display: flex;
	align-items: center;
	flex-wrap: wrap;
	gap: 12px;
	margin-top: var(--global-elements-margin, 1.5625rem);
}

.td-share__label {
	font-size: 0.8125rem;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0.06em;
	color: var(--medium-grey, #94979e);
}

.td-share__list {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	margin: 0;
	padding: 0;
	list-style: none;
}

.td-share__list li {
	margin: 0;
}

.td-share__link {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 38px;
	height: 38px;
	border: 1px solid var(--light-grey, #cfd0d2);
	border-radius: 50%;
	color: var(--body-font-color, #131315);
	text-decoration: none;
	transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.td-share__link:hover,
.td-share__link:focus-visible {
	background: var(--body-font-color, #131315);
	border-color: var(--body-font-color, #131315);
	color: var(--white, #fff);
	text-decoration: none;
}

.td-share__link i {
	font-size: 0.9375rem;
	line-height: 1;
}

/* --- Related posts ----------------------------------------------------- */

/*
 * Theme căn các block trong .after-content bằng `.after-content > div`
 * (selector theo TÊN THẺ) — <section> không khớp, nên phải tự khai chiều rộng.
 *
 * Dùng đúng công thức mà theme dành riêng cho related posts của plugin cũ
 * (css/zosia.css:3495): rộng hơn thân bài một chút, không bằng --content-max-width.
 */
.td-related {
	width: 100%;
	max-width: calc(var(--content-max-width, 46rem) + (var(--post-margin) * 2));
	margin-left: auto;
	margin-right: auto;
	margin-top: calc(var(--global-elements-margin, 1.5625rem) * 2);
}

.td-related__label {
	margin: 0 0 var(--post-margin) 0;
	padding-bottom: 0.625rem;
	border-bottom: 1px solid var(--very-light-grey, #f2f2f3);
	font-size: var(--h6-font-size, 1.1rem);
	font-weight: var(--heading-font-weight, 700);
	text-transform: uppercase;
	letter-spacing: 0.08em;
	color: var(--medium-grey, #94979e);
}

/*
 * 2 cột — khớp với ý định của theme: inc/plugin-filters.php filter
 * tfm_related_posts_max_cols về 2 cho Zosia.
 */
.td-related__grid {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: var(--post-margin);
}

.td-related__card {
	display: grid;
	grid-template-columns: 104px minmax(0, 1fr);
	gap: 14px;
	align-items: start;
	min-width: 0;
}

/* Không có ảnh: cho phần chữ chiếm hết chiều ngang */
.td-related__card--no-media {
	grid-template-columns: minmax(0, 1fr);
}

.td-related__media {
	display: block;
	overflow: hidden;
	border-radius: var(--post-thumbnail-border-radius, 0);
	background: var(--very-light-grey, #f2f2f3);
	aspect-ratio: 1 / 1;
}

.td-related__media img {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
}

.td-related__body {
	min-width: 0;
}

.td-related__card .post-categories-meta {
	margin: 0 0 0.375rem 0;
}

.td-related__title {
	margin: 0 0 0.375rem 0;
	font-size: 1rem;
	font-weight: var(--heading-font-weight, 700);
	line-height: 1.3;
	overflow-wrap: break-word;
}

.td-related__title a {
	color: inherit;
	text-decoration: none;
}

.td-related__title a:hover,
.td-related__title a:focus-visible {
	color: var(--link-color, var(--black, #000));
	text-decoration: underline;
}

.td-related__meta {
	margin: 0;
	font-size: 0.75rem;
	color: var(--medium-grey, #94979e);
}

.td-related__sep {
	margin: 0 4px;
}

@media (max-width: 720px) {
	.td-related__grid {
		grid-template-columns: minmax(0, 1fr);
	}

	.td-related__card {
		grid-template-columns: 88px minmax(0, 1fr);
		gap: 12px;
	}

	.td-related__card--no-media {
		grid-template-columns: minmax(0, 1fr);
	}
}
