/* Paginated reader shell (public/js/paged-reader.js). Theme variables only. */
/* The pager is its own light reading surface (like the shell around an unpaginated plan), so navy headings
   and body text keep their contrast on the dark page background. */
.ipp { margin: 0 0 24px; padding: clamp(14px, 3vw, 28px); background: var(--paper, #faf9f5); color: var(--text, #1b2130); border: 1px solid var(--rule, #dbd5c6); border-radius: 8px; min-width: 0; }
.ipp-boot { color: var(--muted, #5c6273); }
.ipp-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 6px 16px; margin: 0 0 8px; }
.ipp-title { margin: 0; font-size: clamp(1.15rem, 2.4vw, 1.4rem); line-height: 1.3; color: var(--navy, #12213A); }
.ipp-title:focus { outline: 2px solid var(--gold, #a9812e); outline-offset: 3px; }
.ipp-count { margin: 0; font-size: 0.9rem; color: var(--muted, #5c6273); }
.ipp-progress { height: 6px; background: var(--rule, #dbd5c6); border-radius: 3px; overflow: hidden; margin: 0 0 12px; }
.ipp-progress > span { display: block; height: 100%; width: 0; background: var(--teal, #1f6f5c); transition: width 0.2s ease; }
.ipp-toc { margin: 0 0 12px; border: 1px solid var(--rule, #dbd5c6); border-radius: 6px; background: var(--paper, #faf9f5); }
.ipp-toc > summary { cursor: pointer; padding: 12px 14px; min-height: 44px; font-weight: 600; color: var(--navy, #12213A); display: flex; align-items: center; }
.ipp-toc ol { margin: 0; padding: 4px 14px 12px 34px; max-height: 50vh; overflow-y: auto; }
.ipp-toc-link { background: none; border: 0; padding: 10px 4px; min-height: 44px; width: 100%; text-align: left; font: inherit; color: var(--text, #1b2130); cursor: pointer; }
.ipp-toc-link:hover, .ipp-toc-link:focus-visible { color: var(--teal, #1f6f5c); text-decoration: underline; }
.ipp-toc-link.is-current { font-weight: 700; color: var(--navy, #12213A); }
.ipp-status { margin: 0 0 12px; padding: 10px 12px; border-left: 3px solid var(--gold, #a9812e); background: var(--paper, #faf9f5); color: var(--text, #1b2130); }
.ipp-body { min-height: 120px; overflow-wrap: anywhere; }
.ipp-nav { display: flex; gap: 12px; justify-content: space-between; margin: 20px 0 0; }
.ipp-btn { min-height: 44px; min-width: 44px; padding: 10px 18px; border: 1px solid var(--navy, #12213A); border-radius: 6px; background: transparent; color: var(--navy, #12213A); font: inherit; font-weight: 600; cursor: pointer; }
.ipp-btn:hover:not(:disabled), .ipp-btn:focus-visible { border-color: var(--gold, #a9812e); }
.ipp-btn:disabled { opacity: 0.45; cursor: not-allowed; }
.ipp-btn-primary { background: var(--navy, #12213A); color: #fff; }
.ipp-done { margin: 16px 0 0; padding: 12px 14px; border: 1px solid var(--rule, #dbd5c6); border-radius: 6px; background: var(--paper, #faf9f5); }
.ipp-done p { margin: 0; }
.ipp-resume { margin: 0 0 10px; }
@media (max-width: 480px) {
  .ipp-nav { flex-direction: column-reverse; }
  .ipp-nav .ipp-btn { width: 100%; }
}
@media (prefers-reduced-motion: reduce) {
  .ipp-progress > span { transition: none; }
}

/* Text inside a section: the page around the pager is dark and its prose colour is light, so on the pager's
   light surface the body text must be set explicitly (0-specificity :where keeps links/emphasis colours). */
.ipp .ipp-body :where(p, li, td, th, dd, dt, blockquote, figcaption) { color: var(--text, #1b2130); }
.ipp .ipp-body :where(a) { color: var(--teal, #1f6f5c); }
.ipp .ipp-toc { background: #fff; }

/* Reading size: ~17px with 1.75 line-height (A+/A- still scales from this base). Scoped to the pager only, so
   unpaginated plans and every other page keep their own sizes. Table cells stay a little smaller (0.92em of
   this base via plan-content.css) with a tighter line-height. */
.ipp { --ipp-fs: 17px; --ipp-lh: 1.75; }
.ipp .ipp-body { font-size: var(--ipp-fs); line-height: var(--ipp-lh); }
.ipp .ipp-body.ipr-scaled { font-size: calc(var(--ipr-scale, 1) * var(--ipp-fs)); }
.ipp .ipp-body :where(p, li, dd, dt, blockquote) { line-height: var(--ipp-lh); }
.ipp .ipp-body :where(td, th) { line-height: 1.55; }
.ipp .ipp-body :where(li) { margin-bottom: 0.35em; }
.ipp .ipp-body :where(p) { margin: 0 0 0.85em; }

/* Guest reading gate (login / create account after the free preview pages) - markup comes from idea-detail.js
   renderReaderGate(); the buttons are wired by public/js/reader-gate.js. */
.ipr-btn {
  appearance: none; cursor: pointer; font: inherit; font-size: 0.88rem; font-weight: 600;
  min-height: 40px; min-width: 40px; padding: 6px 12px; border-radius: 10px;
  background: var(--paper, #faf9f5); color: var(--navy, #12213a);
  border: 1px solid var(--rule-strong, #c9c2ac); text-decoration: none; display: inline-flex; align-items: center; justify-content: center;
}
.ipr-btn:hover:not(:disabled) { border-color: var(--gold, #a9812e); }
.ipr-btn:disabled { opacity: 0.45; cursor: not-allowed; }
.ipr-btn:focus-visible { outline: 2px solid var(--gold, #a9812e); outline-offset: 2px; }
.ipr-btn-primary { background: var(--navy, #12213a); color: #fff; border-color: var(--navy, #12213a); }
.ipr-gate {
  margin: 20px 0; padding: clamp(16px, 3vw, 26px); text-align: center;
  background: var(--surface, #fff); border: 1px solid var(--gold, #a9812e); border-radius: 14px; color: var(--text, #1b2130);
}
.ipr-gate-title { margin: 0 0 8px; font-weight: 700; font-size: 1.1rem; color: var(--navy, #12213a); }
.ipr-gate-text { margin: 0 0 14px; font-size: 0.95rem; line-height: 1.55; color: var(--muted, #5c6273); }
.ipr-gate-actions { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; }
@media (max-width: 480px) { .ipr-btn { padding: 6px 10px; } }
