/* Canonical reading base lives in /book-base.css (home/book-base.css). */
@import url("/book-base.css");

/* Hide legacy redundant rows */
.where {
  display: none !important;
}
main {
  padding: 1.4rem 1.25rem 4rem;
}
h1 { margin: 0 0 0.7rem; font-size: clamp(1.8rem, 5vw, 2.6rem); letter-spacing: -0.02em; line-height: 1.15; }
h2 { margin: 2.1rem 0 0.55rem; font-size: 1.4rem; letter-spacing: -0.02em; scroll-margin-top: 6.2rem; }
h3 { margin: 1.35rem 0 0.4rem; font-size: 1.12rem; scroll-margin-top: 6.2rem; }
p, li { font-size: 1.05rem; }
.lead { font-size: 1.12rem; line-height: 1.45; }
ol, ul { padding: 0 0 0 1.25rem; }
li { margin: 0 0 0.55rem; }
.toc {
  margin: 0 0 1.2rem;
  padding: 0.75rem 0.9rem 0.85rem;
  background: #fffaf3;
  border: 1px solid rgba(44, 34, 26, 0.12);
  border-radius: 0.7rem;
}
.toc strong { display: block; margin-bottom: 0.35rem; }
.toc ol { margin: 0; }
.toc li { margin: 0 0 0.2rem; }
.portal {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.75rem;
  margin: 0 0 0.4rem;
}
@media (min-width: 720px) {
  .portal { grid-template-columns: 1fr 1fr; }
}
.card {
  display: flex;
  flex-direction: column;
  gap: 0.28rem;
  padding: 0.95rem 1.05rem;
  background: var(--site-panel, #fffaf0);
  border: 1.5px solid var(--site-line, #e7d8bf);
  border-radius: var(--site-radius-md, 12px);
  text-decoration: none;
  color: inherit;
  font-weight: 450;
  transition: border-color 0.15s ease, transform 0.15s ease, background 0.15s ease;
}
.card:hover, .card:focus-visible {
  border-color: var(--site-accent, #b5451d);
  background: var(--site-panel-hover, #ffffff);
  transform: translateY(-2px);
}
.card .kicker { color: var(--site-accent, #b5451d); font-weight: 750; font-size: 0.88rem; }
.card strong {
  font-family: var(--site-font-display, "Literata", "Noto Serif Devanagari", Georgia, serif);
  font-size: 1.15rem;
  letter-spacing: -0.02em;
  color: var(--site-ink, #2c221a);
  line-height: 1.25;
}
.step {
  display: flex;
  gap: 1rem;
  margin: 0.2rem 0 1.1rem;
}
.step a { text-decoration: none; }
.step-next { margin-left: auto; }
.table-scroll { overflow-x: auto; margin: 0 0 1rem; }
table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.98rem;
  background: #fffaf3;
}
th, td {
  text-align: left;
  vertical-align: top;
  padding: 0.45rem 0.55rem;
  border-bottom: 1px solid rgba(44, 34, 26, 0.12);
}
th { font-weight: 750; }
details.order { margin-top: 1rem; }
details.order > summary { cursor: pointer; font-weight: 700; color: #b5451d; }
.where { font-size: 1rem; }
.where .sep { color: rgba(44, 34, 26, 0.45); padding: 0 0.2rem; }
.tipitaka { margin: 0.2rem 0 1.1rem; }
.tipitaka-root {
  display: table;
  margin: 0 auto 0.45rem;
  padding: 0.32rem 0.85rem;
  background: #6d5646;
  color: #fdf6e9;
  font-weight: 750;
  letter-spacing: 0.03em;
  border-radius: 0.35rem;
}
.baskets { display: grid; gap: 0.6rem; }
.basket {
  border: 1px solid rgba(44, 34, 26, 0.2);
  border-radius: 0.55rem;
  padding: 0.45rem 0.45rem 0.2rem;
  background: #fffaf3;
}
.basket-name { margin: 0 0 0.4rem; text-align: center; font-weight: 750; font-size: 0.95rem; }
.basket-name a { color: #2c221a; text-decoration: none; }
.node {
  margin: 0 0 0.32rem;
  padding: 0.26rem 0.35rem;
  background: #f6ead4;
  border: 1px solid rgba(44, 34, 26, 0.12);
  border-radius: 0.3rem;
  font-size: 0.86rem;
  text-align: center;
  line-height: 1.35;
}
.basket.sutta .node { background: #f3ddc4; }
.basket.abhi .node { background: #ead9bf; }
.node.khuddaka-node {
  background: #fffaf3;
  border: 2px solid #b5451d;
  font-weight: 750;
}
.node a, .sub a { color: inherit; text-decoration: none; }
.node a:hover, .sub a:hover { text-decoration: underline; }
.node.khuddaka-node a { color: #8a3414; text-decoration: none; }
.node.khuddaka-node a:hover { text-decoration: underline; }
.sub { display: block; margin-top: 0.15rem; font-size: 0.78rem; font-weight: 550; color: #6d5646; }
.drop { display: none; }
.shelf {
  border: 2px solid #b5451d;
  border-radius: 0.55rem;
  padding: 0.5rem 0.5rem 0.35rem;
  background: #fffaf3;
}
.shelf-title { margin: 0 0 0.4rem; text-align: center; font-weight: 750; font-size: 0.95rem; }
.shelf-title a { color: #8a3414; text-decoration: none; }
.books { display: grid; grid-template-columns: 1fr 1fr; gap: 0.32rem; }
.books a, .books .book {
  display: block;
  padding: 0.26rem 0.3rem;
  background: #f3ddc4;
  border: 1px solid rgba(44, 34, 26, 0.12);
  border-radius: 0.3rem;
  font-size: 0.8rem;
  line-height: 1.3;
  text-align: center;
  font-weight: 650;
  color: inherit;
  text-decoration: none;
}
.books .book a {
  display: inline;
  padding: 0;
  background: none;
  border: 0;
  border-radius: 0;
  font: inherit;
  color: inherit;
  text-decoration: none;
}
.books a:hover, .books .book a:hover { text-decoration: underline; }
.books .extra { background: transparent; border-style: dashed; font-weight: 600; }
.shelf-note { margin: 0.45rem 0 0; font-size: 0.92rem; color: #6d5646; }
@media (min-width: 800px) {
  .baskets { grid-template-columns: 1fr 1.08fr 1fr; align-items: start; }
  .drop {
    display: block;
    width: 0;
    height: 1.05rem;
    margin: 0 auto;
    border-left: 2px dashed rgba(181, 69, 29, 0.75);
  }
  .books { grid-template-columns: 1fr 1fr 1fr 1fr; }
}

/* Dark mode theme adaptations */
html[data-theme="dark"] .toc {
  background: #241c16;
  border-color: rgba(243, 230, 212, 0.14);
}
html[data-theme="dark"] .basket {
  background: #241c16;
  border-color: rgba(243, 230, 212, 0.14);
}
html[data-theme="dark"] .books .book {
  background: #2e241c;
  border-color: rgba(243, 230, 212, 0.14);
  color: #f3e6d4;
}

html[data-theme="dark"] .basket-name a { color: #f3e6d4; }
html[data-theme="dark"] .node {
  background: #2c231b;
  color: #f3e6d4;
  border-color: rgba(243, 230, 212, 0.16);
}
html[data-theme="dark"] .basket.sutta .node { background: #33271d; }
html[data-theme="dark"] .basket.abhi .node { background: #2d231b; }
html[data-theme="dark"] .node.khuddaka-node,
html[data-theme="dark"] .shelf {
  background: #241c16;
  border-color: #e07043;
  color: #f3e6d4;
}
html[data-theme="dark"] .shelf-title a { color: #f0a070; }
html[data-theme="dark"] .books a {
  background: #2e241c;
  border-color: rgba(243, 230, 212, 0.14);
  color: #f3e6d4;
}
html[data-theme="dark"] .canon-root { background: #4a3a2e; color: #f6ead4; }
html[data-theme="dark"] .pill,
html[data-theme="dark"] .nav-pill {
  background: #2a221c;
  color: #f3e6d4;
  border-color: rgba(243, 230, 212, 0.18);
}
html[data-theme="dark"] .card .kicker { color: #f0a070; }
html[data-theme="dark"] details.order > summary { color: #f0a070; }
