/* Type roles shared by the archive, theme editions, and reading pages.
   Keep browser preferences intact; adapt local roles rather than the root. */
html { font-size: 100%; }
:root {
  --type-caption: .75rem;
  --type-small: .875rem;
  --type-body: 1rem;
  --type-lead: 1.125rem;
  --type-card-title: 1.3125rem;
  --type-section-title: 1.375rem;
  --leading-body: 1.9;
  --leading-small: 1.7;
}
body { font-size: var(--type-body); }

/* Primary prose stays readable on both desktop and mobile. */
.reading-section > p { font-size: var(--type-body); line-height: var(--leading-body); }
.reading-lead { font-size: var(--type-lead); }
.chapter-heading h2 { font-size: var(--type-section-title); }
.card-content p, .archive-grid .card-content p,
.theme-recent .card-content p, .work-note p, .reading-timeline p,
.theme-masthead p, .theme-community-copy > p,
.archive-collection p, .feature-copy .work {
  font-size: var(--type-small);
  line-height: var(--leading-small);
}
.card-content h3 { font-size: var(--type-card-title); }
.archive-grid .card-content h3, .theme-recent .card-content h3 {
  font-size: 1.125rem;
}

/* Supporting information is smaller, without becoming miniature text. */
.card-content .eyebrow, .theme-recent .card-content .eyebrow,
.card-date, .archive-grid .card-date, .card-topline .card-index,
.archive-grid .card-topline .card-index, .card-topline,
.archive-grid .card-topline, .eyebrow, .theme-masthead .eyebrow,
.chapter-heading .eyebrow, .quote-topline .eyebrow,
.reading-time, .quote-attribution, .reading-source,
.reading-source a span, .reading-facts dt, .subject-heading p,
.detail-metadata .detail-fields > div,
.edition-detail .detail-image-note, .edition-detail .detail-meta,
.edition-detail .detail-pagination span, .art-caption,
.theme-community-code figcaption, .theme-community-copy .theme-code-hint,
.theme-today, .theme-today span, .theme-pending, .section-count {
  font-size: var(--type-caption);
}
.button, .edition-detail .detail-actions .button, .card-actions,
.card-actions .button, .reading-available,
.theme-community-copy > a, .filter-tabs button,
.search-form input, .archive-toolbar select {
  font-size: var(--type-small);
}
.theme-history-note { font-size: var(--type-caption); white-space: normal; }
.theme-history-paper strong { white-space: normal; }

/* No extra block spacing is needed just because the text grew. */
.reading-section > p { margin-bottom: 14px; }
.reading-section, .detail-copy, .feature-copy, .theme-community-copy { min-width: 0; }
.reading-source a, .original-quote a { overflow-wrap: anywhere; }

@media (max-width: 760px) {
  .site-footer { flex-wrap: wrap; }
  .site-footer p { font-size: var(--type-caption); white-space: normal; }
  .site-footer > * { max-width: 100%; }
  .theme-masthead, .theme-community, .page-heading, .edition-bar {
    flex-wrap: wrap;
  }
  .theme-identity { min-width: 0; }
  .theme-identity h1 { overflow-wrap: anywhere; }
  .today-heading > h1 { white-space: normal; }
}

/* Series name and the full date (Gregorian, weekday, lunar year-month-day)
   share one breadcrumb row. A phone used to drop the date onto its own line;
   that second row is what made the header read as two lines. Stay on one
   line instead, and let the breadcrumb width cap the type so a larger root
   font cannot clip the lunar span or push the page sideways. */
.detail-breadcrumb {
  container-type: inline-size;
  flex-wrap: nowrap;
  align-items: center;
  min-width: 0;
}
.detail-breadcrumb .breadcrumb,
.detail-breadcrumb time,
.detail-breadcrumb time span {
  white-space: nowrap;
}
.detail-breadcrumb time {
  flex-wrap: nowrap;
  width: auto;
  max-width: none;
}

@media (max-width: 760px) {
  .header-inner nav, body[data-theme] .header-inner nav {
    height: auto;
    min-height: 34px;
    max-width: 100%;
    flex-wrap: wrap;
    column-gap: 8px;
  }
  .header-inner nav > a { gap: 3px; }
  .detail-breadcrumb {
    flex-wrap: nowrap;
    align-items: center;
    justify-content: space-between;
    column-gap: clamp(6px, 2.4cqi, 12px);
    padding-block: 12px;
    row-gap: 0;
    min-width: 0;
  }
  .detail-breadcrumb .breadcrumb {
    flex: 0 0 auto;
    font-size: min(0.6875rem, 3.58cqi);
  }
  .detail-breadcrumb time {
    flex: 0 1 auto;
    width: auto;
    max-width: none;
    min-width: 0;
    margin-left: auto;
    justify-content: flex-end;
    flex-wrap: nowrap;
    white-space: nowrap;
    font-size: min(0.75rem, 3.93cqi);
    gap: clamp(4px, 2.15cqi, 8px);
  }
  .detail-breadcrumb time span {
    flex-shrink: 0;
    white-space: nowrap;
    font-size: min(0.6875rem, 3.58cqi);
    padding-left: clamp(4px, 2.15cqi, 8px);
  }
}
