/* Quick Funding Spot — the directory.
 *
 * Set as a reference book: white paper, hairlines, an A–Z index in the
 * masthead, and every section of every page a run of keyed entries. What it
 * is recognisable by in greyscale is the index — seven letter keys in a
 * narrow left column with their entries ranged beside them — and the column
 * of square plates down the eight trades. Nothing else here is square and
 * nothing else here is alphabetical.
 *
 * Frank Ruhl Libre over IBM Plex Sans: a serious book serif for the headings
 * and the keys, and a working sans for the entries and every figure.
 *
 * COLOUR. The brand's bright blue is #1878d8 and it measures 4.45:1 on paper,
 * which is under AA, so it never carries text and never has text on it: it is
 * for rules, borders and the keys' underline only. Anything read takes
 * --blue-solid at 6.44:1 or --blue-deep at 9.55:1. That is the rule Clear
 * Path and Bloom arrived at the hard way, applied before rather than after.
 */

@font-face {
  font-family: "FrankRuhl";
  src: url("display.woff2") format("woff2");
  font-weight: 300 900;
  font-display: swap;
}
@font-face {
  font-family: "PlexSans";
  src: url("text.woff2") format("woff2");
  font-weight: 100 700;
  font-display: swap;
}

:root {
  --paper: #ffffff;
  --tint: #f5f7fa;
  --tint-deep: #eceff4;
  --ink: #16181c;
  --text: #2c3138;
  /* 6.15:1 on paper and 5.73:1 on --tint, which is where most of it sits. */
  --muted: #5a6270;
  /* 4.72:1 on paper. The smallest labels on the site, and nothing else. */
  --faint: #6b7483;
  --rule: #dfe3e9;
  --rule-firm: #c4ccd7;
  /* Rules and borders only: 4.45:1 is under AA and this never carries text. */
  --blue: #1878d8;
  /* 6.44:1 on paper. Every link, and every fill that carries white text. */
  --blue-solid: #1160a8;
  /* 9.55:1 on paper. */
  --blue-deep: #004878;
  --blue-wash: #eef5fc;

  --shell: 1120px;
  --display: "FrankRuhl", Georgia, "Times New Roman", serif;
  --body: "PlexSans", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

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

html {
  scroll-behavior: smooth;
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--text);
  font-family: var(--body);
  font-size: 1rem;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

.shell {
  max-width: var(--shell);
  margin: 0 auto;
  padding: 0 24px;
}

img {
  max-width: 100%;
}

a {
  color: var(--blue-solid);
}

a:focus-visible,
button:focus-visible {
  outline: 3px solid var(--blue);
  outline-offset: 2px;
}

.skip {
  position: absolute;
  left: -9999px;
}

.skip:focus {
  left: 12px;
  top: 12px;
  z-index: 50;
  background: var(--paper);
  padding: 10px 16px;
  border: 2px solid var(--blue-solid);
}

/* Visually hidden, still read out. The programmes table's caption. */
.vh {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
}

/* ---------- masthead ---------- */

.mast {
  background: var(--paper);
  border-bottom: 1px solid var(--rule-firm);
}

.mast__bar {
  display: flex;
  align-items: center;
  gap: 20px;
  min-height: 76px;
  flex-wrap: wrap;
}

.mast__logo {
  display: flex;
  align-items: center;
  margin-right: auto;
}

.mast__logo img {
  height: var(--logo-h, 40px);
  width: auto;
}

.mast__acts {
  display: flex;
  align-items: center;
  gap: 18px;
  margin: 0;
  flex-wrap: wrap;
}

.mast__tel {
  font-weight: 600;
  color: var(--ink) !important;
  text-decoration: none;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

.mast__tel:hover {
  color: var(--blue-solid) !important;
}

.mast__cta {
  background: var(--blue-solid);
  color: #fff !important;
  font-weight: 600;
  text-decoration: none;
  padding: 10px 22px;
  border-radius: 2px;
  white-space: nowrap;
}

.mast__cta:hover {
  background: var(--blue-deep);
}

/* ---------- the index, A to Z ----------
 *
 * The navigation model of this site, and the thing no other site here has:
 * every page in one alphabetical sequence, grouped under its initial letter.
 * Products and company pages are not separated on purpose — an index is for
 * looking up the name you already have, not for choosing a category first.
 *
 * Each run is a grid: a fixed key column and the entries beside it, so the
 * keys line up down the left edge however many entries a letter carries.
 * That column is what this masthead is recognisable by. */
.idx {
  padding: 4px 0 14px;
  border-top: 1px solid var(--rule);
}

.idx__runs,
.idx__set {
  list-style: none;
  margin: 0;
  padding: 0;
}

.idx__runs {
  display: grid;
  gap: 2px 0;
}

.idx__run {
  display: grid;
  grid-template-columns: 26px 1fr;
  align-items: baseline;
  gap: 0 10px;
  padding: 3px 0;
}

.idx__run + .idx__run {
  border-top: 1px solid var(--rule);
}

.idx__key {
  font-family: var(--display);
  font-weight: 700;
  font-size: 0.95rem;
  line-height: 1.3;
  color: var(--blue-deep);
  border-bottom: 2px solid var(--blue);
  text-align: center;
}

.idx__set {
  display: flex;
  flex-wrap: wrap;
  gap: 2px 22px;
}

.idx__set a {
  color: var(--muted);
  text-decoration: none;
  font-size: 0.86rem;
  white-space: nowrap;
}

.idx__set a:hover {
  color: var(--blue-solid);
}

.idx__set a[aria-current="page"] {
  color: var(--ink);
  font-weight: 600;
}

/* ---------- openers ---------- */

main {
  padding-bottom: 8px;
}

.open {
  padding: 46px 0 6px;
  max-width: 44rem;
}

.open--dir {
  max-width: 50rem;
}

.open__h1 {
  font-family: var(--display);
  font-weight: 700;
  font-size: clamp(2rem, 1.3rem + 2.6vw, 3.1rem);
  line-height: 1.12;
  letter-spacing: -0.012em;
  color: var(--ink);
  margin: 0 0 14px;
}

.open__stand {
  margin: 0;
  font-size: 1.06rem;
  color: var(--muted);
}

/* ---------- sections ---------- */

.sec {
  padding: 34px 0;
  border-top: 1px solid var(--rule);
  margin-top: 30px;
}

.sec--dir {
  border-top: 0;
  margin-top: 22px;
  padding-top: 8px;
}

.h2 {
  font-family: var(--display);
  font-weight: 700;
  font-size: clamp(1.4rem, 1.1rem + 1vw, 1.85rem);
  line-height: 1.2;
  color: var(--ink);
  margin: 0 0 10px;
}

.lede {
  margin: 0 0 22px;
  max-width: 46rem;
  color: var(--muted);
}

.aside {
  margin: 18px 0 0;
  font-size: 0.9rem;
  color: var(--faint);
  max-width: 46rem;
}

.prose {
  max-width: 40rem;
}

.prose p {
  margin: 0 0 16px;
}

/* ---------- the directory: eight trades ----------
 *
 * The opener of the front page. One row per trade: the square plate, the
 * trade and what it borrows for, and the programme that usually fits ranged
 * to the right. See photos.mjs for why the plate sits inside the entry and
 * is never bigger than it. */
.dir {
  list-style: none;
  margin: 0;
  padding: 0;
  border-top: 1px solid var(--rule-firm);
}

.dir__row {
  display: grid;
  grid-template-columns: 92px minmax(0, 1fr) 15rem;
  gap: 0 22px;
  align-items: center;
  padding: 18px 0;
  border-bottom: 1px solid var(--rule);
}

.plate {
  width: 92px;
  height: 92px;
  object-fit: cover;
  display: block;
  border: 1px solid var(--rule-firm);
}

.dir__name {
  font-family: var(--display);
  font-weight: 700;
  font-size: 1.16rem;
  line-height: 1.25;
  color: var(--ink);
  margin: 0 0 4px;
}

.dir__need {
  margin: 0;
  font-size: 0.93rem;
  color: var(--muted);
}

.dir__fits {
  margin: 0;
  text-align: right;
}

.dir__fitsk {
  display: block;
  font-size: 0.68rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--faint);
  margin-bottom: 2px;
}

.dir__fits a {
  font-weight: 600;
  text-decoration: none;
  border-bottom: 1px solid var(--blue);
}

.dir__fits a:hover {
  color: var(--blue-deep);
}

/* ---------- keyed entries ----------
 *
 * The object every section on this site is made of: a term and its matter,
 * ruled apart. The programmes table, the trades and the steps are all this
 * shape at different sizes. */
.ent {
  margin: 0;
  display: grid;
  grid-template-columns: 15rem minmax(0, 1fr);
  border-top: 1px solid var(--rule-firm);
}

.ent dt {
  font-family: var(--display);
  font-weight: 700;
  font-size: 1.02rem;
  color: var(--ink);
  padding: 15px 22px 15px 0;
  border-bottom: 1px solid var(--rule);
}

.ent dd {
  margin: 0;
  padding: 15px 0;
  border-bottom: 1px solid var(--rule);
  color: var(--muted);
}

.ent--figs dd {
  font-weight: 600;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
}

/* ---------- the six programmes ---------- */

.tbl__wrap {
  overflow-x: auto;
}

.tbl {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.94rem;
}

.tbl th,
.tbl td {
  text-align: left;
  padding: 13px 16px 13px 0;
  border-bottom: 1px solid var(--rule);
  vertical-align: baseline;
}

.tbl thead th {
  font-family: var(--body);
  font-weight: 600;
  font-size: 0.68rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--faint);
  border-bottom: 1px solid var(--rule-firm);
  padding-top: 0;
}

.tbl tbody th {
  font-family: var(--display);
  font-weight: 700;
  font-size: 1.02rem;
  color: var(--ink);
  white-space: nowrap;
}

.tbl tbody th a {
  text-decoration: none;
  color: inherit;
  border-bottom: 1px solid var(--blue);
}

.tbl tbody th a:hover {
  color: var(--blue-solid);
}

.tbl td {
  color: var(--text);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.tbl tr.is-here {
  background: var(--blue-wash);
}

/* ---------- steps ---------- */

.steps {
  list-style: none;
  margin: 0;
  padding: 0;
  border-top: 1px solid var(--rule-firm);
}

.steps li {
  display: grid;
  grid-template-columns: 3rem minmax(0, 1fr);
  gap: 0 18px;
  padding: 20px 0;
  border-bottom: 1px solid var(--rule);
}

.steps__n {
  font-family: var(--display);
  font-weight: 700;
  font-size: 1.7rem;
  line-height: 1;
  color: var(--blue-deep);
}

.steps h3 {
  font-family: var(--display);
  font-weight: 700;
  font-size: 1.14rem;
  color: var(--ink);
  margin: 0 0 5px;
}

.steps p {
  margin: 0;
  color: var(--muted);
  max-width: 42rem;
}

/* ---------- the network's figures ---------- */

.net {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0;
  border-top: 1px solid var(--rule-firm);
}

.net li {
  padding: 18px 20px 18px 0;
  border-bottom: 1px solid var(--rule);
}

.net strong {
  display: block;
  font-family: var(--display);
  font-weight: 700;
  font-size: 1.7rem;
  line-height: 1.1;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
}

.net span {
  display: block;
  font-size: 0.85rem;
  color: var(--muted);
  margin-top: 3px;
}

/* ---------- marks ---------- */

.marks {
  list-style: none;
  margin: 0;
  padding: 0;
  max-width: 42rem;
}

.marks li {
  padding: 10px 0 10px 26px;
  border-bottom: 1px solid var(--rule);
  position: relative;
  color: var(--text);
}

.marks li::before {
  content: "";
  position: absolute;
  left: 2px;
  top: 1.05em;
  width: 10px;
  height: 1px;
  background: var(--blue);
}

/* ---------- the trade a programme serves ---------- */

.trade {
  display: grid;
  grid-template-columns: 148px minmax(0, 1fr);
  gap: 0 24px;
  align-items: center;
  border-top: 1px solid var(--rule-firm);
  border-bottom: 1px solid var(--rule);
  padding: 20px 0;
}

.trade .plate {
  width: 148px;
  height: 148px;
}

.trade__body {
  max-width: 38rem;
}

.trade__more {
  margin: 10px 0 0;
  font-size: 0.9rem;
}

.trade__more a {
  text-decoration: none;
  font-weight: 600;
  border-bottom: 1px solid var(--blue);
}

/* ---------- the application ---------- */

.sec--apply {
  background: var(--tint);
  border-top: 1px solid var(--rule-firm);
  margin-top: 34px;
  padding: 34px 26px;
}

.frame {
  margin-top: 20px;
  background: var(--paper);
  border: 1px solid var(--rule-firm);
}

.frame iframe {
  display: block;
  width: 100%;
  border: 0;
}

/* ---------- foot ----------
 *
 * The eight trades, the office and the fine print. No page links and no
 * headings: every page of the site is in the index at the top of this one. */
.foot {
  margin-top: 44px;
  border-top: 2px solid var(--ink);
  padding: 30px 0 38px;
  background: var(--paper);
}

.foot__trades {
  margin: 0 0 18px;
  display: flex;
  flex-wrap: wrap;
  gap: 4px 0;
}

.foot__trades a {
  color: var(--ink);
  text-decoration: none;
  font-family: var(--display);
  font-weight: 700;
  font-size: 0.97rem;
  padding-right: 14px;
  margin-right: 14px;
  border-right: 1px solid var(--rule-firm);
}

.foot__trades a:last-child {
  border-right: 0;
  margin-right: 0;
  padding-right: 0;
}

.foot__trades a:hover {
  color: var(--blue-solid);
}

.foot__where {
  margin: 0 0 14px;
  font-size: 0.92rem;
  color: var(--muted);
}

.foot__tel {
  color: var(--muted) !important;
  text-decoration: none;
  font-variant-numeric: tabular-nums;
}

.foot__fine {
  margin: 0 0 14px;
  font-size: 0.82rem;
  color: var(--faint);
  max-width: 62rem;
}

.foot__rule {
  margin: 0;
  padding-top: 14px;
  border-top: 1px solid var(--rule);
  font-size: 0.82rem;
  color: var(--faint);
}

/* ---------- narrower ---------- */

@media (max-width: 900px) {
  .dir__row {
    grid-template-columns: 76px minmax(0, 1fr);
    grid-template-areas:
      "plate body"
      "fits  fits";
    row-gap: 12px;
  }

  .dir__row .plate {
    grid-area: plate;
    width: 76px;
    height: 76px;
  }

  .dir__body {
    grid-area: body;
  }

  /* Ranged right beside a 15rem column reads as a third column; stacked
   * under a two-column row it just reads as an orphan, so it goes left. */
  .dir__fits {
    grid-area: fits;
    text-align: left;
  }

  .dir__fitsk {
    display: inline;
    margin-right: 8px;
  }

  .ent {
    grid-template-columns: minmax(0, 1fr);
  }

  .ent dt {
    padding: 14px 0 0;
    border-bottom: 0;
  }

  .ent dd {
    padding: 4px 0 14px;
  }

  .net {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .trade {
    grid-template-columns: 104px minmax(0, 1fr);
  }

  .trade .plate {
    width: 104px;
    height: 104px;
  }
}

@media (max-width: 560px) {
  .idx__run {
    grid-template-columns: 22px 1fr;
  }

  .idx__set {
    gap: 2px 16px;
  }

  .steps li {
    grid-template-columns: 2.2rem minmax(0, 1fr);
  }

  .sec--apply {
    padding: 28px 16px;
    margin-left: -24px;
    margin-right: -24px;
  }

  .foot__trades a {
    border-right: 0;
    padding-right: 0;
    margin-right: 16px;
  }
}
