/* Fact strip: a section's labelled facts, before its prose.
   Markup: src/_includes/partials/fact-strip.njk. Catalog entry and limits:
   docs/design/component-patterns.md -> Fact strip. Linked by the planning-guide layout for a place-look guide.
   Colours and spacing are Waterline scale literals (scripts/enforcement/waterline-tokens.test.js).
   Link colour, hover colour and the focus ring come from the page. The piece sets no
   outer margin: the section it sits in owns the space around it.
   Both forms change layout by their own width (a container query), not the screen's,
   because a guide's column narrows again where its side rail appears. The two widths
   measure the piece, so they are its own and not screen breakpoints; the catalog entry
   names them (scripts/enforcement/fact-strip.test.js: change both together). A browser
   without container queries keeps the phone layout. */

.fs-list { margin: 0; }
.fs-fact { padding: 16px 0; border-top: 1px solid #CAD4CF; color: #1b1b1b; font: 400 15px/1.55 Inter, system-ui, sans-serif; }
.fs-fact:first-child { border-top: 0; }
.fs-fact dt { margin: 0 0 4px; font: 500 12px/1.4 Inter, system-ui, sans-serif; letter-spacing: .13em; text-transform: uppercase; }
.fs-fact dd { max-width: 68ch; margin: 0; }
.fs-fact a { text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 3px; }

/* ---- Strip: opens a section; the first fact is the lead ---- */
.fs-strip { container-type: inline-size; border-top: 1px solid #1b1b1b; border-bottom: 1px solid #CAD4CF; }
.fs-strip dt { color: #52676A; }
.fs-strip .fs-fact:first-child dd { max-width: 40ch; font: 400 21px/1.3 "Instrument Serif", Georgia, serif; letter-spacing: -.005em; }

/* Two or three facts sit side by side once the strip is 720px wide; below that a
   third column's line is under 20 characters. Four or more facts stay rows. */
@container (min-width: 720px) {
  .fs-strip .fs-fact:first-child dd { font-size: 24px; }
  .fs-cols-2 > .fs-list, .fs-cols-3 > .fs-list { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); }
  .fs-cols-3 > .fs-list { grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr) minmax(0, 1fr); }
  .fs-cols-2 .fs-fact, .fs-cols-3 .fs-fact { padding: 24px 24px 24px 0; border-top: 0; }
  .fs-cols-2 .fs-fact + .fs-fact, .fs-cols-3 .fs-fact + .fs-fact { padding-left: 24px; border-left: 1px solid #CAD4CF; }
  .fs-cols-2 .fs-fact:last-child, .fs-cols-3 .fs-fact:last-child { padding-right: 0; }
}

/* ---- Panel: a figure beside ruled rows ---- */
.fs-panel { display: flex; align-items: flex-start; gap: 16px; padding: 16px 0; border-top: 1px solid #1b1b1b; border-bottom: 1px solid #CAD4CF; }
.fs-figure { flex: none; }
.fs-rows { container-type: inline-size; flex: 1 1 0; min-width: 0; }
.fs-rows dt { color: #A4533E; }
.fs-rows .fs-fact:first-child { padding-top: 0; }
.fs-rows .fs-fact:last-child { padding-bottom: 0; }
/* One fact beside a tall figure sits at its middle, not under an empty band. */
.fs-lone > .fs-rows { align-self: center; }

/* The label moves beside its line once the rows are 480px wide, which leaves the
   line at least 336px. */
@container (min-width: 480px) {
  .fs-rows .fs-fact { display: grid; grid-template-columns: 120px minmax(0, 1fr); column-gap: 24px; align-items: baseline; }
  .fs-rows dt { margin-bottom: 0; }
}

/* Space, not layout: the gap steps up with the screen, where the island inset grows. */
@media (min-width: 900px) {
  .fs-panel { gap: 32px; padding: 24px 0; }
}
