/* Fibre Herd — animal fiche v2 (AlpacaKeep-inspired denser layout, FH brand)
   #6A9440 lime · #484844 charcoal · multi-species safe · FR UI */
:root {
  --fh-v2-lime: #6A9440;
  --fh-v2-lime-soft: #f3f8e4;
  --fh-v2-lime-mid: #d7e8a8;
  --fh-v2-char: #484844;
  --fh-v2-line: #e2e6dc;
  --fh-v2-muted: #6b6e64;
  --fh-v2-card: #fff;
  --fh-v2-bg: #fafaf8;
}

.fh-v2-hero-summary {
  display: flex;
  flex-wrap: wrap;
  gap: .35rem .55rem;
  align-items: center;
  margin: .35rem 0 0;
  font-size: .95rem;
  color: var(--fh-v2-char);
  line-height: 1.35;
}
.fh-v2-hero-summary .fh-v2-dot { color: var(--fh-v2-muted); }
.fh-v2-status-pill {
  display: inline-flex;
  align-items: center;
  gap: .25rem;
  padding: .15rem .55rem;
  border-radius: 999px;
  font-size: .78rem;
  font-weight: 700;
  background: var(--fh-v2-lime-soft);
  color: var(--fh-v2-char);
  border: 1px solid var(--fh-v2-lime-mid);
}
.fh-v2-status-pill.is-warn {
  background: #fff4e8;
  border-color: #f0c9a0;
}

/* Dense metrics strip — latest analysis */
.fh-v2-metrics {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(72px, 1fr));
  gap: .55rem;
  margin: 1rem 0 0;
  padding: .75rem .85rem;
  background: var(--fh-v2-lime-soft);
  border: 1px solid var(--fh-v2-lime-mid);
  border-radius: 12px;
}
.fh-v2-metrics__cell {
  text-align: center;
  min-width: 0;
}
.fh-v2-metrics__label {
  display: block;
  font-size: .68rem;
  font-weight: 700;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: var(--fh-v2-muted);
  margin-bottom: .15rem;
}
.fh-v2-metrics__value {
  display: block;
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--fh-v2-char);
  font-variant-numeric: tabular-nums;
  line-height: 1.15;
}
.fh-v2-metrics__unit {
  font-size: .7rem;
  font-weight: 600;
  color: var(--fh-v2-muted);
  margin-left: .1rem;
}
.fh-v2-metrics__meta {
  grid-column: 1 / -1;
  display: flex;
  flex-wrap: wrap;
  gap: .4rem .75rem;
  align-items: center;
  margin-top: .15rem;
  padding-top: .55rem;
  border-top: 1px dashed var(--fh-v2-lime-mid);
  font-size: .82rem;
  color: var(--fh-v2-muted);
}
.fh-v2-class-pill {
  display: inline-flex;
  align-items: center;
  padding: .2rem .55rem;
  border-radius: 999px;
  background: var(--fh-v2-lime);
  color: #fff;
  font-size: .75rem;
  font-weight: 800;
  letter-spacing: .02em;
}
.fh-v2-lab-badge {
  display: inline-flex;
  align-items: center;
  padding: .15rem .5rem;
  border-radius: 6px;
  background: #fff;
  border: 1px solid var(--fh-v2-lime);
  color: var(--fh-v2-char);
  font-size: .75rem;
  font-weight: 700;
}
.fh-v2-metrics.is-empty {
  background: var(--fh-v2-bg);
  border-color: var(--fh-v2-line);
}
.fh-v2-metrics.is-empty .fh-v2-metrics__value { font-size: .95rem; font-weight: 600; color: var(--fh-v2-muted); }

/* Sticky section nav (pseudo-tabs).
   Sits just under the site header. --fh-header-h is the live header height
   (assets/fh-header.js). Fallback covers the compact bar before that script runs. */
.fh-v2-secnav-wrap {
  position: sticky;
  top: var(--fh-header-h, 3.6rem);
  z-index: 100;
  margin: 0 0 1rem;
  background: rgba(250, 250, 248, .94);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--fh-v2-line);
  padding: .45rem 0 .35rem;
}
.fh-v2-secnav {
  display: flex;
  gap: .25rem;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
  padding: 0 .15rem .15rem;
  scroll-snap-type: x proximity;
}
/* Center the pills when they fit. "safe" keeps the first item reachable
   if the row overflows (narrow desktop). Phone stays left-aligned. */
@media (min-width: 901px) {
  .fh-v2-secnav { justify-content: safe center; }
}
.fh-v2-secnav a {
  flex: 0 0 auto;
  scroll-snap-align: start;
  display: inline-flex;
  align-items: center;
  padding: .45rem .7rem;
  border-radius: 999px;
  font-size: .82rem;
  font-weight: 700;
  color: var(--fh-v2-char);
  text-decoration: none;
  border: 1px solid transparent;
  white-space: nowrap;
}
.fh-v2-secnav a:hover {
  background: var(--fh-v2-lime-soft);
  border-color: var(--fh-v2-lime-mid);
}
.fh-v2-secnav a.is-active {
  background: var(--fh-v2-lime);
  color: #fff;
  border-color: var(--fh-v2-lime);
}
@media (max-width: 560px) {
  .fh-v2-secnav a { font-size: .78rem; padding: .4rem .6rem; }
  .fh-v2-metrics__value { font-size: 1.02rem; }
}

/* Section cards under anchors */
.fh-v2-section {
  scroll-margin-top: calc(var(--fh-header-h, 3.6rem) + 3.15rem);
  margin: 1.25rem 0;
  padding: 1rem 1.05rem;
  background: var(--fh-v2-card);
  border: 1px solid var(--fh-v2-line);
  border-radius: 14px;
}
.fh-v2-section > h2:first-child,
.fh-v2-section > .fh-gallery > h2:first-child {
  margin-top: 0;
  font-size: 1.15rem;
  color: var(--fh-v2-char);
}

/* Class-band axis under histogram (alpaga / Fibrelab referential) */
.fh-v2-class-bands {
  margin: .35rem 0 .15rem;
  padding: 0 2px;
}
.fh-v2-class-bands__bar {
  display: flex;
  height: 10px;
  border-radius: 5px;
  overflow: hidden;
  border: 1px solid var(--fh-v2-line);
}
.fh-v2-class-bands__seg {
  height: 100%;
  min-width: 0;
}
.fh-v2-class-bands__labels {
  display: flex;
  justify-content: space-between;
  margin-top: .25rem;
  font-size: .65rem;
  color: var(--fh-v2-muted);
  font-variant-numeric: tabular-nums;
}
.fh-v2-class-bands__legend {
  display: flex;
  flex-wrap: wrap;
  gap: .25rem .55rem;
  margin-top: .4rem;
  font-size: .68rem;
  color: var(--fh-v2-muted);
}
.fh-v2-class-bands__legend span::before {
  content: "";
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 2px;
  margin-right: .25rem;
  vertical-align: middle;
}
.fh-v2-band-sr::before { background: #5a9e00; }
.fh-v2-band-rb::before { background: #6A9440; }
.fh-v2-band-b::before { background: #a8d44a; }
.fh-v2-band-f::before { background: #c5e070; }
.fh-v2-band-m::before { background: #e0c86a; }
.fh-v2-band-st::before { background: #e0a05a; }
.fh-v2-band-es::before { background: #d07850; }
.fh-v2-band-c::before { background: #b06050; }

.fh-v2-micron-axis {
  display: flex;
  justify-content: space-between;
  margin: .25rem 2px 0;
  font-size: .7rem;
  color: var(--fh-v2-muted);
  font-variant-numeric: tabular-nums;
}

@media print {
  .fh-v2-secnav-wrap { display: none; }
  .fh-v2-section { break-inside: avoid; border: none; padding: 0; }
}

/* BCS plates. Captions are painted on the JPGs, so desktop is 2-up
   (not 3): a third column crushes the score lines. <=900px stays 1 column. */
.fh-bcs-plates {
  display: grid;
  grid-template-columns: 1fr;
  gap: .75rem 1rem;
  margin: .75rem 0 1rem;
  align-items: start;
}
.fh-bcs-plate,
.fh-bcs-copy {
  min-width: 0;
}
.fh-bcs-plates > .fh-bcs-fig,
.fh-bcs-plate > .fh-bcs-fig {
  margin: 0;
}
.fh-bcs-plates .fh-bcs-fig img {
  width: 100%;
  height: auto;
}
.fh-bcs-plate > h3 {
  margin: 0 0 .45rem;
}
.fh-bcs-plate > p:last-child {
  margin: .5rem 0 0;
}
.fh-bcs-copy p {
  margin: 0 0 .65rem;
}
.fh-bcs-copy p:last-child {
  margin-bottom: 0;
}
@media (min-width: 901px) {
  .fh-bcs-plates {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
