/* =============================================================================
 * TRANG CHỦ B2B (inc/home-b2b.php) — chỉ nạp ở trang chủ.
 * Nhịp: số liệu → giải pháp theo dự án → công trình → năng lực → quy trình → hạng mục → đối tác → báo giá → bài viết.
 * Cỡ chữ: H2 28–40px (Playfair), H3 thẻ 18–20px, thân 15–16px, nhãn 12–13px.
 * ========================================================================== */

.ddg-hb {
	padding-block: var(--ddg-space-12, 48px);
	font-family: var(--ddg-font-sans);
	color: var(--ddg-ink-700);
}

@media (min-width: 1024px) {
	.ddg-hb {
		padding-block: 72px;
	}
}

.ddg-hb__head {
	display: flex;
	flex-wrap: wrap;
	align-items: flex-end;
	justify-content: space-between;
	gap: 12px 32px;
	margin-bottom: var(--ddg-space-8, 32px);
}

.ddg-hb__head-text {
	flex: 1 1 520px;
	min-width: 0;
}

.ddg-hb__eyebrow {
	display: inline-flex;
	align-items: center;
	gap: 10px;
	margin: 0 0 8px;
	color: var(--ddg-champagne-600);
	font-size: 12px;
	font-weight: 700;
	letter-spacing: 0.14em;
	line-height: 1.4;
	text-transform: uppercase;
}

.ddg-hb__eyebrow::before {
	content: "";
	width: 28px;
	height: 1px;
	background: currentColor;
}

.ddg-hb .ddg-hb__title {
	margin: 0 0 10px;
	color: var(--ddg-ink-900);
	font-family: var(--ddg-font-display);
	font-size: clamp(1.75rem, 1.2rem + 1.8vw, 2.5rem);
	font-weight: 700;
	line-height: 1.2;
	letter-spacing: -0.01em;
}

.ddg-hb__lead {
	margin: 0;
	color: var(--ddg-ink-700);
	font-size: 16px;
	line-height: 1.65;
}

.ddg-hb__more {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	min-height: 44px;
	color: var(--ddg-brand-600);
	font-size: 15px;
	font-weight: 600;
	text-decoration: none;
	white-space: nowrap;
}

body .ddg-hb__more:hover {
	color: var(--ddg-brand-900) !important;
	text-decoration: underline;
	text-underline-offset: 3px;
}

.ddg-hb ul,
.ddg-hb ol {
	margin: 0;
	padding: 0;
	list-style: none;
}

.ddg-hb li {
	margin: 0;
}

.ddg-hb a {
	text-decoration: none;
}

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

.ddg-hb__img-empty {
	display: block;
	width: 100%;
	height: 100%;
	background: linear-gradient(135deg, var(--ddg-surface-glass), var(--ddg-brand-100));
}

.ddg-hb-chip {
	display: inline-flex;
	align-items: center;
	padding: 3px 10px;
	border: 1px solid var(--ddg-line);
	border-radius: var(--ddg-radius-pill);
	background: var(--ddg-surface);
	color: var(--ddg-ink-700);
	font-size: 12px;
	font-weight: 600;
	line-height: 1.5;
	white-space: nowrap;
}

/* ---------- Số liệu ---------- */
.ddg-hb--stats {
	padding-block: 0;
	background: var(--ddg-brand-900);
	color: var(--ddg-on-dark, #d5d2e0);
}

.ddg-hb-stats {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
}

.ddg-hb-stats__item > a,
.ddg-hb-stats__item > .ddg-hb-stats__num {
	display: block;
}

.ddg-hb-stats__item {
	padding: 22px 16px;
	border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.ddg-hb-stats__item:nth-child(odd) {
	border-right: 1px solid rgba(255, 255, 255, 0.1);
}

.ddg-hb-stats__item a {
	display: block;
	color: inherit;
}

.ddg-hb-stats__num {
	display: block;
	color: #fff;
	font-family: var(--ddg-font-display);
	font-size: clamp(1.75rem, 1.3rem + 1.6vw, 2.5rem);
	font-weight: 700;
	line-height: 1.1;
	font-variant-numeric: lining-nums;
}

.ddg-hb-stats__label {
	display: block;
	margin-top: 6px;
	color: var(--ddg-champagne-300);
	font-size: 13px;
	font-weight: 600;
	letter-spacing: 0.04em;
	line-height: 1.4;
	text-transform: uppercase;
}

.ddg-hb-stats__item a:hover .ddg-hb-stats__label {
	color: #fff;
}

.ddg-hb-stats__note {
	display: flex;
	align-items: flex-start;
	gap: 8px;
	margin: 0;
	padding: 14px 0 18px;
	color: var(--ddg-on-dark, #d5d2e0);
	font-size: 14px;
	line-height: 1.5;
}

.ddg-hb-stats__note .ddg-icon {
	--ddg-icon-size: 18px;
	flex: 0 0 auto;
	color: var(--ddg-champagne-300);
}

@media (min-width: 850px) {
	.ddg-hb-stats {
		grid-template-columns: repeat(4, minmax(0, 1fr));
	}
	.ddg-hb-stats__item {
		padding: 30px 24px 26px;
		border-bottom: 0;
		border-right: 1px solid rgba(255, 255, 255, 0.1);
	}
	.ddg-hb-stats__item:first-child {
		padding-left: 0;
	}
	.ddg-hb-stats__item:last-child {
		border-right: 0;
	}
	.ddg-hb-stats__note {
		border-top: 1px solid rgba(255, 255, 255, 0.1);
	}
}

/* ---------- Giải pháp theo loại dự án ---------- */
.ddg-hb--segments {
	background: var(--ddg-surface);
}

.ddg-hb-seg {
	display: grid;
	grid-template-columns: minmax(0, 1fr);
	gap: 20px;
}

@media (min-width: 600px) {
	.ddg-hb-seg {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}
}

@media (min-width: 1024px) {
	.ddg-hb-seg {
		grid-template-columns: repeat(3, minmax(0, 1fr));
		gap: 24px;
	}
}

.ddg-hb-seg__card {
	display: flex;
	flex-direction: column;
	height: 100%;
	overflow: hidden;
	border: 1px solid var(--ddg-line);
	border-radius: var(--ddg-radius-lg);
	background: var(--ddg-surface);
	color: var(--ddg-ink-700);
	transition: box-shadow 240ms ease, transform 240ms ease, border-color 240ms ease;
}

.ddg-hb-seg__card:hover {
	border-color: transparent;
	box-shadow: var(--ddg-shadow-2);
	transform: translateY(-3px);
	color: var(--ddg-ink-700);
}

.ddg-hb-seg__media {
	display: block;
	aspect-ratio: 16 / 10;
	overflow: hidden;
	background: var(--ddg-surface-glass);
}

.ddg-hb-seg__media img {
	aspect-ratio: 16 / 10;
	transition: transform 500ms ease;
}

.ddg-hb-seg__card:hover .ddg-hb-seg__media img {
	transform: scale(1.05);
}

.ddg-hb-seg__body {
	display: flex;
	flex: 1 1 auto;
	flex-direction: column;
	gap: 10px;
	padding: 18px 20px 20px;
}

.ddg-hb .ddg-hb-seg__title {
	margin: 0;
	color: var(--ddg-ink-900) !important;
	font-family: var(--ddg-font-sans);
	font-size: 19px;
	font-weight: 700;
	line-height: 1.35;
}

.ddg-hb-seg__text {
	font-size: 15px;
	line-height: 1.6;
}

.ddg-hb-seg__chips {
	display: flex;
	flex-wrap: wrap;
	gap: 6px;
}

.ddg-hb-seg__foot {
	margin-top: auto;
	padding-top: 12px;
	border-top: 1px solid var(--ddg-line);
	color: var(--ddg-brand-600);
	font-size: 14px;
	font-weight: 600;
	line-height: 1.45;
}

.ddg-hb-seg__foot-label {
	color: var(--ddg-ink-500);
	font-weight: 500;
}

/* ---------- Công trình tiêu biểu ---------- */
.ddg-hb--projects {
	background: var(--ddg-surface-2);
}

.ddg-hb-proj {
	display: grid;
	grid-template-columns: minmax(0, 1fr);
	gap: 16px;
}

@media (min-width: 600px) {
	.ddg-hb-proj {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}
	.ddg-hb-proj__item--big {
		grid-column: 1 / -1;
	}
}

@media (min-width: 1024px) {
	.ddg-hb-proj {
		grid-template-columns: 1.25fr 1fr 1fr;
		grid-template-rows: repeat(2, minmax(0, 260px));
		gap: 20px;
	}
	.ddg-hb-proj__item--big {
		grid-column: 1;
		grid-row: 1 / span 2;
	}
}

.ddg-hb-proj__card {
	position: relative;
	display: block;
	height: 100%;
	min-height: 240px;
	overflow: hidden;
	border-radius: var(--ddg-radius-lg);
	background: var(--ddg-brand-900);
	color: #fff;
}

.ddg-hb-proj__media {
	position: absolute;
	inset: 0;
}

.ddg-hb-proj__media img {
	transition: transform 600ms ease;
}

.ddg-hb-proj__card:hover .ddg-hb-proj__media img {
	transform: scale(1.05);
}

.ddg-hb-proj__overlay {
	position: absolute;
	right: 0;
	bottom: 0;
	left: 0;
	display: flex;
	flex-direction: column;
	gap: 6px;
	padding: 48px 20px 18px;
	background: linear-gradient(180deg, rgba(21, 17, 31, 0) 0%, rgba(21, 17, 31, 0.86) 62%);
}

.ddg-hb-proj__tag {
	color: var(--ddg-champagne-300);
	font-size: 12px;
	font-weight: 700;
	letter-spacing: 0.08em;
	text-transform: uppercase;
}

.ddg-hb .ddg-hb-proj__title {
	display: -webkit-box;
	margin: 0;
	overflow: hidden;
	color: #fff !important;
	font-family: var(--ddg-font-sans);
	font-size: 17px;
	font-weight: 700;
	line-height: 1.35;
	-webkit-box-orient: vertical;
	-webkit-line-clamp: 2;
}

.ddg-hb-proj__item--big .ddg-hb-proj__card {
	min-height: 340px;
}

.ddg-hb .ddg-hb-proj__item--big .ddg-hb-proj__title {
	font-family: var(--ddg-font-display);
	font-size: clamp(1.25rem, 1rem + 1vw, 1.75rem);
	-webkit-line-clamp: 3;
}

/* ---------- Năng lực ---------- */
.ddg-hb--capability {
	background: var(--ddg-surface);
}

.ddg-hb-cap {
	display: grid;
	grid-template-columns: minmax(0, 1fr);
	gap: 32px;
	align-items: center;
}

@media (min-width: 1024px) {
	.ddg-hb-cap {
		grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr);
		gap: 56px;
	}
}

.ddg-hb-cap__list {
	display: grid;
	gap: 18px;
}

.ddg-hb-cap__item {
	display: grid;
	grid-template-columns: 48px minmax(0, 1fr);
	gap: 14px;
	align-items: start;
}

.ddg-hb-cap__icon {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 48px;
	height: 48px;
	border-radius: var(--ddg-radius-md);
	background: var(--ddg-brand-100);
	color: var(--ddg-brand-700);
}

.ddg-hb-cap__icon .ddg-icon {
	--ddg-icon-size: 24px;
}

.ddg-hb-cap__item-body {
	display: grid;
	gap: 4px;
	font-size: 15px;
	line-height: 1.6;
}

.ddg-hb-cap__item-body strong {
	color: var(--ddg-ink-900);
	font-size: 17px;
	line-height: 1.4;
}

.ddg-hb-cap__addr {
	display: grid;
	gap: 12px;
	margin: 28px 0 0;
	padding: 18px 20px;
	border-left: 3px solid var(--ddg-champagne-600);
	border-radius: 0 var(--ddg-radius-md) var(--ddg-radius-md) 0;
	background: var(--ddg-surface-2);
}

.ddg-hb-cap__addr dt {
	color: var(--ddg-ink-500);
	font-size: 12px;
	font-weight: 700;
	letter-spacing: 0.06em;
	text-transform: uppercase;
}

.ddg-hb-cap__addr dd {
	margin: 2px 0 0;
	letter-spacing: 0;
	text-transform: none;
	font-weight: 500;
	color: var(--ddg-ink-900);
	font-size: 15px;
	line-height: 1.5;
}

.ddg-hb-cap__gallery {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	grid-template-rows: repeat(3, 150px);
	grid-template-areas:
		"a b"
		"a d"
		"c d";
	gap: 12px;
}

/* Bento: ảnh 1 và 4 cao 2 hàng, so le → 4 ảnh phủ kín khung, không khoảng trống */
.ddg-hb-cap__gallery li {
	position: relative;
	min-height: 0;
	overflow: hidden;
	border-radius: var(--ddg-radius-md);
	background: var(--ddg-surface-glass);
}

.ddg-hb-cap__gallery li:nth-child(1) {
	grid-area: a;
}

.ddg-hb-cap__gallery li:nth-child(2) {
	grid-area: b;
}

.ddg-hb-cap__gallery li:nth-child(3) {
	grid-area: c;
}

.ddg-hb-cap__gallery li:nth-child(4) {
	grid-area: d;
}

/* Ảnh tuyệt đối trong ô: kích thước gốc của ảnh không kéo cao lưới — lưới cao theo cột chữ */
.ddg-hb-cap__gallery a,
.ddg-hb-cap__gallery img {
	position: absolute;
	inset: 0;
}

.ddg-hb-cap__gallery img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	transition: transform 500ms ease;
}

.ddg-hb-cap__gallery a:hover img {
	transform: scale(1.05);
}

@media (min-width: 600px) {
	.ddg-hb-cap__gallery {
		grid-template-rows: repeat(3, 200px);
		gap: 16px;
	}
}

@media (min-width: 1024px) {
	/* Cao bằng cột chữ bên trái: 3 hàng chia đều chiều cao cột */
	.ddg-hb-cap {
		align-items: stretch;
	}
	.ddg-hb-cap__gallery {
		grid-template-rows: repeat(3, minmax(0, 1fr));
		height: 100%;
		min-height: 560px;
	}
}

/* ---------- Quy trình ---------- */
.ddg-hb--process {
	background: linear-gradient(180deg, var(--ddg-surface-glass) 0%, var(--ddg-surface-2) 100%);
}

.ddg-hb-steps {
	display: grid;
	grid-template-columns: minmax(0, 1fr);
	gap: 16px;
	counter-reset: none;
}

@media (min-width: 600px) {
	.ddg-hb-steps {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}
}

@media (min-width: 1024px) {
	.ddg-hb-steps {
		grid-template-columns: repeat(3, minmax(0, 1fr));
		gap: 20px;
	}
}

.ddg-hb-steps__item {
	position: relative;
	padding: 22px 22px 22px;
	border: 1px solid var(--ddg-line);
	border-radius: var(--ddg-radius-lg);
	background: var(--ddg-surface);
}

.ddg-hb-steps__num {
	display: block;
	margin-bottom: 10px;
	color: var(--ddg-champagne-600);
	font-family: var(--ddg-font-display);
	font-size: 34px;
	font-weight: 700;
	line-height: 1;
	font-variant-numeric: lining-nums tabular-nums;
}

.ddg-hb .ddg-hb-steps__title {
	margin: 0 0 6px;
	color: var(--ddg-ink-900) !important;
	font-family: var(--ddg-font-sans);
	font-size: 18px;
	font-weight: 700;
	line-height: 1.35;
}

.ddg-hb-steps__text {
	margin: 0;
	font-size: 15px;
	line-height: 1.6;
}

/* ---------- Hạng mục ---------- */
.ddg-hb--cats {
	background: var(--ddg-surface);
}

.ddg-hb-cats {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: 12px;
}

@media (min-width: 850px) {
	.ddg-hb-cats {
		grid-template-columns: repeat(3, minmax(0, 1fr));
		gap: 20px;
	}
}

.ddg-hb-cats__card {
	position: relative;
	display: block;
	overflow: hidden;
	border-radius: var(--ddg-radius-lg);
	aspect-ratio: 4 / 3;
	background: var(--ddg-brand-900);
}

.ddg-hb-cats__media {
	position: absolute;
	inset: 0;
}

.ddg-hb-cats__media img {
	transition: transform 500ms ease;
}

.ddg-hb-cats__card:hover .ddg-hb-cats__media img {
	transform: scale(1.06);
}

.ddg-hb-cats__body {
	position: absolute;
	right: 0;
	bottom: 0;
	left: 0;
	display: flex;
	flex-wrap: wrap;
	align-items: flex-end;
	justify-content: space-between;
	gap: 4px 10px;
	padding: 40px 16px 14px;
	background: linear-gradient(180deg, rgba(21, 17, 31, 0) 0%, rgba(21, 17, 31, 0.85) 70%);
}

.ddg-hb-cats__name {
	color: #fff;
	font-size: 16px;
	font-weight: 700;
	line-height: 1.3;
}

.ddg-hb-cats__count {
	color: var(--ddg-champagne-300);
	font-size: 13px;
	font-weight: 600;
	white-space: nowrap;
}

@media (max-width: 599px) {
	.ddg-hb-cats__name {
		font-size: 14px;
	}
	.ddg-hb-cats__body {
		padding: 32px 10px 10px;
	}
}

/* ---------- Báo giá dự án (nền tối) ---------- */
.ddg-hb--quote {
	background:
		radial-gradient(80% 60% at 100% 0%, rgba(54, 102, 163, 0.35) 0%, rgba(54, 102, 163, 0) 60%),
		var(--ddg-brand-950, #15111f);
	color: var(--ddg-on-dark, #d5d2e0);
}

.ddg-hb-quote {
	display: grid;
	grid-template-columns: minmax(0, 1fr);
	gap: 32px;
	align-items: start;
}

@media (min-width: 1024px) {
	.ddg-hb-quote {
		grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
		gap: 56px;
	}
}

.ddg-hb--quote .ddg-hb__title {
	color: #fff !important;
}

.ddg-hb--quote .ddg-hb__lead {
	color: var(--ddg-on-dark, #d5d2e0);
}

.ddg-hb--quote .ddg-hb__eyebrow {
	color: var(--ddg-champagne-300);
}

.ddg-hb-quote__points {
	display: grid;
	gap: 10px;
	margin: 20px 0 24px !important;
}

.ddg-hb-quote__points li {
	display: flex;
	align-items: flex-start;
	gap: 10px;
	color: #fff;
	font-size: 16px;
	line-height: 1.5;
}

.ddg-hb-quote__points .ddg-icon {
	--ddg-icon-size: 20px;
	flex: 0 0 auto;
	margin-top: 2px;
	color: var(--ddg-champagne-300);
}

.ddg-hb-quote__contact {
	display: flex;
	flex-wrap: wrap;
	gap: 10px;
}

.ddg-hb-quote__contact .ddg-btn {
	margin: 0;
}

.ddg-hb-quote__email {
	display: flex;
	align-items: center;
	gap: 8px;
	margin: 18px 0 0;
	font-size: 15px;
}

.ddg-hb-quote__email .ddg-icon {
	--ddg-icon-size: 18px;
	color: var(--ddg-champagne-300);
}

body .ddg-hb-quote__email a {
	color: #fff !important;
	text-decoration: underline;
	text-underline-offset: 3px;
}

.ddg-hb-quote__form .ddg-quote {
	margin: 0;
	padding: 24px;
	border-radius: var(--ddg-radius-lg);
	background: var(--ddg-surface);
	color: var(--ddg-ink-700);
	box-shadow: 0 24px 60px rgba(0, 0, 0, 0.35);
}

.ddg-hb-quote__form .ddg-quote__title {
	color: var(--ddg-ink-900) !important;
}

@media (max-width: 599px) {
	.ddg-hb-quote__contact .ddg-btn {
		flex: 1 1 100%;
		justify-content: center;
	}
	.ddg-hb-quote__form .ddg-quote {
		padding: 18px;
	}
}

/* ---------- Bài viết mới ---------- */
.ddg-hb--news {
	background: var(--ddg-surface-2);
}

.ddg-hb-news {
	display: grid;
	grid-template-columns: minmax(0, 1fr);
	gap: 16px;
}

@media (min-width: 600px) {
	.ddg-hb-news {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}
}

@media (min-width: 1024px) {
	.ddg-hb-news {
		grid-template-columns: repeat(4, minmax(0, 1fr));
		gap: 20px;
	}
}

.ddg-hb-news__card {
	display: flex;
	flex-direction: column;
	height: 100%;
	overflow: hidden;
	border: 1px solid var(--ddg-line);
	border-radius: var(--ddg-radius-lg);
	background: var(--ddg-surface);
	transition: box-shadow 240ms ease;
}

.ddg-hb-news__card:hover {
	box-shadow: var(--ddg-shadow-2);
}

.ddg-hb-news__media {
	display: block;
	aspect-ratio: 16 / 10;
	overflow: hidden;
	background: var(--ddg-surface-glass);
}

.ddg-hb-news__media img {
	aspect-ratio: 16 / 10;
}

.ddg-hb-news__body {
	display: flex;
	flex: 1 1 auto;
	flex-direction: column;
	gap: 8px;
	padding: 14px 16px 16px;
}

.ddg-hb .ddg-hb-news__title {
	display: -webkit-box;
	margin: 0;
	overflow: hidden;
	color: var(--ddg-ink-900) !important;
	font-family: var(--ddg-font-sans);
	font-size: 16px;
	font-weight: 600;
	line-height: 1.4;
	-webkit-box-orient: vertical;
	-webkit-line-clamp: 3;
}

.ddg-hb-news__card:hover .ddg-hb-news__title {
	color: var(--ddg-brand-600) !important;
}

.ddg-hb-news__date {
	margin-top: auto;
	color: var(--ddg-ink-500);
	font-size: 13px;
}

/* ---------- Đoạn giới thiệu cũ (UX Builder) + tiêu đề đối tác: gọn theo nhịp mới ---------- */
.home .ddg-hb--quote + .section,
.home .ddg-hb--news {
	scroll-margin-top: 90px;
}

/* Mobile: giải pháp + bài viết thành hàng vuốt ngang có snap (trang đỡ dài, không JS). */
@media (max-width: 599px) {
	.ddg-hb-scroll {
		grid-template-columns: none;
		grid-auto-columns: 84%;
		grid-auto-flow: column;
		margin-inline: -15px;
		padding: 4px 15px 14px;
		overflow-x: auto;
		overscroll-behavior-x: contain;
		scroll-padding-inline: 15px;
		scroll-snap-type: x mandatory;
		scrollbar-width: thin;
	}
	.ddg-hb-scroll > li {
		scroll-snap-align: start;
	}
	.ddg-hb-seg__card:hover {
		transform: none;
	}
}

.ddg-hb-scroll:focus-visible {
	outline: 3px solid var(--ddg-focus, #3666a3);
	outline-offset: 4px;
}

@media (prefers-reduced-motion: reduce) {
	.ddg-hb-seg__card,
	.ddg-hb-seg__media img,
	.ddg-hb-proj__media img,
	.ddg-hb-cap__gallery img,
	.ddg-hb-cats__media img,
	.ddg-hb-news__card {
		transition: none;
	}
	.ddg-hb-seg__card:hover,
	.ddg-hb-seg__card:hover .ddg-hb-seg__media img,
	.ddg-hb-proj__card:hover .ddg-hb-proj__media img,
	.ddg-hb-cap__gallery a:hover img,
	.ddg-hb-cats__card:hover .ddg-hb-cats__media img {
		transform: none;
	}
}
