/* Vietnamese typography for /vi/.
 * Fill the available line before wrapping; avoid balancing every short label.
 * Only presentation breaks are softened. Addresses and legal copy keep theirs.
 * No colour rules: these dimensions apply equally in light and dark mode.
 */
html[data-lang="vi"] body :is(h1, h2, h3, h4, h5, h6, legend, summary, dt, th, label, button, .btn, [class*="__title"], [class*="__heading"], [class*="__label"], [class*="__name"], [class*="eyebrow"]),
html[data-lang="vi"] .ar-page--column .ar-head .ar-title {
	text-wrap-style: pretty;
}

/* These templates leave a space/newline beside each presentation-only br. */
html[data-lang="vi"] :is(.hero__title, .ms-card__title, .ms-card__lede, .mc-hub__title, .resource__title) br,
html[data-lang="vi"] .mg-br {
	display: none;
}

html[data-lang="vi"] :is(.lp-hero__lead, .lp-hero__accent, .mg-hero__accent) {
	display: inline;
}

/* The source separates the licensing sentence for English composition. Let
 * Vietnamese use the full column so it settles into two natural lines. */
html[data-lang="vi"] .ct-partner__lede > span {
	display: inline;
}

/* The More Services hero has editorial breaks in the Vietnamese catalog.
 * Keep both breaks at every width instead of hiding the lede break on tablets. */
html[data-lang="vi"] .ms-hero__lede br {
	display: inline;
}

@media (max-width: 599px) {
	html[data-lang="vi"] .ms-hero__title {
		font-size: clamp(26px, 7.2vw, 30px);
		white-space: nowrap;
	}
}

/* Use the panel width, rather than an English-era fixed text measure. */
html[data-lang="vi"] .hero__title {
	max-width: none;
	line-height: 1.18;
}

html[data-lang="vi"] .hero__sentence {
	display: block;
}

html[data-lang="vi"] .calc-page__tab {
	white-space: nowrap;
}

/* On the Option 2 home page, keep the full calculator link next to the three
 * tool tabs. The destination section owns its scroll offset below the header. */
html[data-lang="vi"] .calc-page__suite--with-view-all {
	display: grid;
	grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
}

html[data-lang="vi"] .calc-page__suite--with-view-all > .calc-page__tabs {
	grid-column: 2;
}

html[data-lang="vi"] .calc-page__view-all {
	grid-column: 3;
	align-self: center;
	justify-self: start;
	display: inline-flex;
	align-items: center;
	gap: 8px;
	margin: 0 0 1px 18px;
	font-size: 14px;
	font-weight: 600;
	line-height: 1.35;
	color: var(--gold);
	text-decoration: underline;
	text-decoration-thickness: 1px;
	text-underline-offset: 4px;
	white-space: nowrap;
}

html[data-lang="vi"] .calc-page__view-all:hover {
	color: var(--navy);
}

html[data-lang="vi"] .calc-page__suite--with-view-all > .calc-page__stage {
	grid-column: 1 / -1;
}

/* These two long labels share compact cards with an icon and arrow. Their
 * responsive size preserves one complete action on a single line. */
html[data-lang="vi"] :is(.mc-card--buydown, .mc-card--afford) .mc-card__title {
	font-size: clamp(15px, 4vw, var(--mc-card-title));
	letter-spacing: -0.015em;
	white-space: nowrap;
}

@media (min-width: 900px) and (max-width: 1439px) {
	html[data-lang="vi"] :is(.mc-card--buydown, .mc-card--afford) .mc-card__title {
		font-size: 16px;
	}
}

@media (min-width: 1440px) and (max-width: 1535px) {
	html[data-lang="vi"] :is(.mc-card--buydown, .mc-card--afford) .mc-card__title {
		font-size: 18px;
	}
}

@media (min-width: 1536px) {
	html[data-lang="vi"] :is(.mc-card--buydown, .mc-card--afford) .mc-card__title {
		font-size: 19px;
	}
}

/* Keep the complete first loan-programs statement together once the layout
 * has enough horizontal room. The size follows the hero panel at each step. */
@media (min-width: 600px) and (max-width: 767px) {
	html[data-lang="vi"] .lp-hero__title {
		font-size: 33px;
	}
}

@media (min-width: 768px) and (max-width: 1079px) {
	html[data-lang="vi"] .lp-hero__title {
		font-size: 37px;
	}
}

@media (min-width: 1080px) and (max-width: 1279px) {
	html[data-lang="vi"] .lp-hero__title {
		font-size: 39px;
	}
}

@media (min-width: 1280px) and (max-width: 1535px) {
	html[data-lang="vi"] .lp-hero__title {
		font-size: 44px;
	}
}

@media (min-width: 1536px) {
	html[data-lang="vi"] .lp-hero__title {
		font-size: 49px;
	}
}

@media (min-width: 600px) {
	html[data-lang="vi"] .lp-hero__lead {
		display: inline-block;
		white-space: nowrap;
	}
}

@media (max-width: 899px) {
	html[data-lang="vi"] .calc-page__suite--with-view-all {
		grid-template-columns: minmax(0, 1fr);
	}

	html[data-lang="vi"] .calc-page__suite--with-view-all > .calc-page__tabs,
	html[data-lang="vi"] .calc-page__view-all {
		grid-column: 1;
	}

	html[data-lang="vi"] .calc-page__view-all {
		justify-self: center;
		margin: 14px 0 16px;
	}
}

/* The longer Vietnamese lender heading still reads as one statement on a
 * desktop, while the paragraph below uses two balanced, full lines. */
@media (min-width: 1024px) {
	html[data-lang="vi"] .lenders__title {
		font-size: clamp(34px, 3.35vw, 44px);
		white-space: nowrap;
	}

	html[data-lang="vi"] .lenders__lede {
		max-width: min(720px, 100%);
	}
}

/* U.S. visitors recognize AM/PM and PT; keep that availability line intact
 * wherever the contact card is wide enough to hold it. */
@media (min-width: 600px) {
	html[data-lang="vi"] .ct-card__address > span:nth-child(3) {
		font-size: 17px;
	}
}

/* Let a complete action move down instead of squeezing its label to 3 lines. */
@media (max-width: 599px) {
	html[data-lang="vi"] .calc-page__suite:not(.calc-page__suite--all) > .calc-page__tabs {
		flex-wrap: wrap;
	}

	html[data-lang="vi"] .calc-page__suite:not(.calc-page__suite--all) .calc-page__tab {
		flex: 1 0 auto;
	}

	html[data-lang="vi"] .mg-card__foot {
		flex-wrap: wrap;
	}

	html[data-lang="vi"] .calc-tools {
		display: flex;
		flex-wrap: wrap;
	}

	html[data-lang="vi"] .calc-tools__btn {
		flex: 1 1 auto;
		width: auto;
		min-width: min(100%, 120px);
		height: auto;
		min-height: 44px;
		font-size: 12px;
	}

	html[data-lang="vi"] .calc-tools__btn span {
		max-width: none;
		white-space: nowrap;
	}
}

@media (max-width: 479px) {
	html[data-lang="vi"] :is(.mg-card--side, .mg-card--row) {
		grid-template-columns: 90px minmax(0, 1fr);
	}
}

/* On tablets the single-column hero has enough room for a readable measure. */
@media (min-width: 600px) and (max-width: 1079px) {
	html[data-lang="vi"] .hero__title {
		max-width: 760px;
		font-size: clamp(34px, 6vw, 47px);
	}
}

/* The desktop column barely grows on wide monitors; type should not jump
 * from 44 to 54px while the available text measure stays almost the same. */
@media (min-width: 1080px) {
	html[data-lang="vi"] .hero__title {
		font-size: clamp(32px, 3.1vw, 44px);
	}
}

/* Give the diagram's Vietnamese label room for two complete word groups. */
@media (min-width: 768px) and (max-width: 1279px) {
	html[data-lang="vi"] .ar-sig-board {
		grid-template-columns: 200px minmax(0, 1fr);
	}
}
