.site-wrap {
  width: min(1120px, calc(100% - 32px));
  margin: 0 auto;
}

.site-header {
  padding: 24px 0 14px;
}

.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.brand {
  text-decoration: none;
  font-weight: 750;
  letter-spacing: -.03em;
  font-size: clamp(24px, 4vw, 38px);
  color: var(--text);
}

.nav-links {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
}

.nav-links a,
.theme-toggle,
.up-btn {
  border: 1px solid var(--border);
  background: rgba(255,255,255,.35);
  color: var(--text);
  border-radius: 999px;
  padding: 9px 14px;
  text-decoration: none;
  cursor: pointer;
  font: inherit;
}

.hero {
  margin: 20px 0 28px;
  padding: clamp(22px, 5vw, 48px);
  background: linear-gradient(145deg, var(--surface), var(--surface-2));
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.hero h1 {
  margin: 0 0 10px;
  font-size: clamp(30px, 6vw, 58px);
  line-height: 1.04;
  letter-spacing: -.045em;
}

.hero p {
  margin: 0;
  max-width: 720px;
  color: var(--muted);
  font-size: 18px;
  line-height: 1.7;
}

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 18px;
  margin: 24px 0 60px;
}

.card {
  display: block;
  text-decoration: none;
  padding: 22px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  transition: transform .15s ease, border-color .15s ease;
}

.card:hover {
  transform: translateY(-2px);
  border-color: var(--accent);
}

.card-title {
  margin: 0 0 12px;
  font-size: 22px;
  line-height: 1.28;
  letter-spacing: -.025em;
}

.card-cat {
  color: var(--accent);
  font-size: 14px;
  font-weight: 650;
}

.article-shell {
  width: min(920px, calc(100% - 32px));
  margin: 0 auto 70px;
}

.article-head {
  padding: 24px 0 12px;
}

.breadcrumb {
  margin: 12px 0 22px;
  color: var(--muted);
  font-size: 14px;
}

.breadcrumb a {
  color: var(--muted);
  text-decoration: none;
}

.article-title {
  margin: 0;
  max-width: 860px;
  font-size: clamp(34px, 7vw, 62px);
  line-height: 1.05;
  letter-spacing: -.045em;
}

.article-content {
  max-width: 820px;
  font-family: var(--reading-font);
  font-size: 20px;
  line-height: 1.84;
  font-weight: 400;
  letter-spacing: .002em;
}

.article-content p { margin: 0 0 1.05em; }
.article-content h2,
.article-content h3,
.article-content h4 {
  font-family: var(--ui-font);
  line-height: 1.25;
  letter-spacing: -.025em;
  margin: 1.8em 0 .75em;
}

.article-content blockquote {
  margin: 1.5em 0;
  padding: 1px 0 1px 20px;
  border-left: 3px solid var(--accent);
  color: var(--muted);
}

.article-content a {
  color: var(--accent-2);
  text-underline-offset: 4px;
}

.article-content figure {
  margin: 1.6em 0;
}

.article-content figcaption {
  font-family: var(--ui-font);
  color: var(--muted);
  font-size: 14px;
  margin-top: 8px;
}

.article-footer {
  max-width: 820px;
  margin-top: 34px;
  padding-top: 22px;
  border-top: 1px solid var(--border);
  color: var(--muted);
}

.article-footer a {
  color: var(--accent-2);
  font-weight: 650;
  text-decoration: none;
}

.source-text {
  margin-top: 14px;
  font-size: 14px;
  color: var(--muted);
}

.footer {
  padding: 30px 0 45px;
  color: var(--muted);
  text-align: center;
  border-top: 1px solid var(--border);
}

.up-btn {
  position: fixed;
  right: 18px;
  bottom: 18px;
  display: inline-flex;
  text-decoration: none;
  box-shadow: var(--shadow);
}

.empty {
  padding: 28px;
  border: 1px dashed var(--border);
  border-radius: var(--radius);
  color: var(--muted);
  background: rgba(255,255,255,.25);
}

@media (max-width: 640px) {
  .site-wrap,
  .article-shell {
    width: min(100% - 22px, 920px);
  }

  .nav {
    align-items: flex-start;
    flex-direction: column;
  }

  .nav-links {
    width: 100%;
  }

  .article-content {
    font-size: 18.5px;
    line-height: 1.82;
  }

  .card {
    padding: 18px;
  }
}

/* PHAPHOC_FRONTEND_KOHO_ARTICLE_V2_START */

/*
  Set font KoHo cho nội dung bài viết frontend.
  Nếu KoHo local đã tải được, browser sẽ dùng KoHo thật.
  Nếu không, sẽ fallback về system font.
*/

.article-content,
.article-body,
.post-content,
.entry-content,
.reading-content,
.post-body,
.article-page article,
article .content,
main article {
  font-family: "KoHo", "Koho", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif !important;
  font-size: 20px;
  line-height: 1.86;
  font-weight: 500;
  letter-spacing: -0.012em;
  color: var(--text, #2b2118);
}

.article-content p,
.article-body p,
.post-content p,
.entry-content p,
.reading-content p,
.post-body p,
.article-page article p,
main article p {
  margin-top: 0;
  margin-bottom: 1.12em;
}

@media (max-width: 720px) {
  .article-content,
  .article-body,
  .post-content,
  .entry-content,
  .reading-content,
  .post-body,
  .article-page article,
  article .content,
  main article {
    font-size: 18.5px;
    line-height: 1.84;
  }
}

/* PHAPHOC_FRONTEND_KOHO_ARTICLE_V2_END */

/* PHAPHOC_FRONTEND_KOHO_LIGHT_V3_START */

.article-content,
.article-body,
.post-content,
.entry-content,
.reading-content,
.post-body,
.article-page article,
article .content,
main article {
  font-family: "KoHo", "Koho", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif !important;
  font-weight: 400 !important;
  letter-spacing: -0.006em !important;
}

.article-content strong,
.article-body strong,
.post-content strong,
.entry-content strong,
.reading-content strong,
.post-body strong,
.article-page article strong,
main article strong {
  font-weight: 600 !important;
}

/* PHAPHOC_FRONTEND_KOHO_LIGHT_V3_END */


/* PHAPHOC_PDF_READER_FRONTEND_V1_START */

.pdf-source-box {
  margin: 22px 0 30px;
  padding: 18px 20px;
  border: 1px solid rgba(166, 119, 55, 0.28);
  border-radius: 20px;
  background:
    linear-gradient(180deg, rgba(255, 248, 235, 0.78), rgba(250, 239, 219, 0.72));
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}

html[data-theme="dark"] .pdf-source-box {
  background:
    linear-gradient(180deg, rgba(54, 36, 23, 0.88), rgba(38, 25, 16, 0.9));
  border-color: rgba(218, 169, 83, 0.28);
}

.pdf-source-text strong {
  display: block;
  margin-bottom: 4px;
  font-weight: 600;
}

.pdf-source-text p {
  margin: 0;
  font-size: 15px;
  line-height: 1.55;
  opacity: .86;
}

.pdf-file-name {
  margin-top: 5px !important;
  font-size: 13px !important;
  opacity: .68 !important;
  word-break: break-word;
}

.pdf-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

.pdf-actions a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 38px;
  padding: 0 15px;
  border-radius: 999px;
  border: 1px solid rgba(166, 119, 55, 0.34);
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
  background: rgba(255, 255, 255, 0.42);
}

html[data-theme="dark"] .pdf-actions a {
  background: rgba(255, 230, 180, 0.08);
  border-color: rgba(218, 169, 83, 0.32);
}

@media (max-width: 720px) {
  .pdf-source-box {
    display: block;
    padding: 16px;
  }

  .pdf-actions {
    margin-top: 14px;
    flex-wrap: wrap;
  }

  .pdf-actions a {
    flex: 1 1 auto;
  }
}

/* PHAPHOC_PDF_READER_FRONTEND_V1_END */


/* PHAPHOC_PDF_PARAGRAPH_REFLOW_CSS_V2_START */

.article-content,
.article-body,
.post-content,
.entry-content,
.reading-content,
.post-body,
.article-page article,
main article {
  max-width: 820px;
}

.article-content p,
.article-body p,
.post-content p,
.entry-content p,
.reading-content p,
.post-body p,
.article-page article p,
main article p {
  margin-top: 0;
  margin-bottom: 1.1em;
  line-height: 1.88;
  text-wrap: pretty;
}

.article-content h2,
.article-body h2,
.post-content h2,
.entry-content h2,
.reading-content h2,
.post-body h2,
.article-page article h2,
main article h2 {
  margin-top: 1.7em;
  margin-bottom: .75em;
  font-size: 1.18em;
  line-height: 1.45;
  font-weight: 600;
}

.pdf-meta-line {
  font-size: .92em;
  line-height: 1.65 !important;
  opacity: .76;
  margin-bottom: 1.25em !important;
}

@media (max-width: 720px) {
  .article-content p,
  .article-body p,
  .post-content p,
  .entry-content p,
  .reading-content p,
  .post-body p,
  .article-page article p,
  main article p {
    line-height: 1.84;
    margin-bottom: 1.05em;
  }
}

/* PHAPHOC_PDF_PARAGRAPH_REFLOW_CSS_V2_END */

/* PHAPHOC_PDF2HTML_POLISH_V2B_FRONTEND_CSS_START */

.article-content p,
.article-body p,
.post-content p,
.entry-content p,
.reading-content p,
.post-body p,
.article-page article p,
main article p {
  margin-top: 0;
  margin-bottom: 1.12em;
  line-height: 1.88;
  text-wrap: pretty;
}

.article-content h2,
.article-body h2,
.post-content h2,
.entry-content h2,
.reading-content h2,
.post-body h2,
.article-page article h2,
main article h2 {
  margin-top: 1.75em;
  margin-bottom: .72em;
  font-size: 1.16em;
  line-height: 1.46;
  font-weight: 600;
}

.pdf-meta-line {
  font-size: .92em;
  line-height: 1.65 !important;
  opacity: .74;
  margin-bottom: 1.25em !important;
}

.pdf-polish-list {
  margin: 0 0 1.25em 1.35em;
  padding: 0;
}

.pdf-polish-list li {
  margin-bottom: .42em;
  line-height: 1.76;
}

/* PHAPHOC_PDF2HTML_POLISH_V2B_FRONTEND_CSS_END */

/* PHAPHOC_PDF2HTML_POLISH_V3_FRONTEND_CSS_START */

.pdf-meta-line {
  font-size: .92em;
  line-height: 1.65 !important;
  opacity: .74;
  margin-bottom: 1.25em !important;
}

.pdf-polish-list {
  margin: 0 0 1.25em 1.35em;
  padding: 0;
}

.pdf-polish-list li {
  margin-bottom: .42em;
  line-height: 1.76;
}

/* PHAPHOC_PDF2HTML_POLISH_V3_FRONTEND_CSS_END */

/* PHAPHOC_PDF_NATIVE_LAYOUT_FRONTEND_V1_START */

.pdf-actions a[href^="/pdf-html/"] {
  font-weight: 600 !important;
  border-color: rgba(155, 106, 50, .45) !important;
}

/* PHAPHOC_PDF_NATIVE_LAYOUT_FRONTEND_V1_END */

/* PHAPHOC_PDF2HTML_STYLED_LAYOUT_V4_FRONTEND_CSS_START */

.pdf-styled-document {
  max-width: 920px;
  margin: 0 auto;
}

.pdf-styled-page {
  position: relative;
  box-sizing: border-box;
  max-width: 840px;
  min-height: 960px;
  margin: 0 auto 32px;
  padding: 46px 54px 54px;
  border-radius: 8px;
  border: 1px solid rgba(155, 106, 50, 0.22);
  background: #fffaf1;
  box-shadow:
    0 18px 52px rgba(92, 58, 24, 0.10),
    inset 0 1px 0 rgba(255,255,255,.72);
}

html[data-theme="dark"] .pdf-styled-page {
  background: #f7efe4;
  color: #24180f;
  box-shadow: 0 18px 52px rgba(0,0,0,.32);
}

.pdf-styled-page-number {
  position: absolute;
  top: 18px;
  right: 28px;
  font-size: 12px;
  color: rgba(80, 52, 24, .46);
  user-select: none;
}

.pdf-styled-page pre {
  margin: 0;
  white-space: pre-wrap;
  overflow-wrap: break-word;
  word-break: normal;
  font-family: "KoHo", "Koho", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 18.5px;
  line-height: 1.78;
  font-weight: 400;
  letter-spacing: -0.006em;
  color: #24180f;
}

@media (max-width: 760px) {
  .pdf-styled-document {
    max-width: 100%;
  }

  .pdf-styled-page {
    max-width: 100%;
    min-height: 0;
    margin-bottom: 22px;
    padding: 38px 18px 28px;
    border-radius: 14px;
  }

  .pdf-styled-page-number {
    top: 14px;
    right: 18px;
  }

  .pdf-styled-page pre {
    font-size: 17px;
    line-height: 1.72;
  }
}

/* PHAPHOC_PDF2HTML_STYLED_LAYOUT_V4_FRONTEND_CSS_END */

/* PHAPHOC_PDF2HTML_CLEAN_READING_V5_FRONTEND_CSS_START */

/* V5 không dùng pre/pdf-styled nữa; chỉ tinh chỉnh nhẹ đoạn văn trong bài. */
.article-content p,
.article-body p,
.post-content p,
.entry-content p,
.reading-content p,
.post-body p {
  margin-top: 0;
  margin-bottom: 1.12em;
  line-height: 1.86;
}

/* PHAPHOC_PDF2HTML_CLEAN_READING_V5_FRONTEND_CSS_END */
