/* ===========================================================
   doanthanhnienvn.blog — stylesheet dùng chung
   Không phụ thuộc framework, không cần build.
   =========================================================== */

:root {
  --bg: #ffffff;
  --bg-soft: #f6f7f9;
  --bg-accent: #eef4ff;
  --text: #1a1d23;
  --text-soft: #5a6270;
  --border: #e2e5ea;
  --brand: #c1272d;
  --brand-dark: #9c1f24;
  --link: #1557b0;
  --radius: 10px;
  --wrap: 1080px;
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

* { box-sizing: border-box; }

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

body {
  margin: 0;
  font-family: var(--font);
  font-size: 17px;
  line-height: 1.7;
  color: var(--text);
  background: var(--bg);
}

.wrap {
  max-width: var(--wrap);
  margin: 0 auto;
  padding: 0 20px;
}

/* ---------- Khả năng tiếp cận ---------- */

.skip {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--brand);
  color: #fff;
  padding: 10px 16px;
  z-index: 100;
}
.skip:focus { left: 0; }

:focus-visible {
  outline: 3px solid var(--link);
  outline-offset: 2px;
}

/* ---------- Header ---------- */

.site-header {
  border-bottom: 1px solid var(--border);
  background: var(--bg);
  position: sticky;
  top: 0;
  z-index: 50;
}

.header-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 16px 28px;
  padding-top: 14px;
  padding-bottom: 14px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--text);
  font-weight: 700;
  margin-right: auto;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 8px;
  background: var(--brand);
  color: #fff;
  font-size: 14px;
  letter-spacing: .5px;
  flex: none;
}

.brand-text { font-size: 16px; line-height: 1.25; }

.site-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 22px;
  align-items: center;
}

.site-nav a {
  color: var(--text-soft);
  text-decoration: none;
  font-size: 15.5px;
  padding: 4px 0;
}
.site-nav a:hover,
.site-nav a[aria-current="page"] { color: var(--brand); }

/* ---------- Nút ---------- */

.btn {
  display: inline-block;
  background: var(--brand);
  color: #fff;
  text-decoration: none;
  padding: 11px 22px;
  border-radius: var(--radius);
  font-weight: 600;
  font-size: 16px;
  border: 1px solid var(--brand);
}
.btn:hover { background: var(--brand-dark); border-color: var(--brand-dark); }

.btn-ghost {
  background: transparent;
  color: var(--brand);
}
.btn-ghost:hover { background: var(--bg-accent); }

/* ---------- Nội dung ---------- */

main { padding: 44px 0 64px; }

h1, h2, h3 { line-height: 1.25; margin: 0 0 .5em; }
h1 { font-size: 2.1rem; letter-spacing: -.02em; }
h2 { font-size: 1.5rem; margin-top: 2em; }
h3 { font-size: 1.15rem; margin-top: 1.6em; }

p, ul, ol { margin: 0 0 1.1em; }
ul, ol { padding-left: 1.3em; }
li { margin-bottom: .4em; }

a { color: var(--link); }

.lead {
  font-size: 1.15rem;
  color: var(--text-soft);
  max-width: 62ch;
}

.prose { max-width: 72ch; }

hr { border: 0; border-top: 1px solid var(--border); margin: 2.5em 0; }

/* ---------- Hero ---------- */

.hero {
  background: var(--bg-accent);
  border-bottom: 1px solid var(--border);
  padding: 56px 0;
}
.hero h1 { max-width: 20ch; }
.hero .lead { margin-bottom: 1.6em; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; }

/* ---------- Lưới thẻ ---------- */

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 20px;
  margin: 1.5em 0 2em;
}

.card {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px;
  background: var(--bg);
}
.card h3 { margin-top: 0; }
.card p:last-child { margin-bottom: 0; }

.stat {
  text-align: center;
  padding: 24px 18px;
  background: var(--bg-soft);
  border-radius: var(--radius);
}
.stat b {
  display: block;
  font-size: 2rem;
  color: var(--brand);
  line-height: 1.1;
}
.stat span { color: var(--text-soft); font-size: 15px; }

/* ---------- Bảng ---------- */

table {
  width: 100%;
  border-collapse: collapse;
  margin: 1.2em 0 1.8em;
  font-size: 16px;
}
th, td {
  text-align: left;
  padding: 11px 12px;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
}
th { background: var(--bg-soft); font-weight: 600; }

/* ---------- Ghi chú / chỗ cần điền ---------- */

.note {
  background: var(--bg-soft);
  border-left: 4px solid var(--brand);
  padding: 14px 18px;
  border-radius: 0 var(--radius) var(--radius) 0;
  margin: 1.4em 0;
}
.note p:last-child { margin-bottom: 0; }

.todo {
  background: #fff4d6;
  border: 1px dashed #c89400;
  color: #7a5a00;
  padding: 2px 8px;
  border-radius: 5px;
  font-size: 15px;
  font-weight: 600;
}

/* ---------- Biểu mẫu ---------- */

.form-field { margin-bottom: 18px; max-width: 460px; }
.form-field label { display: block; font-weight: 600; margin-bottom: 6px; font-size: 15.5px; }
.form-field input[type="text"],
.form-field input[type="email"],
.form-field input[type="tel"],
.form-field select,
.form-field textarea {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font: inherit;
  font-size: 16px;
  background: var(--bg);
  color: var(--text);
}
.consent {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  max-width: 600px;
  margin: 22px 0;
  font-size: 15.5px;
  line-height: 1.6;
}
.consent input { margin-top: 5px; flex: none; }

/* ---------- Footer ---------- */

.site-footer {
  border-top: 1px solid var(--border);
  background: var(--bg-soft);
  padding: 40px 0 32px;
  font-size: 15px;
  color: var(--text-soft);
}
.footer-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 28px;
  margin-bottom: 26px;
}
.site-footer h4 {
  font-size: 15px;
  color: var(--text);
  margin: 0 0 10px;
}
.site-footer ul { list-style: none; padding: 0; margin: 0; }
.site-footer li { margin-bottom: 6px; }
.site-footer a { color: var(--text-soft); text-decoration: none; }
.site-footer a:hover { color: var(--brand); text-decoration: underline; }

.footer-legal {
  border-top: 1px solid var(--border);
  padding-top: 18px;
  font-size: 14px;
  line-height: 1.65;
}

/* ---------- Chế độ tối ---------- */

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #15171c;
    --bg-soft: #1d2026;
    --bg-accent: #1b2230;
    --text: #e8eaed;
    --text-soft: #a3aab6;
    --border: #2c3139;
    --brand: #e8545b;
    --brand-dark: #d2454c;
    --link: #79b0ff;
  }
  .btn { color: #15171c; }
  .todo { background: #3a2f10; border-color: #8a6a00; color: #ffd874; }
}

/* ---------- Màn hình nhỏ ---------- */

@media (max-width: 640px) {
  body { font-size: 16.5px; }
  h1 { font-size: 1.7rem; }
  .hero { padding: 38px 0; }
  main { padding: 32px 0 48px; }
  .brand-text { font-size: 15px; }
}

@media print {
  .site-header, .site-footer, .hero-actions { display: none; }
}
