/* Nelson Cream Theme — shared stylesheet
 * Tone kem dễ nhìn, mobile-first, print-friendly.
 * Locked palette — không thay đổi tuỳ tiện.
 */

:root {
  /* Cream palette (locked 2026-04-26) */
  --bg: #fdf8f0;
  --bg-card: #fef9ed;
  --bg-card-2: #faf2e1;
  --border: #e8dcc4;
  --border-soft: #f0e6cf;
  --text: #3a3a3a;
  --text-soft: #6b6256;
  --text-dim: #9a8f7f;

  /* Accents */
  --accent: #c9a661;          /* warm gold — CTA, highlight */
  --accent-soft: #e8d4a0;
  --success: #7a9b76;          /* sage green */
  --warning: #d4925b;          /* terracotta */
  --danger: #c75d5d;           /* dusty red */
  --info: #6b8eaa;             /* dusty blue */

  /* Typography */
  --font-body: -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
  --font-mono: 'SF Mono', Consolas, 'Roboto Mono', monospace;

  /* Spacing */
  --radius: 10px;
  --radius-lg: 14px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

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

body {
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--text);
  line-height: 1.65;
  font-size: 16px;
  padding: 0;
  -webkit-font-smoothing: antialiased;
}

/* Layout */
.container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 24px 20px;
}

/* Header */
.cream-header {
  background: linear-gradient(135deg, #faf2e1 0%, #fef9ed 100%);
  border-bottom: 1px solid var(--border);
  padding: 28px 0 24px;
  position: relative;
}
.cream-header h1 {
  font-size: 28px;
  font-weight: 700;
  letter-spacing: -0.3px;
  color: var(--text);
}
.cream-header .meta {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 20px;
  margin-top: 10px;
  font-size: 13px;
  color: var(--text-soft);
}
.cream-header .meta strong { color: var(--text); }

/* Sections */
.section {
  margin: 32px 0;
}
.section-title {
  display: flex;
  align-items: baseline;
  gap: 10px;
  margin-bottom: 16px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border-soft);
}
.section-title .num {
  font-size: 12px;
  color: var(--accent);
  font-weight: 700;
  letter-spacing: 1px;
}
.section-title h2 {
  font-size: 20px;
  font-weight: 700;
  color: var(--text);
}

/* Cards */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px 20px;
  margin: 12px 0;
}
.card h3 {
  font-size: 15px;
  font-weight: 700;
  margin-bottom: 8px;
  color: var(--text);
}
.card p { color: var(--text-soft); font-size: 14px; }

/* Card grid */
.card-grid {
  display: grid;
  gap: 12px;
}
.card-grid.cols-2 { grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); }
.card-grid.cols-3 { grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }

/* Pills / Badges */
.pill {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 100px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}
.pill.gold { background: rgba(201,166,97,0.15); color: var(--accent); }
.pill.success { background: rgba(122,155,118,0.15); color: var(--success); }
.pill.warning { background: rgba(212,146,91,0.15); color: var(--warning); }
.pill.danger { background: rgba(199,93,93,0.15); color: var(--danger); }
.pill.info { background: rgba(107,142,170,0.15); color: var(--info); }
.pill.gray { background: rgba(58,58,58,0.06); color: var(--text-soft); }

/* Tables */
.table-wrap {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow-x: auto;
  margin: 12px 0;
}
table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}
thead { background: var(--bg-card-2); }
th, td {
  padding: 11px 14px;
  text-align: left;
  border-bottom: 1px solid var(--border-soft);
  vertical-align: top;
}
th {
  font-size: 12px;
  color: var(--text-soft);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  font-weight: 700;
}
tbody tr:last-child td { border-bottom: none; }
tbody tr:hover { background: rgba(201,166,97,0.04); }

/* Code */
code {
  font-family: var(--font-mono);
  font-size: 13px;
  background: var(--bg-card-2);
  padding: 1px 6px;
  border-radius: 4px;
  color: var(--text);
}
pre.code {
  background: #fff8e8;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 14px 16px;
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--text);
  overflow-x: auto;
  line-height: 1.6;
  margin: 10px 0;
}

/* Links */
a {
  color: var(--accent);
  text-decoration: none;
  font-weight: 500;
}
a:hover { text-decoration: underline; }

/* Buttons */
.btn {
  display: inline-block;
  padding: 10px 18px;
  background: var(--accent);
  color: white;
  border-radius: 8px;
  text-decoration: none;
  font-weight: 600;
  font-size: 14px;
  transition: opacity 0.15s;
  min-height: 44px;
  line-height: 24px;
}
.btn:hover { opacity: 0.9; text-decoration: none; }
.btn.outline {
  background: transparent;
  color: var(--accent);
  border: 1px solid var(--accent);
}

/* Footer */
footer {
  margin-top: 48px;
  padding: 20px 0;
  border-top: 1px solid var(--border-soft);
  color: var(--text-dim);
  font-size: 13px;
  text-align: center;
}

/* MOBILE FIRST — overrides for desktop */
@media (min-width: 768px) {
  body { font-size: 15px; }
  .container { padding: 32px 24px; }
  .cream-header { padding: 40px 0 32px; }
  .cream-header h1 { font-size: 36px; }
  .section-title h2 { font-size: 24px; }
}

/* MOBILE — extra tap-friendly */
@media (max-width: 767px) {
  .container { padding: 20px 16px; }
  .cream-header h1 { font-size: 24px; }
  .cream-header .meta { font-size: 12px; gap: 8px 14px; }
  .section { margin: 24px 0; }
  .card { padding: 16px; }
  th, td { padding: 10px 12px; font-size: 13px; }
  pre.code { font-size: 12px; padding: 12px; }
  .btn { width: 100%; text-align: center; }
}

/* PRINT */
@media print {
  body { background: white; color: black; }
  .card, .table-wrap { border-color: #ccc; box-shadow: none; }
  a { color: black; text-decoration: underline; }
}
