/* The facts page. Sits on /compare/compare.css and /guides/guides.css, so the
   nav, bands, type, answer and source list are the guides' own. This file adds
   the contents list, the fact rows, the 100-dot figures, the length chart and
   the misquote. One ink, cotton and white, no accent. */

/* ---------- Hero ---------- */

.fs-hero { display: grid; grid-template-columns: minmax(0, 7fr) minmax(0, 4fr); gap: 48px clamp(40px, 6vw, 96px); align-items: end; }
.fs-hero h1 { max-width: 12ch; }

.fs-meta {
  margin-top: 28px;
  display: flex;
  flex-wrap: wrap;
  gap: 6px 22px;
  font: 500 14px/1.4 var(--sans);
  color: var(--grey);
  font-variant-numeric: tabular-nums;
}

.fs-meta strong { font-weight: 600; color: var(--ink); }

/* Contents: the four groups, with how many facts each holds. */
.fs-toc { border-top: 1px solid var(--ink); }
.fs-toc a {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 16px;
  align-items: baseline;
  padding: 14px 0 15px;
  border-bottom: 1px solid var(--rule);
  text-decoration: none;
  font-family: var(--serif);
  font-variation-settings: "opsz" 20;
  font-size: 20px;
  line-height: 1.25;
}

.fs-toc a span { font: 500 13px/1 var(--sans); color: var(--grey); font-variant-numeric: tabular-nums; }
.fs-toc a:hover { text-decoration: underline; text-underline-offset: 0.22em; }

/* ---------- A group of facts ---------- */

.fs-group { scroll-margin-top: var(--nav); }
.fs-group-head { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: 16px clamp(40px, 7vw, 112px); align-items: end; margin-bottom: clamp(32px, 4vw, 56px); }
.fs-group-head .h-chapter { max-width: 12ch; }
.fs-group-head .lead { max-width: 52ch; color: var(--ink-2); }

.fs-list { border-top: 1px solid var(--ink); }

/* One fact: its number and figure, the sentence and source, then a picture of it. */
.fs-fact {
  display: grid;
  grid-template-columns: minmax(0, 4fr) minmax(0, 5fr) minmax(0, 3fr);
  grid-template-areas: "fig body art";
  gap: 20px clamp(28px, 4vw, 64px);
  padding: clamp(28px, 3.4vw, 44px) 0;
  border-bottom: 1px solid var(--rule);
  scroll-margin-top: calc(var(--nav) + 16px);
}

.fs-fact.no-art { grid-template-areas: "fig body body"; }
.fs-fact.no-art .fs-body { max-width: 60ch; }

.fs-fig { grid-area: fig; display: grid; align-content: start; gap: 10px; }

.fs-no { font: 600 13px/1 var(--sans); color: var(--grey); font-variant-numeric: tabular-nums; }

.fs-num {
  font-family: var(--serif);
  font-variation-settings: "opsz" 72;
  font-weight: 350;
  font-size: clamp(64px, 8.4vw, 112px);
  line-height: 0.92;
  letter-spacing: -0.03em;
  font-variant-numeric: lining-nums proportional-nums;
  color: var(--ink);
  white-space: nowrap;
}

.fs-num small {
  font-size: 0.42em;
  letter-spacing: -0.01em;
  margin-left: 0.06em;
  font-variation-settings: "opsz" 36;
}

.fs-num.is-words { font-size: clamp(44px, 5.2vw, 68px); line-height: 1; white-space: normal; max-width: 7ch; }

.fs-body { grid-area: body; display: grid; align-content: start; gap: 14px; }

.fs-claim {
  font-family: var(--serif);
  font-variation-settings: "opsz" 24;
  font-size: clamp(21px, 1.9vw, 25px);
  line-height: 1.38;
  letter-spacing: -0.004em;
  color: var(--ink);
  text-wrap: pretty;
  max-width: 34ch;
}

.fs-detail { max-width: 52ch; }

.fs-cite {
  display: grid;
  gap: 2px;
  padding-top: 12px;
  border-top: 1px solid var(--rule);
  font: 400 14px/1.45 var(--sans);
  color: var(--grey);
  max-width: 52ch;
}

.fs-cite a { color: var(--ink); font-weight: 500; }

.fs-acts { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 4px; }

.fs-acts button {
  min-height: 36px;
  padding: 0 14px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  box-shadow: inset 0 0 0 1px var(--rule);
  color: var(--ink);
  font: 500 13px/1 var(--sans);
  cursor: pointer;
  transition: box-shadow 160ms ease-out, background-color 160ms ease-out;
}

.fs-acts button:hover { box-shadow: inset 0 0 0 1px var(--ink); }
.fs-acts button:active { background: var(--cotton); }

.fs-fact:target .fs-no { color: var(--ink); }
.fs-fact:target .fs-no::after { content: " \00b7  linked"; font-weight: 500; }

.fs-art { grid-area: art; align-self: start; }
.fs-art figcaption { margin-top: 12px; font: 500 13px/1.4 var(--sans); color: var(--grey); }

/* ---------- 100 dots: one for each person in a hundred ---------- */

.dots {
  display: grid;
  grid-template-columns: repeat(10, 1fr);
  gap: clamp(5px, 0.6vw, 8px);
  max-width: 236px;
}

.dots i {
  aspect-ratio: 1;
  border-radius: 50%;
  box-shadow: inset 0 0 0 1px #c9c2b5;
  background: transparent;
}

.dots i.on { background: var(--ink); box-shadow: none; }
.dots i.part { background: linear-gradient(90deg, var(--ink) var(--part), transparent var(--part)); box-shadow: inset 0 0 0 1px var(--ink); }

/* ---------- The length chart: advised minutes for each speech, from the sources ---------- */

.lengths { margin-top: clamp(8px, 2vw, 24px); }

.len-scale, .len-row {
  display: grid;
  grid-template-columns: minmax(150px, 3fr) minmax(0, 9fr);
  gap: 24px;
  align-items: center;
}

.len-row { padding: 14px 0; border-bottom: 1px solid var(--rule); }
.len-row:first-of-type { border-top: 1px solid var(--ink); }

.len-name { font: 600 15px/1.3 var(--sans); color: var(--ink); }
.len-name small { display: block; margin-top: 2px; font-weight: 400; font-size: 13px; color: var(--grey); }

.len-track { position: relative; height: 30px; }

/* Minute lines behind every bar, so the eye can line them up. */
.len-track::before {
  content: "";
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(90deg, #e4ded3 0 1px, transparent 1px calc(100% / var(--span)));
  background-size: 100% 100%;
}

.len-bar {
  --from: 0;
  --to: 1;
  position: absolute;
  top: 9px;
  bottom: 9px;
  left: calc(var(--from) / var(--span) * 100%);
  width: calc((var(--to) - var(--from)) / var(--span) * 100%);
  min-width: 4px;
  border-radius: 5px;
  background: var(--ink);
  display: flex;
  align-items: center;
}

.len-bar span {
  position: absolute;
  left: calc(100% + 10px);
  font: 500 13px/1 var(--sans);
  color: var(--ink);
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

.len-bar.is-outer { background: repeating-linear-gradient(-45deg, var(--ink) 0 2px, transparent 2px 5px); box-shadow: inset 0 0 0 1px var(--ink); }
.len-key { display: inline-flex; align-items: center; gap: 8px; margin-left: 18px; font-weight: 500; }
.len-key::before { content: ""; width: 22px; height: 12px; border-radius: 4px; background: repeating-linear-gradient(-45deg, var(--ink) 0 2px, transparent 2px 5px); box-shadow: inset 0 0 0 1px var(--ink); }

.len-scale { margin-top: 10px; }
.len-ticks { position: relative; height: 16px; font: 500 12px/1 var(--sans); color: var(--grey); font-variant-numeric: tabular-nums; }
.len-ticks span { position: absolute; transform: translateX(-50%); }
.len-ticks span:first-child { transform: none; }

.len-note { margin-top: 18px; font: 400 14px/1.5 var(--sans); color: var(--grey); max-width: 70ch; }

/* ---------- The misquote ---------- */

.myth { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: 32px clamp(40px, 7vw, 112px); align-items: start; }

.myth-said {
  font-family: var(--serif);
  font-variation-settings: "opsz" 48;
  font-size: clamp(30px, 3.4vw, 42px);
  line-height: 1.14;
  letter-spacing: -0.012em;
  color: var(--ink);
  text-decoration: line-through;
  text-decoration-thickness: 2px;
  text-decoration-color: rgba(26, 26, 26, 0.55);
  max-width: 16ch;
}

.myth-label { margin-bottom: 14px; }
.myth .read + .read { margin-top: 14px; }
.myth .read { max-width: 58ch; }

/* ---------- Using these facts ---------- */

.use { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: 28px clamp(40px, 7vw, 112px); align-items: start; }
.use .read { max-width: 56ch; }
.use .read + .read { margin-top: 12px; }

.cite-box {
  margin-top: 22px;
  padding: 18px 20px;
  border-radius: 14px;
  background: var(--white);
  box-shadow: 0 0 0 1px rgba(26, 26, 26, 0.08), 0 14px 28px -22px rgba(26, 26, 26, 0.3);
  font: 400 15px/1.5 var(--sans);
  color: var(--ink-2);
  max-width: 60ch;
}

.cite-box .fs-acts { margin-top: 12px; }

/* ---------- Narrow screens ---------- */

@media (max-width: 1080px) {
  .fs-fact { grid-template-columns: minmax(0, 4fr) minmax(0, 6fr); grid-template-areas: "fig body" "art body"; }
  .fs-art .dots { max-width: 180px; }
  .fs-fact.no-art { grid-template-areas: "fig body"; }
}

@media (max-width: 960px) {
  .fs-hero, .fs-group-head, .myth, .use { grid-template-columns: minmax(0, 1fr); }
}

@media (max-width: 720px) {
  .fs-fact, .fs-fact.no-art { grid-template-columns: minmax(0, 1fr); grid-template-areas: "fig" "body" "art"; gap: 16px; }
  .fs-fact.no-art { grid-template-areas: "fig" "body"; }
  .fs-num { font-size: clamp(60px, 18vw, 84px); }
  .fs-num.is-words { font-size: clamp(40px, 11vw, 52px); max-width: none; }
  .dots { max-width: 210px; }
  .len-scale, .len-row { grid-template-columns: minmax(0, 1fr); gap: 8px; }
  .len-scale > :first-child { display: none; }
  .len-bar span { font-size: 12px; }
}

@media (prefers-reduced-motion: reduce) {
  .fs-acts button { transition: none; }
}

/* The misquote's sources are lettered, to tell them from the numbered facts. */
.myth .sources li::before { content: counter(src, lower-alpha); }
.myth > div:first-child { position: sticky; top: calc(var(--nav) + 32px); }

@media (max-width: 960px) {
  .myth > div:first-child { position: static; }
}
