/* Legacy Lending Network.
 *
 * On the ADR-0011 skeleton -- `tools/sitegen/page.css` is the layout. What is
 * here is the palette, the two typefaces, and the one band this site has
 * that the skeleton does not: THE CHAPTERS.
 *
 * NOTO SERIF DISPLAY OVER ASSISTANT: a high-contrast book serif for the
 * heads, the voice of a bound history, over a light, open sans for reading.
 * Plum on warm paper with a cream tint, and a near-black aubergine ink. The
 * plum (#7b2d5f) is 8.8:1 on white and 8.1:1 on the cream, so it carries
 * eyebrows and links; fills with white text use #5e1f48. On the aubergine of
 * the application band the eyebrow is a pale rose. The serif sets in a
 * lighter weight than the skeleton's default, the way a book's chapter
 * heads do.
 */

@font-face {
  font-family: "Noto Serif Display";
  src: url("display.woff2") format("woff2");
  font-weight: 400 800;
  font-display: swap;
}

@font-face {
  font-family: "Assistant";
  src: url("text.woff2") format("woff2");
  font-weight: 300 800;
  font-display: swap;
}

:root {
  --ink: #2b1626;
  --ink-soft: #3d2236;
  --text: #4a3644;
  --muted: #6b5765;

  --accent: #7b2d5f;
  --accent-deep: #5e1f48;
  --accent-wash: #f7edf3;
  --accent-line: #e5c6d8;

  --good: #3f6b4f;
  --good-wash: #eaf2ec;
  --warn: #8a4a10;

  --paper: #fffdf9;
  --card: #ffffff;
  --tint: #f7f1ea;
  --rule: #ebe2d8;
  --rule-firm: #d8cabb;

  --ask-ink: #dccbd6;
  --ask-accent: #e7a9cf;

  --shadow: 43, 22, 38;

  --display: "Noto Serif Display", "Iowan Old Style", Georgia, serif;
  --body: "Assistant", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;

  --display-weight: 600;
  --display-track: -0.01em;
  --body-size: 18px;

  --radius: 2px;
  --radius-sm: 2px;

  --hero-bg: linear-gradient(170deg, var(--tint) 0%, var(--paper) 60%);
  --head-bg: linear-gradient(170deg, var(--tint) 0%, var(--paper) 72%);
}

body {
  background: var(--paper);
}

/* ------------------------------------------------------------------ *
 * THE CHAPTERS -- the band this site has and the skeleton does not,
 * directly under the front door.
 *
 * A spine runs down the middle of the band. Each chapter hangs off it on
 * alternate sides, like facing pages, with its Roman numeral set large on
 * the spine itself: the photograph of that chapter's people, a "Chapter II"
 * label, the story in two sentences, and a ruled panel naming the funding
 * that usually suits it. Under 900px the spine moves to the left edge and
 * every chapter hangs to its right.
 * ------------------------------------------------------------------ */
.book {
  list-style: none;
  margin: 64px 0 0;
  padding: 0; /* five chapters: the last is a left page, so nothing hangs below */
  position: relative;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  column-gap: 120px;
  row-gap: 56px;
}

.book::before {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  left: 50%;
  width: 1px;
  background: var(--rule-firm);
}

.book__ch {
  position: relative;
}

/* The right-hand pages sit half a page lower, so the two columns read as
   facing pages rather than a table. */
.book__ch:nth-child(even) {
  transform: translateY(220px);
}

.book__num {
  position: absolute;
  top: 0;
  right: -92px;
  z-index: 1;
  width: 64px;
  padding: 8px 0;
  background: var(--paper);
  border: 1px solid var(--accent-line);
  font-family: var(--display);
  font-weight: 500;
  font-size: 1.6rem;
  line-height: 1;
  text-align: center;
  color: var(--accent);
}

.book__ch:nth-child(even) .book__num {
  right: auto;
  left: -92px;
}

.book__shot {
  margin: 0 0 18px;
}

.book__shot img {
  width: 100%;
  aspect-ratio: 3 / 2;
  object-fit: cover;
  border-radius: var(--radius);
}

.book__label {
  margin: 0 0 4px;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent);
}

.book__page h3 {
  font-family: var(--display);
  font-weight: 600;
  font-size: clamp(1.45rem, 2.2vw, 1.8rem);
  line-height: 1.2;
  color: var(--ink);
  margin: 0 0 10px;
}

.book__page > p {
  margin: 0 0 16px;
  color: var(--text);
}

.book__fit {
  padding: 16px 20px;
  background: var(--card);
  border-top: 1px solid var(--accent-line);
  border-bottom: 1px solid var(--accent-line);
}

.book__fit p {
  margin: 0;
  font-size: 0.95rem;
  color: var(--text);
}

.book__fitlabel {
  font-size: 0.72rem !important;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted) !important;
  margin-bottom: 2px !important;
}

.book__prog {
  display: inline-block;
  font-family: var(--display);
  font-weight: 600;
  font-size: 1.2rem;
  color: var(--accent-deep);
  text-decoration: none;
  margin: 0 0 6px;
}

.book__prog:hover,
.book__also a:hover {
  text-decoration: underline;
}

.book__also {
  margin-top: 10px !important;
  padding-top: 10px;
  border-top: 1px dashed var(--rule-firm);
}

.book__also a {
  color: var(--accent-deep);
  font-weight: 700;
  text-decoration: none;
}

.book__note {
  max-width: 64ch;
  margin: 48px auto 0;
  text-align: center;
  font-style: italic;
  color: var(--muted);
}

@media (max-width: 900px) {
  .book {
    grid-template-columns: 1fr;
    row-gap: 40px;
    padding: 0 0 0 72px;
  }
  .book::before {
    left: 28px;
  }
  .book__ch:nth-child(even) {
    transform: none;
  }
  .book__num,
  .book__ch:nth-child(even) .book__num {
    left: -72px;
    right: auto;
    width: 56px;
    font-size: 1.3rem;
  }
}

/* ---- the shared chrome, painted in this brand's colours ---- */
:root {
  --nav-bg: #fffdf9;
  --nav-ink: #2b1626;
  --nav-ink-soft: #6b5765;
  --nav-rule: #ebe2d8;
  --nav-hover: #7b2d5f;
  --nav-panel: #fffdf9;
  --nav-cta-bg: #5e1f48;
  --nav-cta-ink: #ffffff;
  --nav-font: var(--body);
  --nav-size: 0.82rem;
  --nav-weight: 700;
  --nav-track: 0.12em;
  --nav-case: uppercase;
  --nav-radius: 2px;
  --foot-bg: #2b1626;
  --foot-ink: #cdbcc7;
  --foot-head: #f7f1ea;
  --foot-rule: #47293f;
  --foot-link: #fdf8fb;
}

@media (max-width: 760px) {
  .head--form {
    padding-top: 18px;
  }
  .head--form .frame {
    padding: 6px;
  }
}

/* The legal pages: numbered heads inside the prose, set smaller than a
   band's h2 so a long document reads as one document. */
.legal h2 {
  font-family: var(--display);
  font-size: 1.25rem;
  color: var(--ink);
  margin: 2em 0 0.5em;
}
.legal ul {
  padding-left: 1.2em;
}
.legal li {
  margin-bottom: 0.5em;
}
