/*
 * WordPress compatibility layer for the locally preserved TBLOG source styles.
 * The source stylesheet remains the visual contract; this file only bridges
 * WordPress wrappers and accessible server-rendered interactions.
 */

.wp-site-blocks,
.wp-block-post-content {
	margin: 0;
	padding: 0;
}

.wp-block-post-content > [class*="tblog-"] {
	max-width: none;
}

/* Core's flow layout adds a block gap that does not exist between the source
 * sections. Keep source-authored bottom margins intact while clearing the
 * generated start gap. */
.wp-block-post-content.is-layout-flow > * + * {
	margin-block-start: 0;
}

/* Source sections are full bleed; each section owns its own .container. */
.tblog-content-shell {
	padding-block: 0;
}

.tblog-content-shell > :where(.wp-block-post-content, .wp-block-group),
.tblog-singular-content,
.tblog-archive-shell {
	width: 100%;
	max-width: none;
	margin-inline: 0;
	padding-block: 0;
}

.tblog-container.container,
.tblog-container.w-container {
	width: 100%;
}

.tblog-site-header .tblog-brand,
.tblog-site-footer .tblog-brand {
	max-width: 100%;
}

.tblog-site-header .tblog-brand__image,
.tblog-site-footer .tblog-brand__image {
	display: block;
	height: auto;
}

/* The source top bar has no additional inner container. */
.tblog-site-header .tblog-header-top__inner {
	display: contents;
}

.tblog-site-header .tblog-header-top {
	border-bottom: 0;
}

.tblog-site-header .tblog-language-switcher summary {
	min-height: 24px;
}

/* WordPress menus wrap source links in list items. Neutralize the source
 * stylesheet's generic li padding to preserve the 81px desktop nav height. */
.tblog-site-header .tblog-primary-menu > li {
	padding-block: 0;
}

/* Every source hero overlaps the 81px navigation row. WordPress's block flow
 * otherwise normalizes the negative source margin back to zero. */
.wp-block-post-content > .tblog-hero {
	margin-block-start: -81px;
}

/* The original source stylesheet points this hero at an asset that was not
 * preserved in the approved mirror. The Blockstudio hero renders the imported
 * post image instead, so retain the source overlay without requesting a 404. */
.blog-single-banner {
	background-image: linear-gradient(90deg, #032d5f 17%, rgb(3 45 95 / 30%) 50%, rgb(3 45 95 / 30%));
	background-position: 0 0;
	background-repeat: repeat;
	background-size: auto;
}

.tblog-site-header .tblog-brand__image {
	width: 213px;
	max-height: none;
}

.tblog-site-header .tblog-header-meta__item {
	max-width: none;
}

.tblog-site-header .tblog-header-main__inner {
	gap: 20px;
}

/* The source contact cards sit tightly together. Avoid the wider generic
 * header gap introduced by the WordPress shell. */
.tblog-site-header .tblog-header-meta {
	justify-content: flex-start;
	gap: 15px;
}

/* Use the system sans face for every heading so Vietnamese accents never mix
 * with a Latin-only webfont subset. */
html[lang^="vi"] .tblog-project-article .project-single-content-wrap .w-richtext :is(h1, h2, h3, h4, h5, h6) {
	font-family: sans-serif;
	font-weight: 600;
}

/* Keep every semantic title on one system font. Imported layouts and block
 * styles otherwise reintroduce webfont-specific heading rules later. */
html body :is(h1, h2, h3, h4, h5, h6) {
	font-family: sans-serif !important;
}

.tblog-site-header .tblog-primary-navigation {
	min-width: 0;
	flex: 1 1 auto;
}

.tblog-site-header .tblog-primary-menu {
	width: auto;
	align-items: stretch;
	flex-direction: row;
}

.tblog-site-header .tblog-primary-menu > li {
	display: flex;
	align-items: stretch;
}

.tblog-site-header .navigation-button-wrap {
	margin-left: auto;
}

.tblog-site-header .tblog-header-cta {
	min-width: 0;
	min-height: 80px;
	padding: 30px 50px;
}

.tblog-site-footer .tblog-footer-grid {
	grid-template-columns: 1.5fr 1fr 1fr;
	column-gap: 40px;
	row-gap: 30px;
	padding-block: 0;
}

.tblog-site-footer .tblog-footer-contact .tblog-contact-text {
	display: grid;
	gap: 0.3rem;
}

.tblog-site-footer .tblog-footer-contact .header-link-text {
	display: block;
}

.tblog-site-footer .tblog-footer-title {
	margin: 10px 0;
}

.tblog-site-footer .tblog-footer-menu,
.tblog-site-footer .tblog-footer-social {
	margin: 0;
	padding: 0;
	list-style: none;
}

.tblog-site-footer .tblog-footer-menu {
	display: flex;
	flex-direction: column;
	gap: 0;
}

.tblog-site-footer .tblog-footer-menu li,
.tblog-site-footer .tblog-footer-social li {
	margin: 0;
	padding: 0;
}

.tblog-site-footer .tblog-footer-menu a {
	display: block;
	min-height: 0;
	padding-block: 10px;
	color: #fff;
	font-family: var(--open-sans);
	font-size: 16px;
	font-weight: 600;
	line-height: 1.3;
}

.tblog-site-footer .footer-logo-wrap .tblog-brand__image {
	width: 213px;
}

.tblog-site-footer .footer-logo-wrap .tblog-brand {
	display: block;
	margin-bottom: 0;
	line-height: 0;
}

.tblog-site-footer .tblog-footer-bottom__inner {
	width: auto;
	min-height: 0;
}

.tblog-site-footer .tblog-footer-tools {
	display: flex;
	align-items: center;
	gap: 0;
}

.tblog-site-footer .tblog-footer-social {
	display: flex;
	align-items: center;
	flex-flow: row nowrap;
	gap: 0;
}

.tblog-site-footer .tblog-footer-brochure {
	margin-top: 0;
}

.tblog-site-footer .copyright-text {
	font-size: 16px;
	line-height: 24px;
}

.tblog-site-footer .tblog-footer-newsletter {
	padding-top: 0;
	border-top: 0;
}

.tblog-site-footer .tblog-footer-newsletter .ff-el-group,
.tblog-site-footer .tblog-footer-newsletter .tblog-form__field {
	margin: 0;
}

.tblog-site-footer .tblog-footer-newsletter form,
.tblog-site-footer .tblog-footer-newsletter .tblog-form__row {
	display: block;
}

.tblog-site-footer .tblog-footer-newsletter .ff-t-container {
	display: block !important;
}

.tblog-site-footer .tblog-footer-newsletter .ff-t-cell {
	width: 100% !important;
	max-width: none !important;
	flex-basis: auto !important;
}

.tblog-site-footer .tblog-footer-newsletter input[type="email"] {
	min-width: 0;
	height: 60px;
	margin-bottom: 20px;
	border: 1px solid #4e5683;
	background: transparent;
	color: #fff;
	font-size: 18px;
}

/* Team profiles are optional. When a member has any valid social profile,
 * keep its source-style ribbon anchored to that member's portrait. */
.tblog-gallery--home-team .team-card__media {
	position: relative;
}

.tblog-gallery--home-team .team-card__media-action {
	display: block;
}

.tblog-gallery--home-team .team-card__social {
	position: absolute;
	right: 0;
	bottom: 0;
	z-index: 1;
	display: flex;
	align-items: center;
	gap: 5px;
	height: 60px;
	padding: 10px 15px;
	background: linear-gradient(180deg, #f0a9ac 0%, #e15359 50%, #d71921 100%);
	transform: translateY(26px);
}

.tblog-gallery--home-team .team-card__social-link {
	display: grid;
	box-sizing: border-box;
	flex: 0 0 40px;
	width: 40px;
	height: 40px;
	place-items: center;
	padding: 10px;
}

.tblog-gallery--home-team .team-card__social-link img {
	display: block;
	width: 18px;
	height: 18px;
	object-fit: contain;
}

.tblog-gallery--home-team .team-card__social-link:focus-visible {
	outline: 2px solid #fff;
	outline-offset: 4px;
}

.tblog-site-footer .tblog-footer-newsletter button[type="submit"],
.tblog-site-footer .tblog-footer-newsletter input[type="submit"] {
	width: auto !important;
	min-width: 0 !important;
	min-height: 60px;
	margin: 0;
	border: 0;
	border-radius: 0;
	/* Fluent Forms ships a theme-level !important button colour. This scoped
	 * override restores the source contract without affecting other forms. */
	background: var(--primary-color) !important;
	color: var(--background-color) !important;
	font-family: var(--open-sans);
	font-size: 16px;
	font-weight: 600;
	line-height: 20.8px;
	opacity: 1 !important;
	padding: 21px 35px 18px;
	white-space: nowrap;
}

.tblog-site-footer .tblog-footer-newsletter button[type="submit"]:hover,
.tblog-site-footer .tblog-footer-newsletter input[type="submit"]:hover {
	background: #fff !important;
	color: var(--secondary-color) !important;
}

@media screen and (min-width: 1280px) {
	.tblog-site-footer .tblog-footer-grid {
		grid-template-columns: 1.5fr 0.7fr 0.7fr 1.25fr;
		column-gap: 50px;
	}
}

@media screen and (max-width: 991px) {
	.wp-block-post-content > .tblog-hero {
		margin-block-start: -75px;
	}

	/* Webflow keeps the header row wrapped at the medium breakpoint. The
	 * generic theme rule changes it to a column, which makes the three contact
	 * cards unnecessarily tall at tablet widths. */
	.tblog-site-header .tblog-header-main__inner {
		align-items: center;
		flex-direction: row;
		flex-wrap: wrap;
		justify-content: space-around;
	}

	.tblog-site-header .tblog-header-main {
		padding-block: 1rem;
	}

	/* The source puts the brand on its own wrapped row and centers it. */
	.tblog-site-header .tblog-brand {
		display: flex;
		flex: 0 0 100%;
		justify-content: center;
	}

	.tblog-site-header .tblog-header-meta {
		display: none;
	}

	.tblog-site-header .tblog-header-top__inner {
		display: contents;
	}

	.tblog-site-header .tblog-primary-menu {
		width: 100%;
		flex-direction: column;
	}

	.tblog-site-header .tblog-primary-menu > li {
		display: block;
	}

	.tblog-site-header .tblog-header-cta {
		min-height: 48px;
		padding: 14px 20px;
	}

	.tblog-site-header .tblog-navigation-shell__inner {
		justify-content: center;
	}

	.tblog-site-header .navigation-button-wrap {
		order: 1;
		margin-left: 0;
	}

	.tblog-site-header .tblog-menu-toggle {
		order: 2;
		flex: 0 0 auto;
		width: auto;
		min-width: 104px;
		min-height: 48px;
		justify-content: center;
		gap: 0.6rem;
		padding: 0 18px;
		background: #063c80;
	}

	.tblog-site-header .tblog-menu-toggle__label {
		position: static;
		width: auto;
		height: auto;
		padding: 0;
		margin: 0;
		overflow: visible;
		clip: auto;
		white-space: nowrap;
		border: 0;
	}

	.tblog-site-footer .tblog-footer-grid {
		grid-template-columns: 1.2fr 0.7fr 0.75fr;
		column-gap: 50px;
		row-gap: 30px;
	}

	.tblog-site-footer .tblog-footer-action {
		grid-column: span 2;
	}
}

@media screen and (max-width: 767px) {
	/* A phone should reach the navigation first. The desktop contact cards stay
	 * available in the footer instead of pushing the menu below the fold. */
	.tblog-site-header .tblog-header-main {
		padding-block: 0.75rem;
	}

	.tblog-site-header .tblog-header-main__inner {
		justify-content: center;
	}

	.tblog-site-header .tblog-brand {
		flex: 0 1 auto;
	}

	.tblog-site-header .tblog-brand__image {
		width: min(170px, 55vw);
	}

	.tblog-site-header .tblog-header-meta {
		display: none;
	}

	.tblog-site-header .navigation-button-wrap {
		order: 1;
		margin-left: 0;
	}

	.tblog-site-header .tblog-menu-toggle {
		order: 2;
		flex: 0 0 auto;
		width: auto;
		min-width: 96px;
		min-height: 48px;
		justify-content: center;
		gap: 0.55rem;
		padding: 0 14px;
		background: #063c80;
		color: #fff;
	}

	/* The source's long dropdown labels wrap only below 480px. Extend that
	 * behavior through the full mobile-navigation range so translations cannot
	 * widen an open menu at the adjacent 480px viewport. */
	.tblog-site-header .tblog-primary-menu .nav-dropdown-link {
		white-space: normal;
		overflow-wrap: anywhere;
	}

	/* At 480px the source still uses two feature-point columns whose 230px
	 * minimums exceed the padded container. Let both grid levels shrink while
	 * retaining the source's two-column composition until its 479px breakpoint. */
	.tblog-content-section--home-features .features-grid {
		grid-template-columns: minmax(0, 1fr);
	}

	.tblog-content-section--home-features .features-grid > *,
	.tblog-content-section--home-features .features-icon-list,
	.tblog-content-section--home-features .features-points-wrap {
		min-width: 0;
		max-width: 100%;
	}

	.tblog-feature-cards--home-about .service-image-wrap {
		background-color: #091242;
		background-position: center;
		background-repeat: no-repeat;
		background-size: contain;
	}

	.tblog-site-footer .tblog-footer-grid {
		grid-template-columns: 1fr;
		row-gap: 50px;
	}

	.tblog-site-footer .tblog-footer-action {
		grid-column: auto;
	}
}

@media screen and (max-width: 479px) {
	.tblog-gallery--home-team .team-card__social {
		gap: 0;
		height: 50px;
		padding: 5px;
		transform: translateY(15px);
	}

	.tblog-site-header .tblog-menu-toggle__icon {
		width: 20px;
		gap: 4px;
	}

	.tblog-site-header .tblog-header-cta {
		min-width: 84px;
		padding-inline: 8px;
		font-size: 10px;
	}

	.tblog-site-footer .tblog-footer-grid {
		column-gap: 40px;
		row-gap: 40px;
	}

	.tblog-site-footer .tblog-footer-newsletter button[type="submit"],
	.tblog-site-footer .tblog-footer-newsletter input[type="submit"] {
		min-height: 55px;
		padding: 20px 30px 17px;
	}
}

@media (prefers-reduced-motion: reduce) {
	*,
	*::before,
	*::after {
		scroll-behavior: auto !important;
		animation-duration: 0.01ms !important;
		animation-iteration-count: 1 !important;
		transition-duration: 0.01ms !important;
	}
}
