/* ─────────────────────────────────────────────────────────────
   buppou — trang đọc kinh điển Pali bằng tiếng Việt
   Một tệp CSS, không phụ thuộc mạng ngoài.
   ───────────────────────────────────────────────────────────── */

/* ── bảng màu: ba chế độ nền đọc ───────────────────────────
   sang  — giấy trắng ngà (mặc định, theo hệ thống nếu là ban ngày)
   vang  — lá bối, giấy dó: nền vàng ấm, mực nâu
   toi   — mực đêm: nền than ấm, chữ ngà
   Mọi màu đi qua biến, không hard-code ở nơi khác.
   ───────────────────────────────────────────────────────── */

:root {
  --paper: #fbf8f3;
  --surface: #fffdf9;
  --ink: #1c1a17;
  --ink-soft: #3d382f;
  --muted: #6f675a;
  --line: #e6ded1;
  --accent: #9a4b1e;
  --accent-ink: #7c3a12;
  --accent-wash: #f4e7db;
  --note-wash: #f3efe6;
  --on-accent: #fffdf9;
  --radius: 10px;
  color-scheme: light;

  --font-ui: system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  --font-read: "Noto Serif", "Times New Roman", Georgia, serif;

  --wrap: 66rem;
  --read: calc(40rem + 2.3rem);
  --fs: 1;
}

/* nền lá bối — ấm như giấy dó, mực nâu, không chói */
:root[data-theme="vang"] {
  --paper: #f2e6cd;
  --surface: #f8efdc;
  --ink: #33291c;
  --ink-soft: #4a3c2a;
  --muted: #6f5b40;
  --line: #ddc9a4;
  --accent: #8a4a1c;
  --accent-ink: #6d3812;
  --accent-wash: #ead8b8;
  --note-wash: #ebdfc6;
  --on-accent: #fdf6e9;
  color-scheme: light;
}

/* nền mực đêm — than ấm, không xanh lạnh */
:root[data-theme="toi"] {
  --paper: #15130f;
  --surface: #1c1915;
  --ink: #e9e3d8;
  --ink-soft: #d3ccbf;
  --muted: #a49a89;
  --line: #302b23;
  --accent: #e5a06a;
  --accent-ink: #f2b98d;
  --accent-wash: #2a2117;
  --note-wash: #211d18;
  --on-accent: #17130f;
  color-scheme: dark;
}

/* khi người đọc chưa chọn gì: theo hệ thống */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme]) {
    --paper: #15130f;
    --surface: #1c1915;
    --ink: #e9e3d8;
    --ink-soft: #d3ccbf;
    --muted: #a49a89;
    --line: #302b23;
    --accent: #e5a06a;
    --accent-ink: #f2b98d;
    --accent-wash: #2a2117;
    --note-wash: #211d18;
    --on-accent: #17130f;
    color-scheme: dark;
  }
}

*, *::before, *::after { box-sizing: border-box; }

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: 4.5rem;
}

html { background: var(--paper); }

body {
  margin: 0;
  background: var(--paper);
  transition: background-color .18s ease, color .18s ease;
  color: var(--ink);
  font-family: var(--font-ui);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

a { color: var(--accent-ink); text-decoration-thickness: 1px; text-underline-offset: 2px; }
a:hover { color: var(--accent); }

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

.skip {
  position: absolute; left: -999px; top: 0;
  background: var(--surface); padding: .6rem 1rem; z-index: 99;
}
.skip:focus { left: .5rem; top: .5rem; }

/* ── đầu trang ───────────────────────────────────────────── */

.site-head {
  position: sticky; top: 0; z-index: 20;
  background: color-mix(in srgb, var(--paper) 88%, transparent);
  backdrop-filter: saturate(140%) blur(10px);
  border-bottom: 1px solid var(--line);
}

.head-in {
  display: flex; align-items: center; justify-content: space-between;
  gap: .7rem; height: 3.4rem; min-width: 0;
}

.brand {
  font-weight: 650; letter-spacing: -.02em; font-size: 1.06rem;
  color: var(--ink); text-decoration: none; display: inline-flex;
  align-items: center; gap: .45rem; white-space: nowrap;
}
.brand-mark {
  width: 1.15rem; height: 1.15rem; flex: none; color: var(--accent);
  display: block; overflow: visible;
}
.brand-text { line-height: 1; }

.nav {
  display: flex; gap: .1rem; overflow-x: auto; scrollbar-width: none;
  min-width: 0; flex: 1 1 auto; justify-content: flex-end;
}
.nav::-webkit-scrollbar { display: none; }
.nav a {
  color: var(--muted); text-decoration: none; font-size: .87rem;
  padding: .45rem .55rem; border-radius: 6px; white-space: nowrap;
}
.nav a:hover { color: var(--ink); background: var(--accent-wash); }
.nav a.on { color: var(--accent-ink); font-weight: 600; }

@media (max-width: 30rem) {
  .head-in { gap: .5rem; }
  .nav a { padding: .4rem .22rem; font-size: .74rem; }
  .nav a[data-home], .nav a[data-about] { display: none; }
  .nav { justify-content: flex-end; gap: 0; }
  .brand { font-size: .95rem; }
  .brand-mark { display: none; }
  .wrap { padding: 0 1rem; }
}

@media (max-width: 24rem) {
  .brand-text { display: none; }
  .brand-mark { display: block; }
}

@media (max-width: 21rem) {
  .nav a { padding: .4rem .16rem; }
}

/* ── nút đổi nền đọc ─────────────────────────────────────── */

.theme-switch {
  display: flex; align-items: center; gap: .1rem; flex: none;
  padding: .14rem; border: 1px solid var(--line); border-radius: 99px;
  background: var(--surface);
}
.theme-switch button {
  display: inline-flex; align-items: center; gap: .35rem;
  padding: .34rem .42rem; border: 0; border-radius: 99px;
  background: transparent; color: var(--muted); font: inherit;
  font-size: .78rem; line-height: 1; cursor: pointer;
}
.theme-switch button:hover { color: var(--ink); }
.theme-switch button[aria-pressed="true"] {
  background: var(--accent-wash); color: var(--accent-ink);
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--accent) 40%, transparent);
}
.theme-switch .sw {
  width: .92rem; height: .92rem; border-radius: 50%; flex: none;
  border: 1px solid rgba(0, 0, 0, .16);
}
.sw-sang { background: #fbf8f3; }
.sw-vang { background: #f2e6cd; }
.sw-toi { background: #15130f; border-color: rgba(255, 255, 255, .28); }
.theme-switch .lbl { display: none; padding-right: .1rem; }
@media (min-width: 48rem) { .theme-switch .lbl { display: inline; } }

@media (max-width: 30rem) {
  .theme-switch { padding: .1rem; gap: .02rem; }
  .theme-switch button { padding: .28rem .26rem; }
}

@media (max-width: 21rem) {
  .theme-switch button { padding: .24rem .18rem; }
  .theme-switch .sw { width: .78rem; height: .78rem; }
}

/* ── trang chủ ───────────────────────────────────────────── */

.hero { padding-top: 3.2rem; padding-bottom: 1.2rem; max-width: calc(46rem + 2.3rem); }
.eyebrow {
  margin: 0 0 .6rem; font-size: .76rem; letter-spacing: .09em;
  text-transform: uppercase; color: var(--accent); font-weight: 600;
}
.hero h1 {
  font-family: var(--font-read); font-weight: 600; letter-spacing: -.015em;
  font-size: clamp(1.85rem, 5.6vw, 3rem); line-height: 1.16; margin: 0 0 1rem;
  text-wrap: balance;
}
.lead {
  font-size: 1.06rem; color: var(--ink-soft); line-height: 1.7;
  margin: 0 0 1.2rem; max-width: 40rem;
}

.hero-actions { display: flex; flex-wrap: wrap; gap: .6rem; margin-top: 1.4rem; }
.btn {
  display: inline-block; padding: .62rem 1.05rem; border-radius: var(--radius);
  border: 1px solid var(--line); background: var(--surface);
  color: var(--ink); text-decoration: none; font-size: .92rem; font-weight: 550;
}
.btn:hover { border-color: var(--accent); color: var(--accent-ink); }
.btn-primary { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.btn-primary:hover { background: var(--accent-ink); color: var(--on-accent); }


.section { padding-top: 2.6rem; padding-bottom: 2.6rem; border-top: 1px solid var(--line); }
.section-title {
  font-family: var(--font-read); font-size: 1.32rem; font-weight: 600;
  letter-spacing: -.01em; margin: 0 0 .35rem;
}
.section-sub { color: var(--muted); font-size: .93rem; margin: 0 0 1.4rem; }

/* danh sách bắt đầu */
.start-list { list-style: none; margin: 0; padding: 0; display: grid; gap: .55rem; }
.start-list li a {
  display: grid; gap: .15rem; padding: .9rem 1rem; border: 1px solid var(--line);
  border-radius: var(--radius); background: var(--surface); text-decoration: none;
  color: var(--ink); transition: border-color .12s ease, transform .12s ease;
}
.start-list li a:hover { border-color: var(--accent); transform: translateY(-1px); }
.start-title { font-family: var(--font-read); font-size: 1.06rem; font-weight: 600; }
.start-meta { font-size: .78rem; color: var(--accent); letter-spacing: .02em; }
.start-why { font-size: .88rem; color: var(--muted); line-height: 1.55; }

/* thẻ bộ kinh */
.book-grid { display: grid; gap: .8rem; }
@media (min-width: 44rem) { .book-grid { grid-template-columns: 1fr 1fr; gap: 1rem; } }

.book-card {
  display: block; padding: 1.35rem 1.3rem 1.2rem; border: 1px solid var(--line);
  border-radius: 14px; background: var(--surface); text-decoration: none; color: var(--ink);
  transition: border-color .12s ease, transform .12s ease;
}
.book-card:hover { border-color: var(--accent); transform: translateY(-2px); }
.book-count {
  display: inline-block; font-size: .74rem; letter-spacing: .04em;
  color: var(--accent); background: var(--accent-wash); padding: .18rem .5rem;
  border-radius: 99px; font-weight: 600;
}
.book-card h2 {
  font-family: var(--font-read); font-size: 1.28rem; margin: .6rem 0 .1rem;
  font-weight: 600; letter-spacing: -.01em;
}
.book-pali { margin: 0; color: var(--muted); font-size: .84rem; font-style: italic; }
.book-blurb { margin: .6rem 0 1rem; color: var(--ink-soft); font-size: .92rem; line-height: 1.6; }
.book-cta { font-size: .88rem; font-weight: 600; color: var(--accent-ink); }

/* điểm khác biệt */
.points { margin: 1rem 0 0; padding-left: 1.1rem; color: var(--ink-soft); }
.points li { margin-bottom: .65rem; line-height: 1.65; font-size: .95rem; }
.points strong { color: var(--ink); }

/* ── trang danh sách ─────────────────────────────────────── */

.head-block { padding-top: 2.6rem; padding-bottom: 1.4rem; max-width: calc(42rem + 2.3rem); }
.head-block h1 {
  font-family: var(--font-read); font-weight: 600; letter-spacing: -.015em;
  font-size: clamp(1.7rem, 5vw, 2.4rem); margin: 0 0 .5rem; line-height: 1.2;
}
.head-block.center { text-align: center; margin: 0 auto; }
.meta-line { color: var(--muted); font-size: .86rem; margin: .4rem 0 0; }
.meta-line a { color: var(--accent-ink); }

.filter-bar { display: flex; align-items: center; gap: .7rem; margin: 0 0 1rem; }
.filter-bar input {
  flex: 1 1 auto; min-width: 0; padding: .62rem .8rem; border: 1px solid var(--line); border-radius: var(--radius);
  background: var(--surface); color: var(--ink); font-family: inherit; font-size: .95rem;
}
.filter-bar input:focus { outline: 2px solid var(--accent); outline-offset: 1px; border-color: transparent; }
.filter-count { font-size: .82rem; color: var(--muted); white-space: nowrap; }

.sutta-list { list-style: none; margin: 0 0 3rem; padding: 0; border-top: 1px solid var(--line); }
.row { border-bottom: 1px solid var(--line); }
.row > a {
  display: flex; align-items: baseline; gap: .8rem; padding: .78rem .2rem;
  text-decoration: none; color: var(--ink);
}
.row > a:hover { background: var(--accent-wash); }
.row-num {
  flex: 0 0 2.2rem; text-align: right; color: var(--muted);
  font-variant-numeric: tabular-nums; font-size: .82rem;
}
.row-main { flex: 1; display: flex; flex-direction: column; gap: .1rem; min-width: 0; }
.row-title { font-family: var(--font-read); font-size: 1.02rem; font-weight: 600; }
.row-pali { font-size: .8rem; color: var(--muted); font-style: italic; }
.row-min { font-size: .78rem; color: var(--muted); white-space: nowrap; }
.empty { color: var(--muted); padding: 2rem 0; }


/* ── màn hình rộng: hai cột cho danh sách ────────────────── */

@media (min-width: 64rem) {
  .start-list { grid-template-columns: 1fr 1fr; gap: .7rem; }
  .sutta-list {
    display: grid; grid-template-columns: 1fr 1fr; column-gap: 2.8rem;
    align-items: start;
  }
  .sutta-list .row { border-bottom: 1px solid var(--line); }
  .head-block { max-width: calc(48rem + 2.3rem); }
}
/* ── trang bài kinh ──────────────────────────────────────── */

.article { max-width: var(--read); padding-top: 1.6rem; padding-bottom: 3rem; }
.article.narrow { max-width: calc(44rem + 2.3rem); }
.crumbs { font-size: .8rem; color: var(--muted); margin-bottom: 1.2rem; }
.crumbs a { color: var(--muted); text-decoration: none; }
.crumbs a:hover { color: var(--accent-ink); }

.article-head { margin-bottom: 1.6rem; }
.article-head h1 {
  font-family: var(--font-read); font-weight: 600; letter-spacing: -.015em;
  font-size: clamp(1.6rem, 4.8vw, 2.25rem); line-height: 1.2; margin: .1rem 0 .35rem;
  text-wrap: balance;
}
.pali-title { color: var(--muted); font-style: italic; font-size: .95rem; margin: 0 0 .5rem; }

/* giới thiệu + mục lục thu gọn */
details.intro, details.toc {
  border: 1px solid var(--line); border-radius: var(--radius);
  background: var(--surface); padding: .1rem .95rem; margin: 0 0 .9rem;
}
details.intro summary, details.toc summary {
  cursor: pointer; padding: .7rem 0; font-weight: 600; font-size: .9rem;
  color: var(--accent-ink); list-style: none;
}
details.intro summary::-webkit-details-marker, details.toc summary::-webkit-details-marker { display: none; }
details.intro summary::after, details.toc summary::after { content: " ＋"; font-weight: 400; }
details[open].intro summary::after, details[open].toc summary::after { content: " −"; }
.intro-hint { font-size: .84rem; color: var(--muted); margin: 0 0 .4rem; }
details.toc ol { margin: .2rem 0 .9rem; padding-left: 1.2rem; }
details.toc li { margin-bottom: .3rem; font-size: .9rem; }

/* nội dung bài kinh */
.content {
  font-family: var(--font-read);
  font-size: calc(1.085rem * var(--fs));
  line-height: 1.82;
  color: var(--ink);
}
@media (min-width: 40rem) { .content { font-size: calc(1.14rem * var(--fs)); } }

/* hôm nay đọc gì */
.daily {
  border: 1px solid var(--line); border-radius: 12px; background: var(--accent-wash);
  padding: 1.05rem 1.2rem 1.15rem; max-width: 46rem;
}
.daily-kicker { font-size: .74rem; letter-spacing: .05em; color: var(--accent); margin: 0 0 .3rem; }
.daily-title {
  font-family: var(--font-read); font-size: 1.4rem; font-weight: 600;
  letter-spacing: -.012em; margin: 0 0 .45rem;
}
.daily-title a { color: inherit; text-decoration: none; }
.daily-title a:hover { color: var(--accent-ink); }
.daily-why { margin: 0 0 .8rem; color: var(--ink-soft); font-size: .95rem; line-height: 1.65; }
.daily-why:empty { display: none; }
.daily-meta {
  margin: 0; display: flex; align-items: baseline; gap: .8rem;
  font-size: .85rem; color: var(--muted);
}
.daily-cta { color: var(--accent-ink); text-decoration: none; font-weight: 600; }
.daily-cta:hover { text-decoration: underline; }

/* gợi ý đọc Trường Bộ */
.pick-list { list-style: none; margin: 0; padding: 0; display: grid; gap: .7rem; grid-template-columns: 1fr; }
@media (min-width: 34rem) { .pick-list { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 60rem) { .pick-list { grid-template-columns: repeat(4, 1fr); } }
.pick a {
  display: flex; flex-direction: column; height: 100%;
  border: 1px solid var(--line); border-radius: 10px; padding: .8rem .9rem;
  text-decoration: none; color: inherit; background: var(--surface);
}
.pick a:hover { border-color: var(--accent); }
.pick-title { font-family: var(--font-read); font-weight: 600; font-size: 1.02rem; line-height: 1.35; }
.pick-meta { font-size: .76rem; color: var(--accent); margin: .2rem 0 .45rem; }
.pick-why { font-size: .84rem; color: var(--ink-soft); line-height: 1.5; }
.section-more { margin: .9rem 0 0; font-size: .88rem; }

/* nút lên đầu trang */

.to-top {
  position: fixed; right: 1rem; bottom: calc(1rem + env(safe-area-inset-bottom, 0px));
  width: 2.75rem; height: 2.75rem; display: grid; place-items: center;
  border: 1px solid var(--line); border-radius: 50%; z-index: 15;
  background: var(--surface); color: var(--ink-soft); text-decoration: none;
  box-shadow: 0 2px 10px rgba(40, 30, 15, .08);
  transition: border-color .12s ease, color .12s ease, transform .12s ease;
}
.to-top svg { width: 1.15rem; height: 1.15rem; }
.to-top:hover { border-color: var(--accent); color: var(--accent-ink); transform: translateY(-1px); }
.to-top[hidden] { display: none; }

/* địa chỉ dài trong nguồn tham khảo không được đẩy vỡ bề ngang trang */
.content, .intro, .article-foot, .toc-side { overflow-wrap: break-word; }
.content a, .intro a, .article-foot a { overflow-wrap: anywhere; }

/* chia sẻ bài kinh */

.share { margin: 2.4rem 0 0; padding-top: 1.5rem; border-top: 1px solid var(--line); }
.share-label { font-size: .8rem; letter-spacing: .02em; color: var(--muted); margin: 0 0 .65rem; }
.share-row { display: flex; flex-wrap: wrap; gap: .5rem; }
.share-btn {
  display: inline-flex; align-items: center; gap: .42rem;
  padding: .48rem .8rem; border: 1px solid var(--line); border-radius: 99px;
  background: var(--surface); color: var(--ink-soft); font: inherit; font-size: .84rem;
  text-decoration: none; cursor: pointer;
  transition: border-color .12s ease, color .12s ease, background .12s ease;
}
.share-btn svg { width: 1rem; height: 1rem; flex: none; }
.share-btn:hover { border-color: var(--accent); color: var(--accent-ink); }
.share-btn.is-done { border-color: var(--accent); background: var(--accent-wash); color: var(--accent-ink); }
.share-btn[hidden] { display: none; }
.share-url {
  display: block; width: 100%; margin: .7rem 0 0; padding: .5rem .7rem;
  border: 1px solid var(--accent); border-radius: var(--radius);
  background: var(--surface); color: var(--ink-soft); font: inherit; font-size: .82rem;
}
.share-url[hidden] { display: none; }

.share-status { font-size: .8rem; color: var(--accent-ink); margin: .6rem 0 0; min-height: .9rem; }

/* nút chỉnh cỡ chữ */
.text-size { display: flex; gap: .35rem; margin-top: .9rem; }
.text-size button {
  font: inherit; font-size: .8rem; line-height: 1; padding: .4rem .55rem;
  border: 1px solid var(--line); background: var(--surface); color: var(--muted);
  border-radius: 7px; cursor: pointer;
}
.text-size button:hover { color: var(--accent-ink); border-color: var(--accent); }
.text-size button:active { transform: translateY(1px); }

.content p { margin: 0 0 1.05em; }
.content h2 {
  font-family: var(--font-ui); font-size: 1.06rem; font-weight: 650;
  letter-spacing: -.01em; margin: 2.1em 0 .7em; padding-top: .2em;
  color: var(--accent-ink);
}
.content h3 {
  font-family: var(--font-ui); font-size: .96rem; font-weight: 650;
  margin: 1.7em 0 .5em; color: var(--ink-soft);
}
.content ul, .content ol { margin: 0 0 1.1em; padding-left: 1.35em; }
.content li { margin-bottom: .4em; }
.content strong { font-weight: 700; }
.content em { font-style: italic; }
.content hr { border: 0; border-top: 1px solid var(--line); margin: 2.2em 0; }
.content blockquote {
  margin: 1.4em 0; padding: .2em 0 .2em 1.1em; border-left: 3px solid var(--line);
  color: var(--ink-soft);
}
.content code {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: .88em; background: var(--note-wash); padding: .08em .3em; border-radius: 4px;
}

/* chú thích */
.content .note, .content p.note {
  font-family: var(--font-ui);
  font-size: .81rem; line-height: 1.6; color: var(--muted);
  background: none; border-left: 2px solid var(--line);
  padding: .1rem 0 .1rem .8rem; border-radius: 0; margin: 1em 0;
}
.content .note-translator {
  border-left-color: var(--accent);
  background: none;
  color: var(--ink-soft);
}
.note-inline {
  font-family: var(--font-ui); font-size: .84em; color: var(--muted);
}
.note-inline.note-translator { color: var(--accent-ink); }

/* bảng */
.table-wrap { overflow-x: auto; margin: 1.4em 0; max-width: 100%; }
.table-wrap table { border-collapse: collapse; width: 100%; font-family: var(--font-ui); font-size: .88rem; }
.table-wrap th, .table-wrap td {
  border: 1px solid var(--line); padding: .5rem .65rem; text-align: left; vertical-align: top;
}
.content th { background: var(--note-wash); font-weight: 650; }

/* callout */
.callout {
  border: 1px solid var(--line); border-left: 3px solid var(--accent);
  background: var(--surface); border-radius: 0 8px 8px 0;
  padding: .85rem 1rem .3rem; margin: 1.4em 0; font-family: var(--font-ui);
}
.callout-label {
  font-size: .72rem !important; letter-spacing: .07em; text-transform: uppercase;
  color: var(--accent); font-weight: 700; margin: 0 0 .35rem !important;
}
.callout p { font-size: .9rem; line-height: 1.65; }

/* mốc đoạn */
.seg { display: block; height: 0; scroll-margin-top: 5rem; }
.seg:target { background: var(--accent-wash); }

/* điều hướng bài trước / sau */
.pn-nav { display: grid; gap: .6rem; margin: 3rem 0 1.6rem; }
@media (min-width: 34rem) { .pn-nav { grid-template-columns: 1fr 1fr; } }
.pn {
  display: flex; flex-direction: column; gap: .2rem; padding: .85rem 1rem;
  border: 1px solid var(--line); border-radius: var(--radius);
  background: var(--surface); text-decoration: none; color: var(--ink);
}
.pn:hover { border-color: var(--accent); }
.pn span { font-size: .74rem; letter-spacing: .05em; text-transform: uppercase; color: var(--muted); }
.pn strong { font-family: var(--font-read); font-weight: 600; font-size: .98rem; }
.pn.next { text-align: right; }

.article-foot {
  border-top: 1px solid var(--line); padding-top: 1.2rem;
  font-size: .86rem; color: var(--muted); line-height: 1.6;
}

/* ── chân trang ──────────────────────────────────────────── */

.site-foot {
  border-top: 1px solid var(--line); padding: 2.2rem 0 2.6rem; margin-top: 2rem;
  font-size: .86rem; color: var(--muted);
}
.site-foot p { margin: 0 0 .5rem; }
.foot-links { display: flex; flex-wrap: wrap; gap: 1rem; }
.foot-license { font-size: .8rem; }


/* ── mục lục bên hông (màn hình rộng) ───────────────────── */

.toc-side { display: none; }
.toc-side-title {
  font-size: .71rem; letter-spacing: .09em; text-transform: uppercase;
  color: var(--muted); font-weight: 650; margin: 0 0 .6rem;
}
.toc-side ol { list-style: none; margin: 0; padding: 0; font-size: .84rem; line-height: 1.45; }
.toc-side li { margin-bottom: .4rem; }
.toc-side a {
  display: block; padding: .12rem 0 .12rem .6rem; color: var(--muted);
  text-decoration: none; border-left: 2px solid var(--line);
}
.toc-side a:hover { color: var(--accent-ink); border-left-color: var(--accent); }

@media (min-width: 64rem) {
  .article.sutta {
    display: grid;
    grid-template-columns: 40rem 15rem;
    gap: 3.5rem;
    justify-content: center;
    max-width: calc(40rem + 15rem + 3.5rem + 2.3rem);
    align-items: start;
  }
  .article.sutta .article-main { min-width: 0; }
  .article.sutta details.toc { display: none; }
  .article.sutta .toc-side {
    display: block; grid-column: 2; grid-row: 1;
    position: sticky; top: 5rem; align-self: start;
    max-height: calc(100vh - 7rem); overflow-y: auto;
  }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  body, .btn, .book-card, .start-list li a, .theme-switch button { transition: none; }
}

/* ── in ──────────────────────────────────────────────────── */

@media print {
  .site-head, .site-foot, .pn-nav, details.toc, .toc-side, .text-size, .share, .theme-switch, .crumbs, .article-foot, .to-top { display: none; }
  body { background: #fff; color: #000; }
  .content { font-size: 11pt; line-height: 1.55; }
  details.intro { display: none; }
  a { color: #000; text-decoration: none; }
}
