/* ============================================================
   XGO Care — blog.css · "Góc sức khỏe" hub + bài viết
   (nạp sau main.css; dùng lại design tokens trong :root của main.css)
   Tham chiếu cấu trúc Long Châu, phối lại theo nhận diện XGO Care.
   ============================================================ */

/* ---------- Thanh tiến trình đọc (fixed top) ---------- */
.read-progress { position: fixed; top: 0; left: 0; height: 3px; width: 0; z-index: 90;
  background: linear-gradient(90deg, var(--blue), var(--green)); transition: width .1s linear; }

/* ---------- Tabs chủ đề (hub + archive) ---------- */
.hub-tabs { background: #fff; border-bottom: 1px solid var(--line); }
.hub-tabs .container { display: flex; gap: 6px; overflow-x: auto; padding: 10px 0; scrollbar-width: thin; }
.hub-tabs a { white-space: nowrap; padding: 8px 16px; border-radius: var(--r-pill); font-weight: 600;
  font-size: .9rem; color: var(--ink); background: var(--bg-soft); border: 1px solid transparent; }
.hub-tabs a:hover { background: var(--bg-soft-2); color: var(--blue); }
.hub-tabs a.is-active { background: var(--blue); color: #fff; }

/* ---------- Hero nổi bật ---------- */
.hub-hero { display: grid; grid-template-columns: 1.5fr 1fr; gap: 18px; margin-bottom: 26px; }
.hub-hero__main { position: relative; border-radius: var(--r-lg); overflow: hidden; min-height: 320px;
  display: flex; align-items: flex-end; color: #fff; box-shadow: var(--shadow-sm); background: var(--navy); }
.hub-hero__main img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.hub-hero__main::after { content: ""; position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(20,30,55,0) 35%, rgba(20,30,55,.85) 100%); }
.hub-hero__main .cap { position: relative; z-index: 1; padding: 26px; }
.hub-hero__main .cap .acard__cat { background: rgba(255,255,255,.92); }
.hub-hero__main h2 { color: #fff; font-size: clamp(1.2rem, 2.4vw, 1.6rem); margin: 10px 0 6px; }
.hub-hero__main h2 a { color: inherit; }
.hub-hero__main .meta { color: rgba(255,255,255,.85); font-size: .82rem; }
.hub-hero__list { display: grid; gap: 12px; align-content: start; }

/* ---------- Thẻ bài viết ---------- */
.acard { background: #fff; border: 1px solid var(--line); border-radius: var(--r); overflow: hidden;
  display: flex; flex-direction: column; transition: box-shadow .2s, transform .15s; }
.acard:hover { box-shadow: var(--shadow); transform: translateY(-3px); }
.acard__thumb { display: block; aspect-ratio: 16/10; background: var(--bg-soft); overflow: hidden; }
.acard__thumb img { width: 100%; height: 100%; object-fit: cover; }
.acard__body { padding: 14px 16px; display: flex; flex-direction: column; gap: 8px; flex: 1; }
.acard__cat { align-self: flex-start; font-size: .72rem; font-weight: 700; color: var(--blue);
  background: var(--bg-soft-2); padding: 3px 10px; border-radius: var(--r-pill); }
.acard__title { font-size: 1.02rem; line-height: 1.35; margin: 0; color: var(--navy);
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.acard__title a { color: inherit; }
.acard__excerpt { font-size: .86rem; color: var(--muted); flex: 1;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.acard__meta { font-size: .78rem; color: var(--muted); display: flex; gap: 8px; align-items: center; }
.acard__meta .sep { color: var(--line); }

/* Biến thể hàng ngang (hero list + sidebar) */
.acard--row { flex-direction: row; align-items: stretch; }
.acard--row .acard__thumb { flex: none; width: 116px; aspect-ratio: 1/1; align-self: stretch; }
.acard--row .acard__body { padding: 10px 12px; gap: 5px; }
.acard--row .acard__title { font-size: .92rem; -webkit-line-clamp: 3; }

/* ---------- Lưới + layout hub ---------- */
.hub-layout { display: grid; grid-template-columns: minmax(0,1fr) 320px; gap: 26px; align-items: start; }
.section-head { display: flex; align-items: center; justify-content: space-between; margin: 0 0 16px; }
.section-head h2 { font-size: 1.25rem; margin: 0; position: relative; padding-left: 14px; }
.section-head h2::before { content: ""; position: absolute; left: 0; top: 2px; bottom: 2px; width: 4px;
  border-radius: var(--r-pill); background: var(--blue); }
.section-head .see-all { color: var(--blue); font-weight: 700; font-size: .88rem; }
.acard-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px,1fr)); gap: 18px; }

/* ---------- Sidebar ---------- */
.side-widget { background: #fff; border: 1px solid var(--line); border-radius: var(--r-lg); padding: 16px 18px; margin-bottom: 18px; }
.side-widget__title { font-size: 1.02rem; color: var(--navy); margin: 0 0 12px; padding-bottom: 10px; border-bottom: 1px solid var(--line); }
.side-rank { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
.side-rank li { display: flex; gap: 11px; align-items: flex-start; }
.side-rank .n { flex: none; width: 24px; height: 24px; border-radius: var(--r-pill); display: grid; place-items: center;
  font-size: .78rem; font-weight: 800; background: var(--bg-soft-2); color: var(--blue); }
.side-rank li:nth-child(1) .n { background: var(--blue); color: #fff; }
.side-rank li:nth-child(2) .n { background: #5B8DD6; color: #fff; }
.side-rank li:nth-child(3) .n { background: #8FB4E6; color: #fff; }
.side-rank a { color: var(--ink); font-size: .9rem; line-height: 1.4; font-weight: 500;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.side-rank a:hover { color: var(--blue); }
.topic-list { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.topic-list a { font-size: .85rem; font-weight: 600; color: var(--ink); background: var(--bg-soft);
  padding: 7px 13px; border-radius: var(--r-pill); }
.topic-list a:hover { background: var(--blue); color: #fff; }
.topic-list .count { color: var(--muted); font-weight: 400; }
.topic-list a:hover .count { color: rgba(255,255,255,.85); }

/* Promo sản phẩm trong sidebar */
.side-promo { border: 1px solid var(--line); border-radius: var(--r-lg); overflow: hidden;
  background: linear-gradient(180deg, var(--bg-soft-2), #fff 70%); padding: 18px; text-align: center; }
.side-promo img { width: 100%; max-width: 180px; aspect-ratio: 1/1; object-fit: contain; margin: 0 auto 10px; }
.side-promo b { display: block; color: var(--navy); font-size: 1rem; margin-bottom: 4px; }
.side-promo span { display: block; color: var(--muted); font-size: .83rem; margin-bottom: 12px; }

/* ---------- Trang bài viết đơn ---------- */
.article-head { background: linear-gradient(120deg, #EAF4FB, #fff); border-bottom: 1px solid var(--line); }
.article-head .container { padding: 22px 0 24px; max-width: 820px; }
.article-head__cat { display: inline-block; font-size: .76rem; font-weight: 700; color: #fff;
  background: var(--blue); padding: 4px 12px; border-radius: var(--r-pill); margin-bottom: 12px; }
.article-head h1 { font-size: clamp(1.5rem, 3.2vw, 2.1rem); line-height: 1.25; margin: 0 0 14px; }
.article-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; color: var(--muted); font-size: .86rem; }
.article-meta .who { display: inline-flex; align-items: center; gap: 8px; }
.article-meta .avatar { width: 30px; height: 30px; border-radius: var(--r-pill); background: var(--navy); color: #fff;
  display: grid; place-items: center; font-weight: 800; font-size: .85rem; }
.article-meta .who b { color: var(--ink); font-weight: 700; }
.article-meta .dot { width: 4px; height: 4px; border-radius: var(--r-pill); background: var(--line); }
.article-meta .ico { display: inline-flex; align-items: center; gap: 5px; }

.article-grid { display: grid; grid-template-columns: minmax(0,1fr) 320px; gap: 30px; align-items: start; }
.article-main { max-width: 760px; }
.article-cover { border-radius: var(--r-lg); overflow: hidden; margin: 0 0 20px; }
.article-cover img { width: 100%; display: block; }

/* Mục lục */
.toc { background: var(--bg-soft); border: 1px solid var(--line); border-left: 4px solid var(--blue);
  border-radius: var(--r); padding: 14px 18px; margin: 0 0 22px; }
.toc__title { display: flex; align-items: center; gap: 8px; font-weight: 800; color: var(--navy); margin-bottom: 8px; font-size: .96rem; }
.toc ol { margin: 0; padding-left: 20px; display: grid; gap: 6px; }
.toc a { color: var(--ink); font-size: .9rem; line-height: 1.4; }
.toc a:hover, .toc a.is-active { color: var(--blue); font-weight: 600; }

/* Thân bài (kế thừa .prose, thêm tinh chỉnh) */
.article-body { color: var(--ink); line-height: 1.75; font-size: 1.02rem; }
.article-body h2 { scroll-margin-top: 120px; font-size: 1.32rem; margin: 30px 0 12px; }
.article-body h3 { scroll-margin-top: 120px; }
.article-body figure { margin: 18px 0; }
.article-body figure img, .article-body > img { border-radius: var(--r); width: 100%; }
.article-body figcaption { text-align: center; font-size: .82rem; color: var(--muted); margin-top: 8px; }
.article-body blockquote { margin: 18px 0; padding: 14px 18px; background: var(--bg-soft);
  border-left: 4px solid var(--green); border-radius: 0 var(--r) var(--r) 0; color: var(--navy); font-style: italic; }

/* Tags */
.article-tags { display: flex; flex-wrap: wrap; gap: 8px; margin: 26px 0; padding-top: 18px; border-top: 1px solid var(--line); }
.article-tags .lbl { color: var(--muted); font-size: .86rem; align-self: center; margin-right: 2px; }
.article-tags a { font-size: .82rem; font-weight: 600; color: var(--blue); background: var(--bg-soft-2);
  padding: 6px 13px; border-radius: var(--r-pill); }
.article-tags a:hover { background: var(--blue); color: #fff; }

/* Khuyến cáo y tế */
.med-disclaimer { display: flex; gap: 12px; background: #FFF8EC; border: 1px solid #F4E2BC;
  border-radius: var(--r); padding: 14px 16px; margin: 22px 0; font-size: .86rem; color: #7A5A1E; }
.med-disclaimer svg { flex: none; color: #C98A12; margin-top: 1px; }

/* Hộp tác giả */
.author-box { display: flex; gap: 14px; align-items: flex-start; background: var(--bg-soft);
  border: 1px solid var(--line); border-radius: var(--r-lg); padding: 16px 18px; margin: 24px 0; }
.author-box .avatar { flex: none; width: 52px; height: 52px; border-radius: var(--r-pill); background: var(--navy);
  color: #fff; display: grid; place-items: center; font-weight: 800; font-size: 1.2rem; }
.author-box b { color: var(--navy); }
.author-box .role { color: var(--muted); font-size: .82rem; }
.author-box p { margin: 6px 0 0; font-size: .88rem; color: var(--ink); }

/* Bài liên quan */
.related-posts { margin-top: 34px; }
.related-posts .acard-grid { grid-template-columns: repeat(auto-fill, minmax(220px,1fr)); }

/* ---------- Responsive ---------- */
@media (max-width: 980px) {
  .hub-layout, .article-grid { grid-template-columns: 1fr; }
  .article-side, .hub-aside { order: 2; }
  .hub-hero { grid-template-columns: 1fr; }
  .hub-hero__main { min-height: 240px; }
  .article-main { max-width: none; }
}
@media (max-width: 560px) {
  .acard--row .acard__thumb { width: 96px; }
}
