/* Jua's Musings: the reading pages for Jua's books, in Amber's brand colours and fonts.
   Moved from Light & Ruins (Oct 25 2026); only the look changed. Loaded after site.css.
   Dark reading mode applies to the reading area of chapter pages only (header and footer stay Amber's). */
:root {
  --reading-scale: 1; --measure: 42rem;
  --m-text: var(--plum); --m-muted: var(--mauve); --m-accent: var(--rose); --m-strong: var(--raspberry);
  --m-panel: var(--card); --m-panel-2: var(--blush); --m-field: #fff; --m-line: var(--line);
  --m-edge: var(--mauve); --m-ok: #2F6B3F; --m-bg: var(--cream);
}
:root[data-theme="dark"] body.reading {
  --m-text: #FBEFEA; --m-muted: #E3C6CC; --m-accent: #F2A7B8; --m-strong: #FFC9D5;
  --m-panel: #3A2430; --m-panel-2: #33202A; --m-field: #2A1820; --m-line: rgba(242, 167, 184, .32);
  --m-edge: #C9A0AA; --m-ok: #9FD3A8; --m-bg: #24141B;
}
[hidden] { display: none !important; }
html { scroll-padding-top: 1rem; }
.lede { font-size: 19px; color: var(--mauve); max-width: 46rem; }
.mz-head h1 .script { display: inline-block; }
.kicker { font-family: var(--font-body); text-transform: uppercase; letter-spacing: .14em; font-size: 14px; font-weight: 800; color: var(--m-accent); margin: 0 0 .4rem; }
.btn-row { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 18px; }
.fine-print { max-width: var(--measure); margin: 2.5rem auto 0; font-size: 14px; color: var(--m-muted); text-align: center; }
.prose-block { max-width: 46rem; }
.prose-block h2 { display: flex; align-items: center; gap: 10px; }

/* breadcrumbs */
.mz-crumbs { padding-top: 22px; }
.mz-crumbs ol { list-style: none; display: flex; flex-wrap: wrap; gap: 6px; padding: 0; margin: 0; color: var(--m-muted); }
.mz-crumbs li + li::before { content: "/"; margin-right: 6px; color: var(--dusty-rose); }
.mz-crumbs a { color: var(--m-muted); }
.mz-crumbs [aria-current] { color: var(--m-text); }

/* book cards */
.book-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 22rem), 1fr)); gap: 22px; list-style: none; padding: 0; margin: 0; }
.book-card { position: relative; display: grid; grid-template-columns: 9rem 1fr; gap: 18px; padding: 18px; background: var(--card); border: 1px solid var(--line); border-radius: 16px; }
.book-card:hover { border-color: var(--dusty-rose); }
.book-card img { border-radius: 6px; box-shadow: 0 10px 22px rgba(71, 32, 42, .22); }
.book-card h3 { font-size: 28px; margin: 0 0 4px; }
.book-card h3 a { color: var(--plum); text-decoration: none; }
.book-card h3 a::after { content: ""; position: absolute; inset: 0; border-radius: 16px; }
.book-card h3 a:hover { color: var(--raspberry); }
.book-card .subtitle { font-family: var(--font-heading); font-style: italic; font-size: 19px; color: var(--mauve); margin: 0 0 8px; }
.book-card .meta { font-size: 14px; color: var(--mauve); margin: 0; }
.book-card .status { font-size: 14px; font-weight: 700; color: var(--rose); margin: 8px 0 0; }
@media (max-width: 480px) { .book-card { grid-template-columns: 6.5rem 1fr; gap: 14px; } }
.continue { padding: 8px 0 0; }
.continue-card { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 16px; background: var(--card); border: 1px solid var(--line); border-left: 4px solid var(--dusty-rose); border-radius: 0 16px 16px 0; padding: 16px 20px; }
.continue-card .c-title { font-family: var(--font-heading); font-size: 26px; font-weight: 600; margin: 0; }
.continue-card p { margin: 0; }
.author-portrait { width: min(22rem, 80%); aspect-ratio: 1; object-fit: cover; border-radius: 50%; margin: 0 auto; border: 3px solid transparent; background: var(--rainbow) border-box; box-shadow: 0 14px 30px rgba(71, 32, 42, .18); }

/* book page */
.book-hero { padding: 28px 0 48px; }
.book-hero .wrap { display: grid; grid-template-columns: minmax(13rem, 20rem) 1fr; gap: clamp(24px, 5vw, 56px); align-items: center; }
.book-hero img.cover { border-radius: 8px; box-shadow: 0 22px 44px rgba(71, 32, 42, .3); }
.book-hero h1 { margin-bottom: 2px; }
.book-hero .subtitle { font-family: var(--font-heading); font-style: italic; font-size: clamp(21px, 3vw, 27px); color: var(--mauve); margin: 0 0 10px; }
.book-hero .byline { font-weight: 700; margin: 0 0 6px; }
.book-hero .meta { color: var(--mauve); font-size: 15px; margin: 0 0 4px; }
@media (max-width: 760px) {
  .book-hero .wrap { grid-template-columns: 1fr; text-align: center; }
  .book-hero img.cover { max-width: 14rem; margin: 0 auto; }
  .book-hero .btn-row { justify-content: center; }
}
.summary { max-width: var(--measure); margin-inline: auto; font-size: 18px; }
.summary p:first-child { font-family: var(--font-heading); font-size: 27px; line-height: 1.3; font-weight: 600; color: var(--raspberry); }
.summary p:last-child { margin-bottom: 0; }

/* contents */
.toc { max-width: 52rem; margin-inline: auto; }
.toc > h2 { text-align: center; }
.toc-group { margin-top: 28px; }
.toc-group h3 { font-size: 25px; color: var(--m-strong); border-bottom: 2px solid var(--m-line); padding-bottom: 6px; }
.toc ol { list-style: none; margin: 0; padding: 0; }
.toc li a { display: grid; grid-template-columns: 7rem 1fr auto; gap: 2px 14px; align-items: baseline; padding: 12px; border-radius: 10px; text-decoration: none; color: var(--m-text); min-height: 44px; }
.toc li a:hover { background: var(--m-panel-2); }
.toc .label { font-size: 14px; font-weight: 800; color: var(--m-accent); letter-spacing: .04em; }
.toc .title { font-family: var(--font-heading); font-size: 22px; font-weight: 600; line-height: 1.2; }
.toc .excerpt { grid-column: 2 / 3; color: var(--m-muted); font-size: 15px; }
.toc .time { color: var(--m-muted); font-size: 14px; white-space: nowrap; }
.toc li.done .time::before { content: "✓ "; color: var(--m-ok); font-weight: 800; }
.toc li.current a { background: var(--m-panel-2); outline: 1px solid var(--m-line); }
@media (max-width: 600px) {
  .toc li a { grid-template-columns: 1fr auto; }
  .toc .label, .toc .excerpt { grid-column: 1 / -1; }
}

/* reading pages */
body.reading { background: var(--cream); }
.reading-area { background: var(--m-bg); color: var(--m-text); padding-bottom: 8px; }
.reading-area h1, .reading-area h2, .reading-area h3 { color: var(--m-text); }
.reading-area a { color: var(--m-accent); }
.reading-area a:hover { color: var(--m-strong); }
.progress { position: fixed; top: 0; left: 0; height: 4px; width: 0; background: var(--rainbow); z-index: 60; }
.reader-tools { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; margin-top: 14px; }
.reader-tools .btn { min-height: 40px; padding: 6px 14px; font-size: 15px; }
:root[data-theme="dark"] body.reading .reading-area .btn-secondary { background: var(--m-panel); color: var(--m-text); border-color: var(--m-accent); }
:root[data-theme="dark"] body.reading .reading-area .btn-primary { background: #F2A7B8; color: #24141B; }
.chapter { width: min(var(--measure), 100% - 32px); margin: 0 auto; padding: 28px 0 40px; }
.chapter-head { text-align: center; margin-bottom: 30px; }
.chapter-head h1 { font-size: clamp(36px, 6vw, 52px); margin: 0; }
.chapter-head .meta { color: var(--m-muted); font-size: 15px; margin: 12px 0 0; }
.chapter-head::after { content: ""; display: block; width: 120px; height: 3px; margin: 22px auto 0; border-radius: 3px; background: var(--rainbow); opacity: .8; }
.prose { font-size: calc(19px * var(--reading-scale)); line-height: 1.8; }
.prose p { margin: 0 0 1.15em; }
.prose h2 { font-size: 1.7em; margin: 2em 0 .7em; text-align: center; color: var(--m-strong); }
.prose h3 { font-size: 1.35em; margin: 1.7em 0 .5em; }
.prose ul, .prose ol { padding-left: 1.4em; margin: 0 0 1.15em; }
.prose li { margin: .35em 0; }
.prose strong { font-weight: 800; }
.prose .dedication { font-style: italic; text-align: center; max-width: 34rem; margin-inline: auto; margin-bottom: 1.4em; }
.prose .signature { text-align: right; margin: 0; font-style: italic; }
.table-wrap { overflow-x: auto; margin: 1.5em 0; border: 1px solid var(--m-line); border-radius: 10px; background: var(--m-panel); }
.table-wrap table { border-collapse: collapse; width: 100%; font-size: .82em; line-height: 1.5; }
.table-wrap th, .table-wrap td { padding: .65em .8em; border-bottom: 1px solid var(--m-line); text-align: left; vertical-align: top; min-width: 8rem; }
.table-wrap th { background: var(--m-panel-2); font-weight: 800; }
.resume { display: flex; justify-content: center; margin: -10px 0 26px; }
.chapter-nav { width: min(var(--measure), 100% - 32px); margin: 0 auto 24px; display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.chapter-nav a { display: block; padding: 14px 16px; border: 1px solid var(--m-line); border-radius: 14px; text-decoration: none; background: var(--m-panel); min-height: 44px; }
.chapter-nav a:hover { border-color: var(--m-accent); }
.chapter-nav .dir { display: block; font-size: 13px; text-transform: uppercase; letter-spacing: .12em; font-weight: 800; color: var(--m-accent); }
.chapter-nav .t { display: block; font-family: var(--font-heading); font-size: 21px; font-weight: 600; color: var(--m-text); line-height: 1.2; }
.chapter-nav .next { text-align: right; grid-column: 2; }
.chapter-links { width: min(var(--measure), 100% - 32px); margin: 0 auto 28px; display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; }
.contents-drawer { width: min(var(--measure), 100% - 32px); margin: 0 auto 36px; border: 1px solid var(--m-line); border-radius: 14px; background: var(--m-panel); }
.contents-drawer summary { cursor: pointer; padding: 14px 18px; font-family: var(--font-heading); font-size: 22px; font-weight: 600; min-height: 44px; }
.contents-drawer .toc { padding: 0 8px 14px; }
.contents-drawer .toc-group { margin-top: 12px; }
.contents-drawer .toc .excerpt { display: none; }
@media (max-width: 600px) { .chapter-nav { grid-template-columns: 1fr; } .chapter-nav .next { grid-column: 1; } }

/* listening */
.listen { margin: 0 auto 30px; padding: 14px 16px 12px; border: 1px solid var(--m-line); border-radius: 14px; background: var(--m-panel); }
.listen-title { display: flex; align-items: center; gap: 8px; margin: 0 0 10px; font-family: var(--font-heading); font-size: 22px; font-weight: 600; }
.listen-title svg { width: 22px; height: 22px; color: var(--m-accent); }
.listen-time { margin-left: auto; font-family: var(--font-body); font-size: 14px; font-weight: 600; color: var(--m-muted); }
.listen audio { width: 100%; }
.ai-note { margin: 10px 0 0; font-size: 14px; color: var(--m-muted); line-height: 1.55; }

/* PDI worksheet */
.pdi-callout { margin: 36px 0 0; padding: 18px 20px; border: 2px solid var(--m-accent); border-radius: 14px; background: var(--m-panel); }
.pdi-who { display: grid; grid-template-columns: 2fr 1fr; gap: 14px; margin: 22px 0 14px; }
.pdi-who label { display: block; font-weight: 800; margin-bottom: 4px; }
.pdi-who input { width: 100%; min-height: 44px; padding: 8px 12px; border-radius: 10px; border: 2px solid var(--m-edge); background: var(--m-field); color: var(--m-text); font: inherit; }
.pdi-pillar { font-size: 32px; text-align: center; color: var(--m-strong); margin: 36px 0 14px; }
.pdi-cat { border: 1px solid var(--m-line); border-radius: 14px; background: var(--m-panel); padding: 16px 18px 14px; margin: 0 0 16px; }
.pdi-cat-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 8px; }
.pdi-cat h3 { font-size: 25px; margin: 0; }
.pdi-sub { margin: 0; color: var(--m-accent); font-weight: 800; }
.pdi-desc { color: var(--m-muted); margin: 4px 0 8px; }
.pdi-metric { border: 0; padding: 0; margin: 12px 0 0; }
.pdi-metric legend { padding: 0; margin-bottom: 6px; }
.pdi-q { display: block; color: var(--m-muted); font-size: 15px; }
.pdi-opts { display: flex; flex-wrap: wrap; gap: 6px; }
.pdi-opt { position: relative; display: inline-flex; align-items: center; gap: 7px; min-height: 44px; padding: 5px 12px; border: 2px solid var(--m-edge); border-radius: 999px; cursor: pointer; font-size: 15px; background: var(--m-field); }
.pdi-opt input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.pdi-opt:has(input:checked) { border-color: var(--m-accent); background: color-mix(in srgb, var(--m-accent) 16%, var(--m-panel)); font-weight: 700; }
.pdi-opt:has(input:focus-visible) { outline: 3px solid var(--m-accent); outline-offset: 2px; }
.pdi-num { display: inline-grid; place-items: center; width: 26px; height: 26px; border-radius: 50%; border: 2px solid var(--m-accent); font-weight: 800; }
.pdi-opt:has(input:checked) .pdi-num { background: var(--m-accent); color: #fff; }
.pdi-book { margin: 12px 0 0; font-size: 14px; color: var(--m-muted); }
.pdi-result { margin-top: 28px; padding: 18px 20px; border: 2px solid var(--m-accent); border-radius: 16px; background: var(--m-panel-2); }
.pdi-result h2 { font-size: 28px; margin: 0 0 4px; }
.pdi-answered { color: var(--m-muted); margin: 0 0 12px; font-size: 15px; }
.pdi-totals { display: flex; flex-wrap: wrap; gap: 22px; align-items: center; }
.pdi-totals p { margin: 0; }
.pdi-big { font-family: var(--font-heading); font-size: 58px; font-weight: 700; line-height: 1; color: var(--m-strong); margin-right: 6px; }
.pdi-of { color: var(--m-muted); }
.pdi-band { display: inline-block; margin-top: 12px; padding: 4px 14px; border-radius: 999px; font-weight: 800; border: 2px solid currentColor; }
.pdi-band--full, .pdi-band--strong { color: #2F6B3F; }
.pdi-band--flawed { color: #8A5A12; }
.pdi-band--name-only { color: #9A4A14; }
.pdi-band--auth { color: #9B2C1C; }
.pdi-scale { position: relative; height: 10px; margin: 40px 0 56px; border-radius: 999px;
  background: linear-gradient(90deg, #B24A3A 0 30%, #D7843F 30% 50%, #E2BE4E 50% 70%, #7FAF6E 70% 85%, #4F8F55 85% 100%); }
.pdi-marker, .pdi-ref { position: absolute; top: 50%; transform: translate(-50%, -50%); }
.pdi-marker { width: 20px; height: 20px; border-radius: 50%; background: var(--plum); border: 3px solid #fff; box-shadow: 0 0 0 2px var(--plum); transition: left .3s ease; }
.pdi-marker span { position: absolute; bottom: 22px; left: 50%; transform: translateX(-50%); font-weight: 800; font-size: 14px; }
.pdi-ref { width: 2px; height: 20px; background: var(--m-muted); }
.pdi-ref.low span { top: 38px; }
.pdi-ref span { position: absolute; top: 20px; left: 50%; transform: translateX(-50%); white-space: nowrap; font-size: 12px; color: var(--m-muted); }
.pdi-gap { color: var(--m-muted); font-size: 15px; }
.pdi-copied { min-height: 1.4em; color: var(--m-ok); margin: 8px 0 0; font-weight: 700; }
.pdi-mini { position: sticky; bottom: 12px; z-index: 30; display: flex; justify-content: center; margin-top: 16px; pointer-events: none; }
.pdi-mini a { pointer-events: auto; display: inline-flex; gap: 10px; align-items: center; padding: 8px 18px; border-radius: 999px; background: var(--card); border: 2px solid var(--rose); box-shadow: 0 8px 22px rgba(71, 32, 42, .18); color: var(--plum); text-decoration: none; min-height: 44px; }
.pdi-mini strong { color: var(--raspberry); }
@media (max-width: 600px) { .pdi-who { grid-template-columns: 1fr; } .pdi-ref span { display: none; } .pdi-word { font-size: 14px; } }

/* Work of Hope notebook */
.nb-box { margin: 36px 0; padding: 18px 20px 16px; border: 2px solid var(--m-accent); border-radius: 16px; background: var(--m-panel); font-size: 16px; line-height: 1.55; }
.prose .nb-title, .nb-title { font-size: 28px; text-align: left; color: var(--m-text); margin: 0 0 6px; }
.nb-promise { font-size: 14px; color: var(--m-muted); margin: 0 0 14px; }
.nb-field { margin: 0 0 14px; border: 0; padding: 0; }
.nb-field > label, .nb-choice legend, .nb-label { display: block; font-weight: 800; margin: 0 0 5px; padding: 0; }
.nb-field input[type=text], .nb-field textarea { width: 100%; padding: 9px 12px; border-radius: 10px; border: 2px solid var(--m-edge); background: var(--m-field); color: var(--m-text); font: inherit; font-size: 16px; line-height: 1.5; }
.nb-field textarea { resize: vertical; min-height: 4.6rem; }
.nb-field input:focus, .nb-field textarea:focus { border-color: var(--m-accent); outline: none; box-shadow: 0 0 0 3px color-mix(in srgb, var(--m-accent) 30%, transparent); }
.nb-check { display: flex; gap: 10px; align-items: flex-start; }
.nb-check input { width: 22px; height: 22px; margin-top: 2px; accent-color: var(--rose); flex: none; }
.nb-check label { font-weight: 400; margin: 0; }
.nb-opts { display: flex; flex-wrap: wrap; gap: 6px; }
.nb-opt { position: relative; display: inline-flex; align-items: center; min-height: 44px; padding: 5px 14px; border: 2px solid var(--m-edge); border-radius: 999px; background: var(--m-field); cursor: pointer; font-size: 15px; }
.nb-opt input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.nb-opt:has(input:checked) { border-color: var(--m-accent); background: color-mix(in srgb, var(--m-accent) 16%, var(--m-panel)); font-weight: 800; }
.nb-opt:has(input:focus-visible) { outline: 3px solid var(--m-accent); outline-offset: 2px; }
.nb-table table { font-size: 15px; }
.nb-table th { font-size: 14px; }
.nb-table td { padding: 5px; }
.nb-table textarea { width: 100%; min-width: 11rem; min-height: 3.2rem; padding: 6px 8px; border-radius: 8px; border: 2px solid var(--m-edge); background: var(--m-field); color: var(--m-text); font: inherit; }
.nb-total, .nb-vow { font-weight: 800; color: var(--m-strong); }
.nb-vow { font-family: var(--font-heading); font-size: 24px; line-height: 1.35; }
.nb-pdi-value { margin: 0 0 10px; }
.nb-saved { min-height: 1.3em; font-size: 14px; color: var(--m-ok); margin: 0 0 12px; font-weight: 700; }
.nb-box .btn { background: var(--card); color: var(--plum); border-color: var(--rose); }
.nb-page .nb-box .btn[href$="/notebook/"] { display: none; }
.nb-section { margin-top: 36px; }
.nb-from { margin: 0 0 -26px; font-weight: 800; color: var(--m-accent); letter-spacing: .04em; }
.nb-promise-box { margin: 28px 0; padding: 18px 20px; border: 1px solid var(--m-line); border-radius: 16px; background: var(--m-panel-2); }
.nb-promise-box h2 { font-size: 27px; margin: 0 0 8px; }
.nb-promise-box ul { padding-left: 1.2rem; }
.nb-promise-box label.btn { cursor: pointer; }
.nb-danger { border-color: #B23A3A !important; }
.nb-msg { min-height: 1.4em; color: var(--m-ok); margin: 12px 0 0; font-weight: 700; }
.nb-printout { display: none; }

@media print {
  .site-header, .site-footer, .chapter-nav, .chapter-links, .contents-drawer, .progress, .reader-tools, .listen, .mz-crumbs { display: none !important; }
  .reading-area { background: #fff; color: #000; }
  .pdi-opt:not(:has(input:checked)) { display: none; }
  .pdi-callout, .pdi-mini, #pdi-copy, #pdi-print, #pdi-reset { display: none !important; }
  /* "Print or save as PDF" on the notebook page prints only the filled-in notebook */
  body:has(.nb-printout:not(:empty)) > *:not(main), body:has(.nb-printout:not(:empty)) main > *:not(.reading-area),
  body:has(.nb-printout:not(:empty)) .reading-area > *:not(.nb-printout) { display: none !important; }
  body:has(.nb-printout:not(:empty)) main > .reading-area, body:has(.nb-printout:not(:empty)) .nb-printout { display: block !important; color: #000; font-family: Georgia, serif; }
  body.reading .nb-box { break-inside: avoid; border-color: #999; }
}
