/**
 * 首页 UI v2（D-64）。令牌仍走 theme.json；本文件只覆盖首页节奏与组件。
 */

:root {
	--tg-home-ease: cubic-bezier(0.2, 0.7, 0.2, 1);
	--tg-home-move: var(--wp--custom--motion--fast, 220ms);
}

/* ——— Header ——— */
.tg-header {
	border-bottom: 0;
	transition: box-shadow var(--tg-home-move) var(--tg-home-ease), background-color var(--tg-home-move) var(--tg-home-ease);
}

/* The wrapper is a child of the tall `.wp-site-blocks`, so it is the element that can actually
 * stick. A sticky element can never leave its containing block, and this header's wrapper
 * (`.wp-block-template-part`) is exactly as tall as the header (measured 2026-10-18: both 73px),
 * so `position: sticky` on `.tg-header` itself never took effect.
 *
 * The wrapper is sticky **from the first frame**. Toggling `position` from a scroll listener
 * (the previous `:has(.tg-header--stuck)` rule) forced a layout of the whole page on every
 * scroll and is what made Home feel like it was catching. `--stuck` now only paints. */
.wp-block-template-part:has(> .tg-header) {
	position: sticky;
	top: 0;
	z-index: 50;
}

.tg-header.tg-header--stuck {
	z-index: 50;
	background: var(--wp--preset--color--surface);
	border-bottom: 1px solid var(--wp--preset--color--rule);
}

.tg-header.tg-header--stuck .tg-topbar {
	display: none;
}

.tg-header.tg-header--stuck .tg-header__bar {
	min-height: 72px;
}

.tg-header .tg-nav .wp-block-navigation-item__content {
	font-size: 0.9375rem;
	font-weight: 500;
}

@media (min-width: 1024px) {
	.tg-header .tg-nav__menu {
		gap: 28px;
	}

	.tg-header .tg-lang {
		margin-inline-end: 24px;
	}
}

/* ——— Hero ——— */
/* Owner 2026-10-25: the copy is centred and the scrim is much lighter than the D-64 gradient — the
 * clip is the point, so it stays visible edge to edge. A centred statement needs a vertical band
 * of weight behind it rather than the left-to-right ramp that only existed to protect a
 * left-aligned column: the peak is at 50% and it falls away to a thin veil at both ends. Both
 * scrims are `theme.json` tokens (`hero-scrim`, `hero-scrim-mobile`) — the design values live
 * there, this file only applies them. Contrast is measured against every frame of the clip, not
 * assumed: `docs/component-guidelines.md` §12. */
.tg-hero .wp-block-cover__background {
	opacity: 1;
	background: var(--wp--preset--gradient--hero-scrim);
}

/* The poster is frame 0 of the hero video, so poster and video must crop identically or the
 * picture jumps when playback starts. Both are centred: the video's subject (the seedling) is
 * in the middle of the frame, not on the right like the retired product poster. */
.tg-hero .wp-block-cover__image-background,
.tg-hero .wp-block-cover__video-background,
.tg-hero__poster,
.tg-hero__video {
	object-position: 50% 50%;
}

.tg-hero {
	min-height: min(86vh, 780px);
}

/* The copy is one centred column, and every child is centred inside it: the statement, the
 * certification line, and the button row (which core lays out as a flex row and now needs
 * `justify-content` so it does not sit left-aligned inside a centred block). */
.tg-hero .wp-block-cover__inner-container {
	text-align: center;
}

/* The copy column has to be as wide as the statement needs. It used to be capped at 52rem (832px),
 * which is narrower than the 1168px the container offers at 1280 — that cap, not the type size, was
 * what split "Tradition Shaped / by Listening." across two lines. Each child is still centred
 * (`justify-items`), so the proof line and the buttons stay narrow and centred inside it. */
.tg-hero__copy {
	display: grid;
	justify-items: center;
	max-width: none;
	width: 100%;
	margin-inline: auto;
	/* A scrim behind the copy only.
	 *
	 * The hero runs a video with no overlay (`.wp-block-cover__background` computes to transparent),
	 * so the headline's contrast was decided by whichever frame happened to be showing: fine over
	 * the dark soil, about 2.5:1 when the frame lightens, and the proof line measured 1.07:1. A
	 * radial gradient darkens where the words are and fades out before the edges, which keeps the
	 * picture open instead of laying a flat 45% sheet over all of it.
	 *
	 * `isolation` keeps the pseudo-element above the cover's background but below the text; without
	 * it a negative `z-index` child can fall behind the video entirely. */
	isolation: isolate;
	position: relative;
}

.tg-hero__copy::before {
	content: "";
	position: absolute;
	z-index: -1;
	inset: -10% -14%;
	background: radial-gradient(
		ellipse 62% 72% at 50% 50%,
		rgb(16 20 18 / 62%) 0%,
		rgb(16 20 18 / 42%) 45%,
		rgb(16 20 18 / 0%) 74%
	);
	pointer-events: none;
}

.tg-hero .wp-block-buttons {
	justify-content: center;
}

/* The statement is the hero's only line of display type, and it is meant to sit on ONE line
 * (owner 2026-10-25). Two things were forcing a wrap, both now gone: the old `max-width: 20ch` on
 * this rule, and a `40rem` / `52rem` cap on `.tg-hero__copy` — 832px against the 1168px the
 * container offers, so the headline broke at "Tradition Shaped / by Listening." long before the
 * type ran out of room.
 *
 * The size is then bounded by the **longest translation**, not by English, so that "one line" holds
 * in all four languages rather than only in the one being designed on. Measured in the browser at
 * 1280 (1119px of room): English 14.1em, German 15.0em, Spanish 16.0em, French 16.6em — so French
 * caps the size at 67px. The clamp is set just under that, and English ends up at 79px.
 *
 * If a future round wants the French line to wrap while English grows further, that is a language
 * -specific override (`html:lang(fr) .tg-front .tg-hero h1`), not a global size change.
 *
 * Below 1024px one line stops being possible — see the media query further down. */
.tg-front .tg-hero h1 {
	margin-inline: auto;
	font-size: clamp(2.5rem, 1.25rem + 3.7vw, 4.2rem);
	line-height: 1.05;
	font-weight: 600;
}

/* Owner 2026-10-25: the hero opens on the film, then the copy starts appearing at **1s** and is
 * fully opaque by 4s, where it stays. (It was 2s–5s on the first pass; the owner asked for the
 * statement to arrive sooner.) The whole copy column fades as one unit rather than the H1 alone:
 * fading only the headline would leave the certification line and the buttons sitting on screen
 * with nothing above them, which reads as a broken page. Plain CSS — nothing to fail if JS never
 * runs: the `from { opacity: 0 }` frame only applies through `animation-fill-mode: backwards`, so
 * a browser that ignores the animation shows the copy immediately. */
@keyframes tg-hero-reveal {
	from {
		opacity: 0;
	}

	to {
		opacity: 1;
	}
}

.tg-front .tg-hero__copy {
	/* Was `3s ease 1s` — four seconds from load until the headline was fully opaque, and measured
	 * at 0.49 opacity two seconds in. An entrance that slow reads as a slow page, not as a
	 * transition, and on a phone the visitor has already started scrolling. 700 ms with a 150 ms
	 * delay still lets the video establish itself first. */
	animation: tg-hero-reveal 0.7s ease 0.15s backwards;
}

@media (prefers-reduced-motion: reduce) {
	.tg-front .tg-hero__copy {
		animation: none;
	}
}

/* The support line is gone from the hero (owner 2026-10-25) — this class survives for the
 * shortcode/pattern fallback and for any template that still renders it. */
.tg-hero__support {
	max-width: 52ch;
	margin-inline: auto;
	font-size: clamp(1.125rem, 1rem + 0.4vw, 1.25rem);
	color: rgb(238 240 235 / 82%);
}

.tg-hero .wp-block-button.is-style-outline .wp-block-button__link {
	border-color: rgb(238 240 235 / 60%);
	color: var(--wp--preset--color--paper);
}

.tg-hero .wp-block-button.is-style-outline .wp-block-button__link:hover {
	background: rgb(238 240 235 / 8%);
	color: var(--wp--preset--color--paper);
}

/* Owner review 2026-10-18: the outline button's arrow was painted `accent` by the generic
 * `.is-style-outline … .tg-icon` rule, which is near-invisible on the hero photograph. On the dark
 * hero — the primary button included — the icon follows the label's own colour. */
.tg-hero .wp-block-button__link .tg-icon,
.tg-hero .wp-block-button.is-style-outline .wp-block-button__link .tg-icon {
	color: currentColor;
}

/* One line under the statement: certifications, a rule, the sample window. It sits *above* the
 * buttons now (owner 2026-10-25), so the gap below the H1 is the group's own block gap, not a
 * top margin. `|` is a real element so it can be hidden when the line wraps or on phones. */
.tg-hero__trust {
	display: flex;
	flex-wrap: wrap;
	align-items: baseline;
	justify-content: center;
	gap: 4px 12px;
	max-width: 62ch;
	margin: 0 auto;
	color: rgb(238 240 235 / 82%);
	font-size: 0.9375rem;
	line-height: 1.5;
}

/* The certification run is one long string of marks; letting it shrink and wrap is what keeps it
 * on the screen at 375px (a `flex: none` item just pushes the row off the edge). The shortcode
 * glues the last mark to "certified" with a no-break space so the word is never stranded alone. */
.tg-hero__trust-item {
	min-width: 0;
	overflow-wrap: break-word;
}

.tg-hero__trust-sep {
	color: rgb(238 240 235 / 40%);
}

/* Below 640px the line is longer than the screen however it is measured, so it wraps and the
 * pipe would be left orphaned at a line end. It is decoration; it goes. */
@media (max-width: 639px) {
	.tg-hero__trust-sep {
		display: none;
	}
}

@media (max-width: 1023px) {
	/* The portrait poster is a close-up of soil with the sprout in the middle, so the copy needs a
	 * little more separation than on the video — but still far less than the 92% this used to be. */
	.tg-hero .wp-block-cover__background {
		background: var(--wp--preset--gradient--hero-scrim-mobile);
	}

	/* No separate phone size any more: the clamp's `2.5rem` floor is what a phone gets, and it is
	 * already the largest size at which English still sets in three lines there. One line stops
	 * being possible below 1024px altogether — the longest translation needs 16.6em and the container
	 * offers ~55em at 1024 and ~25em at 375, so forcing one line would mean ~20px type, smaller than
	 * body copy. Keeping it large beats keeping it short. */
}

/* Owner 2026-10-25: on a phone the two CTAs stack at different widths — "Request a Quote" is short
 * and "Explore OEM/ODM" is long, so the pair reads ragged. Below 640px they become one column of
 * equal-width buttons, each as wide as the copy column. The labels themselves are untouched (they
 * are locked); only the button boxes are equalised. */
@media (max-width: 639px) {
	.tg-hero .wp-block-buttons {
		flex-direction: column;
		align-items: stretch;
		gap: var(--wp--preset--spacing--30);
		width: min(100%, 20rem);
		margin-inline: auto;
	}

	.tg-hero .wp-block-button {
		width: 100%;
	}

	.tg-hero .wp-block-button__link {
		width: 100%;
		justify-content: center;
	}
}

/* ——— 信任条（T-654：客户参考图，四格、图标居中在上、无分隔线；T-655 高度缩到约 2/3） ——— */
.tg-facts {
	--tg-fact-icon: 22px;
	padding-block: clamp(15px, 1.7vw, 22px);
	background: var(--wp--preset--color--surface);
	border-bottom: 0;
}

.tg-main .tg-facts__list {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: var(--wp--preset--spacing--40) var(--wp--preset--spacing--40);
	margin: 0;
	padding: 0;
	list-style: none;
}

.tg-main .tg-facts__list li {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 6px;
	padding: 0;
	border: 0;
	text-align: center;
}

/* The global `.tg-main li + li` spacing rule (components.css:595) is for stacked text lists. In this
 * grid it does not separate anything — the grid gap does — but it still adds 8px to cells 2–4, the
 * row stretches to the tallest, and the band grows by exactly that 8px. Reset it (T-655). */
.tg-main .tg-facts__list li + li {
	margin-top: 0;
}

.tg-facts__icon {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	color: var(--wp--preset--color--accent);
}

.tg-facts__icon,
.tg-facts__icon .tg-icon,
.tg-facts__icon svg {
	width: var(--tg-fact-icon);
	height: var(--tg-fact-icon);
}

.tg-facts__text {
	display: grid;
	gap: 3px;
	justify-items: center;
}

.tg-facts__value {
	margin: 0;
	font-size: clamp(1.0625rem, 0.9rem + 0.55vw, 1.25rem);
	font-weight: 700;
	line-height: 1.15;
	letter-spacing: -0.01em;
	white-space: nowrap;
}

.tg-facts__label {
	color: var(--wp--preset--color--ink-muted);
	font-size: 0.875rem;
	font-weight: 400;
	line-height: 1.25;
}

@media (min-width: 900px) {
	.tg-main .tg-facts__list {
		grid-template-columns: repeat(4, minmax(0, 1fr));
		gap: var(--wp--preset--spacing--60);
	}

	.tg-facts__value {
		font-size: clamp(1.125rem, 0.85rem + 0.65vw, 1.375rem);
	}

	/* At 900–1199px a cell is ~200px and "Product & Brand Customization" is ~205px at 14px, so it
	 * wraps to a second line and that one cell grows a line taller than its three neighbours. One
	 * step down keeps all four labels on one line until the cells widen. */
	.tg-facts__label {
		font-size: 0.8125rem;
	}
}

@media (min-width: 1200px) {
	.tg-facts__label {
		font-size: 0.875rem;
	}
}

/* ——— 模块头 / eyebrow ——— */
.tg-eyebrow {
	margin: 0 0 12px;
	color: var(--wp--preset--color--accent);
	font-size: 0.8125rem;
	font-weight: 600;
	letter-spacing: 0.08em;
	text-transform: uppercase;
}

@media (min-width: 1024px) {
	.tg-front .tg-section__head--split {
		align-items: first baseline;
	}

	.tg-front .tg-section__head--split > .wp-block-html:has(.tg-eyebrow),
	.tg-front .tg-section__head--split > .tg-eyebrow {
		grid-column: 1;
		grid-row: 1;
	}

	.tg-front .tg-section__head--split > h2 {
		grid-column: 1;
		grid-row: 2;
		margin-block: 0;
	}

	.tg-front .tg-section__head--split > p:not(.tg-eyebrow):not(.tg-section-link) {
		grid-column: 2;
		grid-row: 2;
		margin-top: 0;
		align-self: start;
	}

	/* View all 等入口不能和导语抢同一格 */
	.tg-front .tg-section__head--split > p.tg-section-link,
	.tg-front .tg-section__head--split > .wp-block-html:has(.tg-section-link) {
		grid-column: 2;
		grid-row: 3;
		margin-top: 12px;
		justify-self: start;
		align-self: start;
	}
}

/* Insights module head (owner review 2026-10-15): the section link moves up to the head's right,
 * on the heading's line, the way the Client stories head already reads; it used to sit under the
 * right-hand lead. The lead then spans the head below both. */
@media (min-width: 1024px) {
	.tg-front .tg-insights-block .tg-section__head--split > p.tg-section-link,
	.tg-front .tg-insights-block .tg-section__head--split > .wp-block-html:has(.tg-section-link) {
		grid-column: 2;
		grid-row: 2;
		justify-self: end;
		align-self: end;
		margin-top: 0;
	}

	.tg-front .tg-insights-block .tg-section__head--split > p:not(.tg-eyebrow):not(.tg-section-link) {
		grid-column: 1 / -1;
		grid-row: 3;
		max-width: 62ch;
		margin-top: var(--wp--preset--spacing--40);
	}
}

.tg-front .tg-products .tg-section__head--intro h2 {
	font-size: var(--wp--preset--font-size--h-2);
}

.tg-cta-band--brand h2 {
	font-size: var(--wp--preset--font-size--h-2);
}

/* ——— 分类卡 ——— */
.tg-cat-index__item {
	transition: transform var(--tg-home-move) var(--tg-home-ease), box-shadow var(--tg-home-move) var(--tg-home-ease);
}

.tg-cat-index__item:hover,
.tg-cat-index__item:focus-visible {
	transform: translateY(-4px);
	box-shadow: var(--wp--custom--shadow--card-hover, 0 12px 32px rgb(29 39 48 / 8%));
}

.tg-cat-index__item:hover .tg-cat-index__thumb img,
.tg-cat-index__item:focus-visible .tg-cat-index__thumb img {
	transform: scale(1.03);
}

.tg-cat-index__thumb img {
	transition: transform var(--tg-home-move) var(--tg-home-ease);
}

.tg-cat-index__item:focus-visible {
	outline: 2px solid var(--wp--preset--color--accent);
	outline-offset: 3px;
}

.tg-cat-index__text {
	display: flex;
	flex-direction: column;
}

.tg-cat-index__cta {
	margin-top: auto;
	padding-top: 16px;
	color: var(--wp--preset--color--accent);
	font-size: 0.9375rem;
	font-weight: 600;
}

/* Text links carry the same 14px trailing arrow as the Featured products link. Owner review
 * 2026-10-15: `View adapters`, `Read more` and the case-card title had none while `View all
 * products` did. */
.tg-cat-index__cta .tg-icon,
.tg-insight-row__more .tg-icon,
.tg-story-row .wp-block-post-title .tg-icon {
	display: inline-block;
	width: 14px;
	height: 14px;
	margin-left: 8px;
	vertical-align: -2px;
}

/* `Read more` sits outside the card's anchor (the title's ::after covers the card), so the shared
 * `a:hover .tg-icon` nudge never reaches it. */
.tg-front .tg-insight-row:hover .tg-insight-row__more .tg-icon {
	transform: translateX(3px);
}

.tg-cat-index__go {
	display: none;
}

.tg-front .tg-home-products {
	margin-top: 64px;
}

/* ——— 精选卡 ——— */
.tg-front .tg-product-grid--home {
	align-items: stretch;
}

/* li 不写 height: 100%：它的父级是 flex 行，stretch 已经让它等高于最高一张；
 * 写百分比只会解析成 auto，反而把卡片的高度算错。 */
.tg-front .tg-product-grid--home > li {
	display: flex;
	align-items: stretch;
}

/* 卡片填满已拉伸的 li：原来写的 min-height: 100% 在“父级高度由内容决定”时按 auto 解析，
 * 等于没写，每张卡只按自身内容高（owner 2026-10-15 看到的参差）。height: 100% 才生效。
 * 底部留白比侧边（24px）多一档：链接是全卡的最后一个元素，和内边距同宽时会贴边，
 * 看起来像被截断（owner 2026-10-18）。 */
.tg-front .tg-product-tile {
	display: flex;
	flex-direction: column;
	flex: 1 1 auto;
	width: 100%;
	height: 100%;
	/* P1-1: the text block's side padding (spacing-50) is also its bottom padding, so the CTA
	 * sits the same distance from the card's bottom edge as the copy does from its sides. The top
	 * is 0 on purpose — the photograph is flush to the card's top edge and takes the top radius. */
	padding: 0 0 var(--wp--preset--spacing--50);
	overflow: hidden;
	transition: transform var(--tg-home-move) var(--tg-home-ease), box-shadow var(--tg-home-move) var(--tg-home-ease);
}

.tg-front .tg-product-tile:hover,
.tg-front .tg-product-tile:focus-within {
	transform: translateY(-4px);
	box-shadow: var(--wp--custom--shadow--card-hover, 0 12px 32px rgb(29 39 48 / 8%));
}

/* 产品图直接铺满图片区（owner review 2026-10-18）：客户的照片本身就带一层干净背景色
 * （`photo-ground`），之前图片缩到 62%×78% 居中，于是图片区里又出现一个小一点的矩形，
 * 读起来像“框中框”。现在图片区底色与照片背景同色，图片 100%×100% 用 contain 铺满，
 * 产品大小只由照片自己的留白决定。 */
.tg-front .tg-product-tile .tg-product-tile__media {
	aspect-ratio: 4 / 3;
	margin: 0;
	border-radius: var(--wp--custom--radius--m) var(--wp--custom--radius--m) 0 0;
	background: var(--wp--preset--color--photo-ground);
	display: grid;
	place-items: center;
}

.tg-front .tg-product-tile .tg-product-tile__img,
.tg-front .tg-product-tile .tg-product-tile__media .tg-photo-well {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: contain;
}

/* 卡片底部留白与顶部内边距同宽，链接不再贴着卡边（owner 2026-10-18：原来只有 15px）。 */
.tg-front .tg-product-tile :is(.tg-product-tile__cat, .tg-product-tile__name, .tg-product-tile__spec, .tg-product-tile__certs, .tg-product-tile__model, .tg-product-tile__cta) {
	padding-inline: var(--wp--preset--spacing--50);
}

/* 分类标签与标题紧挨着，多出来的高度留给卡片底部（owner 2026-10-18）。`<p>` 的默认下边距
 * 也在两者之间，所以分类行自己清零，只留标题的 8px 上边距。 */
.tg-front .tg-product-tile .tg-product-tile__cat {
	margin-block: var(--wp--preset--spacing--50) 0;
}

.tg-front .tg-product-tile .tg-product-tile__name {
	margin-top: var(--wp--preset--spacing--20);
}

.tg-front .tg-product-tile .tg-product-tile__cta {
	margin-top: auto;
}

.tg-front .tg-product-tile .tg-product-tile__model {
	font-family: ui-monospace, "Cascadia Code", monospace;
	font-size: 0.75rem;
}

/* 精选卡整齐化（owner 2026-10-15）：标题两行、规格一行、认证一行、型号一行。
 * 每张卡的元素数量与行数就固定了，认证胶囊从四行变成一行，六张卡等高。 */
.tg-front .tg-product-tile .tg-product-tile__name {
	display: -webkit-box;
	overflow: hidden;
	-webkit-box-orient: vertical;
	-webkit-line-clamp: 2;
	line-clamp: 2;
	min-height: calc(2 * 1.25em);
}

.tg-front .tg-product-tile :is(.tg-product-tile__spec, .tg-product-tile__model) {
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.tg-front .tg-product-tile .tg-product-tile__certs {
	overflow: hidden;
	max-height: 1.9em;
}

.tg-front .tg-home-products__title {
	font-size: var(--wp--preset--font-size--h-3);
}

/* ——— OEM + 流程 ——— */
.tg-front .tg-oem {
	background: var(--wp--preset--color--surface);
}

.tg-front .tg-oem-intro__media img {
	border-radius: 12px;
}

/* Owner review 2026-10-15: the 1px hairline above the OEM/ODM module (and the 64px it was given
 * to sit in) is gone at every width — the section already opens a new band on `surface`. */
.tg-front .tg-oem-intro {
	padding-top: 0;
	border-top: 0;
}

/* Phones: the two OEM/ODM actions are the same size and fill the column (owner review
 * 2026-10-15). Without this they are content-wide and read as two different weights. */
@media (max-width: 639px) {
	.tg-front .tg-oem-actions,
	.tg-front .tg-oem-actions .wp-block-buttons,
	.tg-front .tg-oem-actions .wp-block-button,
	.tg-front .tg-oem-actions .tg-section-link {
		width: 100%;
	}

	.tg-front .tg-oem-actions .wp-block-button__link,
	.tg-front .tg-oem-actions .tg-btn-icon {
		/* `box-sizing` matters here: `.tg-btn-icon` carries 24px of horizontal padding and a 1px
		 * border, and without border-box `width: 100%` pushed the button 26px past the viewport
		 * (measured at 375px → document scrollWidth 401). */
		box-sizing: border-box;
		width: 100%;
		justify-content: center;
	}
}

.tg-front .tg-oem-process {
	margin-top: 64px;
	padding-top: 0;
	border-top: 0;
}

.tg-front .tg-steps {
	column-gap: 32px;
}

.tg-front .tg-step {
	gap: 16px;
	row-gap: 16px;
}

.tg-front .wp-block-group.tg-step > * {
	margin-block: 0;
}

.tg-front .wp-block-group.tg-step > * + * {
	margin-block-start: 0;
}

.tg-front .tg-oem-process .tg-step h3 {
	margin: 0;
}

@media (min-width: 1024px) {
	.tg-front .tg-steps {
		grid-template-columns: repeat(4, 1fr);
		grid-template-rows: auto auto auto auto;
	}

	.tg-front .tg-step {
		display: grid;
		grid-row: span 4;
		grid-template-rows: subgrid;
	}
}

.tg-front .tg-step::before,
.tg-front .tg-step::after {
	content: none;
	display: none;
}

.tg-front .tg-step > .wp-block-html:has(.tg-step__head) {
	display: contents;
}

.tg-front .tg-step__head {
	display: flex;
	align-items: center;
	gap: 16px;
	min-width: 0;
}

.tg-front .tg-step__head::before {
	content: counter(tg-step, decimal-leading-zero);
	flex: none;
	color: var(--wp--preset--color--accent);
	font-size: var(--wp--preset--font-size--h-3);
	font-weight: 600;
	font-variant-numeric: tabular-nums;
	line-height: 1;
}

.tg-front .tg-step__line {
	flex: 1 1 auto;
	height: 1px;
	min-width: 0;
	background: var(--wp--preset--color--rule);
}

.tg-front .tg-step:last-child .tg-step__line {
	visibility: hidden;
}

@media (min-width: 1024px) {
	.tg-front .tg-step:not(:last-child) .tg-step__head {
		margin-right: -16px;
	}
}

.tg-front .tg-step__title {
	font-size: var(--wp--preset--font-size--h-4);
	min-height: 2lh;
}

@supports (grid-template-rows: subgrid) {
	.tg-front .tg-step__title {
		min-height: 0;
	}
}

.tg-main.tg-front .tg-step__text {
	margin: 0;
}

.tg-front .tg-step__time {
	order: 4;
	/* Below 1024px the step is a plain block group, so `justify-self` has no grid to act on and the
	 * pill stretched the full column (owner review 2026-10-15). `fit-content` keeps it a chip. */
	width: fit-content;
	justify-self: start;
	margin: 0;
	padding: 6px 10px;
	border-radius: 999px;
	background: var(--wp--preset--color--accent-tint);
	color: var(--wp--preset--color--accent);
	font-size: 0.8125rem;
	font-weight: 600;
}

.tg-front .tg-services {
	display: grid;
	grid-template-columns: 1fr;
	column-gap: 24px;
	width: 100%;
	max-width: none;
	margin-top: 56px;
	border-top: 0;
}

.tg-front .tg-services__item {
	display: flex;
	justify-content: space-between;
	align-items: flex-start;
	gap: 12px;
	padding-top: 20px;
	border-top: 1px solid var(--wp--preset--color--rule);
	color: var(--wp--preset--color--ink);
	font-weight: 600;
	line-height: 1.35;
	text-decoration: none;
	transition: border-color var(--tg-home-move) var(--tg-home-ease), color var(--tg-home-move) var(--tg-home-ease);
}

.tg-front .tg-services__label {
	min-width: 0;
}

.tg-front .tg-services__arrow {
	flex: none;
	margin-top: 0.2em;
	color: var(--wp--preset--color--accent);
	transition: transform var(--tg-home-move) var(--tg-home-ease);
}

.tg-front .tg-services__arrow svg {
	display: block;
	width: 16px;
	height: 16px;
}

.tg-front .tg-services__item:hover {
	border-top-color: var(--wp--preset--color--accent);
	color: var(--wp--preset--color--accent);
}

.tg-front .tg-services__item:hover .tg-services__arrow {
	transform: translateX(3px);
}

@media (min-width: 768px) {
	.tg-front .tg-services {
		grid-template-columns: repeat(3, minmax(0, 1fr));
		row-gap: 32px;
	}
}

@media (min-width: 1024px) {
	.tg-front .tg-services {
		grid-template-columns: repeat(5, minmax(0, 1fr));
		row-gap: 0;
	}
}

@media (max-width: 767px) {
	.tg-front .tg-services {
		grid-template-columns: 1fr;
		row-gap: 0;
	}

	.tg-front .tg-services__item {
		padding: 16px 0;
	}
}

/* ——— 制造：slate 深色岛 + 底部渐变图注 ——— */
.tg-front .tg-production {
	padding-block: var(--wp--preset--spacing--section);
	background: var(--wp--preset--color--slate);
	color: var(--wp--preset--color--paper);
}

/* The generic checklist marker (components.css) is a 12×2px accent rule with `flex: 0 0 12px`,
 * and a flex item's main size comes from its basis, not its `width` — so the 20px box below was
 * still drawn 12px wide, and baseline alignment pushed it off the first line (owner review
 * 2026-10-15). Pin the box and hang it beside the first line of text. */
.tg-front .tg-production .tg-checklist li {
	align-items: flex-start;
}

.tg-front .tg-production .tg-checklist li::before {
	content: "";
	flex: 0 0 20px;
	width: 20px;
	height: 20px;
	margin: 3px 12px 0 0;
	transform: none;
	background: var(--wp--preset--color--accent-on-dark);
	mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2'%3E%3Cpath d='M20 6 9 17l-5-5'/%3E%3C/svg%3E") center / contain no-repeat;
}

.tg-front .tg-factory-media {
	gap: 16px;
}

.tg-front .tg-factory-media .wp-block-image {
	position: relative;
	margin: 0;
	overflow: hidden;
	border-radius: var(--wp--custom--radius--m);
}

.tg-front .tg-factory-media figure {
	position: relative;
	margin: 0;
	min-height: 0;
	overflow: hidden;
	background: var(--wp--preset--color--photo-ground);
	border-radius: var(--wp--custom--radius--m);
}

.tg-front .tg-factory-media img {
	display: block;
	width: 100%;
	height: auto;
	aspect-ratio: 16 / 9;
	object-fit: cover;
	border-radius: var(--wp--custom--radius--m);
}

.tg-front .tg-factory-media figcaption {
	position: absolute;
	inset: auto 0 0 0;
	margin: 0;
	padding: 40px 20px 16px;
	background: linear-gradient(to top, rgb(29 39 48 / 90%) 0%, rgb(29 39 48 / 65%) 45%, transparent);
	color: var(--wp--preset--color--paper);
	font-size: var(--wp--preset--font-size--small);
	font-weight: 500;
	line-height: 1.3;
	text-align: left;
}

@media (min-width: 900px) {
	.tg-front .tg-factory-media {
		display: grid;
		grid-template-columns: 2fr 1fr;
		grid-template-rows: 1fr 1fr;
		gap: 16px;
		align-items: stretch;
	}

	/* The mosaic needs one definite height or its `1fr 1fr` rows resolve against nothing: the main
	   image carries `height: 100%` and the two small ones are absolutely positioned, so the grid
	   grew to 1500px at 1280 (a portrait well for a 3:2 photograph) and left a whole empty row
	   under the small figures. 12:7 is the ratio DESIGN/T-313 records for this frame, and it is the
	   one that makes the two columns end on the same line (2/3 × 7/12 ≈ 2 × 1/3 × 9/16). */
	.tg-front .tg-factory-media__main {
		grid-row: 1 / span 2;
		aspect-ratio: 12 / 7;
	}

	.tg-front .tg-factory-media__main img {
		width: 100%;
		height: 100%;
		aspect-ratio: auto;
		object-fit: cover;
	}

	.tg-front .tg-factory-media__row {
		/* Without the row span this column sat in row 1 only, leaving row 2 empty. */
		grid-row: 1 / span 2;
		display: flex;
		flex-direction: column;
		gap: 16px;
		height: 100%;
		min-height: 0;
	}

	.tg-front .tg-factory-media__row .wp-block-image {
		position: relative;
		flex: 1 1 0;
		min-height: 0;
	}

	.tg-front .tg-factory-media__row img {
		position: absolute;
		inset: 0;
		width: 100%;
		height: 100%;
		aspect-ratio: auto;
		object-fit: cover;
	}
}

.tg-front .tg-production + .tg-home-stories {
	padding-top: clamp(40px, 4vw, 56px);
}

/* ——— 案例：H2 左、按钮右；卡内单列、两卡等高 ——— */
.tg-front .tg-home-stories__head {
	display: flex;
	justify-content: space-between;
	align-items: flex-end;
	gap: 32px;
	margin-bottom: 56px;
}

.tg-front .tg-home-stories__head h2 {
	margin: 0;
}

.tg-front .tg-home-stories__head .tg-section-link {
	margin: 0;
}

.tg-front .tg-home-stories .tg-ruled,
.tg-front .tg-home-stories__list {
	border-top: 0;
}

.tg-front .tg-home-stories__query .tg-home-stories__list,
.tg-front .tg-home-stories__query ul.tg-home-stories__list {
	display: grid;
	grid-template-columns: minmax(0, 1fr);
	gap: 32px;
	margin: 0;
	padding: 0;
	list-style: none;
	border: 0;
}

.tg-front .tg-home-stories__list > li {
	max-width: none;
	margin: 0;
	height: 100%;
}

/* ——— 案例卡：客户原话打头，国家（含国旗）在左上角，故事标题作为整卡链接收尾 ——— */
.tg-front .tg-story-row {
	position: relative;
	display: flex;
	flex-direction: column;
	gap: 12px;
	height: 100%;
	padding: 40px;
	background: var(--wp--preset--color--surface);
	border-radius: 16px;
	box-shadow: var(--wp--custom--shadow--card);
	grid-template-columns: none;
	transition: transform var(--tg-home-move) var(--tg-home-ease), box-shadow var(--tg-home-move) var(--tg-home-ease);
}

.tg-front .tg-story-row:hover,
.tg-front .tg-story-row:focus-within {
	transform: translateY(-4px);
	box-shadow: var(--wp--custom--shadow--card-hover);
}

.tg-front .tg-story-row__meta {
	display: flex;
	align-items: center;
	gap: 10px;
	margin: 0;
	color: var(--wp--preset--color--ink);
}

.tg-front .tg-story-row__country {
	font-size: 0.9375rem;
	font-weight: 600;
	line-height: 1.2;
}

.tg-front .tg-flag {
	display: block;
	flex: none;
	width: 21px;
	height: 14px;
	border: 1px solid var(--wp--preset--color--rule);
	border-radius: 2px;
}

.tg-front .tg-story-row__quote {
	margin: 0;
	color: var(--wp--preset--color--ink);
	font-family: var(--wp--preset--font-family--serif, Georgia, serif);
	font-size: 1.125rem;
	line-height: 1.5;
}

.tg-front .tg-story-row__name {
	margin: 0;
	color: var(--wp--preset--color--ink);
	font-size: 0.9375rem;
	font-weight: 600;
	line-height: 1.3;
}

.tg-front .tg-story-row__type {
	margin: 0;
	color: var(--wp--preset--color--ink-muted);
	font-size: 0.8125rem;
	line-height: 1.3;
}

.tg-front .tg-story-row .wp-block-post-title {
	margin: auto 0 0;
	padding-top: 8px;
	font-size: 0.9375rem;
	line-height: 1.4;
	font-weight: 600;
}

/* The story title is a 21px link (measured 2026-10-18) and the category cards' "View adapters" an
 * 18px one: both are the only entry into their card, so both reach the touch minimum. The card keeps
 * its own size — only the link's own box grows, and the title is `::after`-stretched over the card
 * below, so the target is the whole card either way. */
.tg-front .tg-story-row .wp-block-post-title a {
	display: block;
	min-height: 44px;
	padding-block: 6px;
	color: var(--wp--preset--color--accent);
	text-decoration: none;
}

/* P2-2: the category card's "View adapters" label is not a target of its own — the whole card is
 * the link, and its `::after` covers the card — so the 44px block added by T-640's tap-target pass
 * added no tap area at all, only ~37px of dead space under the card's text (the CTA measured 56px
 * tall around a 19px line, with the label's bottom 57px off the card's edge). It hugs its line now
 * and the card's own 16px bottom padding is the air below it. */
.tg-front .tg-cat-index__cta {
	display: block;
}

.tg-front .tg-story-row .wp-block-post-title a:hover,
.tg-front .tg-story-row .wp-block-post-title a:focus-visible {
	text-decoration: underline;
	text-underline-offset: 3px;
}

.tg-front .tg-story-row .wp-block-post-title a::after {
	content: "";
	position: absolute;
	inset: 0;
}

@media (min-width: 768px) {
	.tg-front .tg-home-stories__query .tg-home-stories__list,
	.tg-front .tg-home-stories__query ul.tg-home-stories__list {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}
}

@media (min-width: 1024px) {
	.tg-front .tg-home-stories__query .tg-home-stories__list,
	.tg-front .tg-home-stories__query ul.tg-home-stories__list {
		grid-template-columns: repeat(3, minmax(0, 1fr));
	}
}

@media (max-width: 767px) {
	.tg-front .tg-home-stories__head {
		flex-direction: column;
		align-items: flex-start;
	}

	.tg-front .tg-story-row {
		padding: 28px;
	}
}

/* ——— 创始人：回到统一 container，引言限宽 ——— */
.tg-front .tg-about__grid {
	display: grid;
	gap: 40px;
	align-items: center;
}

.tg-front .tg-founder__portrait {
	margin: 0;
	max-width: none;
	width: 100%;
	background: var(--wp--preset--color--photo-ground);
}

.tg-front .tg-founder__portrait img {
	display: block;
	width: 100%;
	height: auto;
	max-height: 640px;
	aspect-ratio: 4 / 5;
	object-fit: cover;
	object-position: 50% 15%;
	border-radius: var(--wp--custom--radius--m);
}

.tg-front .tg-about__body {
	max-width: none;
}

.tg-front .tg-about__body .tg-founder__quote,
.tg-front .tg-about__body .tg-founder__quote p {
	max-width: 34em;
}

.tg-front .tg-founder__quote {
	margin: 16px 0 0;
	padding: 0 0 0 28px;
	border-left: 3px solid var(--wp--preset--color--accent);
	font-family: var(--wp--preset--font-family--serif, Georgia, serif);
	font-size: clamp(1.375rem, 1.1rem + 0.9vw, 1.75rem);
	line-height: 1.45;
}

.tg-front .tg-founder__quote p,
.tg-main .tg-front .tg-founder__quote p {
	margin: 0;
	max-width: 34em;
	color: var(--wp--preset--color--ink);
	font-family: inherit;
	font-size: inherit;
	line-height: inherit;
}

.tg-front .tg-founder__sign {
	margin: 24px 0 0 31px;
	max-width: none;
}

.tg-front .tg-founder__sign strong {
	display: block;
	font-weight: 600;
}

.tg-front .tg-founder__sign span {
	color: var(--wp--preset--color--ink-muted);
	font-size: 0.875rem;
}

.tg-front .tg-founder__intro,
.tg-main .tg-front .tg-founder__intro {
	margin: 32px 0 0;
	padding-top: 28px;
	border-top: 1px solid var(--wp--preset--color--rule);
	max-width: 62ch;
	color: var(--wp--preset--color--ink-muted);
}

.tg-front .tg-founder__cta {
	margin-top: 32px;
}

@media (min-width: 1024px) {
	.tg-front .tg-about__grid {
		grid-template-columns: minmax(0, 5fr) minmax(0, 6fr);
		column-gap: clamp(40px, 8vw, 96px);
		align-items: center;
	}
}

@media (max-width: 1023px) {
	.tg-front .tg-about__grid {
		grid-template-columns: 1fr;
	}

	/* Owner review 2026-10-15: the 4:5 portrait was 420×525 here and read as a full screen of
	 * face on a phone. Cap the height at 420px — and cap the width at 336px with it, because 4:5 at
	 * 420 tall *is* 336 wide; without the width cap the height cap squashed the box to 1:1 at every
	 * width above 336px (measured 420×420 at 768px). */
	.tg-front .tg-founder__portrait {
		max-width: 336px;
	}

	.tg-front .tg-founder__portrait img {
		max-height: 420px;
	}
}

.tg-front .tg-insight-row {
	position: relative;
	grid-template-columns: 1fr auto;
	align-items: start;
}

.tg-front .tg-insight-row .wp-block-post-title a::after {
	content: "";
	position: absolute;
	inset: 0;
}

.tg-front .tg-insight-row:hover .wp-block-post-title {
	color: var(--wp--preset--color--accent);
}

.tg-front .tg-insight-row .wp-block-post-excerpt {
	max-width: 64ch;
	display: -webkit-box;
	overflow: hidden;
	-webkit-box-orient: vertical;
	-webkit-line-clamp: 2;
}



/* ——— 箭头 hover / 进场（尊重减动） ——— */
.tg-front a .tg-icon {
	transition: transform var(--tg-home-move) var(--tg-home-ease);
}

.tg-front a:hover .tg-icon {
	transform: translateX(3px);
}

@media (prefers-reduced-motion: reduce) {
	.tg-cat-index__item:hover,
	.tg-front .tg-product-tile:hover,
	.tg-front .tg-product-tile:focus-within,
	.tg-front .tg-story-row:hover,
	.tg-front .tg-story-row:focus-within,
	.tg-cat-index__thumb img,
	.tg-front a .tg-icon {
		transform: none;
	}
}

/* ——— Carousel: Home-only pieces ———
 * The component itself (track, viewport, nav, pause, responsive steps) lives in carousel.css,
 * which the product page also loads for its Related products row. Only the Home card styling
 * stays here. */

/* 精选产品：模板可能同时挂着旧的 3 列栅格，这里是轮播时以轨道列宽为准。 */
.tg-front .tg-product-grid--home.tg-carousel__track,
ul.tg-product-grid--home.tg-carousel__track {
	display: flex;
	grid-template-columns: none;
	gap: var(--tg-carousel-gap);
}

/* Insights 的轨道是 `ul.tg-ruled`，而 components.css 里
 * `.tg-front .tg-home-insights .tg-ruled { display: grid }`(0,3,0) 会压过 `.tg-carousel__track`(0,1,1)，
 * 让每张卡占满整行（实测图高 649px）。这里用更高优先级的同名选择器把栅格让回 flex。 */
.tg-front .tg-home-insights .tg-ruled.tg-carousel__track {
	display: flex;
	flex-wrap: nowrap;
	grid-template-columns: none;
	gap: var(--tg-carousel-gap);
}

/* Insights 卡（图在上、题、摘要、Read more）：整卡链接靠标题 a::after 铺满，见上方既有规则。
 * owner 2026-10-15：分类胶囊与日期从首页卡片撤掉（首页不需要，卡片更整齐），
 * 标题固定两行、摘要固定三行，三张卡因此等高，Read more 落在同一基线上。 */
.tg-front .tg-carousel .tg-insight-row__meta,
.tg-front .tg-carousel .tg-insight-row__cat,
.tg-front .tg-carousel .tg-insight-row__date {
	display: none;
}
.tg-front .tg-carousel .tg-insight-row,
.tg-front .tg-carousel .tg-insight-row::before,
.tg-front .tg-carousel .tg-insight-row::after,
.tg-carousel__track > li {
	box-sizing: border-box;
}

.tg-front .tg-carousel .tg-insight-row {
	position: relative;
	display: flex;
	flex-direction: column;
	height: 100%;
	padding: 0 0 var(--wp--preset--spacing--50);
	gap: 0;
	align-items: stretch;
	grid-template-columns: none;
	overflow: hidden;
	background: var(--wp--preset--color--surface);
	border-bottom: 0;
	border-radius: 16px;
	box-shadow: var(--wp--custom--shadow--card);
}

.tg-front .tg-carousel .tg-insight-row__media,
.tg-front .tg-carousel .tg-insight-row__media img {
	width: 100%;
}

.tg-front .tg-carousel .tg-insight-row__media {
	flex: none;
	margin: 0;
	background: var(--wp--preset--color--photo-ground);
	border-radius: 16px 16px 0 0;
	overflow: hidden;
}

.tg-front .tg-carousel .tg-insight-row__media img {
	display: block;
	aspect-ratio: 16 / 9;
	height: auto;
	object-fit: cover;
	border-radius: inherit;
}

.tg-front .tg-carousel .tg-insight-row__date,
.tg-front .tg-carousel .tg-insight-row__cat,
.tg-front .tg-carousel .tg-insight-row .wp-block-post-title,
.tg-front .tg-carousel .tg-insight-row .wp-block-post-excerpt,
.tg-front .tg-carousel .tg-insight-row__more {
	padding-inline: var(--wp--preset--spacing--50);
}

.tg-front .tg-carousel .tg-insight-row__date,
.tg-front .tg-carousel .tg-insight-row__cat {
	margin: var(--wp--preset--spacing--40) 0 0;
}

.tg-front .tg-carousel .tg-insight-row .wp-block-post-title {
	margin: var(--wp--preset--spacing--50) 0 0;
	font-size: var(--wp--preset--font-size--h-4);
	font-weight: 600;
	line-height: 1.3;
	/* 固定两行：标题长短不一时卡片仍等高，Read more 落在同一基线。 */
	display: -webkit-box;
	overflow: hidden;
	-webkit-box-orient: vertical;
	-webkit-line-clamp: 2;
	line-clamp: 2;
	min-height: calc(2 * 1.3em);
}

.tg-front .tg-carousel .tg-insight-row .wp-block-post-excerpt {
	margin: var(--wp--preset--spacing--20) 0 0;
	max-width: none;
	color: var(--wp--preset--color--ink-muted);
}

.tg-front .tg-carousel .tg-insight-row .wp-block-post-excerpt p {
	margin: 0;
	display: -webkit-box;
	overflow: hidden;
	-webkit-box-orient: vertical;
	-webkit-line-clamp: 3;
	line-clamp: 3;
	/* 固定三行：摘要短的卡也占满三行高度。 */
	min-height: calc(3 * 1.55em);
	line-height: 1.55;
}

.tg-front .tg-carousel .tg-insight-row__more {
	position: relative;
	display: inline-block;
	margin: auto 0 0;
	padding-top: var(--wp--preset--spacing--40);
	color: var(--wp--preset--color--accent);
	font-size: 0.9375rem;
	font-weight: 600;
}
