/* ==========================================================================
   ĐI MỘT LẦN — Hệ thống thiết kế
   Nguồn duy nhất cho màu, chữ, khoảng cách và các khối lặp lại.
   Sửa file này, không sửa rải rác trong Elementor.
   ========================================================================== */

:root {
  /* Màu — theo cẩm nang nhận diện */
  --dml-muc:        #253029;  /* Nền tối, chữ chính */
  --dml-xothom:     #6E8B7A;  /* Màu chủ đạo */
  --dml-xothom-nhat:#B9CBBE;  /* Nền phụ, chữ trên nền tối */
  --dml-datnung:    #B85042;  /* Điểm nhấn — dưới 5% diện tích */
  --dml-cat:        #EAE4D9;  /* Nền thẻ nội dung */
  --dml-giay:       #FBFAF8;  /* Nền trang */
  --dml-chu-phu:    #5F6B63;  /* Chữ phụ, chú thích */
  --dml-vien:       #DDD8CD;

  /* Màu riêng của mùa — chỉ dùng ở nhãn mùa và tiêu đề chuyên mục */
  --dml-mua:        #1F6F5C;  /* Mùa 1 · Sri Lanka */

  /* Chữ */
  --dml-font:  'Be Vietnam Pro', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;

  --dml-h1:    clamp(2.05rem, 1.35rem + 2.6vw, 3.1rem);
  --dml-h2:    clamp(1.45rem, 1.15rem + 1.1vw, 1.95rem);
  --dml-h3:    clamp(1.15rem, 1.02rem + 0.5vw, 1.35rem);
  --dml-body:  1.125rem;   /* 18px */
  --dml-small: 0.9375rem;  /* 15px */
  --dml-caption:0.8125rem; /* 13px */

  /* Khoảng cách — thang 4px */
  --dml-s1: 0.5rem;  --dml-s2: 1rem;   --dml-s3: 1.5rem;
  --dml-s4: 2rem;    --dml-s5: 3rem;   --dml-s6: 4.5rem;
  --dml-s7: 7rem;

  --dml-prose: 68ch;  /* Bề rộng cột chữ tối đa */
}

/* --------------------------------------------------------------------------
   1. Nền tảng
   -------------------------------------------------------------------------- */

body {
  background: var(--dml-giay);
  color: var(--dml-muc);
  font-family: var(--dml-font);
  font-size: var(--dml-body);
  line-height: 1.75;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

h1, h2, h3, h4 {
  font-family: var(--dml-font);
  color: var(--dml-muc);
  text-wrap: balance;
}

h1 { font-size: var(--dml-h1); font-weight: 700; line-height: 1.14; letter-spacing: -0.4px; margin: 0 0 var(--dml-s3); }
h2 { font-size: var(--dml-h2); font-weight: 600; line-height: 1.28; margin: var(--dml-s5) 0 var(--dml-s2); }
h3 { font-size: var(--dml-h3); font-weight: 600; line-height: 1.4;  margin: var(--dml-s4) 0 var(--dml-s1); }

p, ul, ol { max-width: var(--dml-prose); }
p { margin: 0 0 var(--dml-s3); }

a { color: var(--dml-mua); text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { color: var(--dml-datnung); }

strong { font-weight: 600; }

/* Không dùng chữ in hoa toàn phần cho đoạn văn tiếng Việt — chỉ cho nhãn ngắn */
.dml-eyebrow {
  font-size: var(--dml-caption);
  font-weight: 500;
  letter-spacing: 0.9px;
  text-transform: uppercase;
  color: var(--dml-chu-phu);
  margin: 0 0 var(--dml-s2);
  display: block;
}

/* --------------------------------------------------------------------------
   2. Nhãn mùa — chi tiết lặp lại trên mọi kênh
   -------------------------------------------------------------------------- */

.dml-season {
  display: inline-flex; align-items: center; justify-content: center;
  gap: 0.4em;
  min-height: 2.25rem; padding: 0 0.95rem;
  border: 1px solid var(--dml-mua);
  border-radius: 999px;
  font-size: var(--dml-caption); font-weight: 500; letter-spacing: 0.6px;
  color: var(--dml-mua);
  text-decoration: none;
}
.dml-season--onDark { border-color: var(--dml-xothom-nhat); color: var(--dml-xothom-nhat); }

/* --------------------------------------------------------------------------
   3. Khối meta dưới H1 — nguồn và ngày cập nhật
      Đây là định vị của thương hiệu, cô đọng trong một dòng.
   -------------------------------------------------------------------------- */

.dml-meta {
  display: flex; flex-wrap: wrap; align-items: center;
  gap: 0.5rem 1rem;
  max-width: var(--dml-prose);
  margin: 0 0 var(--dml-s4);
  padding: 0 0 var(--dml-s2);
  border-bottom: 1px solid var(--dml-vien);
  font-size: var(--dml-small);
  color: var(--dml-chu-phu);
  line-height: 1.5;
}
.dml-meta > * + *::before {
  content: '·'; margin-right: 1rem; color: var(--dml-vien);
}
.dml-meta a { color: var(--dml-chu-phu); }

/* Đoạn mở — câu trả lời trước, giải thích sau */
.dml-lede {
  font-size: clamp(1.15rem, 1.05rem + 0.4vw, 1.3rem);
  line-height: 1.6;
  color: var(--dml-muc);
  max-width: 60ch;
  margin: 0 0 var(--dml-s4);
}

/* --------------------------------------------------------------------------
   4. Bảng số liệu — nền cát, cuộn ngang trên mobile
   -------------------------------------------------------------------------- */

.dml-table-wrap {
  max-width: 100%;
  margin: var(--dml-s4) 0;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}
.dml-table-wrap table, table.dml-table {
  width: 100%; min-width: 34rem;
  border-collapse: collapse;
  background: var(--dml-cat);
  font-size: var(--dml-small);
}
.dml-table-wrap th, table.dml-table th {
  text-align: left; font-weight: 600;
  padding: 0.85rem 1rem;
  border-bottom: 1.5px solid var(--dml-muc);
  white-space: nowrap;
}
.dml-table-wrap td, table.dml-table td {
  padding: 0.8rem 1rem;
  border-bottom: 1px solid rgba(37,48,41,0.12);
  vertical-align: top;
}
.dml-table-wrap tr:last-child td { border-bottom: 0; }
.dml-num { font-variant-numeric: tabular-nums; white-space: nowrap; }
.dml-table-note {
  font-size: var(--dml-caption); color: var(--dml-chu-phu);
  margin-top: calc(var(--dml-s2) * -1 + 0.25rem);
}

/* --------------------------------------------------------------------------
   5. Khối "Cách xử lý" — viền trái màu đất nung
   -------------------------------------------------------------------------- */

.dml-note {
  max-width: var(--dml-prose);
  margin: var(--dml-s4) 0;
  padding: 0.2rem 0 0.2rem var(--dml-s3);
  border-left: 3px solid var(--dml-datnung);
}
.dml-note > :last-child { margin-bottom: 0; }
.dml-note-label {
  display: block;
  font-size: var(--dml-caption); font-weight: 600; letter-spacing: 0.8px;
  text-transform: uppercase; color: var(--dml-datnung);
  margin-bottom: var(--dml-s1);
}

/* --------------------------------------------------------------------------
   6. Khối thu email — một trường, một nút, không giục
   -------------------------------------------------------------------------- */

.dml-email {
  max-width: var(--dml-prose);
  margin: var(--dml-s5) 0;
  padding: var(--dml-s4);
  background: var(--dml-cat);
}
.dml-email--dark { background: var(--dml-muc); color: var(--dml-xothom-nhat); }
.dml-email--dark h2, .dml-email--dark h3 { color: #fff; }
.dml-email h3 { margin-top: 0; }
.dml-email p { font-size: var(--dml-small); }
.dml-email--dark p { color: var(--dml-xothom-nhat); }

.dml-btn {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 3rem; padding: 0 1.6rem;
  background: var(--dml-muc); color: var(--dml-giay);
  border: 1px solid var(--dml-muc); border-radius: 2px;
  font-family: var(--dml-font); font-size: var(--dml-small); font-weight: 500;
  letter-spacing: 0.3px;
  text-decoration: none; cursor: pointer;
  transition: background 160ms ease, color 160ms ease;
}
.dml-btn:hover { background: var(--dml-mua); border-color: var(--dml-mua); color: #fff; }
.dml-btn--ghost { background: transparent; color: var(--dml-muc); }
.dml-btn--ghost:hover { background: var(--dml-muc); color: var(--dml-giay); }
.dml-btn--onDark { background: var(--dml-giay); color: var(--dml-muc); border-color: var(--dml-giay); }
.dml-btn--onDark:hover { background: var(--dml-xothom-nhat); border-color: var(--dml-xothom-nhat); color: var(--dml-muc); }

/* --------------------------------------------------------------------------
   7. Danh sách bài nền — đánh số, không phải lưới thẻ
   -------------------------------------------------------------------------- */

.dml-index { list-style: none; margin: var(--dml-s4) 0; padding: 0; max-width: 46rem; }
.dml-index li { border-top: 1px solid var(--dml-vien); }
.dml-index li:last-child { border-bottom: 1px solid var(--dml-vien); }
.dml-index a {
  display: grid; grid-template-columns: 3rem 1fr; gap: var(--dml-s2);
  padding: var(--dml-s3) 0;
  text-decoration: none; color: var(--dml-muc);
}
.dml-index a:hover .dml-index-title { color: var(--dml-mua); }
.dml-index-num {
  font-size: var(--dml-caption); font-weight: 500;
  color: var(--dml-chu-phu); padding-top: 0.45rem;
  font-variant-numeric: tabular-nums;
}
.dml-index-title { font-size: var(--dml-h3); font-weight: 600; line-height: 1.35; display: block; }
.dml-index-desc { font-size: var(--dml-small); color: var(--dml-chu-phu); margin: 0.35rem 0 0; max-width: 52ch; }
.dml-index-date { font-size: var(--dml-caption); color: var(--dml-chu-phu); margin: 0.4rem 0 0; }
.dml-index li.is-key .dml-index-num { color: var(--dml-mua); }

/* --------------------------------------------------------------------------
   8. Điều hướng tuyến tính cuối bài
   -------------------------------------------------------------------------- */

.dml-next {
  max-width: var(--dml-prose);
  margin: var(--dml-s5) 0 var(--dml-s4);
  padding-top: var(--dml-s3);
  border-top: 1px solid var(--dml-vien);
}
.dml-next-label { font-size: var(--dml-caption); color: var(--dml-chu-phu); display: block; margin-bottom: 0.3rem; }
.dml-next a { font-size: var(--dml-h3); font-weight: 600; text-decoration: none; }

/* Chú thích nguồn cuối bài */
.dml-source {
  max-width: var(--dml-prose);
  font-size: var(--dml-caption); color: var(--dml-chu-phu);
  line-height: 1.6; font-style: italic;
  border-top: 1px solid var(--dml-vien);
  padding-top: var(--dml-s2); margin-top: var(--dml-s4);
}

/* --------------------------------------------------------------------------
   9. Vùng nền
   -------------------------------------------------------------------------- */

.dml-band-sand  { background: var(--dml-cat); }
.dml-band-ink   { background: var(--dml-muc); color: var(--dml-xothom-nhat); }
.dml-band-ink h1, .dml-band-ink h2, .dml-band-ink h3 { color: #FBFAF8; }
.dml-band-ink a { color: var(--dml-xothom-nhat); }
.dml-band-paper { background: var(--dml-giay); }

/* --------------------------------------------------------------------------
   9b. ĐÁNH DẤU CHỜ KIỂM CHỨNG — CHỈ DÙNG Ở BẢN NHÁP
       Toàn bộ khối này phải biến mất trước khi xuất bản công khai.
   -------------------------------------------------------------------------- */

.dml-verify {
  background: #FFF3B0; color: #6B5400;
  padding: 0 0.32em; border-radius: 2px;
  font-size: 0.85em; font-weight: 600; white-space: nowrap;
}

.dml-draftbox {
  max-width: var(--dml-prose);
  margin: 0 0 var(--dml-s4);
  padding: var(--dml-s3);
  background: #FFF8E1;
  border: 1px dashed #C9A227;
  font-size: var(--dml-small);
  line-height: 1.6;
}
.dml-draftbox h4 {
  margin: 0 0 0.6rem; font-size: var(--dml-caption);
  text-transform: uppercase; letter-spacing: 0.9px; color: #8A6D1F;
}
.dml-draftbox ul { margin: 0; padding-left: 1.15rem; max-width: none; }
.dml-draftbox li { margin-bottom: 0.4rem; }
.dml-draftbox p:last-child { margin-bottom: 0; }

/* --------------------------------------------------------------------------
   10. Khả năng tiếp cận & responsive
   -------------------------------------------------------------------------- */

:where(a, button, input, [tabindex]):focus-visible {
  outline: 2px solid var(--dml-datnung);
  outline-offset: 3px;
}

.dml-skip {
  position: absolute; left: -9999px;
}
.dml-skip:focus { left: 1rem; top: 1rem; z-index: 999; background: var(--dml-muc); color: #fff; padding: 0.75rem 1rem; }

@media (max-width: 767px) {
  :root { --dml-s5: 2.25rem; --dml-s6: 3rem; --dml-s7: 4rem; }
  body { font-size: 1.0625rem; }
  .dml-email { padding: var(--dml-s3); }
  .dml-index a { grid-template-columns: 2.25rem 1fr; gap: 0.75rem; }
  .dml-table-wrap { margin-inline: calc(var(--dml-s3) * -1); padding-inline: var(--dml-s3); }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}
