/* ============================================================
   Trang chủ — module create-home (conditional: is_front_page)
   Port từ _design-reference/.../home.css + static-ui.css + app-shell.css
   ============================================================ */

/* ---- Design tokens (mega-menu.css scope sang .hf-header — không kế thừa ra ngoài) ---- */
:root {
  --blue:      #17479D;
  --orange:    #EE6823;
  --blue-700:  #0f3270;
  --blue-50:   #eef3fb;
  --blue-100:  #dde7f6;
  --orange-50: #fdf0e7;
  --ink:       #14213d;
  --ink-soft:  #4a5a76;
  --muted:     #7a879c;
  --line:      #e4eaf2;
  --bg-soft:   #f5f8fc;
  --radius:    4px;
  --radius-lg: 6px;
  --shadow-sm: 0 2px 8px rgba(20,33,61,.06);
  --shadow-md: 0 10px 30px rgba(20,33,61,.10);
  --shadow-lg: 0 10px 28px rgba(20,33,61,.10);
  --maxw:      1360px;
  --gut:       32px;
  --ease:      cubic-bezier(.22,.61,.36,1);
}

/* ---- Font 'Mulish' — mega-menu.css chỉ scope @font-face + áp dụng cho
   .hf-header/.hf-mobile (phần header), KHÔNG lan ra nội dung trang chủ →
   hero/thống kê/nút trước đây rơi về font hệ thống mặc định. @font-face đã
   đăng ký global (không cần khai lại), chỉ cần áp font-family cho các
   section chính của trang chủ. ---- */
.hf-hero-slider, .hf-hero-searchwrap, .hf-statsband, .hf-section, .hf-partners, .hf-cta-band {
  font-family: 'Mulish', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
}

/* ---- Shared section wrapper ---- */
.hf-section { padding: 80px 0; }
.hf-section.soft { background: var(--bg-soft); }

.hf-head-row { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; margin-bottom: 40px; }
.hf-head h2 { font-size: clamp(26px, 3.4vw, 36px); margin-top: 10px; }
.hf-head p { font-size: 17px; color: var(--ink-soft); }
.hf-head.center { text-align: center; }

.hf-eyebrow {
  display: inline-flex; align-items: center; gap: 10px;
  font-size: 12.5px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase;
  color: var(--orange);
}
.hf-eyebrow::before { content: ""; width: 22px; height: 3px; border-radius: 2px; background: var(--orange); }
.hf-eyebrow.center { justify-content: center; }

.hf-tag { display: inline-block; font-size: 12.5px; font-weight: 800; padding: 5px 11px; border-radius: 999px; }
.hf-tag-orange { background: var(--orange-50); color: var(--orange); }
.hf-tag-blue   { background: var(--blue-50);   color: var(--blue); }

.hf-link-arrow {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: 15px; font-weight: 800; color: var(--blue);
  transition: gap .18s var(--ease); white-space: nowrap;
}
.hf-link-arrow:hover { gap: 12px; }

/* ============ Hero slider — CSS radio-input trick ============ */
.hf-hero-radio {
  position: absolute; width: 1px; height: 1px; opacity: 0;
  margin: 0; padding: 0; border: 0; pointer-events: none;
  clip: rect(0 0 0 0); overflow: hidden;
}
.hf-hero-radio[data-hf-slide="0"]:checked ~ .hf-hero-slides { transform: translateX(-0%); }
.hf-hero-radio[data-hf-slide="1"]:checked ~ .hf-hero-slides { transform: translateX(-100%); }
.hf-hero-radio[data-hf-slide="2"]:checked ~ .hf-hero-slides { transform: translateX(-200%); }
.hf-hero-radio[data-hf-slide="3"]:checked ~ .hf-hero-slides { transform: translateX(-300%); }

.hf-hero-radio[data-hf-slide="0"]:checked ~ .hf-hero-dots .hf-hero-dot[data-hf-dot="0"],
.hf-hero-radio[data-hf-slide="1"]:checked ~ .hf-hero-dots .hf-hero-dot[data-hf-dot="1"],
.hf-hero-radio[data-hf-slide="2"]:checked ~ .hf-hero-dots .hf-hero-dot[data-hf-dot="2"],
.hf-hero-radio[data-hf-slide="3"]:checked ~ .hf-hero-dots .hf-hero-dot[data-hf-dot="3"] {
  background: var(--orange); width: 42px;
}

.hf-hero-slider { position: relative; width: 100%; overflow: hidden; }
.hf-hero-slides { display: flex; width: 100%; transition: transform .6s var(--ease); }
.hf-hero-slide {
  position: relative; flex: 0 0 100%; width: 100%;
  min-height: 480px; display: flex; align-items: center;
  padding-top: 44px; padding-bottom: 56px; overflow: hidden;
}
.hf-hero-bg { position: absolute; inset: 0; z-index: 0; background: var(--blue-700); }
.hf-hero-bg img { width: 100%; height: 100%; object-fit: cover; display: block; }
.hf-hero-overlay {
  position: absolute; inset: 0;
  background: linear-gradient(100deg, rgba(15,50,112,.92) 0%, rgba(23,71,157,.7) 38%, rgba(23,71,157,.06) 62%, transparent 78%);
}
.hf-hero-in { position: relative; z-index: 1; width: 100%; }
.hf-hero-copy { max-width: 640px; color: #fff; }
.hf-hero-badge {
  display: inline-flex; align-items: center; gap: 8px;
  font-weight: 800; font-size: 13.5px;
  background: rgba(255,255,255,.14); border: 1px solid rgba(255,255,255,.28);
  color: #fff; padding: 8px 15px; border-radius: 4px; backdrop-filter: blur(4px);
}
.hf-hero-badge svg { color: var(--orange); }
.hf-hero-slide h1 {
  font-size: clamp(32px, 5vw, 56px); font-weight: 700;
  margin: 16px 0 14px; letter-spacing: -.03em; color: #fff; line-height: 1.08;
}
.hf-hero-slide h1 span { color: var(--orange); }
.hf-hero-copy > p { font-size: clamp(15px, 1.7vw, 18px); color: #dbe5f5; max-width: 540px; }
.hf-hero-actions { display: flex; gap: 14px; margin-top: 24px; flex-wrap: wrap; }

.hf-hero-dots {
  position: absolute; left: 0; right: 0; bottom: 64px;
  z-index: 3; display: flex; justify-content: center; gap: 9px;
}
.hf-hero-dot {
  width: 28px; height: 5px; border-radius: 4px;
  background: rgba(255,255,255,.4); transition: background .2s, width .2s;
  cursor: pointer;
}

/* ============ Hero search bar ============ */
.hf-hero-searchwrap { position: relative; z-index: 1; margin-top: 0; }
.hf-search {
  background: #fff; border: 1px solid var(--line);
  border-radius: var(--radius-lg); padding: 16px;
  box-shadow: var(--shadow-lg); max-width: 880px;
}
.hf-search-bar { display: flex; align-items: center; gap: 12px; padding: 4px 6px 4px 16px; }
.hf-search-bar > svg { color: var(--blue); flex-shrink: 0; }
.hf-search-bar input {
  flex: 1; border: none; outline: none; font-size: 17px; font-weight: 600;
  color: var(--ink); min-width: 0; background: transparent; font-family: inherit;
}
.hf-search-bar input::placeholder { color: var(--muted); font-weight: 500; }

/* ============ Stats band ============ */
.hf-statsband { background: var(--blue); }
.hf-stats-grid { display: grid; grid-template-columns: repeat(4, 1fr); }
.hf-stat {
  padding: 34px 18px; text-align: center; color: #fff; position: relative;
  opacity: 0; transform: translateY(14px);
  transition: opacity .5s var(--ease), transform .5s var(--ease);
}
.hf-stat.in { opacity: 1; transform: none; }
.hf-stat + .hf-stat::before {
  content: ""; position: absolute; left: 0; top: 26px; bottom: 26px;
  width: 1px; background: rgba(255,255,255,.18);
}
.hf-stat-val { font-size: clamp(32px, 4vw, 46px); font-weight: 700; letter-spacing: -.03em; }
.hf-stat-lab { font-size: 14px; color: #b9cae8; font-weight: 600; margin-top: 4px; }

/* ============ Faculties ============ */
.hf-fac-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.hf-fac-card {
  display: flex; gap: 16px; text-align: left; padding: 26px; border-radius: var(--radius);
  background: #fff; box-shadow: var(--shadow-sm); border: 1px solid var(--line);
  transition: transform .2s var(--ease), box-shadow .2s, border-color .2s, background .2s, color .2s;
  align-items: flex-start; cursor: pointer;
}
.hf-fac-card:hover {
  transform: translateY(-5px); box-shadow: var(--shadow-md); border-color: transparent;
  background: var(--blue-700); color: #fff;
}
.hf-fac-ic {
  display: grid; place-items: center; width: 44px; height: 44px;
  border-radius: 4px; background: var(--bg-soft); color: var(--blue);
  flex-shrink: 0; transition: transform .2s var(--ease), background .2s, color .2s;
}
.hf-fac-card:hover .hf-fac-ic { transform: rotate(-6deg) scale(1.05); background: rgba(255,255,255,.16); color: #fff; }
.hf-fac-body h3 { font-size: 18.5px; margin-bottom: 6px; }
.hf-fac-body p { font-size: 14px; color: var(--ink-soft); margin-bottom: 14px; transition: color .2s; }
.hf-fac-card:hover .hf-fac-body p { color: #c9d8f1; }
.hf-fac-count { display: inline-flex; align-items: center; gap: 6px; font-weight: 800; font-size: 13.5px; color: var(--orange); transition: color .2s; }
.hf-fac-card:hover .hf-fac-count { color: #ffd9bf; }

/* ============ Why HUFLIT ============ */
.hf-why { display: grid; grid-template-columns: .85fr 1fr; gap: 56px; align-items: center; }
.hf-why-media { position: relative; }
.hf-why-media-img {
  position: relative; overflow: hidden; border-radius: 24px;
  aspect-ratio: 4 / 5; background: var(--bg-soft);
}
.hf-why-media-img img { width: 100%; height: 100%; object-fit: cover; display: block; }
.hf-why-float {
  position: absolute; bottom: 24px; left: -24px;
  background: #fff; border-radius: 4px; box-shadow: var(--shadow-md);
  padding: 14px 18px; display: flex; align-items: center; gap: 12px;
}
.hf-why-float svg { color: var(--orange); }
.hf-why-float strong { display: block; font-size: 15px; }
.hf-why-float span { font-size: 12.5px; color: var(--muted); }
.hf-why-copy h2 { font-size: clamp(26px, 3.4vw, 38px); margin: 14px 0 26px; }
.hf-why-list { display: flex; flex-direction: column; gap: 18px; margin-bottom: 30px; }
.hf-why-item { display: flex; gap: 15px; align-items: flex-start; }
.hf-why-ic {
  display: grid; place-items: center; width: 36px; height: 36px;
  border-radius: 4px; background: #fff; color: var(--blue);
  box-shadow: var(--shadow-sm); flex-shrink: 0;
}
.hf-why-item strong { font-size: 16.5px; display: block; margin-bottom: 4px; }
.hf-why-item p { font-size: 14.5px; color: var(--ink-soft); }

/* ============ Video ============ */
.hf-video-wrap {
  position: relative; width: 100%; max-width: 920px; margin: 0 auto;
  aspect-ratio: 16 / 9; border-radius: var(--radius-lg); overflow: hidden;
  box-shadow: var(--shadow-lg); background: #0b1830;
}
.hf-video-wrap iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }

/* ============ CTA band ============ */
.hf-cta-band { background: var(--orange); color: #fff; padding: 60px 0; }
.hf-cta-in { display: flex; align-items: center; justify-content: space-between; gap: 36px; flex-wrap: wrap; }
.hf-cta-copy .hf-eyebrow { color: #ffd9bf; }
/* ::before dùng background: var(--orange) — vô hình trên nền cam, khớp design */
.hf-cta-copy h2 { font-size: clamp(26px, 3.6vw, 38px); margin: 12px 0 12px; max-width: 600px; color: #fff; }
.hf-cta-copy p { font-size: 16.5px; color: #fff5ee; max-width: 560px; }
.hf-cta-actions { display: flex; flex-direction: column; align-items: flex-start; gap: 12px; }
.hf-cta-link { color: #fff; font-weight: 800; text-decoration: underline; text-underline-offset: 4px; opacity: .9; }
.hf-cta-link:hover { opacity: 1; }

/* ============ News ============ */
.hf-news-home { display: grid; grid-template-columns: 1.15fr 1fr; gap: 26px; }
.hf-news-feat {
  text-align: left; border-radius: var(--radius); overflow: hidden;
  background: #fff; box-shadow: var(--shadow-sm); border: 1px solid var(--line);
  transition: transform .2s var(--ease), box-shadow .2s; display: block;
}
.hf-news-feat:hover { transform: translateY(-4px); box-shadow: var(--shadow-md); }
.hf-news-feat-img { position: relative; overflow: hidden; aspect-ratio: 16/10; background: var(--bg-soft); }
.hf-news-feat-img img { width: 100%; height: 100%; object-fit: cover; display: block; }
.hf-news-feat-body { padding: 22px 24px 26px; }
.hf-news-feat-body h3 { font-size: 23px; margin: 12px 0 14px; line-height: 1.2; }
.hf-news-date { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: var(--muted); font-weight: 700; }
.hf-news-date svg { flex-shrink: 0; }
.hf-news-side { display: flex; flex-direction: column; gap: 14px; }
.hf-news-row {
  display: flex; gap: 16px; text-align: left; padding: 12px;
  border-radius: 4px; transition: background .15s; align-items: center;
  cursor: pointer; width: 100%;
}
.hf-news-row:hover { background: var(--bg-soft); }
.hf-news-row-img { position: relative; overflow: hidden; border-radius: 12px; width: 96px; height: 72px; flex-shrink: 0; background: var(--bg-soft); }
.hf-news-row-img img { width: 100%; height: 100%; object-fit: cover; display: block; }
.hf-news-row h4 { font-size: 15.5px; line-height: 1.3; margin: 8px 0 6px; }

/* ============ Partners ============ */
.hf-partners { padding: 50px 0 70px; }
.hf-partners-lab { text-align: center; color: var(--muted); font-weight: 700; font-size: 14px; margin-bottom: 26px; }
.hf-partners-row { display: flex; flex-wrap: wrap; justify-content: center; gap: 14px 40px; }
.hf-partner { font-size: 22px; font-weight: 700; color: #c2ccdb; letter-spacing: -.02em; transition: color .2s; }
.hf-partner:hover { color: var(--blue); }

/* ============ Scroll-to-top ============ */
/* ============ Reveal animation ============ */
.hf-reveal {
  opacity: 0; transform: translateY(56px) scale(.97); filter: blur(6px);
  transition: opacity .9s var(--ease), transform .9s var(--ease), filter .9s var(--ease);
  will-change: opacity, transform, filter;
}
.hf-reveal.in { opacity: 1; transform: none; filter: blur(0); }

.hf-reveal .hf-fac-card,
.hf-reveal .hf-why-item {
  opacity: 0; transform: translateY(26px);
  transition: opacity .55s var(--ease), transform .55s var(--ease);
}
.hf-reveal.in .hf-fac-card,
.hf-reveal.in .hf-why-item {
  opacity: 1; transform: none;
}
.hf-reveal :is(.hf-fac-card, .hf-why-item):nth-child(1) { transition-delay: .04s; }
.hf-reveal :is(.hf-fac-card, .hf-why-item):nth-child(2) { transition-delay: .10s; }
.hf-reveal :is(.hf-fac-card, .hf-why-item):nth-child(3) { transition-delay: .16s; }
.hf-reveal :is(.hf-fac-card, .hf-why-item):nth-child(4) { transition-delay: .22s; }
.hf-reveal :is(.hf-fac-card, .hf-why-item):nth-child(5) { transition-delay: .28s; }
.hf-reveal :is(.hf-fac-card, .hf-why-item):nth-child(n+6) { transition-delay: .34s; }

@media (prefers-reduced-motion: reduce) {
  .hf-reveal, .hf-reveal * {
    opacity: 1 !important; transform: none !important;
    filter: none !important; transition: none !important;
  }
}

/* ============ Search autocomplete dropdown ============ */
.hf-search { position: relative; }
.hf-search-dropdown {
  position: absolute; top: calc(100% + 6px); left: 0; right: 0;
  background: #fff; border-radius: 8px;
  box-shadow: 0 8px 24px rgba(20,33,61,.14), 0 2px 6px rgba(20,33,61,.08);
  border: 1px solid var(--line);
  max-height: 336px; overflow-y: auto;
  z-index: 9999;
  list-style: none; margin: 0; padding: 4px 0;
}
.hf-search-row {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 18px; cursor: pointer; gap: 12px;
  border-bottom: 1px solid var(--line);
  text-decoration: none;
  transition: background .12s;
}
.hf-search-row:last-child { border-bottom: none; }
.hf-search-row:hover, .hf-search-row.hf-active { background: var(--bg-soft); }
.hf-search-row-info { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.hf-search-row-name { font-size: 14.5px; font-weight: 700; color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hf-search-row-fac  { font-size: 12.5px; color: var(--muted); }
.hf-search-row svg  { color: var(--orange); flex-shrink: 0; }
.hf-search-empty {
  padding: 16px 18px; font-size: 14px; color: var(--muted); text-align: center;
}

/* ============ Responsive ============ */
@media (max-width: 960px) {
  .hf-fac-grid { grid-template-columns: repeat(2, 1fr); }
  .hf-why { grid-template-columns: 1fr; gap: 32px; }
  .hf-news-home { grid-template-columns: 1fr; }
  .hf-stats-grid { grid-template-columns: repeat(2, 1fr); }
  .hf-stat:nth-child(3)::before,
  .hf-stat:nth-child(1)::before { display: none; }
}
@media (max-width: 720px) {
  .hf-hero-slide { min-height: 560px; padding-bottom: 70px; }
  .hf-hero-dots { bottom: 84px; }
  .hf-hero-searchwrap { margin-top: 0; }
}
@media (max-width: 600px) {
  .hf-fac-grid { grid-template-columns: 1fr; }
  .hf-section { padding: 56px 0; }
  .hf-why-float { left: 0; }
  .hf-cta-in { flex-direction: column; align-items: flex-start; }
}
