/* Where They Stand family kit: how a checked briefing looks, the same on every briefing site in its own cloth.
   Generated into each site by sync.mjs. Edit family/kit/briefing.css, not the copies. The markup, the words and
   the behaviour each part needs are in family/BRIEFINGS.md. Give the briefing's container class="wts-cloth--<id>".
   Nothing here relies on colour alone: every mark has a shape or words as well, and a text equivalent for screen
   readers in the markup. Anything that moves is inside prefers-reduced-motion: no-preference. */

:root {
  --wts-warn: #8A4B00;          /* text and marks for points to check: 7.0:1 on the page */
  --wts-warn-bg: #FFF4E5;
  --wts-mark-mps: #D9EBDF;      /* the record's highlight, in each cloth: ink stays above 12:1 on it */
  --wts-mark-councils: #F1E4D6;
  --wts-mark-countries: #D8E8F4;
  --wts-mark-landlords: #E3E6E8;
  --wts-mark-lives: #EDE1EF;
}
@supports (color: light-dark(#000, #fff)) {
  :root {
    --wts-warn: light-dark(#8A4B00, #F0B46A);
    --wts-warn-bg: light-dark(#FFF4E5, #2A1F12);
    --wts-mark-mps: light-dark(#D9EBDF, #1E3B2E);
    --wts-mark-councils: light-dark(#F1E4D6, #3A2A1C);
    --wts-mark-countries: light-dark(#D8E8F4, #17344A);
    --wts-mark-landlords: light-dark(#E3E6E8, #2B3236);
    --wts-mark-lives: light-dark(#EDE1EF, #33233A);
  }
}
@supports not (color: light-dark(#000, #fff)) {
  @media (prefers-color-scheme: dark) {
    :root {
      --wts-warn: #F0B46A; --wts-warn-bg: #2A1F12;
      --wts-mark-mps: #1E3B2E; --wts-mark-councils: #3A2A1C; --wts-mark-countries: #17344A;
      --wts-mark-landlords: #2B3236; --wts-mark-lives: #33233A;
    }
  }
}
.wts-cloth--mps { --wts-mark: var(--wts-mark-mps); }
.wts-cloth--councils { --wts-mark: var(--wts-mark-councils); }
.wts-cloth--countries { --wts-mark: var(--wts-mark-countries); }
.wts-cloth--landlords { --wts-mark: var(--wts-mark-landlords); }
.wts-cloth--lives { --wts-mark: var(--wts-mark-lives); }

.wts-vh { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* The check strip: at the top of every briefing, a band in the site's cloth with the three counts in words */
.wts-check { background: var(--wts-cloth); color: var(--wts-on-cloth); border-radius: 6px; padding: 1rem 1.25rem;
  display: grid; gap: .75rem; margin: 0 0 1.5rem; font-family: var(--wts-sans); }
.wts-check a { color: var(--wts-on-cloth); }
.wts-check a:focus-visible { outline: var(--wts-focus-width) solid var(--wts-on-cloth); outline-offset: 2px; }
.wts-check__head { display: flex; flex-wrap: wrap; justify-content: space-between; gap: .25rem 1rem; align-items: baseline; }
.wts-check__title { font-family: var(--wts-serif); font-size: 1.125rem; font-weight: 700; margin: 0; }
.wts-check__more { font-size: .9375rem; }
.wts-check__list { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(13rem, 1fr)); gap: .75rem 1.5rem; }
.wts-check__item { display: flex; flex-direction: column; gap: .1rem; min-width: 0; padding-top: .5rem;
  border-top: 1px solid color-mix(in srgb, var(--wts-on-cloth) 35%, transparent); }
.wts-check__count { display: inline-flex; gap: .4rem; align-items: baseline; }
.wts-check__glyph { font-weight: 700; }
.wts-check__num { font-family: var(--wts-serif); font-size: 2rem; line-height: 1; font-weight: 700; font-variant-numeric: tabular-nums; }
.wts-check__badge { font-size: .8125rem; font-weight: 700; border: 2px solid var(--wts-on-cloth); border-radius: 4px; padding: 0 .35rem; line-height: 1.4; }
.wts-check__first { white-space: nowrap; }
@media (max-width: 40rem) {
  .wts-check__head { flex-direction: column; }
  .wts-check__list { grid-template-columns: 1fr; gap: .5rem; }
  .wts-check__item { display: grid; grid-template-columns: 6.25rem minmax(0, 1fr); align-items: baseline; gap: .5rem; }
  .wts-check__num { font-size: 1.75rem; }
  .wts-check__badge { display: none; }
}

/* Record quotations: the record's own words, in its serif face, on the record's highlight, with a tick */
.wts-quote { font-family: var(--wts-serif); font-size: 1.03em; }
.wts-quote--checked { background: var(--wts-mark); border-radius: 2px; padding: 0 .1em;
  box-decoration-break: clone; -webkit-box-decoration-break: clone; }
.wts-quote__tick { font-family: var(--wts-sans); font-size: .72em; font-weight: 700; color: var(--wts-cloth-text);
  margin-left: .2em; white-space: nowrap; vertical-align: .1em; }
.wts-quote--missing { text-decoration: underline wavy var(--wts-warn); text-underline-offset: .25em; }
.wts-quote--missing .wts-quote__tick { color: var(--wts-warn); }

/* Source chips: who said it, where and when, in place of a bare number */
/* A button is always laid out as one box, so a chip that folds onto two lines on a phone would fill the line and push
   the full stop after it onto a line of its own: it stops short of the full width, and its name stays left-aligned */
.wts-chip { display: inline; border: 0; background: none; padding: 0; margin: 0; color: inherit; font: inherit; cursor: pointer;
  text-align: start; max-inline-size: calc(100% - .6em); }
.wts-chip__in { display: inline-flex; align-items: baseline; gap: .35em; margin: .15em 0 .15em .3em; vertical-align: .08em;
  font-family: var(--wts-sans); font-size: .8125rem; line-height: 1.5; white-space: normal; color: var(--wts-cloth-text);
  background: var(--wts-paper-light); border: 1px solid var(--wts-cloth-text); border-radius: .8em; padding: 0 .55em 0 0; }
.wts-chip__n { background: var(--wts-cloth); color: var(--wts-on-cloth); border-radius: .8em; padding: 0 .45em; min-width: 1.6em;
  text-align: center; font-weight: 700; font-variant-numeric: tabular-nums; flex: none; white-space: nowrap; }
.wts-chip:hover .wts-chip__in, .wts-chip[aria-current="true"] .wts-chip__in { text-decoration: underline; text-decoration-thickness: 2px; }
.wts-chip[aria-current="true"] .wts-chip__in { background: var(--wts-mark); }
.wts-chip:focus-visible { outline: none; }
.wts-chip:focus-visible .wts-chip__in { outline: var(--wts-focus-width) solid var(--wts-focus); outline-offset: 2px; }
@media (pointer: coarse) { .wts-chip__in { padding-block: .2em; } }

/* Text no source supports: a dotted underline, and the first time "No source" in words */
.wts-nosource { text-decoration: underline dotted var(--wts-warn); text-decoration-thickness: 2px; text-underline-offset: .28em; }
.wts-nosource:target, .wts-nosource.is-shown { background: var(--wts-warn-bg); }
.wts-nosource__tag { display: inline-block; font-family: var(--wts-sans); font-size: .75rem; font-weight: 700; color: var(--wts-warn);
  border: 1.5px solid var(--wts-warn); border-radius: 4px; padding: 0 .3rem; margin-left: .35rem; line-height: 1.45;
  vertical-align: .12em; white-space: nowrap; }

/* The record beside the briefing (wide screens), and the same slip in the bottom sheet (phones) */
.wts-record { position: sticky; top: 1rem; display: grid; gap: .75rem; }
.wts-record__title { font-size: .9375rem; font-weight: 600; margin: 0; display: flex; justify-content: space-between; gap: 1rem; }
.wts-record__title span { font-weight: 400; color: var(--wts-ink-muted); }
.wts-record__pager { display: flex; gap: .5rem; }
.wts-record__pager button { border: 1px solid var(--wts-rule); background: var(--wts-paper-light); color: var(--wts-ink); border-radius: 6px;
  min-height: var(--wts-target); padding: 0 .75rem; font: inherit; cursor: pointer; }
.wts-slip { background: var(--wts-paper-light); color: var(--wts-ink); border: 1px solid var(--wts-rule); border-radius: 6px;
  padding: 1rem 1.1rem; display: grid; gap: .5rem; }
.wts-slip__top { display: flex; flex-wrap: wrap; justify-content: space-between; gap: .25rem .75rem; font-size: .8125rem;
  color: var(--wts-ink-muted); border-bottom: 1px solid var(--wts-rule-faint); padding-bottom: .4rem; }
.wts-slip__top b { color: var(--wts-ink); font-weight: 600; }
.wts-slip__sym { font-family: var(--wts-serif); font-size: 1.25rem; font-weight: 700; color: var(--wts-ink); }
.wts-slip__who { font-size: .9375rem; }
.wts-slip__heading { font-size: .875rem; color: var(--wts-ink-muted); }
.wts-passage { font-family: var(--wts-serif); font-size: 1rem; line-height: 1.6; margin: 0; max-height: 20rem; overflow: auto; }
.wts-passage mark { background: var(--wts-mark); color: inherit; border-radius: 2px; padding: 0 .1em;
  box-decoration-break: clone; -webkit-box-decoration-break: clone;
  text-decoration: underline 2px var(--wts-cloth-text); text-underline-offset: .2em; }
.wts-passage mark.wts-now { outline: 2px solid var(--wts-cloth-text); outline-offset: 1px; }
.wts-slip__foot { display: flex; flex-wrap: wrap; justify-content: space-between; gap: .5rem; font-size: .875rem; align-items: center; }
.wts-slip__found { font-weight: 600; color: var(--wts-cloth-text); }
.wts-connector { position: absolute; inset: 0; pointer-events: none; overflow: visible; }
.wts-connector path { fill: none; stroke: var(--wts-cloth-text); stroke-width: 1.5; }
.wts-connector circle { fill: var(--wts-cloth-text); }

.wts-sheet__back { position: fixed; inset: 0; background: color-mix(in srgb, var(--wts-ink) 40%, transparent); z-index: 50; }
.wts-sheet { position: fixed; left: 0; right: 0; bottom: 0; z-index: 51; background: var(--wts-paper-light); color: var(--wts-ink);
  border-top: 1px solid var(--wts-rule); border-radius: 12px 12px 0 0; max-height: 78vh; overflow: auto;
  padding: .75rem max(1rem, env(safe-area-inset-right, 0px)) calc(1rem + env(safe-area-inset-bottom, 0px)) max(1rem, env(safe-area-inset-left, 0px));
  box-shadow: 0 -8px 24px rgb(0 0 0 / .18); }
.wts-sheet__head { display: flex; justify-content: space-between; align-items: center; gap: 1rem; margin-bottom: .5rem; }
.wts-sheet__head h2 { font-size: 1.0625rem; margin: 0; }
.wts-sheet__close { border: 1px solid var(--wts-rule); background: var(--wts-paper-light); color: var(--wts-ink); border-radius: 6px;
  min-height: var(--wts-target); padding: 0 .9rem; font: inherit; cursor: pointer; }
.wts-sheet .wts-slip { border: 0; padding: 0; }
.wts-sheet .wts-passage { max-height: none; }

/* The wait: the stages, the question as read, the records as they arrive, the checks' results */
.wts-stages { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(10.5rem, 1fr)); gap: .5rem; }
.wts-stage { border: 1px solid var(--wts-rule); border-radius: 6px; padding: .5rem .75rem; font-size: .9375rem; display: grid; gap: .1rem; }
.wts-stage__state { font-size: .8125rem; color: var(--wts-ink-muted); }
.wts-stage[data-state="now"] { border: 2px solid var(--wts-cloth-text); padding: calc(.5rem - 1px) calc(.75rem - 1px); }
.wts-stage[data-state="now"] .wts-stage__state { color: var(--wts-cloth-text); font-weight: 700; }
.wts-stage[data-state="now"] .wts-stage__state::before { content: ""; display: inline-block; width: .55em; height: .55em; border-radius: 50%;
  background: currentColor; margin-right: .4em; vertical-align: .05em; }
.wts-stage[data-state="done"] .wts-stage__state { color: var(--wts-ink); }
.wts-plan { display: flex; flex-wrap: wrap; gap: .5rem; list-style: none; padding: 0; margin: 0; }
.wts-plan li { font-family: var(--wts-serif); font-size: clamp(1.125rem, 1rem + .8vw, 1.5rem); font-weight: 600; color: var(--wts-cloth-text);
  border: 2px solid var(--wts-cloth-text); border-radius: 999px; padding: .2rem .9rem; }
.wts-found { margin: 0; }
.wts-found strong { font-family: var(--wts-serif); font-size: 1.375rem; font-variant-numeric: tabular-nums; }
/* Before the first event: the family's books on a shelf (one is taken down and put back in turn: see below) */
.wts-spines { display: flex; gap: 3px; align-items: end; width: max-content; height: 84px; padding: 0 8px;
  border-bottom: 4px solid var(--wts-ink); }
.wts-spines span { width: 20px; height: var(--h, 60px); border-radius: 2px 2px 0 0; background: var(--c, var(--wts-cloth)); position: relative; }
.wts-spines span::before, .wts-spines span::after { content: ""; position: absolute; left: 0; right: 0; height: 2px; background: var(--wts-gilt-spine); }
.wts-spines span::before { top: 9px; } .wts-spines span::after { bottom: 9px; }
.wts-pile { max-height: min(62vh, 36rem); overflow: auto; padding: 4px; }
.wts-pile ul { list-style: none; margin: 0; padding: 0; display: grid; }
.wts-card { background: var(--wts-paper-light); color: var(--wts-ink); border: 1px solid var(--wts-rule); border-radius: 5px; padding: .3rem .7rem;
  font-size: .8125rem; line-height: 1.35; box-shadow: 0 1px 2px rgb(0 0 0 / .08); }
.wts-card + .wts-card { margin-top: -1px; border-top-left-radius: 0; border-top-right-radius: 0; }
.wts-card__top { display: flex; justify-content: space-between; gap: .5rem; color: var(--wts-ink-muted); white-space: nowrap; overflow: hidden; }
/* a long name gives way to the date: it is cut short with an ellipsis, and the date keeps its width */
.wts-card__top > :first-child { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.wts-card__top > :last-child:not(:first-child) { flex: none; }
.wts-card__sym { font-family: var(--wts-serif); font-weight: 700; color: var(--wts-ink); }
/* the name gives way to "Cited": the name is in its own span and is cut short with an ellipsis, "Cited" never is */
.wts-card__who { font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; display: flex; gap: .35em; }
.wts-card__who > :not(.wts-card__cited) { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.wts-card__who > .wts-card__cited { flex: none; }
.wts-card__line { font-family: var(--wts-serif); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.wts-card:not(.is-cited):not(:last-child) .wts-card__line { display: none; }
.wts-card__cited { display: none; font-weight: 700; color: var(--wts-cloth-text); }
.wts-card.is-cited { border: 2px solid var(--wts-cloth-text); padding: calc(.3rem - 1px) calc(.7rem - 1px); }
.wts-card.is-cited, .wts-card.is-cited + .wts-card { margin-top: .35rem; border-radius: 5px; }
.wts-card.is-cited .wts-card__cited { display: block; }
.wts-card.is-checked .wts-card__line { background: var(--wts-mark); }
@media (max-width: 63.99rem) {
  .wts-pile { max-height: none; overflow-x: auto; overflow-y: hidden; padding: 10px 4px 6px; }
  .wts-pile ul { display: flex; }
  .wts-card { flex: none; width: 13.5rem; }
  .wts-card + .wts-card { margin-top: 0; margin-left: -10.5rem; border-radius: 5px; }
  .wts-card.is-cited, .wts-card.is-cited + .wts-card { margin-top: 0; margin-left: .35rem; }
}
/* While the checks run (after the text is written, before the results): words, and a bar that moves while they run */
.wts-checking { display: grid; gap: .4rem; margin: 1rem 0; padding: .75rem 1rem; border: 2px solid var(--wts-cloth-text);
  border-radius: 6px; font-weight: 600; color: var(--wts-cloth-text); }
.wts-checking__bar { height: 4px; border-radius: 2px; background: color-mix(in srgb, var(--wts-cloth-text) 20%, transparent); overflow: hidden; }
.wts-checking__bar::before { content: ""; display: block; height: 100%; width: 30%; background: var(--wts-cloth-text); border-radius: 2px; }
.wts-cursor { display: inline-block; width: .5em; height: 1em; vertical-align: -.1em; background: var(--wts-ink-muted); margin-left: .1em; }

/* The home page's proof: three steps, then a sentence from a briefing beside the passage of the record it cites */
.wts-proof { display: grid; gap: 1.75rem; }
/* one column, then all three side by side: never two and one left over (found at 768 pixels on Where Countries Stand) */
.wts-proof__steps { list-style: none; margin: 0; padding: 0; display: grid; gap: 1rem 2rem;
  grid-template-columns: minmax(0, 1fr); counter-reset: wts-step; }
.wts-proof__steps li { font-family: var(--wts-serif); font-size: clamp(1.125rem, 1rem + .6vw, 1.375rem); font-weight: 600; line-height: 1.3;
  counter-increment: wts-step; display: grid; gap: .3rem; align-content: start; padding-top: .6rem; border-top: 2px solid var(--wts-cloth-text); }
.wts-proof__steps li::before { content: "Step " counter(wts-step); font-family: var(--wts-sans); font-size: .8125rem; font-weight: 600; color: var(--wts-cloth-text); }
.wts-proof__pair { display: grid; gap: 1.25rem; }
.wts-proof__side { display: flex; flex-direction: column; gap: .4rem; min-width: 0; margin: 0; }
.wts-proof__label { font-size: .875rem; font-weight: 600; color: var(--wts-ink-muted); margin: 0; }
/* the sentence sits in the middle of its card when the passage beside it is the taller (no hole under it) */
.wts-proof__card { flex: 1; display: grid; align-content: center; gap: .75rem; background: var(--wts-paper-light); color: var(--wts-ink);
  border: 1px solid var(--wts-rule); border-radius: 6px; padding: 1rem 1.1rem; }
.wts-proof__side > .wts-slip { flex: 1; align-content: start; }
.wts-proof__said { font-size: 1.0625rem; line-height: 1.75; margin: 0; }
.wts-proof__from { font-size: .8125rem; color: var(--wts-ink-muted); margin: 0; padding-top: .4rem; border-top: 1px solid var(--wts-rule-faint); }
@media (min-width: 48rem) {
  .wts-proof__steps { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1rem 1.5rem; }
  /* the two labels share a row, so the cards start level however long a label is (Where Councils Stand's runs to
     two lines), and the join runs across the gutter from the middle of the first card */
  .wts-proof__pair { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); grid-template-rows: auto 1fr; column-gap: 2.5rem; row-gap: 0; }
  .wts-proof__side { display: grid; grid-row: span 2; grid-template-rows: subgrid; row-gap: .4rem; }
  .wts-proof__label { align-self: end; }
  .wts-proof__side:first-child > .wts-proof__card { position: relative; }
  .wts-proof__side:first-child > .wts-proof__card::after { content: ""; position: absolute; top: 50%; left: calc(100% + 1px); width: 2.5rem;
    border-top: 2px solid var(--wts-cloth-text); }
}

@media (prefers-reduced-motion: no-preference) {
  .wts-card { animation: wts-dealt .35s var(--wts-ease-out) both; }
  @keyframes wts-dealt { from { transform: translate(18px, -10px) rotate(var(--wts-r, 2deg)); opacity: 0; } to { transform: none; opacity: 1; } }
  .wts-quote--checked, .wts-passage mark { transition: background-color .3s var(--wts-ease-out); }
  /* each book in turn is lifted from the shelf and put back, as if looked through: one at a time, left to right */
  .wts-spines span { animation: wts-look 3s ease-in-out infinite; animation-delay: calc(var(--i, 0) * 600ms); }
  @keyframes wts-look { 0%, 20%, 100% { transform: none; } 6%, 14% { transform: translateY(-14px) rotate(-3deg); } }
  .wts-stage[data-state="now"] .wts-stage__state::before { animation: wts-pulse .9s ease-in-out infinite alternate; }
  @keyframes wts-pulse { from { opacity: 1; transform: scale(1); } to { opacity: .35; transform: scale(.7); } }
  .wts-checking__bar::before { animation: wts-sweep 1.4s ease-in-out infinite; }
  @keyframes wts-sweep { from { transform: translateX(-100%); } to { transform: translateX(340%); } }
  .wts-record.is-settling { animation: wts-settle .45s var(--wts-ease-out) both; }
  @keyframes wts-settle { from { transform: translateY(12px); opacity: .2; } to { transform: none; opacity: 1; } }
}
.wts-quote.is-flash, .wts-card.is-flash { outline: 3px solid var(--wts-cloth-text); outline-offset: 1px; }

@media (forced-colors: active) {
  .wts-check { border: 2px solid CanvasText; }
  .wts-quote--checked, .wts-passage mark { background: Mark; color: MarkText; }
  .wts-chip__in { border-color: LinkText; }
  .wts-checking__bar::before { background: CanvasText; }
  .wts-nosource { text-decoration-color: CanvasText; }
}

/* Print and PDF: the numbers stay, the names go to the printed reference list, the panels stay off the page */
@media print {
  .wts-check { background: none; color: #000; border: 1px solid #000; }
  .wts-check a { color: #000; }
  .wts-chip__in { border: 0; background: none; padding: 0; color: #000; }
  .wts-chip__in > :not(.wts-chip__n) { display: none; }
  .wts-chip__n { background: none; color: #000; padding: 0; min-width: 0; }
  .wts-chip__n::before { content: "["; } .wts-chip__n::after { content: "]"; }
  .wts-quote--checked { background: none; }
  .wts-record, .wts-sheet, .wts-sheet__back, .wts-connector, .wts-stages, .wts-pile, .wts-checking { display: none !important; }
}
