/* Where They Stand: the charity's hub. The Bound Volume identity (brand/README.md): ink, paper and gilt for the
   charity, a cloth colour for each project, Source Serif 4 throughout. The colours are the family kit's tokens
   (/family/family.css, from family/kit/), so the hub follows the reader's light or dark setting as the sites do. */

:root {
  color-scheme: light dark;
  --ink: var(--wts-ink);
  --ink-muted: var(--wts-ink-muted);
  --paper: var(--wts-paper);
  --paper-light: var(--wts-paper-light);
  --rule: var(--wts-rule);
  --rule-faint: var(--wts-rule-faint);
  --gilt: var(--wts-gilt);
  --gilt-text: var(--wts-gilt-text);
  --gilt-spine: var(--wts-gilt-spine);
  --spine-text: var(--wts-spine-text);
  --link: var(--wts-cloth-mps-text);
  --focus: var(--wts-cloth-countries-text);
  --serif: var(--wts-serif);
  --gutter: clamp(16px, 4vw, 56px);
}

*, *::before, *::after { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--paper-light);
  color: var(--ink);
  font-family: var(--serif);
  font-size: clamp(1rem, 0.96rem + 0.2vw, 1.1rem);
  line-height: 1.5;
}

.page {
  max-inline-size: 72rem;
  margin-inline: auto;
  padding: clamp(24px, 5vw, 56px) var(--gutter) 48px;
}

a { color: var(--link); text-underline-offset: 0.15em; }
a:hover { color: var(--ink); text-decoration-thickness: 2px; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; }

.skip {
  position: absolute;
  inset-inline-start: 8px;
  inset-block-start: -48px;
  padding: 8px 12px;
  background: var(--paper);
  color: var(--ink);
  border: 2px solid var(--ink);
  z-index: 10;
}
.skip:focus { inset-block-start: 8px; }

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

/* ---- Masthead: the mark and the wordmark over a gilt rule, and the charity's pages ---- */

.masthead {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 16px 24px;
}
.masthead__home { display: flex; align-items: center; gap: clamp(12px, 2vw, 20px); color: inherit; text-decoration: none; }
.mark { inline-size: clamp(56px, 9vw, 84px); block-size: auto; flex: none; }
.wordmark { display: flex; flex-direction: column; gap: 8px; }
.wordmark span:first-child {
  font-size: clamp(1.45rem, 1rem + 2.4vw, 2.4rem);
  font-weight: 600;
  letter-spacing: 0.07em;
  line-height: 1;
}
.gilt-rule { block-size: 2px; background: var(--gilt); }
a.masthead__home:hover .gilt-rule { block-size: 3px; }

.sitenav ul { display: flex; flex-wrap: wrap; gap: 4px 20px; margin: 0; padding: 0; list-style: none; }
.sitenav a { color: var(--ink); text-decoration-color: var(--rule); font-size: 1.05rem; }
.sitenav a:hover { text-decoration-color: currentColor; }
.sitenav a[aria-current] { font-weight: 600; text-decoration-color: var(--gilt); text-decoration-thickness: 2px; }

/* The mark's ink spine and shelf take the ink colour, so they show in dark mode */
.mark .wts-mark__ink { fill: var(--ink); }
.mark .wts-mark__shelf { stroke: var(--ink); }

.lede {
  max-inline-size: 40em;
  margin: clamp(28px, 5vw, 48px) 0 12px;
  font-size: clamp(1.2rem, 1rem + 0.9vw, 1.6rem);
  line-height: 1.4;
}
.intro { max-inline-size: 40em; margin: 0 0 16px; color: var(--ink-muted); }
.status { margin: 0; font-style: italic; color: var(--ink-muted); }

.section-title {
  margin: clamp(40px, 6vw, 64px) 0 20px;
  font-size: 0.95rem;
  font-weight: 600;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--gilt-text);
}
.key { max-inline-size: 48em; margin: -8px 0 20px; color: var(--ink-muted); font-size: 0.95rem; }

/* ---- The shelves ---- */

.shelves { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 30rem), 1fr)); gap: 24px; }

.shelf {
  background: var(--paper);
  border: 1px solid var(--rule-faint);
  padding: clamp(18px, 3vw, 28px);
}
.shelf__name {
  margin: 0 0 20px;
  padding-block-end: 8px;
  border-block-end: 1px solid var(--rule);
  font-size: 0.95rem;
  font-weight: 600;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--gilt-text);
}

.shelf__books {
  display: flex;
  align-items: flex-end;
  gap: clamp(8px, 1.5vw, 14px);
  block-size: clamp(250px, 26vw, 300px);
  padding-inline-start: clamp(12px, 3vw, 36px);
  border-block-end: 6px solid var(--wts-shelf-line);
  container-type: size;  /* the spines' names are sized to the shelf's height */
}
/* Every volume the same height, as on a shelf of one edition, with gilt bands at head and foot */
.spine {
  inline-size: clamp(52px, 7vw, 82px);
  block-size: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
  color: var(--spine-text);
  text-decoration: none;
  background-color: var(--wts-cloth);
  background-image:
    linear-gradient(var(--gilt-spine), var(--gilt-spine)), linear-gradient(var(--gilt-spine), var(--gilt-spine)),
    linear-gradient(var(--gilt-spine), var(--gilt-spine));
  background-size: 100% 2px;
  background-repeat: no-repeat;
  background-position: 0 14px, 0 20px, 0 calc(100% - 14px);
}
.spine span {
  writing-mode: vertical-rl;
  /* one size of lettering for the set, fitted between the gilt bands to the longest name (21 letters) */
  font-size: min(1.2rem, calc((100cqh - 64px) / (21 * 0.76)));
  font-weight: 600;
  letter-spacing: 0.1em;
  white-space: nowrap;
}
a.spine:hover { color: #FFFFFF; filter: brightness(1.12); }

/* ---- The games shelf: a Game Boy-shaped cartridge, standing label-out (drawn in index.html) ---- */

.shelf__intro { margin: 20px 0 0; color: var(--ink-muted); font-style: italic; }
.cart { display: block; block-size: 86%; aspect-ratio: 107.6 / 128.2; }
.cart__art { display: block; inline-size: 100%; block-size: 100%; }
a.cart:hover { filter: brightness(1.1); }

.projects { list-style: none; margin: 24px 0 0; padding: 0; display: grid; gap: 20px; }
.project { display: grid; grid-template-columns: 40px 1fr; gap: 14px; align-items: start; }
.project__icon { inline-size: 40px; block-size: 40px; }
.project__icon .project__cloth { fill: var(--wts-cloth); }
.project__icon .project__ground { stroke: var(--wts-shelf-line); }
.project h4 { margin: 2px 0 4px; font-size: 1.35rem; font-weight: 600; line-height: 1.2; }
.project h4 a { color: var(--ink); text-decoration-color: var(--rule); }
.project h4 a:hover { text-decoration-color: currentColor; }
.project p { margin: 0 0 6px; color: var(--ink-muted); }
.project__url { font-size: 0.95rem; }

/* A project's status, as a small label beside its name */
.tag {
  display: inline-block;
  margin-inline-start: 0.35em;
  padding: 0.1em 0.5em 0.15em;
  border: 1px solid currentColor;
  border-radius: 2px;
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  line-height: 1.4;
  text-transform: uppercase;
  vertical-align: 0.3em;
  white-space: nowrap;
  color: var(--gilt-text);
}
.tag--beta, .tag--live { color: var(--link); }

/* ---- How we work ---- */

.principles { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 17rem), 1fr)); gap: 24px; }
.principles div { border-block-start: 2px solid var(--gilt); padding-block-start: 12px; }
.principles h3 { margin: 0 0 6px; font-size: 1.25rem; font-weight: 600; }
.principles p { margin: 0; color: var(--ink-muted); }

.contact { margin: 0; }

/* ---- The charity's own pages: About, Donate, Privacy, and the 404 ---- */

.prose { max-inline-size: 40em; }
.prose h1, .notfound {
  margin: clamp(28px, 5vw, 48px) 0 8px;
  font-size: clamp(1.6rem, 1.2rem + 1.5vw, 2.4rem);
  font-weight: 600;
  line-height: 1.15;
}
.prose h2 {
  margin: 2em 0 0.4em;
  font-size: 0.95rem;
  font-weight: 600;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--gilt-text);
}
.prose h3 { margin: 1.4em 0 0.3em; font-size: 1.2rem; font-weight: 600; }
.prose p, .prose li { margin-block: 0 0.75em; }
.prose ul { padding-inline-start: 1.2em; }
.prose .lede { margin-block-start: 8px; }
.notfound + .lede { margin-block-start: 8px; }
.plain-list { list-style: none; padding: 0; }
.plain-list li { margin-block-end: 0.9em; }
.plain-list .desc { display: block; margin-block-start: 0.15em; }
.aside { color: var(--ink-muted); font-size: 0.95em; }
.updated { margin-block-start: 2.5em; color: var(--ink-muted); font-style: italic; font-size: 0.95rem; }

/* The link to give: a plain, bordered call to action */
.give {
  display: inline-block;
  margin: 0.5em 0 1em;
  padding: 0.55em 1.1em 0.6em;
  border: 2px solid var(--ink);
  background: var(--paper);
  color: var(--ink);
  font-size: 1.15rem;
  font-weight: 600;
  text-decoration: none;
}
.give:hover { background: var(--ink); color: var(--paper-light); }

/* ---- Foot: the family shelf (from the kit), then the hub's own line ---- */

.foot {
  max-inline-size: 72rem;
  margin: 0 auto;
  padding: 16px var(--gutter) 32px;
  font-size: 0.95rem;
  color: var(--ink-muted);
}
.foot p { margin: 0 0 4px; }
.foot ul { display: flex; flex-wrap: wrap; gap: 4px 20px; margin: 8px 0 0; padding: 0; list-style: none; }
.foot a { color: inherit; }
/* Line the family shelf up with the page's column */
.wts-shelf { margin-block-start: 0; padding-inline: var(--gutter); }
.wts-shelf__inner { max-inline-size: calc(72rem - 2 * var(--gutter)); }
.foot { max-inline-size: 72rem; }

@media (prefers-reduced-motion: no-preference) {
  a.spine, a.cart { transition: filter 120ms ease; }
}
@media (forced-colors: active) {
  .spine { border: 1px solid CanvasText; forced-color-adjust: none; }
  .tag { border-color: CanvasText; }
}
