/* Page-local reading guide and verse reader. Shared colors and fonts live in style.css. */
:root { --dhp-measure: 760px; --dhp-copy: 64ch; --dhp-frame: 58rem; }
body.dhp-page { padding-inline: 0; font-family: var(--font-heading); font-weight: 400; line-height: 1.66; -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; }
.dhp-shell { width: 100%; max-width: var(--dhp-frame); margin-inline: auto; padding-inline: var(--gutter); }
.dhp-page .post-back, .dhp-page .u-next, .dhp-page .site-footer-inner { width: 100%; max-width: var(--dhp-measure); margin-inline: auto; padding-inline: var(--gutter); }
.dhp-page .post-back { display: block; padding-top: clamp(2.5rem, 7vw, 5rem); }
.dhp-page .site-footer-inner { font-family: var(--font-body); }
.dhp-hero { display: flex; flex-direction: column; justify-content: center; min-height: calc(100svh - 4rem); max-width: 61rem; padding-block: clamp(4.5rem, 11svh, 7rem); text-align: center; }
.dhp-hero .u-title { max-width: 11ch; margin-inline: auto; font-size: clamp(3rem, 10vw, 7.5rem); line-height: .94; letter-spacing: -.035em; text-wrap: balance; }
.dhp-hero .u-dek { max-width: 49ch; margin: 1.6rem auto 0; font-size: 1.24rem; line-height: 1.58; font-style: normal; text-wrap: pretty; }
.dhp-hero .u-meta { justify-content: center; margin-top: 1.6rem; padding-top: 0; border-top: 0; gap: .5em 1.05em; letter-spacing: .11em; }
.dhp-scroll { display: block; margin-top: 2.8rem; color: var(--text-dim); opacity: .68; font-variant: small-caps; letter-spacing: .22em; font-size: .82rem; }
.dhp-page main a, .dhp-hero a { color: var(--accent); text-decoration: none; border-bottom: 1px solid var(--s-gold-hair); }
.dhp-page main a:hover, .dhp-hero a:hover { color: var(--accent-hover); }
.dhp-layer { position: relative; padding-block: clamp(4.5rem, 8svh, 6.5rem); border-top: 1px solid var(--rule); scroll-margin-top: 1rem; }
.dhp-layer:last-of-type { padding-bottom: clamp(2.6rem, 5svh, 3.4rem); }
.dhp-layer-tag { display: flex; align-items: center; justify-content: center; gap: .8rem; margin: 0 0 1.1rem; font-family: var(--font-mono); font-size: .72rem; line-height: 1.3; letter-spacing: .13em; text-transform: uppercase; color: var(--text-faint); }
.dhp-layer-tag b { color: var(--accent); font-weight: 400; }
.dhp-section-title { max-width: 22ch; margin: 0 auto; font-family: var(--font-heading); font-size: clamp(2rem, 5vw, 2.5rem); line-height: 1.12; letter-spacing: -.02em; color: var(--text-bright); text-align: center; text-wrap: balance; }
.dhp-plain { max-width: var(--dhp-copy); margin: 2.6rem auto 0; }
.dhp-plain p { margin: 0 0 1.15em; font-family: var(--font-heading); font-size: 1.3rem; line-height: 1.74; color: var(--text); text-wrap: pretty; }
.dhp-plain p:last-child { margin-bottom: 0; }
.dhp-lead::first-letter { float: left; padding: .06em .12em 0 0; color: var(--accent); font-size: 3.4em; line-height: .74; font-weight: 700; }
.dhp-page .u-textcheck { max-width: var(--dhp-copy); margin: 2.6rem auto 0; }
.dhp-history-note { max-width: var(--dhp-copy); margin: 1.7rem auto 0; font-size: 1.05rem; line-height: 1.7; text-wrap: pretty; }
.dhp-concept-list { max-width: var(--dhp-copy); margin: clamp(2.8rem, 6vw, 4.2rem) auto 0; border-top: 1px solid var(--rule); }
.dhp-concept { scroll-margin-top: 1rem; border-bottom: 1px solid var(--rule); }
.dhp-concept > summary { list-style: none; min-height: 6rem; padding: 1.45rem 1rem; cursor: pointer; }
.dhp-concept > summary::-webkit-details-marker { display: none; }
.dhp-concept-heading { display: grid; grid-template-columns: 3.2rem 1fr 1.8rem; gap: 1rem; align-items: start; margin: 0; font-weight: 400; scroll-margin-top: 1rem; }
.dhp-concept-n { padding-top: .25rem; font-family: var(--font-mono); font-size: .72rem; color: var(--accent); }
.dhp-concept-statement { display: block; margin: 0; font-family: var(--font-heading); font-size: clamp(1.3rem, 3vw, 1.65rem); font-weight: 400; line-height: 1.26; color: var(--text-bright); text-wrap: balance; scroll-margin-top: 1rem; }
.dhp-concept-mark { display: grid; place-items: center; width: 1.75rem; height: 1.75rem; margin-top: .05rem; border: 1px solid var(--rule); border-radius: 50%; color: var(--accent); font-family: var(--font-mono); font-size: 1rem; line-height: 1; }
.dhp-concept-mark::before { content: "+"; }
.dhp-concept[open] { margin-block: 1.1rem; border: 1px solid var(--rule); border-left: 3px solid var(--accent); border-radius: 12px; background: color-mix(in srgb, var(--accent) 4.5%, transparent); }
.dhp-concept[open] .dhp-concept-mark::before { content: "−"; }
.dhp-concept:not([open]):has(+ .dhp-concept[open]) { border-bottom-color: transparent; }
.dhp-concept-list:has(> .dhp-concept[open]:first-child) { border-top-color: transparent; }
.dhp-concept-body { padding: .1rem 3.2rem clamp(2.7rem, 6vw, 4.2rem); }
.dhp-concept-body p { margin: 0 0 1.15em; font-size: 1.14rem; line-height: 1.72; text-wrap: pretty; }
.dhp-concept-body p:last-child { margin-bottom: 0; }
.dhp-reference { font-size: .86em; white-space: normal; }
.dhp-reader-intro { max-width: 49ch; margin: 1rem auto 0; font-family: var(--font-heading); font-size: 1.22rem; line-height: 1.5; font-style: italic; color: var(--text-dim); text-align: center; text-wrap: pretty; }
.dhp-starts { display: flex; flex-wrap: wrap; justify-content: center; gap: .4rem 1.2rem; margin: 1.1rem 0 2.8rem; font-family: var(--font-mono); font-size: .72rem; }
.dhp-starts a { display: inline-flex; min-height: 44px; align-items: center; }
.dhp { max-width: var(--dhp-copy); margin-inline: auto; scroll-margin-top: 1rem; }
.dhp-bar { position: sticky; top: .5rem; z-index: 20; display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: .25rem; margin-bottom: 2rem; padding: .5rem; border: 1px solid var(--rule); border-left: 3px solid var(--accent); border-radius: 12px; background: color-mix(in srgb, var(--bg) 96%, var(--accent)); }
.dhp-nav { flex: none; display: grid; place-items: center; min-width: 44px; min-height: 44px; padding: 0 0 .15rem; border: 0; border-radius: 50%; background: transparent; color: var(--accent); font-family: var(--font-heading); font-size: 1.8rem; cursor: pointer; }
.dhp-nav:hover:not(:disabled), .dhp-jump:hover { background: color-mix(in srgb, var(--text) 6%, transparent); }
.dhp-nav:disabled { opacity: .3; cursor: default; }
.dhp-jump { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: .15rem; flex: 1; min-width: 0; max-width: 23rem; min-height: 52px; padding: .25rem .5rem; border: 0; border-radius: 10px; background: transparent; cursor: pointer; }
#dhp-vno { font-family: var(--font-heading); font-size: 1.15rem; line-height: 1.2; color: var(--text-bright); }
#dhp-title { font-family: var(--font-heading); font-style: italic; font-size: .95rem; line-height: 1.25; color: var(--text-dim); }
.dhp-count { flex-basis: 100%; text-align: center; font-family: var(--font-mono); font-size: .65rem; color: var(--text-faint); padding-bottom: .2rem; }
.dhp-grid { max-height: 60svh; overflow-y: auto; overscroll-behavior: contain; margin-bottom: 1.5rem; padding: .75rem; border: 1px solid var(--rule-strong); border-radius: 14px; background: var(--bg); }
.dhp-grid[hidden] { display: none; }
.dhp-gridsec + .dhp-gridsec { margin-top: 1.1rem; }
.dhp-gridlabel { margin: 0 0 .5rem; font-family: var(--font-mono); font-size: .72rem; line-height: 1.5; color: var(--text-dim); }
.dhp-gridrow { display: grid; grid-template-columns: repeat(auto-fill, minmax(44px, 1fr)); gap: 4px; }
.dhp-grid button { min-height: 44px; border: 1px solid var(--rule); border-radius: 6px; background: transparent; color: var(--text-dim); font-family: var(--font-mono); font-size: .78rem; cursor: pointer; }
.dhp-grid button:hover { color: var(--accent-hover); border-color: var(--accent); }
.dhp-grid button.is-cur { background: var(--accent); color: var(--bg-raised); }
.dhp-notes { margin: 0 0 1.7rem; padding: 1.6rem clamp(1.2rem, 3vw, 2rem); border: 1px solid var(--rule); border-left: 3px solid var(--accent); border-radius: 12px; background: color-mix(in srgb, var(--accent) 4.5%, transparent); }
.dhp-note-k { margin: 0 0 .6rem; font-family: var(--font-mono); font-size: .7rem; letter-spacing: .12em; text-transform: uppercase; color: var(--accent); }
.dhp-note-text { margin: 0; font-family: var(--font-heading); font-size: 1.22rem; line-height: 1.7; text-wrap: pretty; }
.dhp-source { margin: 0 0 2rem; color: var(--text-dim); }
.dhp-source summary { width: fit-content; min-height: 44px; align-content: center; font-family: var(--font-mono); font-size: .72rem; cursor: pointer; }
.dhp-pali { margin: .5rem 0 0; font-family: var(--font-heading); font-size: 1.08rem; line-height: 1.8; color: var(--text); }
.dhp-tier { display: flex; justify-content: space-between; align-items: baseline; gap: 1rem; margin: 2rem 0 .75rem; }
.dhp-tier:first-child { margin-top: 0; }
.dhp-tier h3 { margin: 0; font-family: var(--font-mono); font-size: .72rem; font-weight: 400; letter-spacing: .12em; text-transform: uppercase; color: var(--accent); }
.dhp-tier span { font-family: var(--font-mono); font-size: .72rem; color: var(--text-faint); }
.dhp-v { padding: 1.1rem 0 1.2rem; border-top: 1px solid var(--rule); }
.dhp-vh { display: flex; justify-content: space-between; align-items: baseline; gap: .8rem; margin-bottom: .55rem; }
.dhp-vn { font-family: var(--font-heading); font-size: 1.13rem; }
.dhp-vy { flex: none; font-family: var(--font-mono); font-size: .72rem; color: var(--text-faint); }
.dhp-range { margin: -.15rem 0 .65rem; font-family: var(--font-body); font-size: .8rem; line-height: 1.5; color: var(--text-dim); }
.dhp-vt { font-family: var(--font-heading); font-size: 1.14rem; line-height: 1.72; }
.dhp-loading { font-family: var(--font-body); font-size: 1rem; line-height: 1.6; color: var(--text-dim); }
.dhp-ready .dhp-loading { display: none; }
html:not(.js) .dhp-bar, html:not(.js) .dhp-loading, html:not(.js) .dhp-source { display: none; }
.dhp-sources { max-width: var(--dhp-copy); margin: 3rem auto 1rem; scroll-margin-top: 1rem; }
.dhp-source-copy { padding-block: 1rem .25rem; font-family: var(--font-body); font-size: .96rem; line-height: 1.7; color: var(--text-dim); }
.dhp-source-copy p { margin: 0 0 1em; }
.dhp-source-copy ul { padding-left: 1.2rem; }
.dhp-source-copy li { margin-bottom: .7rem; }
.dhp-page button:focus-visible, .dhp-page summary:focus-visible, .dhp-page a:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
@media (max-width: 560px) {
  .dhp-layer { padding-block: 3.4rem; }
  .dhp-concept > summary { padding: 1.15rem .85rem; }
  .dhp-concept-heading { grid-template-columns: 1.65rem 1fr 1.65rem; gap: .65rem; }
  .dhp-concept-body { padding: .1rem 1.15rem 2.6rem; }
}
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
