/* Letter Well — kỹ năng văn phòng & viết lách
   Thiết kế văn phòng bưu điện: nền trắng, mực xanh hải quân, phong bì kem, dấu niêm phong đỏ sáp.
   Headlines: Source Serif 4 (transitional). UI/body: Inter. */

:root {
  --ink: #0f1d33;
  --ink-soft: #334156;
  --muted: #6b7489;
  --paper: #ffffff;
  --page: #faf8f1;
  --cream: #f5ead3;
  --cream-deep: #ead9b3;
  --rule: #d9cfa5;
  --rule-soft: #ebe3c7;
  --wax: #a4302e;
  --wax-dark: #7e2320;
  --stamp: #0b4a7a;
  --max: 1120px;
  --serif: "Source Serif 4", Georgia, "Times New Roman", serif;
  --sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; overflow-x: hidden; }
body { overflow-x: hidden; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.65;
  font-feature-settings: "liga", "kern";
  overflow-wrap: break-word;
  word-wrap: break-word;
}
h1, h2, h3, h4 { overflow-wrap: break-word; }
img { max-width: 100%; height: auto; display: block; }
a { color: var(--ink); text-decoration: underline; text-decoration-color: var(--wax); text-underline-offset: 3px; text-decoration-thickness: 1px; }
a:hover { color: var(--wax-dark); text-decoration-thickness: 2px; }
h1, h2, h3, h4 {
  font-family: var(--serif);
  line-height: 1.18;
  margin: 0 0 .5em;
  font-weight: 600;
  letter-spacing: -0.005em;
  color: var(--ink);
}
h1 { font-size: 2.1rem; font-weight: 700; }
h2 { font-size: 1.55rem; }
h3 { font-size: 1.2rem; }
p { margin: 0 0 1em; }

.wrap { max-width: var(--max); margin: 0 auto; padding: 0 20px; }
.skip { position: absolute; left: -9999px; }
.skip:focus { left: 16px; top: 8px; background: var(--paper); padding: 8px 12px; z-index: 20; border: 2px solid var(--ink); }

/* Masthead: paper + envelope rule */
.masthead {
  background: var(--paper);
  border-bottom: 1px solid var(--rule);
  position: relative;
}
.masthead::after {
  content: "";
  position: absolute;
  left: 0; right: 0; bottom: -5px;
  height: 4px;
  background:
    repeating-linear-gradient(135deg, var(--wax) 0 8px, transparent 8px 16px, var(--stamp) 16px 24px, transparent 24px 32px);
  opacity: .55;
}
.masthead .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding-top: 22px;
  padding-bottom: 22px;
}
.logo { display: inline-flex; align-items: center; gap: 14px; text-decoration: none; color: var(--ink); }
.logo svg { width: 46px; height: 46px; flex: none; }
.logo-word { font-family: var(--serif); font-size: 1.55rem; font-weight: 700; letter-spacing: -0.01em; display: block; line-height: 1; }
.logo-tag { display: block; font-size: 0.72rem; letter-spacing: 0.14em; text-transform: uppercase; color: var(--muted); margin-top: 4px; }
.mast-cta {
  display: inline-block;
  padding: 10px 16px;
  background: var(--ink);
  color: var(--paper);
  text-decoration: none;
  font-weight: 600;
  font-size: 0.92rem;
  letter-spacing: 0.02em;
  border-radius: 2px;
}
.mast-cta:hover { background: var(--wax); color: var(--paper); }

/* Nav — single horizontal line, scroll on mobile */
.mainnav {
  background: var(--page);
  border-bottom: 1px solid var(--rule-soft);
  font-size: 0.94rem;
}
.mainnav ul { list-style: none; margin: 0; padding: 0; display: flex; gap: 0; overflow-x: auto; }
.mainnav li { flex: none; }
.mainnav a {
  display: inline-block;
  padding: 14px 18px 12px;
  text-decoration: none;
  color: var(--ink-soft);
  border-bottom: 2px solid transparent;
  white-space: nowrap;
  font-weight: 500;
}
.mainnav a:hover { color: var(--wax); }
.mainnav a[aria-current="page"] { color: var(--ink); border-bottom-color: var(--wax); }

/* Topstrip removed — nav is enough */

/* Hero on home */
.hero {
  background: var(--page);
  border-bottom: 1px solid var(--rule-soft);
  padding: 46px 0 40px;
}
.hero-grid {
  display: grid;
  grid-template-columns: 1.6fr 1fr;
  gap: 36px;
  align-items: start;
}
.hero .feature .kicker {
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  color: var(--wax);
  font-weight: 600;
}
.hero .feature h1 { font-size: 2.35rem; margin: 10px 0 14px; }
.hero .feature h1 a { text-decoration: none; }
.hero .feature .lede { font-size: 1.1rem; color: var(--ink-soft); line-height: 1.55; font-family: var(--serif); }
.hero .feature .meta { font-size: 0.85rem; color: var(--muted); margin-top: 10px; display: flex; gap: 14px; flex-wrap: wrap; }

.hero-art {
  background: var(--cream);
  border: 1px solid var(--rule);
  padding: 20px;
  position: relative;
}
.hero-art svg { width: 100%; height: auto; display: block; }
.hero-art::after {
  content: "";
  position: absolute;
  top: -10px; right: 18px;
  width: 44px; height: 44px;
  background: radial-gradient(circle at 35% 35%, #c84441, var(--wax) 55%, var(--wax-dark));
  border-radius: 50%;
  box-shadow: 0 2px 4px rgba(0,0,0,0.18);
}

/* Section */
.section { padding: 48px 0; }
.section-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 26px;
  border-bottom: 1px solid var(--rule-soft);
  padding-bottom: 12px;
}
.section-head h2 { margin: 0; font-size: 1.4rem; }
.section-head a { font-size: 0.9rem; color: var(--stamp); }

/* Article grid */
.grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 32px 28px; }
.card { background: var(--paper); }
.card .thumb {
  display: block;
  aspect-ratio: 16/10;
  background: var(--cream);
  border: 1px solid var(--rule);
  margin-bottom: 14px;
  overflow: hidden;
}
.card .thumb svg { width: 100%; height: 100%; display: block; }
.card .kicker {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  color: var(--wax);
  font-weight: 600;
}
.card h3 { font-size: 1.12rem; margin: 6px 0 8px; line-height: 1.3; }
.card h3 a { text-decoration: none; }
.card h3 a:hover { color: var(--wax); text-decoration: underline; text-decoration-color: var(--wax); }
.card p { font-size: 0.96rem; color: var(--ink-soft); margin-bottom: 8px; }
.card .meta { font-size: 0.82rem; color: var(--muted); display: flex; gap: 12px; }

/* Topic strip */
.topics { background: var(--page); border-top: 1px solid var(--rule-soft); border-bottom: 1px solid var(--rule-soft); padding: 40px 0; }
.topics h2 { font-size: 1.3rem; margin-bottom: 20px; }
.topic-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 16px; }
.topic {
  display: block;
  padding: 16px 18px;
  background: var(--paper);
  border: 1px solid var(--rule);
  text-decoration: none;
  color: var(--ink);
}
.topic:hover { border-color: var(--wax); }
.topic strong { font-family: var(--serif); font-size: 1.05rem; display: block; margin-bottom: 4px; }
.topic span { font-size: 0.86rem; color: var(--muted); }

/* CTA band */
.cta-band {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 24px;
  align-items: center;
  background: var(--cream);
  border: 1px solid var(--rule);
  padding: 28px 32px;
  position: relative;
}
.cta-band::before {
  content: "";
  position: absolute;
  top: 10px; bottom: 10px; left: 10px;
  width: 3px;
  background: var(--wax);
}
.cta-band h2 { font-size: 1.35rem; margin: 0 0 6px; }
.cta-band p { margin: 0; color: var(--ink-soft); }
.btn {
  display: inline-block;
  padding: 11px 20px;
  background: var(--ink);
  color: var(--paper);
  text-decoration: none;
  font-weight: 600;
  letter-spacing: 0.02em;
  border-radius: 2px;
  justify-self: end;
}
.btn:hover { background: var(--wax); color: var(--paper); }

/* Article page */
.article { padding: 42px 0 60px; background: var(--paper); }
.article-wrap { max-width: 740px; margin: 0 auto; padding: 0 20px; }
.breadcrumb { font-size: 0.85rem; color: var(--muted); margin-bottom: 18px; }
.breadcrumb a { color: var(--stamp); text-decoration: none; }
.breadcrumb a:hover { text-decoration: underline; }
.article-head .kicker {
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  color: var(--wax);
  font-weight: 600;
  text-decoration: none;
  display: inline-block;
  margin-bottom: 12px;
}
.article-head h1 { font-size: 2.2rem; line-height: 1.15; margin-bottom: 16px; }
.standfirst { font-family: var(--serif); font-size: 1.22rem; line-height: 1.5; color: var(--ink-soft); margin-bottom: 18px; }
.byline { font-size: 0.88rem; color: var(--muted); border-top: 1px solid var(--rule-soft); border-bottom: 1px solid var(--rule-soft); padding: 10px 0; display: flex; flex-wrap: wrap; gap: 16px; margin-bottom: 26px; }
.article-body { font-size: 1.04rem; }
.article-body h2 { margin-top: 1.8em; font-size: 1.45rem; padding-bottom: 6px; border-bottom: 1px solid var(--rule-soft); }
.article-body h3 { margin-top: 1.6em; font-size: 1.15rem; }
.article-body ul, .article-body ol { padding-left: 1.4em; margin: 0 0 1em; }
.article-body li { margin-bottom: 0.4em; }
.article-body blockquote {
  margin: 1.4em 0;
  padding: 2px 0 2px 20px;
  border-left: 3px solid var(--wax);
  color: var(--ink-soft);
  font-family: var(--serif);
  font-style: italic;
  font-size: 1.05rem;
}
.article-body a { color: var(--stamp); text-decoration-color: var(--stamp); }

/* Example boxes: Trước / Sau */
.example {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin: 1.4em 0;
}
.example .box {
  background: var(--page);
  border: 1px solid var(--rule);
  padding: 16px 18px;
  font-size: 0.95rem;
  font-family: "SFMono-Regular", Consolas, Menlo, monospace;
  line-height: 1.5;
  position: relative;
  white-space: pre-wrap;
}
.example .box.before { background: #fbf2ee; border-color: #e3bdb3; }
.example .box.after { background: #eef5ee; border-color: #c4ddc4; }
.example .box::before {
  content: attr(data-label);
  position: absolute;
  top: -10px; left: 12px;
  background: var(--paper);
  padding: 0 8px;
  font-family: var(--sans);
  font-size: 0.72rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  font-weight: 600;
}
.example .box.before::before { color: var(--wax); border: 1px solid #e3bdb3; }
.example .box.after::before { color: #2a6a2a; border: 1px solid #c4ddc4; }

.note {
  background: var(--cream);
  border-left: 3px solid var(--wax);
  padding: 14px 16px;
  margin: 1.4em 0;
  font-size: 0.97rem;
}
.note strong { font-family: var(--serif); }

figure { margin: 1.5em 0; }
figure img, figure svg { width: 100%; height: auto; border: 1px solid var(--rule); background: var(--cream); }
figcaption { font-size: 0.85rem; color: var(--muted); margin-top: 8px; }

/* Blog index */
.blog-head { background: var(--page); padding: 36px 0; border-bottom: 1px solid var(--rule-soft); }
.blog-head h1 { margin: 0 0 6px; font-size: 1.9rem; }
.blog-head p { margin: 0; color: var(--muted); font-size: 1rem; }
.cat-label { font-family: var(--sans); font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.16em; color: var(--muted); margin: 32px 0 10px; }

/* Pages */
.page { padding: 42px 0 60px; }
.page-wrap { max-width: 720px; margin: 0 auto; padding: 0 20px; }
.page h1 { font-size: 2rem; margin-bottom: 12px; }
.page h2 { font-size: 1.35rem; margin-top: 1.6em; padding-bottom: 6px; border-bottom: 1px solid var(--rule-soft); }
.page .lede { font-family: var(--serif); font-size: 1.18rem; color: var(--ink-soft); line-height: 1.5; margin-bottom: 20px; }
.page ul, .page ol { padding-left: 1.4em; }
.page li { margin-bottom: 0.4em; }

/* 404 */
.notfound { min-height: 58vh; display: grid; place-items: center; padding: 60px 20px; text-align: center; }
.notfound h1 { font-size: 3rem; }
.notfound p { color: var(--muted); max-width: 440px; margin: 0 auto 1em; }

/* Footer */
.site-footer {
  background: var(--ink);
  color: #c7cfdc;
  padding: 36px 0 24px;
  font-size: 0.92rem;
}
.site-footer .wrap { padding-top: 10px; }
.foot-grid { display: grid; grid-template-columns: 1.6fr 1fr 1fr; gap: 28px; margin-bottom: 20px; }
.site-footer h4 { color: var(--paper); font-family: var(--serif); font-size: 1.02rem; margin: 0 0 10px; }
.site-footer ul { list-style: none; margin: 0; padding: 0; }
.site-footer li { margin-bottom: 6px; }
.site-footer a { color: #c7cfdc; text-decoration: none; }
.site-footer a:hover { color: var(--cream); text-decoration: underline; text-decoration-color: var(--cream); }
.site-footer .logo-word { color: var(--paper); }
.foot-base { border-top: 1px solid rgba(255,255,255,0.14); padding-top: 14px; font-size: 0.82rem; color: #9aa5b8; display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; }

/* Related posts */
.related { background: var(--page); padding: 36px 0; border-top: 1px solid var(--rule-soft); }
.related h2 { font-size: 1.2rem; margin-bottom: 18px; }
.related .grid { grid-template-columns: repeat(3, 1fr); gap: 20px; }
.related .card .thumb { aspect-ratio: 16/10; }

/* Responsive */
@media (max-width: 920px) {
  .hero-grid { grid-template-columns: 1fr; }
  .grid { grid-template-columns: repeat(2, 1fr); }
  .related .grid { grid-template-columns: repeat(2, 1fr); }
  .topic-grid { grid-template-columns: repeat(2, 1fr); }
  .foot-grid { grid-template-columns: 1fr 1fr; }
  .cta-band { grid-template-columns: 1fr; }
  .btn { justify-self: start; }
}
@media (max-width: 620px) {
  body { font-size: 16.5px; }
  h1 { font-size: 1.55rem; }
  h2 { font-size: 1.3rem; }
  .hero { padding: 26px 0 24px; }
  .hero .feature h1 { font-size: 1.55rem; }
  .hero .feature .lede { font-size: 1rem; }
  .article-head h1 { font-size: 1.5rem; }
  .standfirst { font-size: 1.05rem; }
  .article-body h2 { font-size: 1.22rem; }
  .grid { grid-template-columns: 1fr; gap: 26px; }
  .related .grid { grid-template-columns: 1fr; }
  .topic-grid { grid-template-columns: 1fr; }
  .foot-grid { grid-template-columns: 1fr; }
  .example { grid-template-columns: 1fr; }
  .mast-cta { display: none; }
  .logo-tag { display: none; }
  .mainnav a { padding: 12px 14px 10px; }
  .wrap { padding: 0 16px; }
}
