/* ==========================================================================
   Layout: utilities, containers, sections, header + menu, home outline, footer.
   Skeleton phase: structure + basic look only. Detailed styling comes with each section.
   ========================================================================== */

/* --- Utilities -------------------------------------------------------- */
.u-visually-hidden {
	position: absolute !important;
	width: 1px;
	height: 1px;
	padding: 0;
	margin: -1px;
	overflow: hidden;
	clip: rect(0, 0, 0, 0);
	white-space: nowrap;
	border: 0;
}

.u-nowrap {
	white-space: nowrap;
}

.u-br-pc {
	display: none;
}

@media (min-width: 768px) {
	.u-br-sp {
		display: none;
	}

	.u-br-pc {
		display: inline;
	}
}

/* --- Containers & sections ------------------------------------------ */
.l-container {
	width: min(var(--container-max), 100% - var(--container-gutter) * 2);
	margin-inline: auto;
}

.l-container--narrow {
	width: min(var(--container-narrow), 100% - var(--container-gutter) * 2);
}

.l-main {
	display: block;
	outline: none;
}

.l-section {
	padding-block: var(--section-space);
}

.l-section--flush-top {
	padding-top: 0;
}

/* --- Skip link -------------------------------------------------------- */
.c-skip-link {
	position: fixed;
	top: 8px;
	left: 8px;
	z-index: var(--z-skip);
	padding: var(--space-2) var(--space-4);
	background: var(--c-primary);
	color: var(--c-on-primary);
	border-radius: var(--radius-sm);
	transform: translateY(-200%);
}

.c-skip-link:focus {
	transform: none;
}

/* --- Header -----------------------------------------------------------
   Sizes are deliberately NOT a literal Figma conversion: the comp's header (logo 102px,
   menu 21px bold, 54px button, 3px border at 1920) reads heavy. Product-site standard instead:
   height 64 → 72 → 80 · logo 32 → 36 → 40 · menu 15–16px semibold · CTA 44px · 1px hairline.
   ---------------------------------------------------------------------- */
.c-header {
	position: sticky;
	top: var(--admin-bar-h);
	z-index: var(--z-header);
	background: var(--c-bg);
	border-bottom: 1px solid var(--c-header-line);
	transition: box-shadow var(--transition-base);
}

/* Frosted glass only with the horizontal menu: backdrop-filter makes the header the containing block
   of position:fixed children, which would trap the mobile drawer inside the 64px header. */
@media (min-width: 1280px) {
	@supports (backdrop-filter: blur(1px)) {
		.c-header {
			background: rgba(255, 255, 255, 0.82);
			backdrop-filter: saturate(180%) blur(14px);
		}
	}
}

.c-header.is-scrolled {
	box-shadow: var(--shadow-header);
}

.c-header__inner {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: var(--space-6);
	min-height: var(--header-h);
}

.c-logo {
	display: inline-flex;
	align-items: center;
	flex-shrink: 0;
	text-decoration: none;
}

.c-header__logo .c-logo__img {
	width: auto;
	height: var(--logo-h);
}

.c-logo__text {
	font-family: var(--font-display);
	font-weight: var(--fw-bold);
	font-size: 1.5rem;
	color: var(--c-primary);
}

/* Menu below 1280px — Figma "Group 52" (mobile, drawn ×6): a cream panel that drops from under the
   header (#FFFDF7, bottom corners 20px, height = content), 5 items with hairlines, full-width blue CTA;
   page behind dimmed (tap it to close). Sub-menus are collapsed — a chevron button opens each one
   (main.js). Sizes are not literal: Figma's 9px items / 24px button are too small → 16px / 48px. */
.c-nav {
	position: fixed;
	top: calc(var(--header-h) + var(--admin-bar-h));
	right: 0;
	left: 0;
	display: flex;
	flex-direction: column;
	max-height: calc(100dvh - var(--header-h) - var(--admin-bar-h) - 24px);
	padding: var(--space-2) var(--container-padding) var(--space-6);
	overflow-y: auto;
	overscroll-behavior: contain;
	background: var(--c-bg-cream);
	border-radius: 0 0 20px 20px;
	box-shadow: 0 16px 32px rgba(19, 61, 115, 0.14);
	visibility: hidden;
	opacity: 0;
	transform: translateY(-8px);
	transition: opacity var(--transition-fast), transform var(--transition-fast), visibility var(--transition-fast);
}

.is-nav-open .c-nav {
	visibility: visible;
	opacity: 1;
	transform: none;
}

/* dimmed page behind the panel (header pseudo → a tap on it hits the header: main.js closes) */
.is-nav-open .c-header::before {
	content: "";
	position: fixed;
	inset: calc(var(--header-h) + var(--admin-bar-h)) 0 0;
	background: rgba(19, 61, 115, 0.28);
}

.is-nav-open {
	overflow: hidden;
}

.c-nav__list > li {
	position: relative;
	display: grid;
	grid-template-columns: minmax(0, 1fr) auto;
	align-items: center;
}

.c-nav__list > li:not(:last-child) {
	border-bottom: 1px solid rgba(0, 0, 0, 0.1);    /* Figma Line 4–7 (black hairline) */
}

.c-nav__list a {
	display: block;
	padding: var(--space-4) 0;
	font-size: 1rem;
	font-weight: var(--fw-semibold);
	color: var(--c-text);                           /* Figma #565656 */
	text-decoration: none;
	transition: color var(--transition-fast), background-color var(--transition-fast);
}

.c-nav__list a[href]:hover,
.c-nav__list .current-menu-item > a,
.c-nav__list .current-menu-ancestor > a,
.c-nav__list .current-page-ancestor > a {
	color: var(--c-primary);
}

/* chevron button (added by main.js) */
.c-nav__expand {
	display: grid;
	place-items: center;
	width: var(--tap-min);
	height: var(--tap-min);
	margin-right: -12px;
	padding: 0;
	background: none;
	border: 0;
	border-radius: 50%;
	color: var(--c-text);
	cursor: pointer;
}

.c-nav__expand::before {
	content: "";
	width: 7px;
	height: 7px;
	margin-top: -4px;
	border-right: 1.5px solid currentColor;
	border-bottom: 1.5px solid currentColor;
	transform: rotate(45deg);
	transition: transform var(--transition-fast), margin var(--transition-fast);
}

.c-nav__expand[aria-expanded="true"]::before {
	margin-top: 4px;
	transform: rotate(-135deg);
}

.c-nav__expand:focus-visible {
	outline: 2px solid var(--c-primary);
	outline-offset: -4px;
}

.c-nav__list .sub-menu {
	grid-column: 1 / -1;
	margin: 0 0 var(--space-3);
	padding: 0 0 0 var(--space-4);
	list-style: none;
	border-left: 2px solid var(--c-border);
}

@media (max-width: 1279px) {
	.js .c-nav__list > li:not(.is-open) > .sub-menu {
		display: none;
	}
}

.c-nav__list .sub-menu a {
	padding: var(--space-2) 0;
	font-size: var(--fs-sm);
	font-weight: var(--fw-medium);
	color: var(--c-text);
}

.c-nav__cta {
	width: 100%;
	min-height: 48px;
	margin-top: var(--space-5);
	font-size: var(--fs-sm);
}

/* Hamburger — Figma "Group 51": white circle, pale grey rim, 3 black bars (the last one shorter) */
.c-nav-toggle {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 40px;
	height: 40px;
	margin-right: -2px;
	padding: 0;
	background: var(--c-surface);
	border: 1px solid #DEDEDE;
	border-radius: 50%;
	cursor: pointer;
}

.c-nav-toggle:focus-visible {
	outline: 2px solid var(--c-primary);
	outline-offset: 2px;
}

.c-nav-toggle__bar,
.c-nav-toggle__bar::before,
.c-nav-toggle__bar::after {
	display: block;
	width: 17px;
	height: 1.5px;
	background: #1A1A1A;
	border-radius: 2px;
	transition: transform var(--transition-fast), background var(--transition-fast), width var(--transition-fast);
}

.c-nav-toggle__bar {
	position: relative;
}

.c-nav-toggle__bar::before,
.c-nav-toggle__bar::after {
	content: "";
	position: absolute;
	left: 0;
}

.c-nav-toggle__bar::before {
	top: -6px;
}

.c-nav-toggle__bar::after {
	top: 6px;
	width: 11px;                       /* Figma Line 3: shorter */
}

[aria-expanded="true"] .c-nav-toggle__bar {
	background: transparent;
}

[aria-expanded="true"] .c-nav-toggle__bar::before {
	transform: translateY(6px) rotate(45deg);
}

[aria-expanded="true"] .c-nav-toggle__bar::after {
	width: 17px;
	transform: translateY(-6px) rotate(-45deg);
}

/* Horizontal menu from 1280px (below: drawer — 5 items + CTA need ~1100px). */
@media (min-width: 1280px) {
	.c-nav {
		position: static;
		flex-direction: row;
		align-items: center;
		gap: var(--space-5);
		max-height: none;
		padding: 0;
		overflow: visible;
		background: none;
		border-radius: 0;
		box-shadow: none;
		visibility: visible;
		opacity: 1;
		transform: none;
	}

	/* reset the drawer-only bits */
	.c-nav__list > li,
	.c-nav__list > li:not(:last-child) {
		display: block;
		border-bottom: 0;
	}

	.c-nav__list a {
		color: var(--c-text-strong);
	}

	.c-nav__list .sub-menu a {
		color: var(--c-text);
	}

	.c-nav__expand,
	.is-nav-open .c-header::before {
		display: none;
	}

	.c-nav__cta {
		margin-top: 0;
	}

	.c-nav__list {
		display: flex;
		align-items: center;
		gap: var(--space-1);
	}

	.c-nav__list > li {
		position: relative;
		border: 0;
	}

	.c-nav__list > li > a {
		display: inline-flex;
		align-items: center;
		gap: 6px;
		padding: var(--space-2) var(--space-3);
		border-radius: var(--radius-pill);
		font-size: var(--fs-nav);
		white-space: nowrap;
	}

	.c-nav__list > li > a[href]:hover,
	.c-nav__list > .menu-item-has-children:hover > a,   /* dropdown open, even when the group page itself is not live */
	.c-nav__list > li:focus-within > a {
		color: var(--c-primary);
		background: var(--c-pastel-ice);
	}

	/* Chevron */
	.c-nav__list > .menu-item-has-children > a::after {
		content: "";
		width: 6px;
		height: 6px;
		margin-top: -3px;
		border-right: 1.5px solid currentColor;
		border-bottom: 1.5px solid currentColor;
		transform: rotate(45deg);
		opacity: 0.7;
		transition: transform var(--transition-fast);
	}

	.c-nav__list > .menu-item-has-children:hover > a::after,
	.c-nav__list > .menu-item-has-children:focus-within > a::after {
		margin-top: 3px;
		transform: rotate(-135deg);
	}

	/* Dropdown: hover or keyboard focus */
	.c-nav__list .sub-menu {
		position: absolute;
		top: calc(100% + 10px);
		left: 0;
		min-width: 260px;
		margin: 0;
		padding: var(--space-2);
		background: var(--c-surface);
		border: 1px solid var(--c-header-line);
		border-radius: var(--radius-md);
		box-shadow: var(--shadow-dropdown);
		visibility: hidden;
		opacity: 0;
		transform: translateY(6px);
		transition: opacity var(--transition-fast), transform var(--transition-fast), visibility var(--transition-fast);
	}

	/* Hover bridge over the 10px gap, so the menu does not close on the way down. */
	.c-nav__list .sub-menu::before {
		content: "";
		position: absolute;
		inset: -12px 0 auto;
		height: 12px;
	}

	.c-nav__list > li:hover > .sub-menu,
	.c-nav__list > li:focus-within > .sub-menu {
		visibility: visible;
		opacity: 1;
		transform: none;
	}

	.c-nav__list .sub-menu a {
		padding: var(--space-2) var(--space-3);
		border-radius: var(--radius-sm);
		white-space: nowrap;
	}

	.c-nav__list .sub-menu a[href]:hover {
		background: var(--c-pastel-ice);
		color: var(--c-primary);
	}

	.c-nav__cta {
		width: auto;
		min-height: 44px;
		padding-inline: var(--space-5);
		font-size: var(--fs-nav);
		white-space: nowrap;
	}

	.c-nav-toggle {
		display: none;
	}

	.is-nav-open {
		overflow: visible;
	}
}

@media (min-width: 1600px) {
	.c-nav__list {
		gap: var(--space-2);
	}

	.c-nav__list > li > a {
		padding-inline: var(--space-4);
	}
}

/* --- Home outline = bottom tab bar on phones only (user 18/11/2026) ----------------------------
   No outline on tablet / desktop (the vertical left column was removed). Phones (< 768px): 8 pastel
   tabs fixed at the bottom, rounded top corners, 2-line labels; the tab of the section on screen
   rises. Slides away while the footer is on screen and while typing in a form (main.js adds
   html.is-obar-hidden); the contact dock rides above it (components.css "Contact dock"). */
.c-outline {
	display: none;
}

@media (max-width: 767px) {
	:root {
		--obar-h: 56px;                    /* resting tab height; the active tab rises 8px above it */
	}

	.c-outline {
		position: fixed;
		right: 0;
		bottom: 0;
		left: 0;
		z-index: var(--z-outline);
		display: block;
		padding: 0;                        /* no backdrop (user 18/11); tabs edge to edge, touching (user 26/11) */
		pointer-events: none;              /* page stays tappable between / above the tabs … */
		transition: transform 0.35s var(--ease-out), visibility 0s linear 0s;
	}

	.c-outline__link {
		pointer-events: auto;              /* … the tabs themselves are tappable */
	}

	.is-obar-hidden .c-outline {
		visibility: hidden;
		transform: translateY(calc(100% + 12px));
		transition: transform 0.35s var(--ease-out), visibility 0s linear 0.35s;
	}

	.c-outline .c-outline__list {       /* beats reset.css ul[class] */
		display: grid;
		grid-auto-columns: minmax(0, 1fr);  /* as many tabs as visible sections (8 → 6 on 19/11) */
		grid-auto-flow: column;
		align-items: end;
		gap: 0;
		margin: 0;
		padding: 0;
		list-style: none;
	}

	/* One colour per section (Figma "Group 54", Rectangle 62–69 + their text layers) */
	.c-outline__item--dau-trang { --ol-bg: #F8BAD2; --ol-ink: #8E2C5B; }
	.c-outline__item--ban-la-ai { --ol-bg: #CBDFFA; --ol-ink: #254D80; }
	.c-outline__item--tinh-nang { --ol-bg: #DEFACA; --ol-ink: #446F4C; }
	.c-outline__item--vuot-troi { --ol-bg: #FFE86C; --ol-ink: #876A3F; }
	.c-outline__item--cau-chuyen { --ol-bg: #DFCCF8; --ol-ink: #6D5894; }
	.c-outline__item--doi-tac { --ol-bg: #62E7F5; --ol-ink: #2A4F7F; }
	.c-outline__item--lo-trinh { --ol-bg: #F58C34; --ol-ink: #5C2E00; }   /* Figma: white — 2.3:1, too low → dark brown 4.7:1 (17/11) */
	.c-outline__item--dang-ky { --ol-bg: #1974EC; --ol-ink: #FFFFFF; }

	.c-outline__link {
		display: flex;
		align-items: center;
		justify-content: center;
		box-sizing: content-box;
		height: var(--obar-h);
		padding: 2px 1px env(safe-area-inset-bottom);   /* tab colour runs under the iPhone home bar */
		background: var(--ol-bg);
		border-radius: 16px 16px 0 0;
		/* thin shadow on the top edge only (negative spread → never spills onto the next tab): a tab stays
		   visible on a section of the same colour */
		box-shadow: 0 -2px 6px -2px rgba(19, 61, 115, 0.22);
		color: var(--ol-ink);
		font-family: var(--font-display);
		font-size: clamp(0.625rem, 3vw - 0.5px, 0.8125rem);   /* 10.3px at 360 (iOS tab-bar size) → 13px from 450 */
		font-weight: var(--fw-bold);
		line-height: 1.15;
		letter-spacing: -0.01em;
		text-align: center;
		text-decoration: none;
		-webkit-tap-highlight-color: transparent;
		transition: height 0.3s var(--ease-out);
	}

	.c-outline__link.is-active {
		height: calc(var(--obar-h) + 8px);
	}

	.c-outline__link:focus-visible {
		outline: 2px solid var(--c-primary-dark);
		outline-offset: -2px;
	}

	.c-outline__label {
		display: block;
		white-space: nowrap;               /* the template breaks after the first word */
	}
}

@media (prefers-reduced-motion: reduce) {
	.c-outline,
	.is-obar-hidden .c-outline,
	.c-outline__link {
		transition: none;
	}
}
/* --- Footer ----------------------------------------------------------- */
/* Figma "SỬA MỚI" y 32153: white, hairline on top, logo + intro left, 3 columns right.
   Sizes not literal (Figma 26–30px text at 1920) — standard footer scale instead. */
.c-footer {
	padding-block: var(--space-8) var(--space-5);
	background: var(--c-bg);
	border-top: 1px solid var(--c-header-line);
	color: var(--c-text-strong);
}

.c-footer__inner {
	display: grid;
	gap: var(--space-7);
}

.c-footer__logo .c-logo__img {
	width: auto;
	height: 48px;
}

.c-footer__intro {
	max-width: 32em;
	margin-top: var(--space-4);
	font-size: var(--fs-sm);
}

.c-footer__contacts {
	margin-top: var(--space-4);
	font-size: var(--fs-sm);
}

.c-footer__contact {
	display: flex;
	gap: var(--space-2);
}

.c-footer__contact dt {
	font-weight: var(--fw-bold);
}

/* Offices (Figma 18/11: city regular + address medium, Mona Sans 40 → 15px) */
.c-footer__offices {
	max-width: 36em;
	margin-top: var(--space-5);
	font-size: var(--fs-sm);
	font-style: normal;
	font-weight: var(--fw-medium);
	line-height: 1.6;
}

.c-footer__offices ul {
	display: grid;
	gap: var(--space-2);
	margin: 0;
	padding: 0;
	list-style: none;
}

.c-footer__city {
	font-weight: var(--fw-regular);
	color: var(--c-text);
}

/* 3 app icons + label (Figma 191px → 64px) */
.c-footer .c-footer__apps {          /* beats reset.css ul[class] { margin: 0 } */
	display: flex;
	gap: var(--space-5);
	margin-top: var(--space-6);
}

.c-footer__app {
	display: grid;
	justify-items: center;
	gap: var(--space-2);
	font-size: var(--fs-xs);
	font-weight: var(--fw-medium);
	color: var(--c-text-strong);
	text-decoration: none;
}

.c-footer__app-icon {
	width: 64px;
	height: 64px;
	border-radius: 15px;
	transition: transform var(--transition-fast);
}

.c-footer__app[href]:hover {
	color: var(--c-primary);
}

.c-footer__app[href]:hover .c-footer__app-icon {
	transform: translateY(var(--lift));
}

.c-footer__side {
	display: grid;
	gap: var(--space-7);
	align-content: space-between;
}

/* "Kết nối với SanAn kids" + Facebook / TikTok / YouTube (Figma: one row, right side) */
.c-footer__connect {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: var(--space-3) var(--space-5);
}

.c-footer__connect-title {
	margin: 0;
	font-size: var(--fs-base);
	font-weight: var(--fw-medium);
	color: var(--c-text-strong);
}

.c-footer__socials {
	display: flex;
	gap: var(--space-3);
}

.c-footer__social {
	display: block;
	width: 44px;
	height: 44px;
	border-radius: 50%;
	transition: transform var(--transition-fast);
}

.c-footer__social svg {
	width: 100%;
	height: 100%;
}

.c-footer__social:hover {
	transform: translateY(var(--lift));
}

.c-footer__social:focus-visible,
.c-footer__app:focus-visible {
	outline: 2px solid var(--c-primary);
	outline-offset: 3px;
}

@media (min-width: 1024px) {
	.c-footer__connect {
		justify-content: flex-end;
	}
}

.c-footer__nav {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
	gap: var(--space-6);
}

.c-footer__title {
	margin-bottom: var(--space-4);
	font-family: var(--font-display);
	font-size: var(--fs-base);
	font-weight: var(--fw-bold);
	color: var(--c-text-strong);
}

.c-footer__list {
	display: grid;
	gap: var(--space-3);
	font-size: var(--fs-sm);
}

.c-footer__list a {
	text-decoration: none;
}

.c-footer__list a[href]:hover {
	color: var(--c-primary);
	text-decoration: underline;
}

.c-footer__bottom {                 /* Figma: copyright only — right-aligned from 1024px (below) */
	display: flex;
	flex-wrap: wrap;
	justify-content: flex-start;
	gap: var(--space-3);
	margin-top: var(--space-7);
	padding-top: var(--space-4);
	border-top: 1px solid var(--c-border);
	font-size: var(--fs-xs);
}

/* Room for the floating contact buttons at the very end of the page (below 1360px they sit over the
   container; from 1360px the 140px gutter keeps them clear). */
@media (max-width: 1359px) {
	.c-footer:has(+ .c-dock) {
		padding-bottom: calc(var(--space-5) + 72px);
	}
}

.c-footer__copyright {
	font-size: inherit;               /* <small> would shrink it to 10.8px — 13px is the site minimum */
}

@media (min-width: 1024px) {
	.c-footer__bottom {
		justify-content: flex-end;
	}
}

@media (min-width: 1024px) {
	.c-footer__inner {
		grid-template-columns: minmax(0, 1.1fr) minmax(0, 1.9fr);
	}
}

@media (min-width: 1440px) {
	.c-footer__logo .c-logo__img {
		height: 64px;
	}
}
