/* =======================================================
   styles.css – WebBook Nobel Economics
   Theme: Orange (Cam) đậm → nhạt → pastel
   Font: 100% tiếng Việt (Noto Sans)
   Thêm căn đều chữ (text-align: justify)
   ======================================================= */

/* Import font chuẩn tiếng Việt */
@import url('https://fonts.googleapis.com/css2?family=Noto+Sans:wght@400;500;600;700&display=swap&subset=vietnamese');

/* Ép tất cả dùng font này */
* {
  font-family: "Noto Sans", system-ui, -apple-system, "Segoe UI", sans-serif !important;
}

/* ====== Bảng màu Cam ====== */
:root {
  --orange-dark:   #D35400;
  --orange-med:    #E67E22;
  --orange-light:  #F5B082;
  --orange-soft:   #FAD7A0;
  --orange-pale:   #FDEBD0;

  --text-color:    #22252a;
  --text-muted:    #6c757d;
  --bg-color:      #fefcf8;
  --border-color:  #e6d5c3;
}

/* ---------- TOÀN TRANG ---------- */
body {
  background-color: var(--bg-color);
  color: var(--text-color);
  line-height: 1.6;
  font-size: 16px;
}

/* 🔥 Căn đều đoạn văn */
p, li, blockquote, .content p, .content li {
  text-align: justify;
  text-justify: inter-word;
}

/* ---------- HEADING ---------- */
h1 {
  color: var(--orange-dark);
  font-size: 1.6rem;
  font-weight: 700;
  margin-top: 2.5rem;
  margin-bottom: 1rem;
  border-bottom: 3px solid var(--orange-light);
  padding-bottom: 0.3rem;
  text-align: left !important;     /* heading vẫn left */
}

h2 {
  color: var(--orange-med);
  font-size: 1.4rem;
  margin-top: 2rem;
  margin-bottom: 0.7rem;
  text-align: left !important;
}

h3 {
  color: var(--orange-light);
  font-size: 1.25rem;
  margin-top: 1.6rem;
  text-align: left !important;
}

h4 {
  color: var(--orange-med);
  font-size: 1.1rem;
  text-align: left !important;
}

h5 {
  color: var(--text-muted);
  font-size: 1rem;
  text-align: left !important;
}

/* ---------- LINKS ---------- */
a {
  color: var(--orange-med);
  text-decoration: none;
  font-weight: 500;
}

a:hover {
  color: var(--orange-dark);
  text-decoration: underline;
}

/* ---------- SIDEBAR ---------- */
.sidebar {
  background-color: white;
  border-right: 1px solid var(--border-color);
}

.sidebar-title {
  font-weight: 700;
  color: var(--orange-dark);
}

.sidebar-item a {
  color: var(--text-color);
}

.sidebar-item a:hover {
  color: var(--orange-med);
}

.sidebar-item .active > a,
.sidebar-item a.active {
  font-weight: 600;
  color: var(--orange-dark);
  border-left: 3px solid var(--orange-dark);
  padding-left: 0.5rem;
  background-color: var(--orange-pale);
}

/* ---------- BLOCKQUOTE ---------- */
blockquote {
  border-left: 5px solid var(--orange-med);
  padding-left: 1rem;
  background: var(--orange-pale);
  color: #444;
  text-align: justify;
}

/* ---------- CALLOUT ---------- */
.callout {
  border-radius: 8px;
  border-width: 1px !important;
  border-style: solid;
}

.callout-note {
  border-color: var(--orange-light);
}

.callout-note .callout-title {
  background-color: var(--orange-pale);
}

.callout-important {
  border-color: var(--orange-med);
}

.callout-important .callout-title {
  background-color: var(--orange-soft);
}

/* ---------- TABLE ---------- */
table {
  width: 100%;
  border-collapse: collapse;
  margin: 1rem 0;
}

thead {
  background: var(--orange-pale);
}

thead th {
  border-bottom: 2px solid var(--border-color);
  padding: 0.5rem 0.7rem;
  font-weight: 600;
}

tbody td {
  border-bottom: 1px solid var(--border-color);
  padding: 0.5rem 0.7rem;
}

tbody tr:nth-child(even) {
  background-color: #fef6ef;
}

caption,
.table-caption {
  caption-side: bottom;
  font-size: 0.85rem;
  color: var(--text-muted);
  padding-top: 0.25rem;
}

/* =======================================================
   Style hình theo tông cam WebBook Nobel
   ======================================================= */

/* Căn giữa hình */
.quarto-figure img,
img {
  display: block;
  margin-left: auto;
  margin-right: auto;
}

/* Bo góc + khung cam pastel + bóng mềm */
.quarto-figure img {
  border-radius: 10px;                     /* bo góc mềm */
  border: 2px solid #F5B082;               /* khung cam nhạt */
  box-shadow: 0 6px 18px rgba(211, 84, 0, 0.18); /* shadow cam nhẹ */
  padding: 4px;                            /* tạo khoảng thoáng */
  background-color: #fffaf5;               /* nền cam siêu pastel */
}

/* Caption màu cam nhẹ */
.figure-caption, figcaption {
  font-size: 0.9rem;
  color: #D35400;                /* cam đậm */
  text-align: center;
  margin-top: 0.4rem;
  font-weight: 500;
}

/* Căn container hình để đẹp hơn */
.quarto-figure {
  margin: 1.4rem auto;
  text-align: center;
}

/* ---------- CODE BLOCK ---------- */
pre {
  background-color: #1e1e1e;
  color: white;
  border-radius: 8px;
  padding: 0.9rem;
  overflow-x: auto;
}

code {
  background: #f1e1d2;
  padding: 0.1rem 0.3rem;
  border-radius: 4px;
}

/* ---------- FOOTNOTES ---------- */
.footnotes {
  border-top: 1px solid var(--border-color);
  margin-top: 2rem;
  padding-top: 0.6rem;
  color: var(--text-muted);
}

/* ---------- MOBILE ---------- */
@media (max-width: 768px) {
  h1 { font-size: 1.7rem; }
  h2 { font-size: 1.4rem; }
}
