/* ==========================================================================
   THINHBDS.VN — Global: font, reset, typography, layout, header, footer
   ========================================================================== */

/* Font local (SIL OFL 1.1) — tải thực tế từ assets/fonts, không phụ thuộc máy người xem */
@font-face { font-family: "Be Vietnam Pro"; font-style: normal; font-weight: 400; font-display: swap; src: url("../fonts/BeVietnamPro-Regular.ttf") format("truetype"); }
@font-face { font-family: "Be Vietnam Pro"; font-style: normal; font-weight: 500; font-display: swap; src: url("../fonts/BeVietnamPro-Medium.ttf") format("truetype"); }
@font-face { font-family: "Be Vietnam Pro"; font-style: normal; font-weight: 600; font-display: swap; src: url("../fonts/BeVietnamPro-SemiBold.ttf") format("truetype"); }
@font-face { font-family: "Be Vietnam Pro"; font-style: normal; font-weight: 700; font-display: swap; src: url("../fonts/BeVietnamPro-Bold.ttf") format("truetype"); }
@font-face { font-family: "Be Vietnam Pro"; font-style: normal; font-weight: 800; font-display: swap; src: url("../fonts/BeVietnamPro-ExtraBold.ttf") format("truetype"); }

/* Reset */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: calc(var(--header-h) + 16px); }
body {
  margin: 0;
  font-family: var(--font-sans);
  font-size: var(--fs-base);
  line-height: 1.65;
  color: var(--c-text);
  background: var(--c-bg);
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}
body.is-locked { overflow: hidden; }
img, svg, video { max-width: 100%; height: auto; display: block; }
h1, h2, h3, h4, p, ul, ol, figure, blockquote { margin: 0; }
ul[role="list"], .reset-list { list-style: none; padding: 0; margin: 0; }
a { color: var(--c-primary); text-underline-offset: 3px; }
a:hover { color: var(--c-dark); text-decoration-thickness: 2px; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
[hidden] { display: none !important; }

h1, h2, h3, h4 { font-weight: 700; line-height: 1.3; color: var(--c-dark); letter-spacing: -0.005em; }
h1 { font-size: var(--fs-h1); font-weight: 800; line-height: 1.2; }
h2 { font-size: var(--fs-h2); line-height: 1.25; }
h3 { font-size: var(--fs-h3); }
h4 { font-size: var(--fs-h4); }
p + p { margin-top: 1em; }

/* Focus rõ ràng */
:focus-visible { outline: 3px solid var(--c-focus); outline-offset: 3px; border-radius: 4px; }
.on-dark :focus-visible, .site-footer :focus-visible, .hero :focus-visible, .connect :focus-visible { outline-color: var(--c-focus-on-dark); }

.sr-only { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
.skip-link { position: absolute; left: 16px; top: -100px; z-index: 1000; background: var(--c-primary); color: #fff; padding: 10px 16px; border-radius: var(--r-sm); text-decoration: none; font-weight: 600; }
.skip-link:focus { top: 12px; color: #fff; }

/* Icon */
.i { width: 1.25em; height: 1.25em; flex: none; fill: none; stroke: currentColor; stroke-width: 1.75; stroke-linecap: round; stroke-linejoin: round; }
.i--fill { fill: currentColor; stroke: none; }

/* Layout */
.container { width: min(100% - 2 * var(--gutter), var(--container)); margin-inline: auto; }
.grid { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: var(--gap); }
.c-12 { grid-column: span 12; } .c-8 { grid-column: span 8; } .c-7 { grid-column: span 7; }
.c-6 { grid-column: span 6; } .c-5 { grid-column: span 5; } .c-4 { grid-column: span 4; } .c-3 { grid-column: span 3; }
.grid--center { align-items: center; }
.grid--start { align-items: start; }
.stack > * + * { margin-top: var(--stack, 16px); }
.stack-lg { --stack: 24px; }

.section { padding-block: var(--section-y); }
.section--soft { background: var(--c-soft); }
.section--white { background: var(--c-white); }
.section--tight { padding-block: clamp(32px, 4vw, 56px); }
.section-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 12px 24px; margin-bottom: clamp(24px, 3vw, 40px); }
.section-head__text { max-width: 680px; }
.section-head .lead { margin-top: 10px; }
.eyebrow { display: inline-block; margin-bottom: 8px; font-size: var(--fs-xs); font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--c-accent); }
.lead { font-size: var(--fs-lg); color: var(--c-muted); line-height: 1.6; }
.muted { color: var(--c-muted); }
.text-sm { font-size: var(--fs-sm); }
.link-arrow { display: inline-flex; align-items: center; gap: 6px; font-weight: 600; text-decoration: none; min-height: 44px; }
.link-arrow:hover { text-decoration: underline; }
.link-arrow .i { transition: transform var(--t-fast); }
.link-arrow:hover .i { transform: translateX(3px); }

/* Thanh DEMO */
.demo-bar { background: var(--c-demo-bg); color: var(--c-demo-text); border-bottom: 1px solid var(--c-demo-border); font-size: var(--fs-xs); line-height: 1.45; text-align: center; padding: 7px var(--gutter); }
.demo-bar strong { font-weight: 800; letter-spacing: 0.06em; }

/* Header (màu phẳng) */
.site-header { position: sticky; top: 0; z-index: 100; background: var(--c-white); border-bottom: 1px solid var(--c-border); }
.header-inner { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: var(--header-h); }
.brand { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; color: var(--c-dark); font-weight: 800; letter-spacing: 0.01em; font-size: 1.125rem; }
.brand:hover { color: var(--c-dark); }
/* Logo chính thức: bản Bordeaux trên header sáng, bản Champagne trên footer tối, biểu tượng giản lược cho màn hình rất hẹp */
.brand { min-height: 44px; }
/* Logo gốc 1920×335 (có lề trong suốt ~2%); giữ nguyên tỷ lệ, chỉ đặt chiều cao */
.brand-logo { display: block; height: 44px; width: auto; max-width: 100%; aspect-ratio: 1920 / 335; margin-left: -5px; }

.primary-nav ul { list-style: none; margin: 0; padding: 0; display: flex; align-items: center; gap: 4px; }
.primary-nav a { display: inline-flex; align-items: center; min-height: 44px; padding: 0 12px; border-radius: var(--r-sm); text-decoration: none; color: var(--c-text); font-size: var(--fs-sm); font-weight: 500; transition: background var(--t-fast), color var(--t-fast); }
.primary-nav a:hover { background: var(--c-soft); color: var(--c-primary); text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 6px; }
.primary-nav a[aria-current="page"], .primary-nav a.is-active { color: var(--c-primary); font-weight: 700; box-shadow: inset 0 -3px 0 var(--c-primary); border-radius: var(--r-sm) var(--r-sm) 0 0; }
.primary-nav .nav-cta a { background: var(--c-primary); color: #fff; font-weight: 600; margin-left: 8px; padding: 0 18px; box-shadow: none; border-radius: var(--r-sm); }
.primary-nav .nav-cta a:hover { background: var(--c-dark); color: #fff; text-decoration: underline; text-underline-offset: 4px; }
.primary-nav .nav-cta a[aria-current="page"] { background: var(--c-dark); color: #fff; box-shadow: none; border-radius: var(--r-sm); }

.has-sub { position: relative; display: flex; align-items: center; }
.has-sub > a { padding-right: 4px; }
.sub-toggle { display: inline-grid; place-items: center; width: 32px; height: 44px; background: none; border: 0; border-radius: var(--r-sm); color: var(--c-muted); padding: 0; }
.sub-toggle:hover { background: var(--c-soft); color: var(--c-primary); }
.sub-toggle .i { width: 16px; height: 16px; transition: transform var(--t-fast); }
.sub-toggle[aria-expanded="true"] .i { transform: rotate(180deg); }
.subnav { position: absolute; top: calc(100% + 4px); left: 0; min-width: 240px; background: var(--c-white); border: 1px solid var(--c-border); border-radius: var(--r-lg); box-shadow: var(--shadow-md); padding: 8px !important; flex-direction: column; align-items: stretch !important; gap: 2px !important; opacity: 0; visibility: hidden; transform: translateY(-4px); transition: opacity var(--t-fast), transform var(--t-fast), visibility var(--t-fast); }
.has-sub.is-open > .subnav, .has-sub:hover > .subnav { opacity: 1; visibility: visible; transform: none; }
.subnav a { width: 100%; justify-content: flex-start; font-weight: 500 !important; box-shadow: none !important; border-radius: var(--r-sm) !important; }

.menu-toggle { display: none; align-items: center; justify-content: center; width: 44px; height: 44px; border: 1px solid var(--c-border-strong); border-radius: var(--r-sm); background: var(--c-white); color: var(--c-dark); padding: 0; }
.menu-toggle .bars, .menu-toggle .bars::before, .menu-toggle .bars::after { display: block; width: 20px; height: 2px; background: currentColor; border-radius: 2px; transition: transform var(--t-base), background var(--t-base); content: ""; position: relative; }
.menu-toggle .bars::before { position: absolute; top: -6px; left: 0; }
.menu-toggle .bars::after { position: absolute; top: 6px; left: 0; }
.menu-toggle[aria-expanded="true"] .bars { background: transparent; }
.menu-toggle[aria-expanded="true"] .bars::before { transform: translateY(6px) rotate(45deg); }
.menu-toggle[aria-expanded="true"] .bars::after { transform: translateY(-6px) rotate(-45deg); }

/* Footer (màu phẳng) */
.site-footer { background: var(--c-dark); color: var(--c-on-dark-muted); padding-top: clamp(40px, 5vw, 64px); border-top: 4px solid var(--brand-gold); }
.site-footer a { color: var(--c-on-dark-muted); text-decoration: none; }
.site-footer a:hover { color: #fff; text-decoration: underline; }
.site-footer h2 { font-size: var(--fs-base); color: #fff; margin-bottom: 14px; font-weight: 700; }
.site-footer .brand { color: #fff; }
.site-footer .brand-logo { height: 56px; }
.footer-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 2px; }
.footer-list a, .footer-list span { display: inline-flex; align-items: center; gap: 10px; min-height: 36px; font-size: var(--fs-sm); }
.footer-list .i { width: 18px; height: 18px; flex: none; }
.footer-bottom { margin-top: clamp(32px, 4vw, 48px); padding-block: 20px; border-top: 1px solid rgba(255, 255, 255, 0.16); display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px 24px; font-size: var(--fs-xs); }

/* Toast */
.toast { position: fixed; left: 50%; bottom: 24px; z-index: 300; transform: translate(-50%, 20px); max-width: min(92vw, 520px); background: var(--c-dark); color: #fff; padding: 12px 18px; border-radius: var(--r-md); box-shadow: var(--shadow-md); font-size: var(--fs-sm); opacity: 0; pointer-events: none; transition: opacity var(--t-base), transform var(--t-base); }
.toast.is-visible { opacity: 1; transform: translate(-50%, 0); }

/* V1.4: tiêu đề và đoạn dài ngắt dòng cân đối, tránh từ đơn lẻ ở cuối dòng */
h1, h2, h3 { text-wrap: balance; }
.lead, .hero__lead, .hero__more, .prose p, .card__excerpt, .tile p { text-wrap: pretty; }
