/* ==========================================================================
   Banner trang chủ (inc/home-hero.php): bảng xanh đậm phủ hết chiều ngang.
   Trái: thông điệp, tìm kiếm, lối tắt, số liệu. Phải: kệ "Tài liệu mới đăng" (trang đề nổi, chip, thẻ thông tin).
   Nền: ánh sáng xanh/cam rất nhẹ, lưới ô li 2 cấp, họa tiết nét phấn mờ; đáy là vạch thước như header.
   Tương phản: chữ trắng / #c9d6e8 trên #132a4f (>= 9:1); nút cam dùng chữ tối; nhãn trên thẻ trắng giữ màu hệ thống.
   ========================================================================== */
.gt-hero {
  --hero-bg: #132a4f;
  --hero-ink: #fff;
  --hero-muted: #c9d6e8;
  --hero-line: rgba(255, 255, 255, 0.14);
  --hero-chalk: rgba(226, 236, 250, 0.13);
  --hero-chalk-accent: rgba(255, 209, 102, 0.3);
  position: relative;
  isolation: isolate;
  overflow: hidden;
  color: var(--hero-ink);
  background:
    radial-gradient(900px 520px at 82% 18%, rgba(46, 116, 214, 0.42), transparent 62%),
    radial-gradient(700px 420px at 6% 96%, rgba(247, 147, 30, 0.13), transparent 60%),
    linear-gradient(rgba(255, 255, 255, 0.055) 1px, transparent 1px) 0 0 / 120px 120px,
    linear-gradient(90deg, rgba(255, 255, 255, 0.055) 1px, transparent 1px) 0 0 / 120px 120px,
    linear-gradient(rgba(255, 255, 255, 0.025) 1px, transparent 1px) 0 0 / 24px 24px,
    linear-gradient(90deg, rgba(255, 255, 255, 0.025) 1px, transparent 1px) 0 0 / 24px 24px,
    linear-gradient(180deg, #102445 0%, var(--hero-bg) 45%, #0f2242 100%);
}
/* Viền tối nhẹ ở 4 góc để mắt dồn vào giữa. */
.gt-hero::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: radial-gradient(120% 90% at 50% 40%, transparent 55%, rgba(5, 14, 30, 0.45));
  pointer-events: none;
}
/* Vạch thước ở đáy (đồng bộ dải thước dưới header). */
.gt-hero::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 12px;
  background:
    repeating-linear-gradient(90deg, rgba(255, 255, 255, 0.28) 0 1.5px, transparent 1.5px 60px) 0 0 / 100% 12px no-repeat,
    repeating-linear-gradient(90deg, rgba(255, 255, 255, 0.16) 0 1px, transparent 1px 12px) 0 6px / 100% 6px no-repeat;
  pointer-events: none;
}

/* ---------- Họa tiết nền ---------- */
.gt-hero__bg { position: absolute; inset: 0; z-index: -1; pointer-events: none; color: var(--hero-chalk); }
.gt-hero__deco { position: absolute; overflow: visible; }
.gt-hero__deco text { font-family: var(--gt-head); font-weight: 700; }
.gt-hero__deco .is-accent { color: var(--hero-chalk-accent); stroke: var(--hero-chalk-accent); }
.gt-hero__deco text.is-accent { fill: var(--hero-chalk-accent); stroke: none; }
.gt-hero__deco--graph { width: 620px; right: -90px; top: -40px; }
.gt-hero__deco--protractor { width: 230px; left: -120px; bottom: 36px; } /* chỉ nằm ở lề trái, không đè chữ */
.gt-hero__deco--circle { width: 170px; left: 44%; top: 30px; opacity: 0.8; }
.gt-hero__formula {
  position: absolute;
  font-family: var(--gt-head);
  font-weight: 700;
  font-size: 1.375rem;
  color: var(--hero-chalk);
  white-space: nowrap;
}

/* ---------- Khung ---------- */
.gt-hero__inner {
  box-sizing: border-box;
  max-width: 1200px;
  margin: 0 auto;
  padding: 64px 24px 44px;
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 6fr);
  gap: 56px;
  align-items: center;
}

/* ---------- Cột trái ---------- */
.gt-hero__eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin: 0;
  padding: 7px 16px 7px 12px;
  border: 1px solid var(--hero-line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
  font-size: 0.875rem;
  font-weight: 600;
  line-height: 1.3;
  color: #fff;
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
}
.gt-hero__live { position: relative; flex: none; width: 8px; height: 8px; border-radius: 50%; background: #4ade80; }
.gt-hero__live::after {
  content: "";
  position: absolute;
  inset: -4px;
  border-radius: 50%;
  border: 2px solid rgba(74, 222, 128, 0.5);
  animation: gt-live 2.4s ease-out infinite;
}
@keyframes gt-live { from { transform: scale(0.6); opacity: 1; } to { transform: scale(1.8); opacity: 0; } }

.gt-hero__title {
  margin: 20px 0 16px;
  font-family: var(--gt-head);
  font-weight: 800;
  font-size: clamp(2.1rem, 3.7vw, 3.25rem);
  line-height: 1.1;
  letter-spacing: -0.012em;
  color: #fff;
  text-wrap: balance;
}
.gt-hero__title mark {
  background: linear-gradient(90deg, #ffd166, #ffb347);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  white-space: nowrap;
}
.gt-hero__lead { max-width: 34em; margin: 0 0 28px; font-size: 1.0625rem; line-height: 1.65; color: var(--hero-muted); }

.gt-hero__search {
  position: relative;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px;
  border-radius: 18px;
  background: #fff;
  box-shadow: 0 0 0 6px rgba(255, 255, 255, 0.06), 0 24px 48px -20px rgba(0, 0, 0, 0.55);
  transition: box-shadow 0.2s ease;
}
.gt-hero__search:focus-within { box-shadow: 0 0 0 4px rgba(255, 209, 102, 0.55), 0 24px 48px -20px rgba(0, 0, 0, 0.55); }
.gt-hero__search-icon { display: grid; place-items: center; padding-left: 10px; color: #64748b; }
.gt-hero__search-icon .mlib-icon { width: 20px; height: 20px; }
.gt-hero__search input[type="search"] {
  flex: 1;
  min-width: 0;
  height: 50px;
  padding: 0 4px;
  border: 0;
  outline: 0;
  background: none;
  box-shadow: none;
  font: inherit;
  font-size: 1rem;
  color: var(--gt-navy);
}
.gt-hero__search input::placeholder { color: #64748b; }
.gt-hero__search button {
  flex: none;
  min-height: 50px;
  padding: 0 26px;
  border: 0;
  border-radius: 12px;
  background: var(--mlib-accent);
  color: #1f1300;
  font: inherit;
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  box-shadow: inset 0 -3px 0 rgba(0, 0, 0, 0.12);
  transition: background-color 0.2s ease, transform 0.15s ease;
}
.gt-hero__search button:hover { background: #ffa53d; }
.gt-hero__search button:active { transform: translateY(1px); }

.gt-hero__quick { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 18px; }
.gt-hero__quick a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0 16px;
  border: 1px solid var(--hero-line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.05);
  color: #fff;
  font-size: 0.9375rem;
  font-weight: 600;
  text-decoration: none;
  transition: background-color 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}
.gt-hero__quick a:hover { border-color: #ffd166; background: rgba(255, 209, 102, 0.1); color: #ffd166; }

/* Một hàng không xuống dòng (khoảng cách + cỡ số co theo bề rộng); điện thoại: tự xuống dòng, bỏ vạch ngăn, canh mép trái (≤640px). */
.gt-hero__stats { display: flex; flex-wrap: nowrap; margin: 34px 0 0; padding: 0; }
.gt-hero__stats > div { display: flex; flex-direction: column-reverse; min-width: 0; padding: 0 clamp(14px, 2vw, 28px); border-left: 1px solid var(--hero-line); }
.gt-hero__stats > div:first-child { padding-left: 0; border-left: 0; }
.gt-hero__stats dd { margin: 0; font-family: var(--gt-head); font-size: clamp(1.5rem, 2.2vw, 2rem); font-weight: 800; line-height: 1.05; color: #fff; font-variant-numeric: tabular-nums; }
.gt-hero__stats dt { margin-top: 2px; font-size: 0.875rem; color: var(--hero-muted); white-space: nowrap; }
.gt-hero__stats dt a { color: inherit; text-decoration: underline; text-decoration-color: rgba(201, 214, 232, 0.4); text-underline-offset: 3px; }
.gt-hero__stats dt a:hover { color: #fff; text-decoration-color: #ffd166; }

/* ---------- Kệ tài liệu mới: trang đề nổi + chip thông số + thẻ thông tin (Dimensional Layering) ---------- */
.gt-tone--green { --tone: var(--gt-green); --tone-bg: var(--gt-green-bg); --tone-hi: #4ade80; --tone-glow: rgba(34, 197, 94, 0.34); }
.gt-tone--blue { --tone: var(--gt-blue); --tone-bg: var(--gt-blue-bg); --tone-hi: #60a5fa; --tone-glow: rgba(59, 130, 246, 0.42); }
.gt-tone--orange { --tone: var(--gt-orange); --tone-bg: var(--gt-orange-bg); --tone-hi: #fbbf24; --tone-glow: rgba(247, 147, 30, 0.36); }
.gt-tone--purple { --tone: var(--gt-purple); --tone-bg: var(--gt-purple-bg); --tone-hi: #a78bfa; --tone-glow: rgba(139, 92, 246, 0.42); }

.gt-shelf { position: relative; display: grid; grid-template-columns: minmax(0, 1fr); color: #fff; }
.gt-shelf__bar { grid-row: 1; }
.gt-shelf__bar { display: flex; align-items: center; gap: 14px; }
.gt-shelf__title { display: flex; align-items: center; gap: 10px; margin: 0; font-family: var(--gt-head); font-size: 1.125rem; font-weight: 800; color: #fff; white-space: nowrap; }
/* Ngọn lửa cạnh tiêu đề kệ (vector 3 lớp). Mỗi lần đổi tài liệu, JS thêm .is-flare: lửa bùng lên ~0,9s rồi dịu lại.
   Rê chuột vào kệ (tiêu đề, ảnh tài liệu, thẻ thông tin): lửa cháy liên tục cùng một nhịp. */
.gt-shelf__flame {
  display: grid;
  place-items: center;
  width: 24px;
  height: 28px;
  transform: translateY(-5px); /* thân lửa nặng phần dưới: nâng lên để phần sáng ngang tầm chữ */
  filter: drop-shadow(0 0 6px rgba(249, 115, 22, 0.45));
}
.gt-shelf__flame svg { display: block; width: 21px; height: 28px; overflow: visible; transform-origin: 50% 92%; }
.gt-shelf__flame path { transform-box: fill-box; transform-origin: 50% 100%; }
.gt-shelf__flame.is-flare { animation: gt-flare-glow 0.9s ease-out; }
.gt-shelf__flame.is-flare svg { animation: gt-flare-grow 0.9s cubic-bezier(0.22, 1, 0.36, 1); }
.gt-shelf__flame.is-flare .fo { animation: gt-flare-lick 0.3s ease-in-out 3 alternate; }
.gt-shelf__flame.is-flare .fm { animation: gt-flare-lick 0.22s ease-in-out -0.1s 4 alternate-reverse; }
.gt-shelf__flame.is-flare .fc { animation: gt-flare-core 0.18s ease-in-out 5 alternate; }
@media (hover: hover) {
  .gt-shelf:hover .gt-shelf__flame { animation: gt-flare-glow 1.2s ease-in-out infinite; }
  .gt-shelf:hover .gt-shelf__flame svg { animation: gt-flare-burn 1.2s ease-in-out infinite; }
  .gt-shelf:hover .gt-shelf__flame .fo { animation: gt-flare-lick 0.3s ease-in-out infinite alternate; }
  .gt-shelf:hover .gt-shelf__flame .fm { animation: gt-flare-lick 0.22s ease-in-out -0.1s infinite alternate-reverse; }
  .gt-shelf:hover .gt-shelf__flame .fc { animation: gt-flare-core 0.18s ease-in-out infinite alternate; }
}
@keyframes gt-flare-burn {
  0%, 100% { transform: scale(1.12); }
  30% { transform: scale(1.3) translateY(-1px); }
  60% { transform: scale(1.18); }
}
@keyframes gt-flare-grow {
  0% { transform: scale(1); }
  28% { transform: scale(1.38) translateY(-1px); }
  60% { transform: scale(1.12); }
  100% { transform: scale(1); }
}
@keyframes gt-flare-glow {
  0%, 100% { filter: drop-shadow(0 0 6px rgba(249, 115, 22, 0.45)); }
  30% { filter: drop-shadow(0 0 14px rgba(249, 115, 22, 0.95)) drop-shadow(0 -4px 8px rgba(253, 186, 116, 0.8)); }
}
@keyframes gt-flare-lick {
  from { transform: scale(1, 1) skewX(0deg); }
  to { transform: scale(0.94, 1.12) skewX(-4deg); }
}
@keyframes gt-flare-core {
  from { transform: scale(1, 0.92); }
  to { transform: scale(0.9, 1.18) translateY(-4%); }
}

/* Thanh vạch kiểu "story": mỗi vạch là một tab (vùng bấm 44px), vạch đang chọn dài hơn, màu vàng. */
.gt-shelf__tabs { display: flex; align-items: center; margin-left: auto; }
.gt-shelf__tabs[hidden] { display: none; }
.gt-hero .gt-shelf__tab,
.gt-hero .gt-shelf__tab:hover,
.gt-hero .gt-shelf__tab:focus {
  position: relative;
  width: 30px;
  height: 44px;
  padding: 0;
  border: 0;
  background: none;
  color: inherit;
  cursor: pointer;
  transition: width 0.3s cubic-bezier(0.22, 1, 0.36, 1);
}
.gt-shelf__tab::before {
  content: "";
  position: absolute;
  left: 4px;
  right: 4px;
  top: 20px;
  height: 4px;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.22);
  transition: background-color 0.2s ease;
}
.gt-hero .gt-shelf__tab:hover::before { background: rgba(255, 255, 255, 0.5); }
.gt-hero .gt-shelf__tab[aria-selected="true"] { width: 52px; }
.gt-hero .gt-shelf__tab[aria-selected="true"]::before { background: #ffd166; box-shadow: 0 0 12px rgba(255, 209, 102, 0.6); }
/* Tự chuyển (assets/js/home-hero.js thêm .is-auto): vạch đang chọn là rãnh mờ, phần vàng chạy đầy trong --gt-shelf-ms;
   chạy hết (animationend) thì sang tài liệu kế. Dừng khi rê chuột, khi focus bàn phím bên trong,
   khi kệ ra khỏi màn hình hoặc tab ẩn (.is-held). */
.gt-shelf { --gt-shelf-ms: 6s; }
.gt-hero .gt-shelf.is-auto .gt-shelf__tab[aria-selected="true"]::before { background: rgba(255, 209, 102, 0.28); box-shadow: none; }
.gt-shelf.is-auto .gt-shelf__tab[aria-selected="true"]::after {
  content: "";
  position: absolute;
  left: 4px;
  top: 20px;
  width: calc(100% - 8px);
  height: 4px;
  border-radius: 4px;
  background: #ffd166;
  box-shadow: 0 0 12px rgba(255, 209, 102, 0.6);
  transform-origin: left center;
  animation: gt-shelf-progress var(--gt-shelf-ms) linear forwards;
}
@media (hover: hover) {
  .gt-shelf.is-auto:hover .gt-shelf__tab::after { animation-play-state: paused; }
}
.gt-shelf.is-auto:has(:focus-visible) .gt-shelf__tab::after,
.gt-shelf.is-auto.is-held .gt-shelf__tab::after { animation-play-state: paused; }
@keyframes gt-shelf-progress { from { transform: scaleX(0); } to { transform: scaleX(1); } }


.gt-shelf__nav { display: flex; align-items: center; gap: 6px; }
.gt-shelf__nav[hidden] { display: none; }
.gt-shelf__count { min-width: 30px; font-size: 0.875rem; color: var(--hero-muted); text-align: right; font-variant-numeric: tabular-nums; }
.gt-shelf__count b { color: #fff; }
.gt-hero .gt-icon-btn,
.gt-hero .gt-icon-btn:focus {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.07);
  color: #fff;
  cursor: pointer;
  transition: border-color 0.2s ease, background-color 0.2s ease;
}
.gt-hero .gt-icon-btn:hover { border-color: #ffd166; background: rgba(255, 209, 102, 0.14); color: #ffd166; }
.gt-icon-btn .mlib-icon { width: 20px; height: 20px; }

.gt-shelf__panel { position: relative; grid-row: 2; grid-column: 1; height: 440px; margin-top: 6px; }
.gt-shelf__panel[hidden] { display: none; }

/* Sân khấu: quầng sáng theo loại tài liệu + vòng tròn nét phấn, trang đề đặt nghiêng có 2 tờ lót. */
.gt-stage {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  width: 54%;
  display: grid;
  place-items: center;
  text-decoration: none;
}
.gt-stage::before {
  content: "";
  position: absolute;
  inset: 4% 0;
  background: radial-gradient(closest-side, var(--tone-glow), transparent);
  pointer-events: none;
}
.gt-stage__orbit {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 360px;
  height: 360px;
  margin: -180px 0 0 -180px;
  border: 1.5px dashed rgba(255, 255, 255, 0.16);
  border-radius: 50%;
}
.gt-stage__orbit::before {
  content: "";
  position: absolute;
  inset: 52px;
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: 50%;
}
.gt-stage__orbit::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 180px;
  height: 0;
  border-top: 1.5px dashed rgba(255, 209, 102, 0.35);
  transform: rotate(-38deg);
  transform-origin: 0 0;
}

.gt-page {
  position: relative;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: 226px;
  aspect-ratio: 210 / 297;
  padding: 18px 17px 16px;
  border-top: 6px solid var(--tone);
  border-radius: 4px;
  background: #fff;
  color: #334155;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.18), 0 44px 70px -24px rgba(0, 0, 0, 0.75);
}
.gt-stack { position: relative; z-index: 1; display: block; transform: rotate(-6deg); transition: transform 0.45s cubic-bezier(0.22, 1, 0.36, 1); }
.gt-stack__sheet {
  position: absolute;
  inset: -6px 0 0;
  border-radius: 4px;
  background: #e9eef6;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
  transform: rotate(6deg) translate(16px, 4px);
}
.gt-stack__sheet.is-back { background: var(--tone-bg); transform: rotate(13deg) translate(36px, 18px); }
.gt-stage:hover .gt-stack { transform: rotate(-3deg) translateY(-6px); }
.gt-page i { display: block; height: 4px; border-radius: 2px; background: #e2e8f0; }
.gt-page i.is-short { width: 58%; }
.gt-page__head { display: flex; justify-content: space-between; gap: 24px; }
.gt-page__head i { flex: 1; }
.gt-page__head i:last-child { flex: 0 0 34%; }
.gt-page__term { margin-top: 6px; font-size: 0.875rem; font-weight: 800; line-height: 1.2; letter-spacing: 0.04em; text-align: center; text-transform: uppercase; color: var(--tone); }
.gt-page__sub { margin-top: -4px; font-size: 0.6875rem; font-weight: 600; text-align: center; color: #64748b; }
.gt-page__q { display: flex; flex-direction: column; gap: 4px; font-size: 0.6875rem; line-height: 1.3; color: #475569; }
.gt-page__q b { color: var(--gt-navy); }
.gt-page__q em { font-style: normal; font-weight: 600; color: var(--gt-navy); }
.gt-page__fig { display: flex; align-items: center; gap: 10px; color: #94a3b8; }
.gt-page__fig svg { flex: none; width: 66px; height: auto; }
.gt-page__fig text { fill: #64748b; font-family: var(--gt-head); }
.gt-page__fig > span { display: flex; flex: 1; flex-direction: column; gap: 5px; }
.gt-page__stamp {
  position: absolute;
  right: -18px;
  bottom: 26px;
  display: grid;
  place-items: center;
  align-content: center;
  width: 74px;
  height: 74px;
  border: 2.5px solid var(--tone);
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.94);
  color: var(--tone);
  font-family: var(--gt-head);
  font-size: 1.75rem;
  font-weight: 800;
  line-height: 0.9;
  box-shadow: 0 0 0 3px #fff, 0 0 0 4.5px var(--tone), 0 10px 20px -8px rgba(0, 0, 0, 0.55);
  transform: rotate(-12deg);
}
.gt-page__stamp small { font-family: "Be Vietnam Pro", sans-serif; font-size: 0.625rem; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; }

/* Chip kính mờ nổi quanh trang đề (trang trí; số liệu đọc cho trình đọc màn hình nằm trong thẻ thông tin). */
.gt-chip {
  position: absolute;
  z-index: 2;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 8px 14px;
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 999px;
  background: rgba(19, 42, 79, 0.55);
  color: #e6edf7;
  font-size: 0.8125rem;
  font-weight: 500;
  white-space: nowrap;
  box-shadow: 0 14px 28px -14px rgba(0, 0, 0, 0.7), inset 0 1px 0 rgba(255, 255, 255, 0.12);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  animation: gt-float 6s ease-in-out infinite alternate;
}
.gt-chip b { font-weight: 800; color: #fff; }
.gt-chip .mlib-icon { width: 15px; height: 15px; color: #ffd166; }
.gt-chip__dot { width: 8px; height: 8px; border-radius: 50%; background: #4ade80; box-shadow: 0 0 0 3px rgba(74, 222, 128, 0.25); }
.gt-chip--new { top: 26px; left: 4%; font-weight: 700; color: #fff; }
.gt-chip--views { top: 64px; right: 2%; animation-delay: -2s; }
.gt-chip--dl { bottom: 52px; left: 8%; animation-delay: -4s; }
.gt-chip--fmt { top: 46%; left: -11%; font-weight: 800; letter-spacing: 0.03em; color: #fff; animation-delay: -1s; }
.gt-chip--fmt .mlib-icon { color: #fca5a5; }
@keyframes gt-float { from { transform: translateY(0); } to { transform: translateY(-8px); } }

/* Thẻ thông tin trắng đè chéo lên góc sân khấu. */
.gt-doccard {
  position: absolute;
  z-index: 3;
  right: 0;
  bottom: 22px;
  box-sizing: border-box;
  width: 300px;
  padding: 22px 22px 14px;
  border-radius: 20px;
  background: #fff;
  color: var(--gt-navy);
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.12), 0 36px 64px -28px rgba(0, 0, 0, 0.85), 0 14px 28px -18px rgba(0, 0, 0, 0.5);
}
.gt-doccard::before { content: ""; position: absolute; top: 0; left: 22px; width: 44px; height: 4px; border-radius: 0 0 4px 4px; background: var(--tone); }
.gt-doccard__tags { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 10px; }
.gt-doccard__tags .mlib-tag { margin: 0; }
.gt-doccard__title {
  margin: 0 0 10px;
  font-family: var(--gt-head);
  font-size: 1.25rem;
  font-weight: 800;
  line-height: 1.3;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.gt-doccard__title a { color: var(--gt-navy); text-decoration: none; }
.gt-doccard__title a:hover { color: var(--gt-blue); }
.gt-doccard__meta { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 14px; margin: 0 0 16px; font-size: 0.875rem; color: #475569; }
.gt-doccard__meta > span:first-child { display: inline-flex; align-items: center; gap: 5px; }
.gt-doccard__meta .mlib-icon { width: 15px; height: 15px; }
.gt-doccard__price { font-weight: 700; color: var(--mlib-success); }
.gt-doccard__price.mlib-price--price { color: var(--mlib-accent-ink); }
.gt-doccard__price.mlib-price--unlocked { color: var(--gt-blue); }
.gt-doccard .gt-btn { width: 100%; }
.gt-doccard__more {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  min-height: 44px;
  margin-top: 4px;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--gt-blue);
  text-decoration: none;
}
.gt-doccard__more .mlib-icon { width: 15px; height: 15px; transition: transform 0.2s ease; }
.gt-doccard__more:hover { color: #0f4c99; }
.gt-doccard__more:hover .mlib-icon { transform: translateX(3px); }

.gt-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 48px;
  padding: 0 18px;
  border-radius: 12px;
  font-size: 0.9375rem;
  font-weight: 700;
  white-space: nowrap;
  text-decoration: none;
  transition: background-color 0.2s ease;
}
.gt-btn .mlib-icon { width: 17px; height: 17px; transition: transform 0.2s ease; }
.gt-btn--primary { background: var(--gt-blue); color: #fff; box-shadow: inset 0 -3px 0 rgba(0, 0, 0, 0.15), 0 10px 20px -12px rgba(21, 96, 189, 0.9); }
.gt-btn--primary:hover { background: #0f4c99; color: #fff; }
.gt-btn--primary:hover .mlib-icon { transform: translateX(3px); }

/* Hiệu ứng khi đổi tài liệu: trang đề lật vào, thẻ thông tin trượt lên. */
/* Đổi tài liệu: tài liệu cũ (.is-leaving) trượt ra + mờ đi, tài liệu mới (.is-entering) trượt vào chậm hơn một nhịp;
   hai lớp chồng lên nhau nên chuyển mượt, không chớp/giật. --gt-dir: hướng chuyển (JS đặt ±24px). */
.gt-shelf__panel.is-leaving { z-index: 0; pointer-events: none; }
.gt-shelf__panel.is-leaving .gt-stack { animation: gt-page-out 0.45s cubic-bezier(0.4, 0, 0.2, 1) forwards; }
.gt-shelf__panel.is-leaving .gt-doccard { animation: gt-card-out 0.32s cubic-bezier(0.4, 0, 1, 1) forwards; }
.gt-shelf__panel.is-leaving .gt-chip,
.gt-shelf__panel.is-leaving .gt-stage__orbit,
.gt-shelf__panel.is-leaving .gt-stage::before { animation: gt-fade-out 0.3s ease forwards; }
.gt-shelf__panel.is-entering { z-index: 1; }
.gt-shelf__panel.is-entering .gt-stack { animation: gt-page-in 0.6s 0.12s cubic-bezier(0.22, 1, 0.36, 1) backwards; }
.gt-shelf__panel.is-entering .gt-doccard { animation: gt-card-in 0.5s 0.2s cubic-bezier(0.22, 1, 0.36, 1) backwards; }
.gt-shelf__panel.is-entering .gt-chip { animation: gt-fade 0.5s 0.3s ease backwards, gt-float 6s 0.8s ease-in-out infinite alternate; }
.gt-shelf__panel.is-entering .gt-stage__orbit,
.gt-shelf__panel.is-entering .gt-stage::before { animation: gt-fade 0.6s 0.1s ease backwards; }
@keyframes gt-page-in { from { opacity: 0; transform: translateX(var(--gt-dir, 24px)) rotate(0deg) scale(0.97); } to { opacity: 1; transform: rotate(-6deg); } }
@keyframes gt-page-out { from { opacity: 1; transform: rotate(-6deg); } to { opacity: 0; transform: translateX(calc(var(--gt-dir, 24px) * -1)) rotate(-11deg) scale(0.96); } }
@keyframes gt-card-in { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }
@keyframes gt-card-out { from { opacity: 1; transform: none; } to { opacity: 0; transform: translateY(-8px); } }
@keyframes gt-fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes gt-fade-out { from { opacity: 1; } to { opacity: 0; } }

/* ---------- Thanh cam kết: một hàng thoáng, vạch ngăn mảnh, biểu tượng vẽ riêng (gt_hero_trust_icon) ---------- */
.gt-hero__trust {
  box-sizing: border-box;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  row-gap: 22px;
  max-width: 1200px;
  margin: 0 auto;
  padding: 26px 24px 44px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  list-style: none;
}
.gt-hero__trust li { display: flex; align-items: center; gap: 14px; margin: 0; padding: 0 24px; border-left: 1px solid rgba(255, 255, 255, 0.1); }
.gt-hero__trust li:first-child { padding-left: 0; border-left: 0; }
.gt-hero__trust li > span { display: flex; flex-direction: column; gap: 2px; min-width: 0; font-size: 0.8125rem; line-height: 1.4; color: var(--hero-muted); }
.gt-hero__trust b { font-size: 0.9375rem; font-weight: 700; color: #fff; }
.gt-ico { flex: none; width: 40px; height: 40px; color: #dbe5f2; overflow: visible; }
.gt-ico .dim { opacity: 0.5; }
.gt-ico .a { stroke: #ffd166; }
.gt-ico .soft { fill: rgba(255, 209, 102, 0.16); }
.gt-ico .af { fill: #ffd166; stroke: none; }
.gt-ico .bg { fill: #132a4f; }
.gt-ico text { fill: #132a4f; stroke: none; font-family: var(--gt-head); font-size: 6.4px; font-weight: 800; letter-spacing: 0.02em; }
.gt-ico text.num { fill: #dbe5f2; font-size: 6px; opacity: 0.75; }

/* Lớp compa động (assets/js/compass.js) phủ trên banner, không nhận chuột. */
.gt-hero .gt-compass-layer { position: absolute; inset: 0; z-index: 3; overflow: visible; pointer-events: none; }
.gt-hero .gt-arc { transition: opacity 2.6s ease; }
.gt-hero .gt-arc.is-fading { opacity: 0; }

/* Focus rõ trên nền tối và trên thẻ trắng. */
.gt-hero a:focus-visible,
.gt-hero button:focus-visible { outline: 3px solid #ffd166; outline-offset: 2px; }
.gt-shelf a:focus-visible,
.gt-shelf button:focus-visible { outline-color: var(--mlib-focus, #f2a900); }

/* Nội dung dưới banner: chừa khoảng thở (khối nổi bật cũ đã bỏ). */
.home .mlib-home { padding-top: 36px; }

/* ---------- Responsive ---------- */
@media (max-width: 1100px) {
  /* minmax(0, 1fr): chữ không xuống dòng không được đẩy cột rộng hơn màn hình (trước làm mất chữ ở mép phải). */
  .gt-hero__inner { grid-template-columns: minmax(0, 1fr); gap: 36px; padding-top: 48px; }
  .gt-hero__text { max-width: 700px; }
  .gt-hero__formula { display: none; } /* một cột: công thức nền nằm ngay sau chữ chính */
  .gt-hero__deco--graph { opacity: 0.6; }
  .gt-hero__deco--circle,
  .gt-hero__deco--protractor { display: none; }
  .gt-shelf__panel { height: 420px; }
  .gt-stage { width: 52%; }
  .gt-doccard { right: 4%; width: 340px; }
  .gt-chip--fmt { left: -14px; } /* một cột: sát mép trong, không lòi khỏi màn hình */
}
/* Điện thoại ngang: tờ đề sát lề trái, chip phụ này sẽ che chữ trên tờ nên ẩn đi. */
@media (min-width: 641px) and (max-width: 720px) {
  .gt-chip--fmt { display: none; }
}
@media (max-width: 1100px) {
  .gt-hero__trust { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .gt-hero__trust li:nth-child(odd) { padding-left: 0; border-left: 0; }
}
@media (max-width: 640px) {
  .gt-hide-sm { display: none; }
  .gt-hero__inner { gap: 30px; padding: 30px 16px 28px; }
  .gt-hero__deco--graph { width: 420px; right: -220px; top: -60px; opacity: 0.5; }
  .gt-hero__eyebrow { font-size: 0.8125rem; }
  .gt-hero__title { margin: 16px 0 12px; }
  .gt-hero__lead { margin-bottom: 22px; font-size: 1rem; }
  .gt-hero__search { border-radius: 16px; }
  .gt-hero__search button { padding: 0 20px; }
  .gt-hero__quick { flex-wrap: nowrap; overflow-x: auto; margin: 16px -16px 0 0; padding-right: 16px; scrollbar-width: none; }
  .gt-hero__quick::-webkit-scrollbar { display: none; }
  .gt-hero__quick a { flex: none; }
  .gt-hero__stats { flex-wrap: wrap; gap: 14px 30px; margin-top: 26px; } /* thiếu chỗ mới xuống dòng, luôn canh mép trái */
  .gt-hero__stats > div,
  .gt-hero__stats > div:first-child { padding: 0; border-left: 0; }
  .gt-hero__stats dd { font-size: 1.5rem; }

  .gt-shelf__bar { flex-wrap: wrap; gap: 4px 10px; }
  .gt-shelf__nav { margin-left: auto; }
  .gt-shelf__count { display: none; }
  .gt-shelf__tabs { order: 3; width: 100%; justify-content: center; margin: 0; }
  .gt-shelf__panel { height: auto; margin-top: 0; }
  .gt-stage { position: relative; width: 100%; height: 330px; }
  .gt-stage__orbit { width: 280px; height: 280px; margin: -140px 0 0 -140px; }
  .gt-stage__orbit::before { inset: 40px; }
  .gt-stage__orbit::after { width: 140px; }
  .gt-page { width: 176px; gap: 6px; padding: 14px 13px 12px; }
  .gt-page__term { font-size: 0.75rem; }
  .gt-page__q { font-size: 0.5625rem; }
  .gt-page__fig svg { width: 52px; }
  .gt-page__stamp { width: 60px; height: 60px; font-size: 1.375rem; right: -14px; }
  .gt-chip { padding: 6px 11px; font-size: 0.75rem; }
  .gt-chip--new { top: 8px; left: 0; }
  .gt-chip--views { top: 34px; right: 0; }
  .gt-chip--dl { bottom: 18px; left: 2%; }
  .gt-chip--fmt { top: auto; bottom: 30px; left: auto; right: 2%; }
  .gt-doccard { position: relative; right: auto; bottom: auto; width: auto; margin: -28px 4px 0; padding: 20px 18px 12px; }
  .gt-doccard__title { font-size: 1.125rem; }

  .gt-hero__trust { row-gap: 18px; padding: 20px 16px 32px; }
  .gt-hero__trust li { gap: 8px; padding: 0 0 0 12px; }
  .gt-hero__trust li > span { font-size: 0; }
  .gt-hero__trust b { font-size: 0.8125rem; line-height: 1.3; white-space: nowrap; }
  .gt-ico { width: 30px; height: 30px; }
}
/* Màn rất hẹp (320–359px): tiêu đề nhỏ lại cho đủ chữ, nhãn được xuống dòng thay vì bị cắt. */
@media (max-width: 359px) {
  .gt-hero__title { font-size: 1.75rem; }
  .gt-hero__search button { padding: 0 14px; }
  .gt-hero__trust b { white-space: normal; }
}

@media (prefers-reduced-motion: reduce) {
  .gt-hero *,
  .gt-hero *::before,
  .gt-hero *::after { animation: none !important; transition: none !important; }
  .gt-stage:hover .gt-stack { transform: rotate(-6deg); }
}
