/*
 * Dynamic (evidence-governed) care sheet. Field-guide hierarchy: the
 * scientific profile (scientific-profile.css) opens the page, then Natural
 * Habitat and Ecology, then an explicit Captive Care transition, then the
 * husbandry sections. Quiet Reference tokens: hairline dividers, flat surfaces.
 */
.dynamic-care-sheet { display: grid; gap: var(--space-5, 1.5rem); }

/* Slim meta bar (version + print) — replaces the old hero card. */
.dynamic-care-sheet__meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  color: var(--ink-3, #8b9c8e);
  font-size: var(--font-size-sm, 0.8125rem);
  padding-bottom: var(--space-3, 0.75rem);
  border-bottom: 1px solid var(--line, #dce8d8);
}
.dynamic-care-sheet__meta p { margin: 0; }

/* Bands (Natural Habitat, Species Overview, Captive Care, Sources). */
.dynamic-care-sheet__band { display: grid; gap: var(--space-4, 1rem); }
.dynamic-care-sheet__transition {
  border-top: 2px solid var(--ink, #122018);
  padding-top: var(--space-3, 0.75rem);
}
.dynamic-care-sheet__transition-note {
  margin: 0.25rem 0 0;
  color: var(--ink-2, #48594c);
  font-size: var(--font-size-sm, 0.8125rem);
}

.dynamic-care-sheet__summary {
  display: grid;
  gap: .4rem;
  padding: 1rem 1.25rem;
  border-left: 3px solid var(--accent, #50745b);
  background: var(--surface, #fff);
}
.dynamic-care-sheet__summary a { color: inherit; }
.dynamic-care-sheet__summary b { text-transform: capitalize; }

.dynamic-care-sheet__section { break-inside: avoid; padding-block: var(--space-3, 0.75rem); border-top: 1px solid var(--line, #dce8d8); }
.dynamic-care-sheet__section-heading { display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
.dynamic-care-sheet__section-heading h3 { text-transform: capitalize; margin: 0; font-family: var(--serif, Georgia, serif); }
.confidence-badge { white-space: nowrap; padding: .25rem .6rem; border: 1px solid var(--line, #dce8d8); background: var(--surface, #fff); font-size: .78rem; font-weight: 600; color: var(--ink-2, #48594c); }
.confidence-badge--gold, .confidence-badge--platinum { border-color: var(--ink-3, #8b9c8e); }
.dynamic-care-sheet__metrics { color: var(--ink-3, #8b9c8e); font-size: .85rem; }
.dynamic-care-sheet__research-indicator { padding: .55rem .75rem; background: var(--surface, #fff); border-left: 3px solid var(--line, #dce8d8); font-size: .85rem; }
.dynamic-care-sheet__evidence { margin-top: 1rem; padding: .8rem 1rem; border: 1px solid var(--line, #dce8d8); }
.dynamic-care-sheet__evidence summary { cursor: pointer; font-weight: 600; }
.dynamic-care-sheet__evidence li { margin-block: .75rem; }
.dynamic-care-sheet__evidence li span, .dynamic-care-sheet__evidence li small { display: block; color: var(--ink-3, #8b9c8e); }
.dynamic-care-sheet__credits { margin-top: 1rem; padding-top: 1rem; border-top: 2px solid var(--ink, #122018); }

@media (max-width: 42rem) {
  .dynamic-care-sheet__section-heading { align-items: flex-start; flex-direction: column; }
}
/* A print-only provenance line (canonical URL, publication date, version) that
   is hidden on screen and shown only when printing / saving as PDF. */
.dynamic-care-sheet__printfoot { display: none; }

@media print {
  @page { margin: 16mm 14mm; }
  html, body { background: #fff !important; color: #000 !important; }
  /* Interactive/navigation chrome and share controls never print. */
  .site-header, .site-footer, .breadcrumbs, .no-print,
  .dynamic-care-sheet__actions, .dynamic-care-sheet__print, .dynamic-care-sheet__copy { display: none !important; }
  .dynamic-care-sheet__evidence { display: block; }
  .dynamic-care-sheet__printfoot { display: block; margin-top: 1rem; font-size: 0.85rem; color: #000; word-break: break-word; }
  .dynamic-care-sheet { max-width: none; color: #000; }
  /* Keep compact fact tables, sections, and each source/citation entry whole. */
  .dynamic-care-sheet__band, .dynamic-care-sheet__section { break-inside: avoid; }
  .dynamic-care-sheet__credits li, .dynamic-care-sheet__band li { break-inside: avoid; }
  /* No heading orphaned at the bottom of a page where practical. */
  h1, h2, h3 { break-after: avoid; }
  /* Legible without colour; expose external source URLs, not internal nav. */
  a { color: #000 !important; text-decoration: underline; }
  a[href^="http"]::after { content: " (" attr(href) ")"; font-size: 0.85em; word-break: break-all; }
  a[href^="/"]::after, a[href^="#"]::after { content: ""; }
}

/* ---------------------------------------------------------------------------
   RKB-058 — care-sheet assembly: per-section evidence facets, and the
   "Research in Progress" panel that states what is NOT published.

   Deliberately the same flat, chrome-light treatment as the rest of the sheet:
   no cards, no shadows, no colour-only signalling. Every state chip carries its
   own text label, so a reader who cannot distinguish the borders still reads the
   difference — the same rule `.status-badge` follows in site.css.
   --------------------------------------------------------------------------- */

.dynamic-care-sheet__band-note { color: var(--ink-3, #8b9c8e); font-size: .9rem; margin-top: .25rem; }

.cs-facets { display: flex; flex-wrap: wrap; gap: .35rem .9rem; margin: .6rem 0 0; font-size: .82rem; color: var(--ink-3, #8b9c8e); }
.cs-facet { white-space: nowrap; }
.cs-facet b { color: var(--ink-2, #48594c); font-weight: 600; }
.cs-facet--link { white-space: nowrap; font-weight: 600; }

.cs-research { margin-top: 1.5rem; padding-top: 1rem; border-top: 1px solid var(--line, #dce8d8); }
.cs-research__lede { color: var(--ink-2, #48594c); max-width: 60ch; }
.cs-research__links { display: flex; flex-wrap: wrap; gap: .5rem; margin-top: 1rem; }

.cs-research-group { margin-top: 1.25rem; }
.cs-research-group__title { display: flex; align-items: baseline; flex-wrap: wrap; gap: .5rem; margin: 0 0 .25rem; font-size: 1rem; }
.cs-research-group__count { color: var(--ink-3, #8b9c8e); font-size: .82rem; font-weight: 400; }
.cs-research-group__note { color: var(--ink-3, #8b9c8e); font-size: .87rem; max-width: 62ch; margin: 0 0 .5rem; }

.cs-research-list { list-style: none; margin: 0; padding: 0; }
.cs-research-list__row { display: flex; align-items: baseline; justify-content: space-between; gap: 1rem;
  padding: .35rem 0; border-top: 1px solid var(--line, #dce8d8); font-size: .9rem; }
.cs-research-list__label { color: var(--ink-2, #48594c); }
.cs-research-list__counts { color: var(--ink-3, #8b9c8e); font-size: .8rem; white-space: nowrap; }

.cs-status { display: inline-block; padding: .12rem .5rem; border: 1px solid var(--line, #dce8d8);
  background: var(--surface, #fff); font-size: .75rem; font-weight: 600; color: var(--ink-2, #48594c); }
.cs-status--research-incomplete { border-color: var(--ink-3, #8b9c8e); }
.cs-status--insufficient-lawful-evidence { border-style: dashed; }

@media (max-width: 42rem) {
  .cs-research-list__row { flex-direction: column; gap: .15rem; }
  .cs-research-list__counts { white-space: normal; }
}

@media print {
  .cs-research__links { display: none !important; }
  .cs-research, .cs-research-group { break-inside: avoid; }
}
