/**
 * CDT Bcons — Responsive tối ưu trang chủ
 * Breakpoints: 1280 (large) · 1024 (tablet) · 768 (tablet sm) · 640 (mobile) · 480 (mobile sm)
 */

.is-front #page {
	overflow-x: hidden;
}

/* ---------- Large desktop (≤1280px) ---------- */
@media (max-width: 1280px) {
	.hero__main { gap: 36px; }
	.primary-menu > .menu-item > .menu-link { padding: 10px 12px; font-size: 13px; }
}

/* ---------- Tablet landscape (≤1024px) ---------- */
@media (max-width: 1024px) {
	/* Hero */
	.hero { padding-bottom: 48px; }
	.hero__main { padding-top: 40px; padding-bottom: 24px; }
	.hero__lead { font-size: 15px; }

	/* Featured projects — 2 cột */
	.featured-projects { padding: 24px 0 64px; }

	/* Fields */
	.fields-section { padding: 64px 0; }

	/* Projects showcase */
	.projects-section { padding-bottom: 72px; }
	.projects-section__top { margin-bottom: 28px; }

	/* News */
	.news-section { padding: 64px 0; }

	/* Why */
	.why-section { padding-bottom: 64px; }

	/* CTA */
	.cta-banner { padding-bottom: 72px; }

	/* Contact */
	.contact-section { padding: 64px 0; }

	/* Footer */
	.footer-main { padding: 52px 0 40px; }
}

/* ---------- Tablet portrait (≤768px) ---------- */
@media (max-width: 768px) {
	body {
		font-size: 16px;
		line-height: 1.6;
	}

	/* Header */
	.mainbar__inner { min-height: 88px; padding-top: 12px; padding-bottom: 12px; }
	.brand-logo-img { height: 48px; }

	/* Hero */
	.hero__title {
		letter-spacing: -.5px;
		font-size: clamp(24px, 6.5vw, 32px);
		line-height: 1.22;
		text-wrap: balance;
	}
	.hero__lead { font-size: 16px; line-height: 1.55; }
	.hero__actions { width: 100%; }
	.hero__actions .btn--lg {
		flex: 1 1 calc(50% - 6px);
		min-height: 48px;
	}
	.hero__bottom { gap: 12px; }
	.hero-stats { grid-template-columns: repeat(2, 1fr); }
	.stat + .stat::before { display: none; }
	.stat:nth-child(odd) { border-right: 1px solid var(--bc-border-light); }
	.trust-card { flex-wrap: wrap; }

	/* Section headings */
	.section-title {
		font-size: clamp(22px, 5.5vw, 26px);
		line-height: 1.28;
		text-wrap: balance;
	}
	.section-desc { font-size: 16px; line-height: 1.55; }
	.section-head-row { flex-direction: column; align-items: flex-start; gap: 16px; }
	.section-head-row .btn--view-all { width: 100%; justify-content: center; min-height: 48px; }

	/* Tighter section rhythm on home */
	.fields-section,
	.news-section,
	.contact-section { padding: 40px 0; }
	.featured-projects { padding: 16px 0 40px; }
	.projects-section { padding-bottom: 40px; }
	.why-section { padding-bottom: 40px; }
	.cta-banner { padding-bottom: 40px; }

	/* Projects tabs scroll */
	.project-tabs {
		width: 100%;
		overflow-x: auto;
		flex-wrap: nowrap;
		padding-bottom: 4px;
		-webkit-overflow-scrolling: touch;
		scrollbar-width: none;
	}
	.project-tabs::-webkit-scrollbar { display: none; }
	.project-tabs__btn { flex-shrink: 0; white-space: nowrap; min-height: 44px; }

	/* CTA banner */
	.cta-banner__inner { min-height: 300px; }
	.cta-banner__title { font-size: 22px; }

	/* Contact */
	.contact-section__head { margin-bottom: 28px; }

	/* Footer */
	.footer-grid { gap: 28px 20px; }
	.footer-title { font-size: 13px; margin-bottom: 14px; }
}

/* ---------- Mobile (≤640px) ---------- */
@media (max-width: 640px) {
	/* Topbar compact */
	.topbar__inner { justify-content: center; }
	.topbar__contacts { justify-content: center; }
	.topbar__item { font-size: 12px; }

	/* Hero stack */
	.hero__visual { order: -1; }
	.hero__image-frame { border-radius: 16px; aspect-ratio: 16 / 11; }
	.hero__actions { flex-direction: column; }
	.hero__actions .btn--lg { width: 100%; flex: none; }
	.trust-card__media { width: 72px; height: 64px; }
	.trust-card__title { font-size: 13px; }

	/* Featured — 1 cột full width */
	.projects-grid { gap: 12px; }
	.project-card__media { aspect-ratio: 16 / 11; }

	/* Why cards full width */
	.why-card { padding: 18px 16px; }

	/* News */
	.news-card__title,
	.news-card__excerpt { padding-right: 0; }
	.news-card__arrow { bottom: 14px; right: 14px; }

	/* Showcase */
	.showcase-card__body { padding: 14px 44px 8px 4px; }

	/* CTA */
	.cta-banner__btn { max-width: none; width: 100%; }

	/* Footer bottom stack */
	.footer-bottom__inner {
		flex-direction: column;
		text-align: center;
		gap: 12px;
	}
	.footer-legal__menu { justify-content: center; }
}

/* ---------- Small mobile (≤480px) ---------- */
@media (max-width: 480px) {
	.container { padding: 0 14px; }
	.topbar .container,
	.mainbar .container { padding: 0 10px; }

	.hero { padding-bottom: 28px; }
	.hero__main { padding-top: 24px; gap: 20px; }
	.hero__title { font-size: clamp(22px, 6.2vw, 28px); }
	.hero__lead { font-size: 16px; }
	.hero-stats { padding: 12px 6px; gap: 8px 0; }
	.stat { padding: 4px 8px; gap: 8px; }
	.stat__icon { width: 40px; height: 40px; }

	.section-title { font-size: clamp(20px, 5.5vw, 24px); }
	.section-desc { font-size: 15px; }

	.fields-section,
	.news-section,
	.contact-section { padding: 32px 0; }

	.featured-projects { padding: 12px 0 32px; }
	.projects-section { padding-bottom: 32px; }
	.why-section { padding-bottom: 32px; }
	.cta-banner { padding-bottom: 32px; }

	.contact-card__brand { font-size: 18px; }
	.contact-form__title { font-size: 18px; }
	.contact-form input,
	.contact-form select,
	.contact-form textarea,
	.contact-form button {
		min-height: 48px;
		font-size: 16px;
	}

	.footer-main { padding: 36px 0 24px; }
	.footer-brand__img { height: 52px; }
	.footer-desc { font-size: 14px; }

	.back-to-top {
		width: 44px;
		height: 44px;
		bottom: 16px;
		right: 16px;
	}
}

/* ---------- Mid phones (≤430) ---------- */
@media (max-width: 430px) {
	.hero__title { font-size: 24px; }
	.section-title { font-size: 22px; }
	.fields-section,
	.news-section,
	.contact-section { padding: 28px 0; }
}

/* ---------- Compact / narrow (≤390 / ≤375) ---------- */
@media (max-width: 390px) {
	.container { padding: 0 12px; }
	.hero__title { font-size: 22px; }
	.section-title { font-size: 20px; }
}

@media (max-width: 375px) {
	.hero { padding-bottom: 22px; }
	.hero__main { padding-top: 18px; gap: 16px; }
	.hero__title { font-size: 21px; }
	.fields-section,
	.news-section,
	.contact-section { padding: 24px 0; }
}

/* ---------- Touch / reduced motion ---------- */
@media (hover: none) {
	.field-card:hover,
	.news-card:hover,
	.project-card:hover,
	.showcase-card:hover,
	.why-card:hover {
		transform: none;
	}
}

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

/* ---------- Front page content flow ---------- */
.is-front .site-main > section:last-of-type {
	margin-bottom: 0;
}

.is-front .contact-section {
	padding-bottom: 72px;
}

@media (max-width: 640px) {
	.is-front .contact-section {
		padding-bottom: 40px;
	}
}

@media (max-width: 430px) {
	.is-front .contact-section {
		padding-bottom: 32px;
	}
}
