/* Reader and discovery refinements for the existing ivory/forest system. */

/* Match the legacy variants' specificity so each feature shares its surface. */
.research-feature-card,
.research-feature-card:nth-child(2),
.research-feature-card:nth-child(3) {
  background: var(--panel);
}
.research-feature-card h3 { text-wrap: balance; }
.research-feature-card p { font-size: 1rem; line-height: 1.7; }
.feature-card-action { font-size: .9rem; }

/* Keep prose at a reading measure while figures and evidence grids can expand. */
body[data-page="article"] #deep-dive-body p,
body[data-page="article"] #deep-dive-body .entry-sublist,
body[data-page="article"] #deep-dive-body .study-snapshot dl {
  max-width: 72ch;
}
body[data-page="article"] #deep-dive-body .entry-sublist li + li { margin-top: .5rem; }
body[data-page="article"] #deep-dive-body .dossier-section:not(.topic-research-feature) > [data-reader-heading] {
  font: 400 clamp(1.4rem, 2vw, 1.75rem)/1.25 var(--serif);
  letter-spacing: -.02em;
  margin: 0 0 .9rem;
  text-wrap: balance;
}
body[data-page="article"] #deep-dive-body .dossier-section {
  margin-top: 1.5rem;
  margin-bottom: 1.5rem;
}
body[data-page="article"] #deep-dive-body .deep-dive-source > [data-reader-heading] {
  font-size: 1.1rem;
  line-height: 1.45;
}
body[data-page="article"] #deep-dive-body :is(.deep-dive-source, .study-snapshot, .source-review-note) {
  min-width: 0;
  overflow-wrap: anywhere;
}
body[data-page="article"] #deep-dive-body :is(.citation-label, .source-audit-line) {
  font-size: .875rem;
}
body[data-page="article"] #deep-dive-body .source-review-note {
  font-size: .95rem;
  line-height: 1.7;
}
body[data-page="article"] #deep-dive-body .topic-personalization-actions .btn-mini {
  min-height: 44px;
  padding: .55rem .8rem;
}

body[data-page="peptide"] .peptide-reader-title-note { max-width: 72ch; font-size: 1rem; }
body[data-page="peptide"] .peptide-reader .peptide-source-grade { font-size: .875rem; line-height: 1.6; }
body[data-page="peptide"] .peptide-reader :is(.peptide-field-label, .peptide-source-fields dt) { font-size: .875rem; }
body[data-page="peptide"] .peptide-reader :is(.peptide-source-note, .peptide-citations p) { font-size: .9rem; max-width: 72ch; }
body[data-page="peptide"] .peptide-citations a { font-size: 1rem; line-height: 1.7; }
body[data-page="peptide"] .peptide-reader summary {
  min-height: 44px;
  padding-block: .6rem;
  line-height: 1.5;
}
body[data-page="peptide"] .peptide-reader-section > summary { font-size: 1.15rem; }
body[data-page="peptide"] .peptide-reader :is(h1, h2, h3, h4, a) { overflow-wrap: anywhere; }

/* Scope directory type and touch targets without changing the atlas controls. */
body[data-page="topics"] .entry-card { padding: clamp(1rem, 2vw, 1.5rem); }
body[data-page="topics"] .entry-card > p { max-width: 72ch; }
body[data-page="topics"] .entry-card h3 { line-height: 1.35; overflow-wrap: anywhere; }
body[data-page="topics"] :is(.catalog-controls, .catalog-advanced-controls, .catalog-result-bar) :is(input, select) { min-width: 0; min-height: 44px; font-size: 1rem; }
body[data-page="topics"] .alphabet button { min-width: 44px; min-height: 44px; }
body[data-page="topics"] :is(.catalog-refinements summary, .active-topic-filters button) { min-height: 44px; padding-block: .65rem; }
body[data-page="library"] .peptide-category-chip { min-height: 44px; font-size: .875rem; }
body[data-page="library"] .peptide-card .peptide-card-description { font-size: 1rem; line-height: 1.65; }
body[data-page="library"] .peptide-card-meta { font-size: .825rem; }
body[data-page="library"] .peptide-source-grade { font-size: .825rem; }
body[data-page="library"] .peptide-card > a:last-child { display: inline-flex; align-items: center; min-height: 44px; font-size: .9rem; }
body[data-page="library"] .peptide-advanced-filters summary { min-height: 44px; padding-block: .6rem; font-size: .9rem; }
body[data-page="library"] .peptide-import-guide p { max-width: 72ch; font-size: 1rem; }

/* Comfortable reading and recovery paths in the learning and evidence views. */
body[data-page="guides"] .learning-topic-row { padding: .75rem; gap: .75rem; }
body[data-page="guides"] .learning-topic-row .btn-mini { min-height: 44px; padding: .55rem .7rem; }
body[data-page="guides"] .learning-topic-state { font-size: .825rem; letter-spacing: .04em; }
body[data-page="guides"] :is(.learning-check-option, .saved-topic-button) { min-height: 44px; }
body[data-page="guides"] .protocol-profile-card > p { max-width: 72ch; }
body[data-page="evidence"] .coverage-controls { flex-wrap: wrap; }
body[data-page="evidence"] .coverage-controls select { flex: 1 1 16rem; min-width: 0; min-height: 44px; padding: .6rem .75rem; }
body[data-page="evidence"] :is(.risk-controls select, #study-reading-select, .coverage-controls select, .research-desk-controls input, .research-desk-controls select) { font-size: 1rem; }
body[data-page="evidence"] .coverage-card-head { flex-wrap: wrap; }
body[data-page="evidence"] :is(.coverage-card, .frontier-item, .study-reading-lab) { min-width: 0; overflow-wrap: anywhere; }
body[data-page="evidence"] #source-list .frontier-item { padding: 1.25rem 1.5rem; }
body[data-page="evidence"] #source-list .frontier-item::before { content: none; }
body[data-page="evidence"] #source-list .frontier-item > p { max-width: 72ch; }
body[data-page="evidence"] .source-interpretation summary,
body[data-page="evidence"] .evidence-reading-notes summary { min-height: 44px; padding-block: .5rem; }
body[data-page="evidence"] .evidence-reading-notes p,
body[data-page="evidence"] #study-reading-content dd { font-size: 1rem; line-height: 1.7; }
body[data-page="evidence"] .coverage-disclosure { margin-top: 1rem; }
body[data-page="evidence"] .coverage-disclosure > summary { min-height: 44px; padding-block: .65rem; color: var(--accent); cursor: pointer; font-weight: 600; }
body[data-page="evidence"] .coverage-disclosure[open] > summary { margin-bottom: .75rem; }

body[data-page="search"] .search-result-groups > section { min-width: 0; }
body[data-page="search"] .search-result-groups > section > h2 { margin-bottom: 1rem; }
body[data-page="search"] .search-result h3 { line-height: 1.35; overflow-wrap: anywhere; }
body[data-page="search"] .search-result p { font-size: 1rem; max-width: 72ch; line-height: 1.7; }
body[data-page="search"] .search-result-navigation {
  display: flex;
  flex-wrap: wrap;
  gap: .5rem 1.5rem;
  padding-block: .75rem;
  border-block: 1px solid var(--line);
}
body[data-page="search"] .search-result-navigation a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  color: var(--accent);
  font-size: .9rem;
  overflow-wrap: anywhere;
}

@media (max-width: 620px) {
  body[data-page="article"] #deep-dive-body .dossier-section { padding: 1.2rem 1rem; }
  body[data-page="article"] .dossier-nav { flex-wrap: wrap; gap: .4rem; }
  body[data-page="article"] .dossier-nav select { flex-basis: 100%; min-height: 44px; }
  body[data-page="library"] .peptide-card { padding: 1.2rem; }
  body[data-page="evidence"] #source-list .frontier-item { padding: 1rem; }
}

/* Section links keep long editorial reading positions portable. */
.reader-link-actions { display: flex; align-items: center; flex-wrap: wrap; gap: .65rem 1rem; margin-top: .65rem; }
.reader-link-actions :is(button, a) { min-height: 44px; }
.reader-link-actions a { display: inline-flex; align-items: center; text-underline-offset: .2em; }
.reader-link-actions button:disabled { opacity: 1; color: #52635d; background: #eceee7; cursor: default; }
#reader-section-link-status { color: var(--muted); font-size: .875rem; }
#reader-section-link-value { width: 100%; min-width: 0; min-height: 44px; padding: .6rem; color: var(--ink); background: var(--panel); border: 1px solid var(--line); font: inherit; caret-color: var(--accent); }
.reader-link-actions :is(button, a, input):focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
body[data-page="article"] #deep-dive-body :is(.dossier-section, .deep-dive-source) { scroll-margin-block-start: calc(var(--reader-navigation-height, 8rem) + 1rem); }
@media (max-width: 620px) { .reader-link-actions { gap: .5rem 1rem; } #reader-section-link-status { flex-basis: 100%; } }
@media print { .reader-link-actions { display: none; } }
