:root{
  --bg:#ffffff;
  --text:#0b1220;
  --muted:rgba(11,18,32,.72);
  --line:#e6e8ef;
  --card:#ffffff;
  --shadow:0 10px 30px rgba(11,18,32,.08);
  --r:14px;
  --blue:#2563eb;
}

*{box-sizing:border-box}
html,body{margin:0;padding:0}
body{
  font-family:system-ui,-apple-system,Segoe UI,Roboto,Arial,sans-serif;
  background:var(--bg);
  color:var(--text);
  line-height:1.55;
  -webkit-font-smoothing:antialiased;
  text-rendering:optimizeLegibility;

  /* chống nút chat đè footer */
  padding-bottom:90px;
}
a{color:inherit;text-decoration:none}
img{max-width:100%;display:block}

.hsgn-wrap{max-width:1180px;margin:0 auto;padding:18px 16px}

/* =========================================================
   TOP HEADER (logo + nav + search + social = 1 hàng ngang)
   ========================================================= */
.hsgn-top{
  position:sticky;
  top:0;
  z-index:80;
  background:#fff;
  border-bottom:1px solid var(--line);
}
.hsgn-top__inner{
  max-width:1180px;
  margin:0 auto;
  padding:12px 16px;
  display:grid;
  grid-template-columns:auto 1fr auto;
  gap:14px;
  align-items:center;
}

/* Brand */
.hsgn-brand{display:flex;align-items:center;gap:12px;min-width:0}
.hsgn-brand__logo{
  width:54px;height:54px;border-radius:12px;
  object-fit:cover;border:1px solid var(--line);
  background:#f3f4f6;
  flex:0 0 auto;
}
.hsgn-brand__meta{min-width:0}
.hsgn-brand__title{
  font-weight:950;
  letter-spacing:.4px;
  font-size:20px;
  line-height:1.1;
}
.hsgn-brand__sub{
  margin-top:4px;
  color:var(--muted);
  font-size:13px;
  white-space:nowrap;
  overflow:hidden;
  text-overflow:ellipsis;
  max-width:520px;
}

/* Nav */
.hsgn-nav{
  display:flex;
  gap:10px;
  align-items:center;
  justify-content:center;
  overflow-x:auto;
  -webkit-overflow-scrolling:touch;
  scrollbar-width:none;
}
.hsgn-nav::-webkit-scrollbar{display:none}
.hsgn-nav__item{
  padding:10px 14px;
  border-radius:999px;
  font-weight:900;
  border:1px solid transparent;
  white-space:nowrap;
  flex:0 0 auto;
}
.hsgn-nav__item:hover{background:#f6f7fb}
.hsgn-nav__item.is-active{
  background:#eef2ff;
  border-color:#dbeafe;
  color:#1d4ed8;
}

/* Tools */
.hsgn-tools{
  display:flex;
  align-items:center;
  gap:10px;
  justify-content:flex-end;
}

/* Search */
.hsgn-search{
  display:flex;
  align-items:center;
  gap:10px;
  background:#f6f7fb;
  border:1px solid #e5e7eb;
  border-radius:999px;
  padding:8px 10px;
  width:min(520px, 48vw);
  min-width:260px;
}
.hsgn-search__q{
  border:0;
  outline:0;
  background:transparent;
  width:100%;
  font-size:14px;
  color:var(--text);
}
.hsgn-search__q::placeholder{color:rgba(11,18,32,.45)}
.hsgn-search__btn{
  border:0;
  cursor:pointer;
  background:var(--blue);
  color:#fff;
  border-radius:999px;
  padding:10px 14px;
  display:flex;
  align-items:center;
  gap:8px;
  font-weight:950;
  box-shadow:0 10px 22px rgba(37,99,235,.22);
}
.hsgn-search__btn:hover{filter:brightness(.96)}
.hsgn-ico{opacity:.95}
.hsgn-search__txt{font-size:13px;letter-spacing:.3px;white-space:nowrap}

/* Social */
.hsgn-social{display:flex;gap:8px;align-items:center}
.hsgn-social__btn{
  width:34px;height:34px;border-radius:10px;
  display:grid;place-items:center;
  background:linear-gradient(#fff, #f6f7fb);
  border:1px solid var(--line);
  box-shadow:0 10px 18px rgba(11,18,32,.08), inset 0 1px 0 rgba(255,255,255,.9);
  font-weight:950;
  font-size:12px;
  transform:translateZ(0);
}
.hsgn-social__btn:hover{transform:translateY(-1px)}

/* HERO */
.hsgn-hero{display:grid;grid-template-columns:1fr 360px;gap:16px;margin-top:14px}
.hsgn-hero__left{min-width:0}

.hsgn-heroBig{
  border-radius:18px;overflow:hidden;position:relative;
  box-shadow:var(--shadow);border:1px solid var(--line);
  background:#fff;
}
.hsgn-heroBig__img{width:100%;height:360px;object-fit:cover}
.hsgn-heroBig__overlay{
  position:absolute;inset:auto 0 0 0;
  padding:16px;
  background:linear-gradient(to top, rgba(0,0,0,.62), rgba(0,0,0,0));
  color:#fff;
}
.hsgn-heroBig__title{margin:10px 0 0;font-size:28px;line-height:1.2;font-weight:950}
.hsgn-heroBig__meta{display:flex;gap:10px;align-items:center}

.hsgn-badge{
  display:inline-block;padding:6px 10px;border-radius:999px;
  background:rgba(255,255,255,.92);color:#0b1220;
  font-weight:950;font-size:12px;
}
.hsgn-time{font-size:12px;opacity:.92}

/* 3 mini */
.hsgn-heroSmall{display:grid;grid-template-columns:repeat(3, 1fr);gap:12px;margin-top:12px}
.hsgn-mini{
  border:1px solid var(--line);
  border-radius:16px;
  overflow:hidden;
  background:#fff;
  box-shadow:0 8px 18px rgba(11,18,32,.06);
}
.hsgn-mini__img{width:100%;height:132px;object-fit:cover}
.hsgn-mini__body{padding:10px}
.hsgn-mini__meta{display:flex;gap:8px;align-items:center;margin-bottom:8px}
.hsgn-mini__title{margin:0;font-weight:950;line-height:1.25;font-size:14px}

/* Slider */
.hsgn-slider{
  position:relative;
  border:1px solid var(--line);
  border-radius:18px;
  overflow:hidden;
  background:#fff;
  box-shadow:var(--shadow)
}
.hsgn-slider__track{display:flex;transition:transform .35s ease;will-change:transform}
.hsgn-slide{min-width:100%}
.hsgn-slide__img{width:100%;height:248px;object-fit:cover}
.hsgn-slide__body{padding:12px}
.hsgn-slide__meta{display:flex;gap:8px;align-items:center;margin-bottom:8px}
.hsgn-slide__title{margin:0;font-weight:950;line-height:1.25;font-size:18px}

.hsgn-slider__nav{
  position:absolute;top:45%;
  width:38px;height:38px;border-radius:999px;
  border:0;cursor:pointer;
  background:rgba(255,255,255,.92);
  box-shadow:0 12px 26px rgba(0,0,0,.18);
  font-size:22px;font-weight:950;
}
.hsgn-slider__nav.is-prev,[data-prev]{left:10px}
.hsgn-slider__nav.is-next,[data-next]{right:10px}
.hsgn-dots{display:flex;gap:6px;justify-content:center;padding:10px;background:#fff}
.hsgn-dot{width:8px;height:8px;border-radius:999px;border:0;background:#cbd5e1;cursor:pointer}
.hsgn-dot.is-active{background:#111827}

/* Section title */
.hsgn-section{margin-top:16px}
.hsgn-secTitle{margin:0 0 10px;font-weight:950;font-size:18px}

/* Cards grid */
.hsgn-grid{display:grid;grid-template-columns:repeat(3, 1fr);gap:12px}
.hsgn-card{
  border:1px solid var(--line);
  border-radius:16px;
  overflow:hidden;
  background:#fff;
  box-shadow:0 8px 18px rgba(11,18,32,.06);
}
.hsgn-card__media{position:relative}
.hsgn-card__media img{width:100%;height:170px;object-fit:cover}
.hsgn-card__tag{
  position:absolute;left:10px;top:10px;
  background:rgba(255,255,255,.92);
  border:1px solid #e5e7eb;
  padding:6px 10px;border-radius:999px;font-weight:950;font-size:12px;
}
.hsgn-card__body{padding:12px}
.hsgn-card__title{margin:0 0 8px;font-weight:950;line-height:1.25;font-size:16px}
.hsgn-card__meta{color:var(--muted);font-size:12px}

/* Layout + sidebar */
.hsgn-layout{display:grid;grid-template-columns:1fr 360px;gap:16px;align-items:start;margin-top:16px}
.hsgn-col{min-width:0}
.hsgn-side{position:sticky;top:132px}
.hsgn-box{
  border:1px solid var(--line);
  border-radius:16px;
  background:#fff;
  box-shadow:0 8px 18px rgba(11,18,32,.06);
  padding:12px;
  margin-bottom:12px;
}

/* Pagination list (paginate_links type=list) */
.hsgn-section ul.page-numbers,
.page-numbers{list-style:none;padding:0;margin:14px 0 0;display:flex;gap:8px;flex-wrap:wrap}
.page-numbers a,.page-numbers span{
  display:inline-block;
  padding:8px 12px;
  border:1px solid var(--line);
  border-radius:12px;
  background:#fff;
  font-weight:900;
}
.page-numbers .current{
  background:#eef2ff;
  border-color:#dbeafe;
  color:#1d4ed8;
}

/* Floating button */
.hsgn-fab{
  position:fixed;
  right:18px;
  bottom:18px;
  z-index:9999;
  border:0;
  cursor:pointer;
  background:var(--blue);
  color:#fff;
  padding:14px 16px;
  border-radius:999px;
  font-weight:950;
  box-shadow:0 18px 40px rgba(37,99,235,.35);
}
.hsgn-fab:hover{filter:brightness(.96)}

/* CHỈ GIỮ 1 NÚT CHAT (tránh bị nhân đôi do footer.php có button + a) */
a.hsgn-fab{display:none !important;}

/* Footer */
.hsgn-footer{
  border-top:1px solid var(--line);
  background:#fff;
  margin-top:24px;

  /* thêm khoảng thở để không bị nút chat đè */
  padding-bottom:10px;
}

/* footer: copyright trái + links GIỮA */
.hsgn-footer__inner{
  max-width:1180px;
  margin:0 auto;
  padding:16px 16px;

  display:grid;
  grid-template-columns:1fr auto 1fr;
  align-items:center;
  gap:12px;

  color:var(--muted);
}
.hsgn-footer__inner > div:first-child{justify-self:start}
.hsgn-footer__links{
  justify-self:center;
  display:flex;
  gap:14px;
  align-items:center;
}
.hsgn-footer__links a{font-weight:950;color:#0b1220}

/* Responsive */
@media (max-width:1100px){
  .hsgn-top__inner{grid-template-columns:1fr;align-items:start}
  .hsgn-nav{justify-content:flex-start}
  .hsgn-tools{justify-content:flex-start;flex-wrap:wrap}
  .hsgn-search{width:100%;min-width:unset}
  .hsgn-layout{grid-template-columns:1fr}
  .hsgn-side{position:static}
  .hsgn-hero{grid-template-columns:1fr}
  .hsgn-heroSmall{grid-template-columns:repeat(3,1fr)}
  .hsgn-grid{grid-template-columns:repeat(2,1fr)}

  /* footer mobile: xếp dọc cho đẹp */
  .hsgn-footer__inner{
    grid-template-columns:1fr;
    justify-items:start;
  }
  .hsgn-footer__links{justify-self:start}
}
@media (max-width:640px){
  .hsgn-brand__sub{display:none}
  .hsgn-heroBig__img{height:260px}
  .hsgn-heroBig__title{font-size:22px}
  .hsgn-heroSmall{grid-template-columns:1fr}
  .hsgn-mini__img{height:180px}
  .hsgn-grid{grid-template-columns:1fr}
  .hsgn-card__media img{height:190px}
  .hsgn-search__txt{display:none}
}

/* Screen reader */
.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;
}
.hsgn-box--utility{
  background:linear-gradient(180deg,#ffffff,#f8fafc);
}

.hsgn-util{
  display:flex;
  flex-direction:column;
  gap:12px;
}

.hsgn-util__item{
  padding:12px;
  border-radius:12px;
  background:#fff;
  border:1px solid var(--line);
  box-shadow:0 6px 14px rgba(11,18,32,.06);
  font-size:14px;
}

.hsgn-util__sub{
  color:var(--muted);
  font-size:12px;
  margin-top:4px;
}
/* ===========================
   IMPACT BOX (Single)
   =========================== */
.hsgn-impact{
  border:1px solid var(--line);
  border-radius:14px;
  padding:10px 12px;
  margin:10px 0 14px;
  font-size:14px;
  line-height:1.45;
  background:#f7f7fb;
}

.hsgn-impact--high{ background:#fff5f5; border-color:#ffe2e2; }
.hsgn-impact--mid { background:#fff8e6; border-color:#ffe7b3; }
.hsgn-impact--low { background:#f1fff3; border-color:#c9f2d1; }
/* ===========================
   Impact dot (Cards + Hero)
   =========================== */
.hsgn-impDot{
  display:inline-grid;
  place-items:center;
  width:28px;height:28px;
  border-radius:999px;
  border:1px solid rgba(11,18,32,.10);
  background:rgba(255,255,255,.92);
  box-shadow:0 10px 20px rgba(11,18,32,.10);
  font-size:14px;
}

/* Card: dot nằm góc phải trên thumbnail */
.hsgn-card__media .hsgn-impDot{
  position:absolute;
  right:10px; top:10px;
  z-index:2;
}

/* Hero meta: dot nằm trước badge */
.hsgn-heroBig__meta .hsgn-impDot,
.hsgn-mini__meta .hsgn-impDot,
.hsgn-slide__meta .hsgn-impDot{
  margin-right:6px;
}
/* ===========================
   RELATED POSTS (Single)
   =========================== */
.hsgn-related{
  margin:16px 0 18px;
  padding:12px;
  border:1px solid var(--line);
  border-radius:16px;
  background:#fff;
  box-shadow:0 8px 18px rgba(11,18,32,.06);
}
.hsgn-related__title{
  margin:0 0 10px;
  font-weight:950;
  font-size:16px;
}
.hsgn-related__grid{
  display:grid;
  grid-template-columns:repeat(2, 1fr);
  gap:12px;
}
.hsgn-related__item{
  display:grid;
  grid-template-columns:120px 1fr;
  gap:10px;
  align-items:start;
  border:1px solid var(--line);
  border-radius:14px;
  overflow:hidden;
  background:#fff;
  box-shadow:0 6px 14px rgba(11,18,32,.06);
}
.hsgn-related__item:hover{transform:translateY(-1px)}
.hsgn-related__item img{
  width:100%;
  height:92px;
  object-fit:cover;
  display:block;
}
.hsgn-related__body{padding:10px}
.hsgn-related__name{
  font-weight:950;
  line-height:1.25;
  font-size:14px;
  margin:0 0 6px;
}
.hsgn-related__time{
  font-size:12px;
  color:var(--muted);
}

/* Mobile: 1 cột */
@media (max-width:640px){
  .hsgn-related__grid{grid-template-columns:1fr}
  .hsgn-related__item{grid-template-columns:110px 1fr}
  .hsgn-related__item img{height:86px}
}
/* ===========================
   RELATED CTA (Single)
   =========================== */
.hsgn-related__cta{
  margin-top:12px;
  padding-top:12px;
  border-top:1px solid var(--line);
  display:flex;
  gap:10px;
  align-items:center;
  justify-content:space-between;
  flex-wrap:wrap;
}
.hsgn-ctaChat{
  border:0;
  cursor:pointer;
  background:var(--blue);
  color:#fff;
  padding:12px 14px;
  border-radius:999px;
  font-weight:950;
  box-shadow:0 12px 26px rgba(37,99,235,.25);
}
.hsgn-ctaChat:hover{filter:brightness(.96)}
.hsgn-related__sub{
  color:var(--muted);
  font-size:12px;
  line-height:1.4;
}
/* ===========================
   DUAL CHAT (AI + ZALO)
   =========================== */
.hsgn-chat-dual{
  display:flex;
  gap:10px;
  flex-wrap:wrap;
  margin:14px 0 6px;
}
.hsgn-chat-ai,
.hsgn-chat-zalo{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  gap:8px;
  padding:12px 14px;
  border-radius:999px;
  font-weight:950;
  text-decoration:none;
  border:1px solid var(--line);
  cursor:pointer;
}
.hsgn-chat-ai{
  background:var(--blue);
  color:#fff;
  border-color:transparent;
  box-shadow:0 12px 26px rgba(37,99,235,.24);
}
.hsgn-chat-ai:hover{filter:brightness(.96)}
.hsgn-chat-zalo{
  background:#fff;
  color:var(--text);
}
.hsgn-chat-zalo:hover{background:#f6f7fb}
/* ảnh card/hero luôn giữ tỉ lệ, không méo */
.hsgn-card img,
.hsgn-hero img,
.hsgn-thumb img{
  width:100%;
  height:100%;
  object-fit:cover;
  display:block;
}
/* =========================
   FIX: Card/Slider images (no broken layout)
   ========================= */
.hsgn-card img,
.hsgn-related__item img,
.hsgn-heroimg img{
  width:100%;
  height:100%;
  display:block;
  object-fit:cover;
}

/* Nếu khung ảnh đang bị chiều cao quá thấp */
.hsgn-card__thumb,
.hsgn-related__item img,
.hsgn-heroimg{
  aspect-ratio: 16 / 9;
  overflow:hidden;
  border-radius:14px;
}

/* Fallback nếu browser không hỗ trợ aspect-ratio: */
.hsgn-card__thumb{ position:relative; }
.hsgn-card__thumb::before{ content:""; display:block; padding-top:56.25%; }
.hsgn-card__thumb > img{
  position:absolute; inset:0;
}
