/* biquyetlamdep.com — design system v2. Không font/tài nguyên ngoài, không JS. */
:root {
  --green-900: #0b4d43;
  --green-700: #17695b;
  --green-50: #eef5ef;
  --coral-500: #e8735a;
  --coral-700: #b2432b; /* coral đậm cho CHỮ nhỏ (đạt AA trên kem/trắng) */
  --coral-50: #fdeee9;
  --cream: #fbf7f0;
  --white: #fff;
  --ink: #1f2a27;
  --muted: #5f6b67;
  --line: #e6e1d8;
  --radius: 16px;
  --radius-sm: 12px;
  --shadow: 0 2px 10px rgba(31, 42, 39, 0.06);
  --shadow-lg: 0 10px 28px rgba(31, 42, 39, 0.1);
  --serif: Georgia, "Times New Roman", serif;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  --container: 1200px;
  --gutter: 16px;
}

/* Reset nhẹ */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body { margin: 0; background: var(--cream); color: var(--ink); font-family: var(--sans); font-size: 1rem; line-height: 1.7; }
img, svg { max-width: 100%; }
img { height: auto; display: block; }
a { color: var(--green-900); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { color: var(--green-700); }
button, input, select, textarea { font: inherit; color: inherit; }
ul, ol { margin: 0; padding: 0; }
svg { width: 1.25em; height: 1.25em; flex: none; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

/* Typography */
h1, h2, h3, h4 { font-family: var(--serif); color: var(--green-900); line-height: 1.25; margin: 0 0 .6em; font-weight: 700; }
h1 { font-size: clamp(1.9rem, 4.5vw, 3rem); letter-spacing: -.01em; }
h2 { font-size: clamp(1.5rem, 3vw, 2.1rem); }
h3 { font-size: 1.3rem; }
h4 { font-size: 1.1rem; }
p { margin: 0 0 1em; }
.muted { color: var(--muted); }

:focus-visible { outline: 3px solid var(--coral-700); outline-offset: 2px; border-radius: 4px; }

.container { width: 100%; max-width: var(--container); margin: 0 auto; padding: 0 var(--gutter); }

.skip-link { position: absolute; left: 8px; top: -60px; z-index: 100; background: var(--white); color: var(--green-900); padding: .6rem 1rem; border-radius: var(--radius-sm); font-weight: 600; box-shadow: var(--shadow-lg); }
.skip-link:focus { top: 8px; }

/* Trust strip */
.trust-strip { background: var(--green-900); color: var(--white); font-size: .8rem; line-height: 1.4; }
.trust-strip ul { list-style: none; display: flex; flex-wrap: wrap; justify-content: space-between; gap: 6px 24px; padding-top: 8px; padding-bottom: 8px; }
.trust-strip li { display: flex; align-items: center; gap: 8px; }
.trust-strip svg { width: 16px; height: 16px; color: #ffb4a3; }

/* Header */
.site-header { background: var(--white); border-bottom: 1px solid var(--line); position: relative; z-index: 20; }
.header-inner { display: flex; align-items: center; gap: 24px; min-height: 76px; }
.brand { display: block; flex: none; }
.site-logo { width: 190px; height: auto; }
.nav-main { display: flex; flex: 1; justify-content: center; flex-wrap: wrap; gap: 2px 22px; }
.nav-main a, .nav-drawer nav a { text-decoration: none; color: var(--ink); font-weight: 600; font-size: .95rem; padding: 6px 0; border-bottom: 2px solid transparent; }
.nav-main a:hover { color: var(--green-900); border-bottom-color: var(--line); }
.nav-main a[aria-current="page"], .nav-drawer a[aria-current="page"] { color: var(--green-900); border-bottom-color: var(--coral-500); }
.header-actions { display: flex; align-items: center; gap: 8px; margin-left: auto; }
.icon-btn, .nav-drawer summary { display: inline-grid; place-items: center; width: 44px; height: 44px; border-radius: 50%; color: var(--green-900); background: var(--green-50); cursor: pointer; list-style: none; border: 0; }
.icon-btn:hover, .nav-drawer summary:hover { background: #e0ede2; color: var(--green-900); }
.nav-drawer { display: none; position: relative; }
.nav-drawer summary::-webkit-details-marker { display: none; }
.nav-drawer nav { position: absolute; right: 0; top: 52px; width: min(320px, calc(100vw - 32px)); display: flex; flex-direction: column; background: var(--white); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-lg); padding: 8px 18px; }
.nav-drawer nav a { padding: 12px 0; border-bottom: 1px solid var(--line); }
.nav-drawer nav a:last-child { border-bottom: 0; }

/* Footer */
.site-footer { background: var(--green-900); color: #dcebe6; margin-top: 64px; padding: 48px 0 24px; font-size: .95rem; }
.footer-grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: 40px; }
.footer-logo { display: inline-block; background: var(--white); border-radius: var(--radius); padding: 10px 16px; }
.footer-logo .site-logo { width: 170px; }
.footer-brand p { margin-top: 14px; max-width: 34ch; }
.site-footer h2 { color: var(--white); font-size: 1.1rem; margin-bottom: .8em; }
.site-footer ul { list-style: none; display: grid; gap: 8px; }
.site-footer a { color: #dcebe6; text-decoration: none; }
.site-footer a:hover { color: var(--white); text-decoration: underline; }
.site-footer .footer-note { margin: 36px 0 0; padding-top: 18px; border-top: 1px solid rgba(255, 255, 255, .2); font-size: .85rem; color: #c3d9d2; }

/* Component: nhãn */
.kicker { display: inline-block; font-size: .78rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--coral-700); margin-bottom: .5rem; }
.tag { display: inline-block; background: var(--coral-50); color: var(--coral-700); font-size: .78rem; font-weight: 700; padding: 3px 10px; border-radius: 999px; text-decoration: none; line-height: 1.5; }
a.tag:hover { background: #fbdcd2; color: var(--coral-700); }
.chip { display: inline-flex; align-items: center; gap: 6px; background: var(--coral-50); color: var(--coral-700); border: 1px solid transparent; border-radius: 999px; padding: 6px 14px; font-size: .9rem; font-weight: 600; text-decoration: none; cursor: pointer; }
.chip:hover { border-color: var(--coral-500); color: var(--coral-700); }
.chip.is-active { background: var(--green-900); color: var(--white); }

/* Component: nút */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 0 22px; border-radius: 999px; border: 2px solid transparent; font-weight: 700; text-decoration: none; cursor: pointer; line-height: 1.2; }
.btn-primary { background: var(--green-900); color: var(--white); }
.btn-primary:hover { background: var(--green-700); color: var(--white); }
.btn-outline { background: transparent; color: var(--green-900); border-color: var(--green-900); }
.btn-outline:hover { background: var(--green-50); color: var(--green-900); }

/* Component: thẻ bài */
.card { display: flex; flex-direction: column; background: var(--white); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; }
.card > a.card-media, .card > img { display: block; }
.card img { width: 100%; aspect-ratio: 16 / 10; object-fit: cover; background: var(--green-50); }
.card-body { display: flex; flex-direction: column; gap: 8px; padding: 18px 20px 20px; flex: 1; }
.card h2, .card h3 { font-size: 1.2rem; margin: 0; }
.card h2 a, .card h3 a { color: var(--green-900); text-decoration: none; }
.card h2 a:hover, .card h3 a:hover { text-decoration: underline; }
.card p { color: var(--muted); font-size: .95rem; margin: 0; }
.card-row { display: grid; grid-template-columns: 220px 1fr; background: var(--white); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; }
.card-row img { width: 100%; height: 100%; min-height: 140px; aspect-ratio: 4 / 3; object-fit: cover; background: var(--green-50); }
.card-row .card-body { padding: 16px 20px; }
.card-row h2, .card-row h3 { font-size: 1.15rem; margin: 0; }
.card-row h2 a, .card-row h3 a { color: var(--green-900); text-decoration: none; }
.card-row h2 a:hover, .card-row h3 a:hover { text-decoration: underline; }

/* Component: hộp nội dung */
.box-answer, .box-takeaways, .box-definition, .box-warning { border-radius: var(--radius); padding: 18px 22px; margin: 0 0 1.5rem; }
.box-answer, .box-takeaways, .box-definition { background: var(--green-50); border: 1px solid #d5e5d8; }
.box-answer { border-left: 5px solid var(--green-900); }
.box-definition { border-left: 5px solid var(--green-700); }
.box-warning { background: var(--coral-50); border: 1px solid #f6cfc4; border-left: 5px solid var(--coral-500); }
.box-answer > :last-child, .box-takeaways > :last-child, .box-definition > :last-child, .box-warning > :last-child { margin-bottom: 0; }
.box-answer h2, .box-answer h3, .box-takeaways h2, .box-takeaways h3, .box-definition h2, .box-definition h3, .box-warning h2, .box-warning h3 { font-size: 1.1rem; margin-bottom: .4em; }
.box-warning h2, .box-warning h3 { color: var(--coral-700); }
.box-takeaways ul { padding-left: 1.2em; }

/* Component: breadcrumbs */
.breadcrumbs { font-size: .88rem; color: var(--muted); padding: 16px 0 4px; }
.breadcrumbs ol { list-style: none; display: flex; flex-wrap: wrap; gap: 4px 0; }
.breadcrumbs li + li::before { content: "›"; margin: 0 8px; color: var(--muted); }
.breadcrumbs a { color: var(--muted); }
.breadcrumbs a:hover { color: var(--green-900); }
.breadcrumbs [aria-current="page"] { color: var(--ink); }

/* Component: tiêu đề mục */
.section-title { position: relative; padding-bottom: 14px; margin-bottom: 1.4rem; }
.section-title::after { content: ""; position: absolute; left: 0; bottom: 0; width: 48px; height: 4px; border-radius: 4px; background: var(--coral-500); }

/* Component: lưới */
.grid-2, .grid-3, .grid-4 { display: grid; gap: 24px; }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }

/* Component: phân trang */
.pagination { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 8px; margin: 40px 0 0; }
.pagination a, .pagination span { display: inline-flex; align-items: center; justify-content: center; min-width: 44px; min-height: 44px; padding: 0 14px; border-radius: 999px; border: 1px solid var(--line); background: var(--white); color: var(--green-900); text-decoration: none; font-weight: 600; }
.pagination a:hover { border-color: var(--green-900); }
.pagination [aria-current="page"], .pagination .is-active { background: var(--green-900); border-color: var(--green-900); color: var(--white); }

/* Component: meta (ngày, thời gian đọc) */
.meta { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 16px; font-size: .85rem; color: var(--muted); }
.meta > * { display: inline-flex; align-items: center; gap: 6px; }
.meta svg { width: 15px; height: 15px; }

/* Component: ô tìm kiếm */
.search-bar { display: flex; align-items: center; gap: 8px; background: var(--white); border: 1px solid var(--line); border-radius: 999px; padding: 6px 6px 6px 20px; box-shadow: var(--shadow); max-width: 640px; }
.search-bar:focus-within { border-color: var(--green-900); }
.search-bar input { flex: 1; min-width: 0; border: 0; outline: 0; background: transparent; min-height: 40px; }
.search-bar .btn { min-height: 42px; }

/* Responsive */
@media (max-width: 900px) {
  .nav-main { display: none; }
  .nav-drawer { display: block; }
  .header-inner { min-height: 64px; }
  .site-logo { width: 160px; }
  .grid-3, .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .footer-brand { grid-column: 1 / -1; }
}
@media (max-width: 600px) {
  .trust-strip li:not(:first-child) { display: none; }
  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
  .card-row { grid-template-columns: 110px 1fr; }
  .card-row img { min-height: 110px; }
  .card-row .card-body { padding: 12px 14px; }
  .footer-grid { grid-template-columns: 1fr; gap: 28px; }
  .site-footer { margin-top: 40px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}

/* Avatar chữ cái đầu của tác giả (không dùng ảnh người) */
.avatar { display: inline-flex; align-items: center; justify-content: center; flex: none; width: 56px; height: 56px; border-radius: 50%; background: var(--green-900); color: var(--white); font-family: var(--serif); font-weight: 700; font-size: 1.15rem; letter-spacing: .04em; }
.avatar-lg { width: 96px; height: 96px; font-size: 1.9rem; }
