/*
 * Bài viết và trang nội dung (snippets article-main, page-main). Mobile trước, máy tính từ 64em.
 * Máy tính: cột nội dung tối đa ~720px để dễ đọc; bên trái menu chính sách hoặc bên phải mục lục.
 */

.doc { padding-bottom: var(--space-7); }
.doc-main { padding: 0 var(--space-4); display: flex; flex-direction: column; gap: var(--space-4); min-width: 0; }
.doc-head { display: flex; flex-direction: column; gap: 6px; }
.doc-kicker { margin: 0; font-size: var(--text-xs); font-weight: var(--weight-strong); color: var(--color-action); text-transform: uppercase; letter-spacing: .04em; }
.doc-head h1 { margin: 0; font-size: 1.5rem; line-height: var(--leading-tight); overflow-wrap: anywhere; }
.doc-meta { margin: 0; font-size: var(--text-sm); color: var(--color-text-muted); }

.doc-promo { margin: 0; padding: var(--space-3); border-radius: var(--radius-sm); background: var(--color-surface-sunken); font-size: var(--text-sm); display: flex; gap: var(--space-2); align-items: flex-start; }
.doc-promo .icon { width: 18px; height: 18px; flex: none; margin-top: 1px; color: var(--color-text-muted); }
.doc-promo.is-on { background: var(--color-success-bg); }
.doc-promo.is-on .icon, .doc-promo.is-on strong { color: var(--color-success); }
.doc-cover { margin: 0; border-radius: var(--radius-md); overflow: hidden; background: var(--color-surface-sunken); }
.doc-cover img { display: block; width: 100%; height: auto; }

.doc-body { font-size: 1rem; line-height: 1.7; color: var(--color-text); }
.doc-body h2, .doc-body h3 { scroll-margin-top: 96px; }
.doc-body a { color: var(--color-link); }
.doc-body ul, .doc-body ol { padding-left: 1.4em; }
.doc-body table { display: block; overflow-x: auto; }
.doc-body img { max-width: 100%; }
.doc-body blockquote { margin: var(--space-4) 0; padding: var(--space-3) var(--space-4); border-left: 3px solid var(--color-action); background: var(--color-surface-alt); }
.doc-empty { margin: 0; color: var(--color-text-muted); }

/* Mục lục trên điện thoại: khung thu gọn trước nội dung */
.doc-toc { border: 1px solid var(--color-border); border-radius: var(--radius-md); background: var(--color-surface); }
.doc-toc summary { min-height: var(--tap-min); padding: 0 var(--space-4); font-weight: var(--weight-strong); list-style: none; display: flex; align-items: center; justify-content: space-between; cursor: pointer; }
.doc-toc summary::-webkit-details-marker { display: none; }
.doc-toc summary .icon { width: 18px; height: 18px; transition: transform var(--duration-base) var(--ease-out); }
.doc-toc[open] summary .icon { transform: rotate(180deg); }
.doc-toc ol, .doc-toc-side ol { margin: 0; padding: 0 var(--space-4) var(--space-3); list-style: none; display: flex; flex-direction: column; font-size: var(--text-sm); }
.doc-toc li a, .doc-toc-side li a { min-height: 36px; padding: 6px 0; color: var(--color-text); text-decoration: none; display: flex; align-items: center; line-height: var(--leading-tight); }
.doc-toc li.is-h3 a, .doc-toc-side li.is-h3 a { padding-left: var(--space-3); color: var(--color-text-muted); }
.doc-toc li a:hover, .doc-toc-side li a:hover { color: var(--color-action-hover); }
.doc-side--toc { display: none; }

/* Menu chính sách: điện thoại là hàng chip cuộn ngang */
.doc-side--nav { margin-bottom: var(--space-3); }
.doc-nav-h { margin: 0 0 var(--space-2); font-size: var(--text-xs); font-weight: var(--weight-strong); color: var(--color-text-muted); text-transform: uppercase; letter-spacing: .04em; }
.doc-side--nav .doc-nav-h { padding: 0 var(--space-4); }
.doc-nav ul { margin: 0; padding: 0 var(--space-4); list-style: none; display: flex; gap: var(--space-2); overflow-x: auto; scrollbar-width: none; }
.doc-nav ul::-webkit-scrollbar { display: none; }
.doc-nav a { min-height: 36px; padding: 0 var(--space-3); border: 1px solid var(--color-border); border-radius: var(--radius-full); background: var(--color-surface); color: var(--color-text); font-size: var(--text-sm); white-space: nowrap; text-decoration: none; display: inline-flex; align-items: center; }
.doc-nav a[aria-current="page"] { border-color: var(--color-text); background: var(--color-text); color: var(--color-surface); }

.doc-share { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2); font-size: var(--text-sm); color: var(--color-text-muted); }
.doc-share-btn { min-height: 36px; padding: 0 var(--space-3); border: 1px solid var(--color-border); border-radius: var(--radius-full); background: var(--color-surface); color: var(--color-text); font: inherit; font-size: var(--text-sm); text-decoration: none; display: inline-flex; align-items: center; gap: 6px; cursor: pointer; }
.doc-share-btn .icon { width: 16px; height: 16px; }

.doc-cta { padding: var(--space-4); border-radius: var(--radius-md); background: var(--color-secondary-bg); display: flex; flex-direction: column; gap: var(--space-3); }
.doc-cta-h { margin: 0; font-weight: var(--weight-strong); }
.doc-cta p:not(.doc-cta-h) { margin: 4px 0 0; font-size: var(--text-sm); color: var(--color-text-muted); }
.doc-cta-btns { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: var(--space-2); }
.doc-cta-btns .btn { gap: 6px; white-space: nowrap; }
.doc-cta-btns .icon { width: 18px; height: 18px; }

.doc-rel { margin-top: var(--space-6); padding: 0 var(--space-4); }
.doc-rel-hd { margin-bottom: var(--space-3); display: flex; align-items: center; justify-content: space-between; gap: var(--space-2); }
.doc-rel-hd h2 { margin: 0; font-size: var(--text-lg); }
.doc-rel-hd a { min-height: var(--tap-min); margin: -10px 0; font-size: var(--text-sm); font-weight: var(--weight-strong); text-decoration: none; display: inline-flex; align-items: center; }
.doc-rel-hd .icon { width: 16px; height: 16px; }
.doc-rel-list { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: var(--space-3); }
.doc-rel-item { color: var(--color-text); text-decoration: none; display: grid; grid-template-columns: 112px minmax(0, 1fr); grid-template-rows: auto 1fr; gap: 4px var(--space-3); }
.doc-rel-item:hover .doc-rel-title { color: var(--color-action-hover); }
.doc-rel-img { grid-row: 1 / span 2; aspect-ratio: 16 / 9; border-radius: var(--radius-sm); overflow: hidden; background: var(--color-surface-sunken); }
.doc-rel-img img { width: 100%; height: 100%; object-fit: cover; }
.doc-rel-title { font-size: var(--text-sm); font-weight: var(--weight-strong); line-height: var(--leading-tight); display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.doc-rel-date { font-size: var(--text-xs); color: var(--color-text-muted); }

/* ---------- Trang liên hệ (page.contact) ---------- */

.contact { padding-bottom: var(--space-7); }
.contact-head { padding: 0 var(--space-4) var(--space-4); }
.contact-head h1 { margin: 0 0 6px; }
.contact-head p { margin: 0; color: var(--color-text-muted); }
.contact-layout { display: flex; flex-direction: column; gap: var(--space-4); }
.contact-info, .contact-form { padding: var(--space-4); background: var(--color-surface); }
.contact-info { display: flex; flex-direction: column; gap: var(--space-4); }
.contact-quick { margin: 0; padding: 0; list-style: none; display: grid; gap: var(--space-2); }
.contact-q {
  min-height: 56px;
  padding: var(--space-2) var(--space-3);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  color: var(--color-text);
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: var(--space-3);
}
.contact-q:hover { border-color: var(--color-action); }
.contact-q > .icon { width: 24px; height: 24px; flex: none; color: var(--color-action); }
.contact-q span { display: flex; flex-direction: column; min-width: 0; font-size: var(--text-sm); color: var(--color-text-muted); overflow-wrap: anywhere; }
.contact-q b { font-size: 1rem; color: var(--color-text); }
.contact-store { display: flex; flex-direction: column; align-items: flex-start; gap: var(--space-3); }
.contact-row { margin: 0; display: flex; gap: var(--space-2); font-size: var(--text-sm); }
.contact-row .icon { width: 20px; height: 20px; flex: none; color: var(--color-text-muted); }
.contact-store .btn { gap: 6px; }
.contact-store .btn .icon { width: 18px; height: 18px; }
.contact-note { font-size: var(--text-sm); }
.contact-form h2 { margin: 0 0 var(--space-3); font-size: var(--text-lg); }
.contact-form form { display: flex; flex-direction: column; gap: var(--space-3); }
.contact-submit { width: 100%; }
.contact-fine { margin: 0; font-size: var(--text-xs); color: var(--color-text-muted); }

@media (min-width: 40em) {
  .contact-quick { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .doc-rel-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (min-width: 64em) {
  .doc { max-width: var(--page-max); margin: 0 auto; padding-left: var(--space-4); padding-right: var(--space-4); }
  .doc-layout { display: grid; grid-template-columns: minmax(0, 1fr); justify-content: start; gap: var(--space-6); align-items: start; }
  .doc-main { max-width: 760px; width: 100%; margin: 0 auto; padding: var(--space-5) var(--space-6); border-radius: var(--radius-md); background: var(--color-surface); }
  .doc-head h1 { font-size: var(--text-2xl); }
  .doc.has-toc .doc-layout { grid-template-columns: minmax(0, 760px) 280px; }
  .doc.has-toc .doc-toc { display: none; }
  .doc-side--toc { position: sticky; top: 96px; display: block; }
  .doc-side--toc[hidden] { display: none; }
  .doc-toc-side { padding: var(--space-4) 0; border-radius: var(--radius-md); background: var(--color-surface); max-height: calc(100vh - 120px); overflow-y: auto; }
  .doc-toc-side .doc-nav-h { padding: 0 var(--space-4); }
  .doc-toc-side li a { padding: 6px var(--space-2); margin: 0 calc(-1 * var(--space-2)); border-radius: var(--radius-sm); }
  .doc-toc-side li a[aria-current="true"] { color: var(--color-action); font-weight: var(--weight-strong); background: var(--color-action-bg); }

  .doc.has-nav .doc-layout { grid-template-columns: 260px minmax(0, 860px); }
  .doc.has-nav .doc-main { max-width: none; margin: 0; }
  .doc-side--nav { position: sticky; top: 96px; margin: 0; padding: var(--space-4) var(--space-2); border-radius: var(--radius-md); background: var(--color-surface); }
  .doc-side--nav .doc-nav-h { padding: 0 var(--space-3); }
  .doc-nav ul { padding: 0; flex-direction: column; gap: 2px; overflow: visible; }
  .doc-nav a { width: 100%; min-height: 40px; border: 0; border-radius: var(--radius-sm); white-space: normal; padding: 8px var(--space-3); line-height: var(--leading-tight); }
  .doc-nav a:hover { background: var(--color-surface-alt); }
  .doc-nav a[aria-current="page"] { background: var(--color-action-bg); color: var(--color-action); font-weight: var(--weight-strong); }

  .doc-cta { flex-direction: row; align-items: center; justify-content: space-between; }
  .doc-cta-btns { display: flex; }
  .doc-rel { padding: 0; max-width: 1080px; margin-left: auto; margin-right: auto; }
  .doc-rel-list { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: var(--space-4); }
  .doc-rel-item { grid-template-columns: 1fr; grid-template-rows: auto; }
  .doc-rel-img { grid-row: auto; }

  .contact { max-width: var(--page-max); margin: 0 auto; padding-left: var(--space-4); padding-right: var(--space-4); }
  .contact-head { padding: var(--space-2) 0 var(--space-5); }
  .contact-head h1 { font-size: var(--text-2xl); }
  .contact-layout { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: var(--space-5); align-items: start; }
  .contact-info, .contact-form { padding: var(--space-5); border-radius: var(--radius-md); }
  .contact-submit { width: auto; align-self: flex-start; padding-left: var(--space-6); padding-right: var(--space-6); }
}
