/* Header + footer (Figma: hero 167:662, footer 382:3406). Elements live in Bricks templates, styling lives here. */

/* ---------- Header (dafont.vn behaviour): full-width bar at the top, glass pill once the page is scrolled ----------
   All sizes are tokens in tokens.css (--cd-hd-*, --cd-glass-*). state class: body.is-scrolled (assets/js/header.js).
   #brx-header is the sticky box with a constant height, so swapping bar <-> pill never shifts the page. */
#brx-header { position: sticky; top: 0; z-index: 100; height: var(--cd-hd-space); pointer-events: none; }
body.admin-bar #brx-header { top: var(--wp-admin--admin-bar--height, 32px); }
.brxe-section.cd-header { position: relative; padding: 0; min-height: 0; background: none; border: 0; }
.cd-header > .brxe-container {
	--cd-hd-logo-now: var(--cd-hd-logo); --cd-hd-gap-now: var(--cd-hd-gap); --cd-hd-fs-now: var(--cd-hd-fs); --cd-hd-btn-now: var(--cd-hd-btn-h);
	position: relative; isolation: isolate; pointer-events: auto; box-sizing: border-box;
	width: 100%; max-width: 100%; height: var(--cd-hd-h); margin: 0 auto; padding: 0 var(--cd-hd-pad-x);
	display: flex; flex-direction: row; align-items: center; gap: var(--cd-hd-gap-now);
	border-radius: 0;
	transition: max-width var(--cd-dur) var(--cd-ease), margin var(--cd-dur) var(--cd-ease), height var(--cd-dur) var(--cd-ease), padding var(--cd-dur) var(--cd-ease), gap var(--cd-dur) var(--cd-ease), border-radius var(--cd-dur) var(--cd-ease);
}
/* visual layer (kept on a pseudo-element so backdrop-filter does not trap Bricks' fixed mobile menu) */
.cd-header > .brxe-container::before {
	content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none; border-radius: inherit;
	background: var(--cd-white); border-bottom: var(--cd-bw) solid var(--cd-blue-100);
	transition: background-color var(--cd-dur) var(--cd-ease), box-shadow var(--cd-dur) var(--cd-ease), border-color var(--cd-dur) var(--cd-ease);
}
body.is-scrolled .cd-header > .brxe-container {
	--cd-hd-logo-now: var(--cd-hd-pill-logo); --cd-hd-gap-now: var(--cd-hd-pill-gap); --cd-hd-fs-now: var(--cd-hd-pill-fs); --cd-hd-btn-now: var(--cd-hd-pill-btn-h);
	max-width: min(var(--cd-hd-pill-w), calc(100% - 2 * var(--cd-gutter))); height: var(--cd-hd-pill-h); margin-top: var(--cd-hd-pill-top);
	padding-inline: var(--cd-hd-pill-pad-x); border-radius: var(--cd-hd-pill-radius);
}
body.is-scrolled .cd-header > .brxe-container::before {
	background: var(--cd-glass-bg); border: var(--cd-bw) solid var(--cd-glass-edge);
	box-shadow: inset 0 var(--cd-bw) 0 var(--cd-glass-shine), 0 var(--cd-sp-3) var(--cd-sp-9) var(--cd-glass-shadow);
	-webkit-backdrop-filter: blur(var(--cd-glass-blur)) saturate(var(--cd-glass-saturate)); backdrop-filter: blur(var(--cd-glass-blur)) saturate(var(--cd-glass-saturate));
}
.cd-header__logo { flex: none; line-height: 0; }
.cd-header__logo img { height: var(--cd-hd-logo-now); width: auto; display: block; transition: height var(--cd-dur) var(--cd-ease); }
.cd-header .brxe-nav-menu { flex: 1 1 auto; min-width: 0; display: flex; justify-content: flex-start; }
.cd-header .bricks-nav-menu { gap: var(--cd-hd-gap-now); margin: 0; flex-wrap: nowrap; }
.cd-header .bricks-nav-menu > li { margin: 0; padding: 0; }
.cd-header .bricks-nav-menu > li > a { padding: 0; font-size: var(--cd-hd-fs-now); font-weight: var(--cd-fw-medium); line-height: var(--cd-lh-body); color: var(--cd-blue-900); white-space: nowrap; transition: color var(--cd-dur-fast) var(--cd-ease), font-size var(--cd-dur) var(--cd-ease); }
.cd-header .bricks-nav-menu > li > a:hover,
.cd-header .bricks-nav-menu > li.current-menu-item > a { color: var(--cd-blue-600); }
.cd-header .bricks-nav-menu a, .cd-header .bricks-mobile-menu a, .cd-header .cd-header__cta { text-transform: uppercase; }
.cd-btn--gradient { display: inline-flex; align-items: center; justify-content: center; background: linear-gradient(90deg, var(--cd-blue-600), var(--cd-blue-900)); color: var(--cd-white); border: 0; border-radius: var(--cd-radius-btn); min-height: var(--cd-btn-h); padding: 0 var(--cd-sp-5); font-weight: var(--cd-fw-medium); font-size: var(--cd-fs-body); text-align: center; text-decoration: none; }
.cd-btn--gradient:hover { filter: brightness(1.1); color: var(--cd-white); }
.cd-header .cd-btn--gradient { flex: none; letter-spacing: 0; margin-left: auto; min-height: var(--cd-hd-btn-now); border-radius: var(--cd-hd-btn-radius); transition: min-height var(--cd-dur) var(--cd-ease), filter var(--cd-dur-fast) var(--cd-ease); }
@media (max-width: 991px) { .cd-header .cd-btn--gradient { min-height: var(--cd-btn-h-sm); padding: 0 var(--cd-sp-3-5); font-size: var(--cd-fs-sm); } }
@media (max-width: 478px) { .cd-header .cd-btn--gradient { display: none; } }

/* ---------- Footer: layout kept (name on top, 4 columns), sizes and spacing follow the pacdora direction ---------- */
.brxe-section.cd-footer { position: relative; overflow: hidden; isolation: isolate; background: linear-gradient(180deg, var(--cd-blue-50), color-mix(in srgb, var(--cd-blue-100) 55%, var(--cd-blue-50))); border-top: var(--cd-bw) solid var(--cd-blue-100); padding: var(--cd-footer-pt) 0 var(--cd-footer-pb); }
/* logo watermark: feathered on every side (radial mask), slightly blurred, so it melts into the background instead of being cut off */
.cd-footer::before { /* the logo SVG is a mask; a brand-colour gradient slides behind it, so colour "flows" through the logo shape only */
	content: ""; position: absolute; z-index: -1; right: var(--cd-gutter); top: 50%; width: min(46%, 640px); aspect-ratio: 2048 / 1524; transform: translateY(-50%);
	background: linear-gradient(105deg, var(--cd-blue-900) 0%, var(--cd-blue-600) 28%, var(--cd-blue-100) 50%, var(--cd-blue-600) 72%, var(--cd-blue-900) 100%) 0 0 / 260% 100% no-repeat;
	opacity: .38; pointer-events: none;
	-webkit-mask: url(../img/logo-mark.svg) center / contain no-repeat, radial-gradient(ellipse closest-side at 50% 50%, var(--cd-blue-900) 55%, transparent 100%);
	-webkit-mask-composite: source-in;
	mask: url(../img/logo-mark.svg) center / contain no-repeat, radial-gradient(ellipse closest-side at 50% 50%, var(--cd-blue-900) 55%, transparent 100%);
	mask-composite: intersect;
}
@media (prefers-reduced-motion: no-preference) { .cd-footer::before { animation: cd-logo-flow var(--cd-dur-flow) var(--cd-ease-flow) infinite alternate; } }
@keyframes cd-logo-flow { from { background-position: 0 0; } to { background-position: 100% 0; } }
/* soft light behind the text side so the logo never competes with the columns */
.cd-footer::after { content: ""; position: absolute; z-index: -1; inset: 0; pointer-events: none;
	background: linear-gradient(90deg, var(--cd-blue-50) 0%, color-mix(in srgb, var(--cd-blue-50) 70%, transparent) 45%, transparent 80%); }
.cd-footer > .brxe-container { position: relative; width: min(100% - 2 * var(--cd-gutter), var(--cd-container)); max-width: none; margin-inline: auto; padding: 0;
	display: grid; grid-template-columns: minmax(0, 1.6fr) repeat(3, minmax(0, 1fr)); gap: var(--cd-sp-12) var(--cd-sp-16); align-items: start; }
.cd-footer__brand { display: contents; }
.cd-footer__name { grid-column: 1 / -1; margin: 0 0 var(--cd-sp-4); font-size: var(--cd-fs-h2-xl); line-height: var(--cd-lh-h3); font-weight: var(--cd-fw-bold); text-transform: uppercase;
	background: linear-gradient(90deg, var(--cd-blue-600), var(--cd-blue-900)); -webkit-background-clip: text; background-clip: text; color: transparent; -webkit-text-fill-color: transparent; }
.cd-footer__rows { display: grid; gap: var(--cd-sp-4); align-content: start; }
.brxe-block.cd-footer__row { display: flex; flex-direction: row; align-items: flex-start; gap: var(--cd-sp-3); font-size: var(--cd-fs-body); line-height: var(--cd-lh-body); color: var(--cd-blue-900); text-transform: uppercase; }
.cd-footer__row .cd-icon { margin-top: var(--cd-sp-0-5); }
.cd-footer__row > :not(.cd-icon) { flex: 1 1 0; min-width: 0; }
.cd-footer__row a { color: inherit; text-decoration: none; word-break: break-word; }
.cd-footer__row a:hover { color: var(--cd-blue-600); }
.cd-footer__col { display: grid; gap: var(--cd-sp-4); align-content: start; }
.cd-footer__col a, .cd-footer__title { font-size: var(--cd-fs-body); line-height: var(--cd-lh-body); font-weight: var(--cd-fw-medium); text-transform: uppercase; color: var(--cd-blue-900); text-decoration: none; }
.cd-footer__title { font-weight: var(--cd-fw-bold); }
.cd-footer__col a:hover { color: var(--cd-blue-600); }
.brxe-block.cd-footer__social { display: flex; flex-direction: row; gap: var(--cd-sp-3); align-items: center; }

.cd-icon { display: inline-block; flex: none; width: var(--cd-icon-md); height: var(--cd-icon-md); background: center / contain no-repeat; }
.cd-icon--pin  { background-image: url(../img/icons/pin.svg); }
.cd-icon--call { background-image: url(../img/icons/call.svg); }
.cd-icon--email { background-image: url(../img/icons/email.svg); }
.cd-icon--facebook { background-image: url(../img/icons/facebook.svg); width: var(--cd-icon-lg); height: var(--cd-icon-lg); }
.cd-icon--youtube  { background-image: url(../img/icons/youtube.svg); width: var(--cd-icon-lg); height: var(--cd-icon-lg); }

@media (max-width: 991px) {
	.cd-footer > .brxe-container { grid-template-columns: 1fr 1fr; }
	.cd-footer__rows { grid-column: 1 / -1; }
	.cd-footer__name { font-size: var(--cd-fs-h2-md); }
	
	.cd-footer > .brxe-container { gap: var(--cd-sp-10) var(--cd-sp-8); }
	.cd-footer::before { width: 90%; right: -10%; top: auto; bottom: var(--cd-sp-4); transform: none; }
}
@media (max-width: 478px) { .cd-footer > .brxe-container { grid-template-columns: 1fr; } }

/* ---------- Mobile tap targets (>= 44px, WCAG 2.5.8 / ui-ux-pro-max touch rules) ---------- */
.bricks-mobile-menu-toggle { min-width: 44px; min-height: 44px; display: inline-flex; align-items: center; justify-content: center; padding: 12px; }
@media (max-width: 991px) {
	.cd-footer__col a, .cd-footer__row a, .cd-entry__link, .cd-box__link { display: inline-flex; align-items: center; min-height: 44px; }
	.cd-footer__col { gap: 0; }
	.cd-footer__rows { gap: 0; }
	.brxe-block.cd-footer__row { align-items: center; }
	.cd-icon--facebook, .cd-icon--youtube { width: 44px; height: 44px; }
	.cd-header .cd-btn--gradient { min-height: 44px; }
}
@media (max-width: 991px) { .cd-t-card__link, .cd-t-card__title a { display: inline-flex; align-items: center; min-height: 44px; } }

/* Bricks mobile toggle must stay hidden while the desktop menu is shown (>=992px) */
@media (min-width: 992px) { .cd-header .bricks-mobile-menu-toggle { display: none; } }

/* Mobile menu (<=991px): toggle on the right, brand-coloured bars, full-width panel under the 64px bar */
@media (max-width: 991px) {
	.cd-header .brxe-nav-menu { flex: 0 0 auto; margin-left: auto; order: 3; }
	.cd-header .cd-btn--gradient { order: 2; }
	.cd-header .bricks-mobile-menu-toggle { min-width: var(--cd-tap); min-height: var(--cd-tap); padding: var(--cd-sp-2); color: var(--cd-blue-900); }
	.cd-header .bricks-mobile-menu-toggle span { background-color: var(--cd-blue-900); border-radius: var(--cd-radius-pill); }
	.cd-header .bricks-mobile-menu-wrapper { top: var(--cd-header-h); background: var(--cd-white); border-top: var(--cd-bw) solid var(--cd-blue-100); }
	.cd-header .bricks-mobile-menu > li > a { padding: var(--cd-sp-4) var(--cd-gutter); font-size: var(--cd-fs-lead); font-weight: var(--cd-fw-medium); color: var(--cd-blue-900); }
	.cd-header .bricks-mobile-menu > li.current-menu-item > a, .cd-header .bricks-mobile-menu > li > a:hover { color: var(--cd-blue-600); background: var(--cd-blue-50); }
}
@media (max-width: 991px) {
	.cd-header .bricks-mobile-menu-wrapper { width: 100%; max-width: none; }
	.cd-header .bricks-mobile-menu > li > a { display: flex; align-items: center; min-height: var(--cd-tap); }
}
@media (max-width: 991px) {
	.cd-header .bricks-mobile-menu-wrapper::before { background-color: var(--cd-white); }
	.bricks-mobile-menu-overlay { top: var(--cd-header-h); }
}

/* Uppercase menu is wider: tighten it on narrow desktops so it never touches the CTA */
@media (min-width: 992px) and (max-width: 1599px) {
	.cd-header .bricks-nav-menu { gap: var(--cd-sp-4); }
	.cd-header .bricks-nav-menu > li > a { font-size: var(--cd-fs-sm); }
	.cd-header .cd-header__cta { padding-inline: var(--cd-sp-3); font-size: var(--cd-fs-sm); }
}

/* Tablet / mobile menu panel: items centred horizontally and vertically */
@media (max-width: 991px) {
	.cd-header .bricks-mobile-menu-wrapper { text-align: center; }
	.cd-header .bricks-mobile-menu-wrapper .bricks-mobile-menu { display: flex; flex-direction: column; align-items: center; justify-content: center; min-height: 100%; text-align: center; }
	.cd-header .bricks-mobile-menu-wrapper .bricks-mobile-menu > li { width: 100%; }
	.cd-header .bricks-mobile-menu-wrapper .bricks-mobile-menu > li > a, .cd-header .bricks-mobile-menu-wrapper .bricks-mobile-menu > li > .brx-submenu-toggle { justify-content: center; text-align: center; }
}

/* Desktop: logo left, menu truly centred on the page, CTA right (grid with equal side columns) */
@media (min-width: 992px) {
	.cd-header > .brxe-container { display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); }
	.cd-header__logo { justify-self: start; }
	.cd-header .brxe-nav-menu { justify-self: center; flex: none; justify-content: center; }
	.cd-header .cd-header__cta { justify-self: end; white-space: nowrap; }
}

/* Scrolled glass pill: flexible row (menu fills the space between logo and CTA and spreads evenly) instead of the page-centred grid */
@media (min-width: 992px) {
	body.is-scrolled .cd-header > .brxe-container { display: flex; }
	body.is-scrolled .cd-header .brxe-nav-menu { flex: 1 1 auto; min-width: 0; justify-self: auto; }
	body.is-scrolled .cd-header .bricks-nav-menu-wrapper { width: 100%; }
	body.is-scrolled .cd-header .bricks-nav-menu { width: 100%; justify-content: space-evenly; gap: var(--cd-sp-2); }
}

/* Footer: social icons sit under the email (first column); the last column stays empty */
.cd-footer__col:has(.cd-footer__social) { display: contents; }
.cd-footer__col:has(.cd-footer__social) > .cd-footer__title { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
@media (min-width: 992px) {
	.cd-footer__name { grid-row: 1; }
	.cd-footer__rows { grid-column: 1; grid-row: 2; }
	.cd-footer__col:nth-of-type(2) { grid-column: 2; grid-row: 2; }
	.cd-footer__col:nth-of-type(3) { grid-column: 3; grid-row: 2; }
	.brxe-block.cd-footer__social { grid-column: 1; grid-row: 3; margin-top: calc(var(--cd-sp-4) - var(--cd-sp-12)); }
}
@media (max-width: 991px) {
	.cd-footer__name { order: 0; }
	.cd-footer__rows { order: 1; }
	.brxe-block.cd-footer__social { order: 2; grid-column: 1 / -1; }
	.cd-footer__col:not(:has(.cd-footer__social)) { order: 3; }
}

/* Footer social icons: same 24px glyph as the pin/call/email icons, inside a 44px tap target (WCAG 2.5.8) */
.cd-footer__social .cd-icon { width: var(--cd-tap); height: var(--cd-tap); background-size: var(--cd-icon-md); background-position: center; background-repeat: no-repeat; }
.cd-footer__social { gap: 0; margin-left: calc((var(--cd-icon-md) - var(--cd-tap)) / 2); }
@media (min-width: 992px) { .brxe-block.cd-footer__social { margin-top: calc(var(--cd-sp-4) - var(--cd-sp-12) - var(--cd-sp-2-5)); } }
@media (max-width: 991px) { .cd-footer__social .cd-icon { width: var(--cd-tap); height: var(--cd-tap); } }
.cd-footer__social .cd-icon + .cd-icon { margin-left: calc(-1 * var(--cd-sp-1)); }

/* footer (desktop): the animated logo watermark is larger and bleeds off the bottom edge and further to the left */
@media (min-width: 992px) { .cd-footer::before { top: auto; bottom: -18%; right: calc(var(--cd-gutter) - 4%); width: min(82%, 1180px); transform: none; } }
