/*
 * Blog + Document single đọc — header/footer site giữ tông tối như mọi
 * trang, chỉ vùng .article-shell đổi tông sáng. Token light dùng chung được
 * khai trong `.bess-light-surface` tại base.css; tokens.css vẫn chỉ giữ dark.
 * --teal vẫn dùng chung từ tokens.css vì đó là màu thương hiệu, không phải
 * token theo theme sáng/tối.
 */

/* Header dính khai ở base.css (`.bess-single-blog .site-header`) — fixed + chỗ
 * trống cố định trên body, không phải sticky. Xem comment ở đó trước khi đổi. */

.article-shell {
  background: var(--panel-bg);
  color: var(--panel-ink);
  padding-block: 84px;
}

/*
 * Lề đọc lấy từ --gutter (tokens.css) nên tự co theo bậc màn hình — bản
 * trước cố định 24px mỗi bên rồi phải thêm 1 breakpoint riêng chỉ để đổi
 * thành 16px. Nhân 1.5 vì đây là vùng đọc dài, cần lề rộng hơn lề trang.
 */
.article-shell .article-shell-inner {
  width: min(100% - var(--gutter) * 1.5, 720px);
  margin-inline: auto;
}

.article-kicker {
  margin: 0 0 14px;
  color: var(--panel-muted);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.article-title {
  margin: 0 0 16px;
  color: var(--panel-ink);
  font-size: clamp(28px, 4vw, 44px);
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1.15;
}

.article-meta { margin: 0 0 28px; color: var(--panel-muted); font-size: 13px; }

.article-image { width: 100%; height: auto; border-radius: 10px; margin-bottom: 32px; }

.article-body { color: var(--panel-body); font-size: 17px; line-height: 1.75; }
.article-body p { margin: 0 0 20px; }
.article-body h2, .article-body h3 { margin: 36px 0 16px; color: var(--panel-ink); font-weight: 800; letter-spacing: -0.01em; }
.article-body h2 { font-size: 26px; }
.article-body h3 { font-size: 21px; }
/*
 * Chỉ link chữ trong prose mới gạch chân. Phải loại trừ .bess-button: khối khoá
 * (article-locked.php) được render VÀO $body_html rồi in bên trong .article-body,
 * nên CTA "Mua gói thành viên" cũng là <a> con của .article-body. Không loại trừ
 * thì `.article-body a` (0,1,1) thắng `.bess-button` (0,1,0) và nút bị gạch chân,
 * nhưng `.bess-button:hover` (0,2,0) lại thắng ngược nên gạch chân biến mất khi
 * hover — vi phạm quy tắc nút của UI-DESIGN-STANDARDS.md §6.3.
 */
.article-body a:not(.bess-button) { color: var(--panel-ink); text-decoration: underline; text-underline-offset: 2px; }
.article-body ul, .article-body ol { margin: 0 0 20px; padding-left: 22px; }
.article-body li { margin-bottom: 8px; }
.article-body blockquote { margin: 28px 0; padding-left: 20px; border-left: 3px solid var(--panel-line); color: var(--panel-muted); font-style: italic; }
.article-body img { max-width: 100%; height: auto; border-radius: 8px; }

.article-actions {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  margin-top: 72px;
  padding-block: 24px;
  border-block: 1px solid var(--panel-line);
}

.article-action {
  display: flex;
  min-width: 0;
  min-height: 72px;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 8px;
  padding: 8px;
  border: 0;
  color: var(--panel-ink);
  background: transparent;
  font: inherit;
  font-size: 12px;
  font-weight: 600;
  text-align: center;
  cursor: pointer;
  transition: opacity 180ms ease;
}

.article-action:hover { color: var(--panel-ink); background: transparent; opacity: 0.58; }
.article-action__icon { display: grid; width: 28px; height: 28px; place-items: center; font-size: 27px; line-height: 1; }
.article-action__icon--brand { font-family: var(--font-sans); font-size: 27px; font-weight: 700; }
.article-action__icon--linkedin { font-size: 21px; letter-spacing: -0.08em; }
.article-action__icon--x { font-size: 24px; font-weight: var(--font-weight-semibold); }

.article-recommendations {
  color: var(--panel-ink);
}

.article-recommendations h2 {
  margin: 0 0 28px;
  padding-top: 72px;
  color: var(--panel-ink);
  font-size: clamp(24px, 3vw, 32px);
  font-weight: 800;
  letter-spacing: -0.025em;
}

.article-recommendations .article-card { display: block; min-width: 0; transition: transform 180ms ease; }
.article-recommendations .article-card:hover { transform: translateY(-3px); }
.article-recommendations .card-thumbnail { overflow: hidden; border-radius: 12px; background: var(--panel-line); }
.article-recommendations .card-thumbnail img { display: block; width: 100%; height: auto; }
.article-recommendations .card-title { display: -webkit-box; overflow: hidden; margin: 16px 0 0; color: var(--panel-ink); font-size: 16px; font-weight: 700; line-height: 1.42; -webkit-box-orient: vertical; -webkit-line-clamp: 3; }
.article-recommendations .card-excerpt { display: -webkit-box; min-height: 44px; overflow: hidden; margin: 8px 0 0; color: var(--panel-muted); font-size: 13px; line-height: 1.65; -webkit-box-orient: vertical; -webkit-line-clamp: 2; }

.article-notice.access-gate {
  max-width: none;
  margin-top: 8px;
  border-color: var(--panel-line);
}
.article-notice .access-gate__copy { width: 100%; }
/* `.article-body h2/p` có specificity cao hơn style component trong base.css;
   giữ nhịp chữ canonical của access-gate thay vì nhận nhịp prose dài. */
.article-notice .access-gate__title { margin: 20px 0 0; font-size: clamp(19px, 2vw, 24px); line-height: 1.3; }
.article-notice .access-gate__body { margin: 10px 0 0; font-size: 14px; line-height: 1.65; }

/* ==================================================
   Responsive — thang bậc 1279 / 1023 / 767 / 479 (tokens.css)
   Trang một cột, chỉ cần hạ bậc chữ; bề ngang đã do --gutter lo.
   ================================================== */

@media (max-width: 767px) {
  .article-shell { margin-top: 48px; padding-block: clamp(32px, 6vw, 48px) var(--space-section); }
  .article-shell .article-shell-inner { width: min(calc(100% - 40px), 720px); }
  .article-kicker { margin-bottom: 10px; font-size: 11px; }
  .article-title { margin-bottom: 12px; }
  .article-meta { margin-bottom: 22px; font-size: 12px; }
  .article-image { margin-bottom: 24px; border-radius: 8px; }

  /* 17px/1.75 là cỡ đọc cho cột 720px; ở ~340px thì 16px/1.72 cho số ký tự
     mỗi dòng hợp lý hơn (khoảng 40 ký tự thay vì 34). */
  .article-body { font-size: 16px; line-height: 1.72; }
  .article-body h2, .article-body h3 { margin: 28px 0 12px; }
  .article-body h2 { font-size: 22px; }
  .article-body h3 { font-size: 19px; }
  .article-body blockquote { margin: 22px 0; padding-left: 16px; }
	.article-actions { grid-template-columns: repeat(6, minmax(0, 1fr)); margin-top: 42px; padding-block: 12px; }
	.article-action { min-height: 52px; gap: 4px; padding: 4px 1px; font-size: 9px; }
	.article-action__icon { width: 20px; height: 20px; font-size: 20px; }
	.article-action__icon--linkedin { font-size: 15px; }
	.article-action__icon--x { font-size: 18px; }
	.article-recommendations h2 { margin-bottom: 22px; padding-top: 32px; }
	.article-recommendations .content-grid { row-gap: 36px; }
	.article-recommendations .card-thumbnail { border-radius: 10px; }

  .article-notice.access-gate { min-height: 320px; padding: 32px 20px; }
  /* CTA full width — hành động duy nhất ở cuối bài, không có lý do co lại. */
  .article-notice .access-gate__cta { display: flex; width: 100%; justify-content: center; min-height: var(--tap-min); }
}

@media (max-width: 479px) {
  .article-recommendations .content-grid { row-gap: 40px; }
  .article-recommendations .card-thumbnail { border-radius: 8px; }
}

/* ==================================================
   Lớp cảm ứng — xem base.css để biết vì sao dùng (hover: none)
   ================================================== */

@media (hover: none) {
	.article-action:hover { color: var(--panel-ink); background: transparent; opacity: 1; }
	.article-recommendations .article-card:hover { transform: none; }
  .article-notice .access-gate__cta:hover { transform: none; }
}

@media print {
  .site-header,
  .site-footer,
  .article-actions,
  .article-recommendations,
  .cta-bar { display: none !important; }

  /* Header bị ẩn khi in — bỏ luôn chỗ trống dành cho nó (base.css). */
  .bess-single-blog { padding-top: 0; }

  .article-shell { padding: 0; }
  .article-shell .article-shell-inner { width: 100%; }
}
.article-context-back { margin: 0 0 28px; }
.article-context-back a {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: var(--brand-dark, #126b62);
  font-size: 13px;
  font-weight: 700;
  line-height: 1.4;
  text-decoration: none;
}
.article-context-back a .material-symbols-outlined { width: 18px; height: 18px; flex: 0 0 18px; font-size: 18px; }
.article-context-back a:hover { color: #0d5a53; text-decoration: none; transform: translateX(-2px); }
.article-context-back a:focus-visible { border-radius: 2px; outline: 2px solid currentColor; outline-offset: 4px; }
