/* ==========================================================================
   Sunme — Base (G1)
   Reset nhẹ, thang chữ (plan 4.1), link, container, section spacing.
   Mọi màu dùng biến (tokens.css), mọi khoảng cách dùng spacing token.
   KHÔNG chứa @media — mọi breakpoint nằm trong responsive.css.
   ========================================================================== */

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: var(--font-sans);
  font-size: var(--fs-body);
  font-weight: 400;
  line-height: var(--lh-body);
  color: var(--ink-body);
  background-color: var(--white);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  /* Header fixed: chừa đúng chiều cao header để nội dung không bị che. */
  padding-top: var(--header-height);
  overflow-x: hidden;
}

/* G5S-8: form control KHÔNG kế thừa font theo mặc định trình duyệt —
   nút icon + input hidden đo được font Arial. Ép kế thừa để toàn web
   chỉ có 1 font (Be Vietnam Pro + BVP Fallback). */
button, input, select, textarea {
  font-family: inherit;
}

/* --- Thang chữ (plan 4.1, quyết định 9.1a: chữ thường, tối đa 700 ở G1) --- */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-sans);
  line-height: var(--lh-heading);
  color: var(--ink-heading);
  margin: 0 0 var(--space-16);
}

h1, h2, h3 {
  /* Cân độ dài các dòng, tránh từ lẻ loi một dòng (plan 4.4; lệnh Lobe
     24/11 mở rộng cho H3 — trước đó chỉ H1/H2). */
  text-wrap: balance;
}

h1 {
  font-size: var(--fs-h1-page);
  font-weight: 700;
  line-height: var(--lh-h1);
  letter-spacing: var(--ls-h1);
}

h2 {
  font-size: var(--fs-h2);
  font-weight: 700;
  letter-spacing: var(--ls-h2);
}

h3 {
  font-size: var(--fs-h3);
  font-weight: 700;
  letter-spacing: var(--ls-h3);
}

h4 {
  font-size: var(--fs-body);
  font-weight: 700;
}

p {
  margin: 0 0 var(--space-16);
}

/* --- Link: KHÔNG gạch chân ở bất kỳ trạng thái nào (G5S, quyết định
   của Lobe 24/11 — ghi đè plan 4.4 "hover đỏ + gạch chân"). Phản hồi
   hover chỉ bằng đổi màu (đỏ -> đỏ đậm) và/hoặc icon dịch chuyển;
   focus-visible dùng vòng sáng mềm đỏ (xem dưới). --- */
a {
  color: var(--red);
  text-decoration: none;
  transition: color var(--transition-base);
}

a:hover {
  color: var(--red-dark);
}

/* Link kèm mũi tên (thẻ dịch vụ, G2): mũi tên xoay từ chéo lên thẳng khi hover. */
.sunme-link-arrow {
  display: inline-flex;
  align-items: center;
  gap: var(--space-8);
  font-weight: 700;
  color: var(--red);
  text-decoration: none;
}

.sunme-link-arrow:hover {
  color: var(--red-dark);
  text-decoration: none;
}

.sunme-link-arrow .lucide {
  width: 18px;
  height: 18px;
  transform: rotate(-45deg);
  transition: transform var(--transition-base);
}

.sunme-link-arrow:hover .lucide {
  transform: rotate(0deg);
}

/* Focus: vòng sáng mềm đỏ (G5, nghiên cứu techtorevenue — thay outline
   2px cứng trong plan). Trên nền đỏ đậm, vòng đỏ khó thấy hơn (hạn chế
   đã biết, giữ nguyên); không dùng gạch chân làm chỉ báo focus (G5S:
   toàn site không gạch chân link ở mọi trạng thái). */
:focus-visible {
  outline: none;
  box-shadow: var(--shadow-focus);
}

img {
  max-width: 100%;
  height: auto;
}

::selection {
  background-color: var(--red-soft);
  color: var(--ink-heading);
}

/* --- Nhấn trong đoạn văn (G5, lệnh Lobe 12:04): text thường LUÔN 400,
   không dùng weight để nhấn. Trong các container prose, <strong>/<b>
   hiển thị ở 400 với màu đỏ nhấn (không in đậm). Nhãn UI (nút, menu,
   tag, số liệu, "Việc đã làm:") giữ 600/700 theo rule riêng của chúng. --- */
.sunme-page-content strong,
.sunme-page-content b,
.sunme-entry-content strong,
.sunme-entry-content b,
.sunme-lead strong,
.sunme-lead b,
.sunme-about-intro strong,
.sunme-about-intro b,
.sunme-svc-body p strong,
.sunme-svc-body p b,
.sunme-project-body p strong,
.sunme-project-body p b,
.sunme-faq-a p strong,
.sunme-faq-a p b {
  font-weight: 400;
  color: var(--red-mid);
}

/* --- Blog publish 28/11: cụm in đậm trong H2 bài viết GIỮ đỏ + in đậm
   như phần còn lại của tiêu đề (rule 400 phía trên chỉ áp dụng cho
   nhấn trong đoạn văn; H2 cần 700 để cụm key phrase nổi đúng kiểu
   tiêu đề). Specificity (0,1,2) thắng rule (0,1,1) phía trên. --- */
.sunme-entry-content h2 strong,
.sunme-entry-content h2 b {
  font-weight: 700;
  color: var(--red-mid);
}

/* --- Container (plan 4.4: tối đa 1400px, gutter 30/20/16;
   G6R: lề tối thiểu --container-min-margin mỗi bên trên desktop,
   nên cột thực tế = min(1400px, 100% - 180px). --- */
.sunme-container {
  width: 100%;
  max-width: min(var(--container-max), calc(100% - var(--container-min-margin) * 2));
  margin-inline: auto;
  padding-inline: var(--container-gutter);
}

/* --- Section (plan 4.2: thang padding 80 / 64 / 72 desktop) --- */
.sunme-section {
  position: relative;
  padding-block: var(--section-pad);
  /* G5E/G5L: reveal ngang (--left/--right) dịch ±30% TRƯỚC khi hiện; theo
     spec, phần dịch chuyển đó vẫn tính vào vùng cuộn ngang của trang nên
     gây thanh cuộn ngang (đo được 1551px ở 1440, 966px ở 768 trên
     /gioi-thieu/). overflow-x: clip cắt phần đó mà không tạo scroll
     container (không phá sticky/fixed con cháu như overflow: hidden). */
  overflow-x: clip;
}

.sunme-section--short {
  padding-block: var(--section-pad-short);
}

.sunme-section--cta {
  padding-block: var(--section-pad-cta);
}

.sunme-section--tint {
  background-color: var(--bg-tint);
}

/* Divider 1px đầu mỗi section sáng (trừ section đầu tiên sau hero).
   Divider nằm sát mép trên section (margin-top âm triệt tiêu padding),
   nội dung vẫn cách divider đúng 1 nhịp --section-pad như mọi section khác.
   Sửa G2: bản G1 thiếu margin-top âm nên divider nằm giữa khoảng hở và
   đội nội dung xuống thêm 80px, phá nhịp spacing. */
.sunme-section--divided::before {
  content: "";
  display: block;
  /* G6R: cùng công thức với .sunme-container để divider thẳng hàng
     với cột nội dung ở mọi màn hình. */
  max-width: min(var(--container-max), calc(100% - var(--container-min-margin) * 2));
  margin-inline: auto;
  border-top: 1px solid var(--bg-divider);
  margin-top: calc(-1 * var(--section-pad));
  margin-bottom: var(--section-pad);
}

/* G5S (Lobe 24/11, lỗi line trắng dưới section Đánh giá): section NGẮN
   (--short, padding 64px) mà dùng margin --section-pad (80px) thì
   divider bị kéo lên 16px VƯỢT mép trên section, lơ lửng trong section
   trước — sau section tối (Đánh giá) nó hiện thành 1 đường trắng như
   lỗi; đồng thời nội dung section bị đội xuống 145px thay vì 64px.
   Section ngắn + divider dùng đúng nhịp --section-pad-short (hiện chỉ
   section Đối tác dùng combo này; các section --divided khác đều
   padding chuẩn nên không đổi). */
.sunme-section--short.sunme-section--divided::before {
  margin-top: calc(-1 * var(--section-pad-short));
  margin-bottom: var(--section-pad-short);
}

/* --- Reveal khi cuộn (G2, plan 5.4/8.4) ---
   Trạng thái ẩn CHỈ áp dụng khi <html> có class .js (script nhỏ trong
   <head> thêm class này — xem sunme_js_detect() trong functions.php).
   Tắt JavaScript thì class .js không có, nội dung hiện đủ ngay. */
html.js .sunme-reveal {
  opacity: 0;
  /* G7-audit (01/12): nhanh hơn — transition 0.4s, delay 0s (trước
     0.8s + delay 0.1s, nội dung mờ đủ sau ~1.0s, cảm giác chậm).
     Bỏ var(--reveal-delay) khỏi transition nên các --reveal-delay
     inline (hero 120ms, tin tức 100ms) không còn tác dụng. */
  transform: translateY(30%);
  transition: opacity 400ms ease, transform 400ms ease;
  will-change: opacity, transform;
}

html.js .sunme-reveal.is-visible {
  opacity: 1;
  transform: none;
}

/* G5L: biến thể reveal NGANG — khớp DIWE .effect-left/.effect-right
   (translateX ±30%, transition all .8s, dùng ở các cột trang con). */
html.js .sunme-reveal--left {
  transform: translateX(-30%);
}

html.js .sunme-reveal--right {
  transform: translateX(30%);
}

/* --- Icon Lucide inline (stroke=currentColor, CSS định cỡ) --- */
.lucide {
  width: 1.25em;
  height: 1.25em;
  flex: none;
  vertical-align: -.22em;
}

/* --- Trợ năng --- */
.screen-reader-text {
  border: 0;
  clip: rect(1px, 1px, 1px, 1px);
  clip-path: inset(50%);
  height: 1px;
  margin: -1px;
  overflow: hidden;
  padding: 0;
  position: absolute;
  width: 1px;
  word-wrap: normal;
}

.skip-link:focus {
  position: fixed;
  top: var(--space-8);
  left: var(--space-8);
  z-index: var(--z-to-top);
  background-color: var(--white);
  color: var(--red-dark);
  padding: var(--space-8) var(--space-16);
  border-radius: var(--radius-sm);
  clip: auto;
  clip-path: none;
  height: auto;
  width: auto;
}

/* --- Trang con / archive / single / search / 404 (G4) ---
   Toàn bộ bố cục trang con nằm trong assets/css/page.css (hero, nội dung
   Gutenberg, archive, single, tìm kiếm, 404) và assets/css/contact.css
   (riêng trang Liên hệ). base.css không giữ rule trang con nào. */

/* Tôn trọng prefers-reduced-motion: xem responsive.css (mọi @media tập trung ở đó). */
