/* Bảng màu: chàm (藍) của Nhật và vàng nghệ của Việt Nam */
:root {
  --cham: #1E3557;
  --cham-nhat: #3A5A86;
  --nghe: #D99A1E;
  --giay: #F5F6F3;
  --muc: #1A1F29;
  --suong: #DCE2EA;
  --chu-phu: #4A5568;
  --font: "Hiragino Sans", "Hiragino Kaku Gothic ProN", "Noto Sans JP", "Yu Gothic UI", "Yu Gothic",
          "Segoe UI", system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;
}

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

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--giay);
  color: var(--muc);
  font-family: var(--font);
  font-size: 1.0625rem;
  line-height: 1.75;
}

a { color: var(--cham); text-underline-offset: 0.2em; }
a:hover { color: var(--cham-nhat); }
:focus-visible { outline: 3px solid var(--nghe); outline-offset: 3px; border-radius: 2px; }

.bo-qua { position: absolute; left: -9999px; }
.bo-qua:focus { left: 16px; top: 16px; background: #fff; padding: 8px 12px; z-index: 10; }

/* Đầu trang */
.dau-trang {
  display: flex; justify-content: space-between; align-items: center; gap: 16px;
  max-width: 1080px; margin: 0 auto; padding: 24px clamp(16px, 5vw, 48px);
}
.logo { font-weight: 700; font-size: 1.125rem; text-decoration: none; color: var(--cham); letter-spacing: 0.02em; }
.chon-ngon-ngu { display: flex; gap: 4px; list-style: none; margin: 0; padding: 0; }
.chon-ngon-ngu a {
  display: block; padding: 6px 12px; border-radius: 999px; text-decoration: none; font-size: 0.9375rem; color: var(--chu-phu);
}
.chon-ngon-ngu a[aria-current="true"] { background: var(--cham); color: #fff; }

main { max-width: 1080px; margin: 0 auto; padding: 0 clamp(16px, 5vw, 48px); }

/* Mở đầu: tiêu đề hai thứ tiếng nối bằng sợi chỉ vàng nghệ */
.mo-dau { padding: clamp(48px, 10vw, 112px) 0 clamp(56px, 9vw, 96px); max-width: 860px; }
.mo-dau h1 {
  margin: 0; color: var(--cham);
  font-size: clamp(2.25rem, 6.4vw, 4.5rem); line-height: 1.15; font-weight: 800; letter-spacing: -0.01em;
}
.soi-chi { display: block; width: min(100%, 600px); height: 40px; margin: 28px 0 12px; overflow: visible; }
.soi-chi path { fill: none; stroke: var(--nghe); stroke-width: 3; stroke-linecap: round; }
.soi-chi circle { fill: var(--nghe); }
.tieu-de-phu { margin: 0; font-size: clamp(1.125rem, 2.6vw, 1.625rem); color: var(--cham-nhat); font-weight: 500; line-height: 1.5; }
.gioi-thieu { margin: 32px 0 0; max-width: 38em; color: var(--chu-phu); }
.cac-nut { display: flex; flex-wrap: wrap; gap: 12px; margin: 36px 0 0; }
.nut {
  display: inline-block; padding: 12px 24px; border-radius: 999px; font-weight: 600; text-decoration: none;
  border: 2px solid var(--cham);
}
.nut-chinh { background: var(--cham); color: #fff; }
.nut-chinh:hover { background: var(--cham-nhat); border-color: var(--cham-nhat); color: #fff; }
.nut-phu { color: var(--cham); }
.nut-phu:hover { background: var(--suong); }

/* Các khối nội dung */
.khoi { padding: clamp(48px, 8vw, 88px) 0; border-top: 1px solid var(--suong); }
.khoi h2 { margin: 0 0 32px; font-size: clamp(1.5rem, 3vw, 2rem); line-height: 1.3; color: var(--cham); }

.chu-de { display: grid; grid-template-columns: repeat(3, 1fr); gap: clamp(24px, 4vw, 48px); list-style: none; margin: 0; padding: 0; }
.ky-hieu {
  display: block; font-size: clamp(3.5rem, 7vw, 5rem); line-height: 1; font-weight: 800; color: var(--cham);
  padding-bottom: 16px; margin-bottom: 16px; border-bottom: 3px solid var(--nghe); width: max-content; min-width: 1.2em;
}
.chu-de h3 { margin: 0 0 8px; font-size: 1.25rem; }
.chu-de p { margin: 0; color: var(--chu-phu); }

.hai-cot { display: grid; grid-template-columns: 1fr 2fr; gap: 32px; }
.hai-cot h2 { margin: 0; }
.ve-toi { margin: 0; max-width: 36em; }

.lo-trinh { margin: 0; padding: 0; list-style: none; counter-reset: buoc; }
.lo-trinh li {
  counter-increment: buoc; display: grid; grid-template-columns: 48px 1fr; column-gap: 16px;
  padding: 16px 0; border-bottom: 1px solid var(--suong);
}
.lo-trinh li:first-child { padding-top: 0; }
.lo-trinh li::before {
  content: counter(buoc); grid-row: span 2; width: 36px; height: 36px; border-radius: 50%;
  display: grid; place-items: center; font-weight: 700; color: var(--cham); border: 2px solid var(--cham);
}
.lo-trinh strong { font-size: 1.125rem; }
.lo-trinh span { color: var(--chu-phu); }

.lien-he { background: var(--cham); color: #fff; border-radius: 24px; padding: clamp(32px, 6vw, 64px); margin-bottom: 64px; border-top: 0; }
.lien-he h2 { color: #fff; margin-bottom: 12px; }
.lien-he p { margin: 0 0 16px; max-width: 36em; }
.lien-he .email { color: #fff; font-size: clamp(1.25rem, 3vw, 1.75rem); font-weight: 700; text-decoration-color: var(--nghe); text-decoration-thickness: 3px; word-break: break-all; }

/* Menu */
.menu { display: flex; align-items: center; gap: 16px; }
.menu-bai-viet { font-weight: 600; text-decoration: none; }
.menu-bai-viet:hover { text-decoration: underline; }

/* Danh sách bài viết */
.ds-bai { list-style: none; margin: 0; padding: 0; max-width: 46em; }
.ds-bai li { padding: 24px 0; border-bottom: 1px solid var(--suong); }
.ds-bai li:first-child { padding-top: 0; }
.ds-bai h3 { margin: 4px 0 6px; font-size: 1.25rem; line-height: 1.45; }
.ds-bai h3 a { text-decoration: none; }
.ds-bai h3 a:hover { text-decoration: underline; }
.ds-bai p { margin: 0; color: var(--chu-phu); }
.thong-tin { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; margin: 0; font-size: 0.9375rem; color: var(--chu-phu); }
.nhan { padding: 2px 10px; border-radius: 999px; background: var(--suong); color: var(--cham); font-size: 0.8125rem; font-weight: 600; }
.xem-tat-ca { margin: 24px 0 0; font-weight: 600; }
.trong { color: var(--chu-phu); }
.trang-danh-sach { padding: 48px 0 80px; }
.trang-danh-sach h1 { color: var(--cham); font-size: clamp(1.75rem, 4vw, 2.5rem); margin: 0 0 32px; }

/* Trang phụ và bài viết */
.bai-viet .thong-tin { margin-bottom: 8px; }
.bai-viet h1 { margin-top: 0; }
.bai-viet img { max-width: 100%; height: auto; border-radius: 8px; }
.bai-viet table { border-collapse: collapse; width: 100%; }
.bai-viet th, .bai-viet td { border: 1px solid var(--suong); padding: 8px 12px; text-align: left; }
.quay-lai { margin-top: 48px; font-weight: 600; }
.bai-viet { max-width: 42em; padding: 48px 0 80px; }
.bai-viet h1 { color: var(--cham); font-size: clamp(1.75rem, 4vw, 2.5rem); line-height: 1.3; }
.bai-viet h2 { color: var(--cham); font-size: 1.375rem; margin-top: 2em; }

.chan-trang {
  max-width: 1080px; margin: 0 auto; padding: 24px clamp(16px, 5vw, 48px) 48px;
  display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px 24px; color: var(--chu-phu); font-size: 0.9375rem;
}
.chan-trang p { margin: 0; }

@media (max-width: 760px) {
  .chu-de { grid-template-columns: 1fr; gap: 48px; }
  .hai-cot { grid-template-columns: 1fr; gap: 16px; }
  .lien-he { border-radius: 16px; }
}

@media (prefers-reduced-motion: reduce) {
  * { scroll-behavior: auto !important; }
}
html { scroll-behavior: smooth; }
