/* The Valley Desk: shared tokens, masthead and footer. Warm paper, ink type, one blue for links. */
.directory-site,
.directory-chrome {
  --paper: light-dark(#fbfaf7, #141519);
  --surface: light-dark(#f2f0ea, #1c1e24);
  --card: light-dark(#ffffff, #181a1f);
  --text: light-dark(#1c1b19, #ecebe6);
  --muted: light-dark(#5b5852, #b0ada6);
  --line: light-dark(#dcd8ce, #34363d);
  --rule: light-dark(#1c1b19, #d9d7d0);
  --field: light-dark(#858077, #80848e);
  --accent: light-dark(#1d2a8f, #aab4ff);
  --button: light-dark(#1d2a8f, #aab4ff);
  --button-text: light-dark(#ffffff, #12131a);
  --publication: light-dark(#8c2f1b, #f2a58e);
  --software: light-dark(#0b5f58, #7dd3c7);
  --study: light-dark(#5a3a8c, #cbb4f2);
  --dataset: light-dark(#8a5a00, #f0c26b);
  --regional: light-dark(#4d5f14, #cbdc86);
  --verified: light-dark(#e3efe6, #1c3226);
  --verified-text: light-dark(#1d4f30, #b5e2c3);
  --sans: "IBM Plex Sans", "Helvetica Neue", Arial, sans-serif;
  --serif: "IBM Plex Serif", Georgia, "Times New Roman", serif;
  --frame-width: 76rem;
  --frame-gutter: clamp(1rem, 3vw, 2rem);
  --mark-bg: light-dark(transparent, #e7e3fa);
}

.directory-chrome {
  background: var(--paper);
  color: var(--text);
  font: 400 .92rem/1.45 var(--sans);
}

.directory-chrome .desk-frame {
  width: min(calc(100% - var(--frame-gutter) * 2), var(--frame-width));
  margin-inline: auto;
}

.directory-chrome :focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* A heavy ink rule over a quiet masthead, as on a printed title page. */
.directory-chrome.desk-masthead { border-top: 4px solid var(--rule); border-bottom: 1px solid var(--line); }
.directory-chrome .desk-masthead-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  column-gap: 1.5rem;
  min-height: 3.75rem;
}
.directory-chrome .desk-brand {
  display: inline-flex;
  align-items: center;
  gap: .55rem;
  min-height: 44px;
  color: var(--text);
  text-decoration: none;
}
.directory-chrome .desk-mark { flex: none; width: 32px; height: 32px; border-radius: 3px; background: var(--mark-bg); }
.directory-chrome .desk-wordmark { font: 600 1.3rem/1 var(--serif); letter-spacing: -.01em; white-space: nowrap; }
.directory-chrome .desk-primary { display: flex; flex-wrap: wrap; column-gap: 1.25rem; }
.directory-chrome .desk-primary a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  color: var(--text);
  font-weight: 600;
  text-decoration: none;
  border-bottom: 2px solid transparent;
}
.directory-chrome .desk-primary a:hover { border-bottom-color: var(--line); }
.directory-chrome .desk-primary a[aria-current] { border-bottom-color: var(--rule); }

/* The footer is a view of the city from the Schuylkill: an evening sky (where supporters are
   thanked on the home page), the skyline, and the river the footer links sit on. By day the river
   holds the pale sky; by night it is dark. --river matches the water drawn in the art.
   Art: public/footer-skyline-{light,dark}.svg, drawn by scripts/build-footer-art.mjs. */
.directory-chrome.desk-footer {
  --sky-horizon: light-dark(#f1e2d0, #232a52);
  --river: light-dark(#c5cadb, #0a0c18);
  --river-text: light-dark(#1c1b19, #e4e5f1);
  --river-muted: light-dark(#3a3f5c, #a9add0);
  --river-link: light-dark(#1d2a8f, #c9cfff);
  margin-top: 4rem;
  background: var(--river);
}
/* Away from the home page: a strip of the same skyline, cut just under the waterline. The towers fade
   into the sky at the top edge rather than ending in a cut. */
.directory-chrome.desk-footer.is-strip { margin-top: 3rem; }
.directory-chrome.is-strip .desk-footer-art {
  height: clamp(76px, 8.4vw, 108px);
  background-size: max(100%, 64rem) auto;
  background-position: 50% 82%;
  -webkit-mask-image: linear-gradient(to bottom, transparent, #000 55%);
  mask-image: linear-gradient(to bottom, transparent, #000 55%);
}
.directory-chrome .desk-footer-sky { background: linear-gradient(to bottom, var(--paper), var(--sky-horizon)); }
.directory-chrome .desk-footer-art {
  height: clamp(150px, 18.5vw, 340px);
  margin-top: -1px;
  background: url("/footer-skyline-light.svg") center bottom / cover no-repeat;
}
:root[data-theme="dark"] .directory-chrome .desk-footer-art { background-image: url("/footer-skyline-dark.svg"); }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme]) .directory-chrome .desk-footer-art { background-image: url("/footer-skyline-dark.svg"); }
}
.directory-chrome .desk-footer-river { color: var(--river-text); }

/* Supporters: set like the dedication page of a book, names in the sky above the city. */
.directory-chrome .footer-patrons { padding-block: clamp(2.5rem, 6vw, 4.5rem) clamp(1rem, 3vw, 2rem); text-align: center; }
.directory-chrome .patron-title {
  margin: 0 auto 1.4rem;
  color: var(--muted);
  font: 600 .74rem/1.3 var(--sans);
  letter-spacing: .14em;
  text-transform: uppercase;
}
.directory-chrome .patron-title::before,
.directory-chrome .patron-title::after {
  content: "";
  display: inline-block;
  width: 2.5rem;
  height: 1px;
  margin: 0 .9rem;
  vertical-align: middle;
  background: currentColor;
  opacity: .5;
}
.directory-chrome .patron-list {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: baseline;
  gap: .55rem 1.9rem;
  max-width: 60rem;
  margin: 0 auto;
  padding: 0;
  list-style: none;
}
.directory-chrome .patron { color: var(--text); font: 500 clamp(1rem, 1.5vw, 1.14rem)/1.35 var(--serif); }
.directory-chrome .patron.is-institution { font: 600 .78rem/1.35 var(--sans); letter-spacing: .1em; text-transform: uppercase; }
.directory-chrome .patron-group + .patron-group { margin-top: 1.6rem; }
.directory-chrome .patron-group-title {
  margin: 0 0 .7rem;
  color: var(--muted);
  font: italic 400 .95rem/1.3 var(--serif);
}
.directory-chrome .is-founders .patron { font-size: clamp(1.1rem, 1.8vw, 1.32rem); }
.directory-chrome .is-founders .patron.is-institution { font-size: .86rem; }
.directory-chrome .patron-link { color: inherit; text-decoration: underline; text-decoration-thickness: 1px; text-decoration-color: color-mix(in srgb, currentColor 35%, transparent); text-underline-offset: .22em; }
.directory-chrome .patron-link:hover { text-decoration-color: currentColor; }
.directory-chrome .patron-gift { color: var(--muted); font: italic 400 .8rem/1.3 var(--serif); letter-spacing: 0; text-transform: none; }
.directory-chrome .patron-first { margin: 0; color: var(--muted); font: italic 400 1.05rem/1.5 var(--serif); }
.directory-chrome .patron-more {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: .25rem 1.25rem;
  margin: 1.3rem 0 0;
  color: var(--muted);
  font: italic 400 .98rem/1.5 var(--serif);
}
.directory-chrome .patron-more a { display: inline-flex; align-items: center; min-height: 44px; margin-block: -.75rem; color: var(--accent); font: 600 .88rem/1.4 var(--sans); }
.directory-chrome .patron-more a::after { content: " →"; white-space: pre; }
.directory-chrome .desk-footer-inner {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: .75rem 2rem;
  padding-block: 1.1rem 1.25rem;
}
.directory-chrome .desk-footer-river .desk-footer-brand { color: var(--river-text); font: 600 .95rem/1.3 var(--serif); text-decoration: none; }
.directory-chrome .desk-footer-river .desk-footer-brand:hover { color: var(--river-text); text-decoration: underline; }
.directory-chrome .desk-footer-links { display: flex; flex-wrap: wrap; column-gap: 1.1rem; }
.directory-chrome .desk-footer-river a { color: var(--river-link); }
.directory-chrome .desk-footer-river :focus-visible { outline-color: var(--river-link); }
.directory-chrome .desk-footer-links a { display: inline-flex; align-items: center; min-height: 44px; }
.directory-chrome .desk-footer-copy { grid-column: 1 / -1; margin: 0; color: var(--river-muted); font-size: .84rem; }
/* Theme: three labelled choices on the river, the current one lit. */
.directory-chrome .desk-theme {
  display: inline-flex;
  align-self: center;
  padding: 3px;
  border: 1px solid color-mix(in srgb, var(--river-muted) 45%, transparent);
  border-radius: 999px;
}
/* The control works only with scripts. It keeps its space so nothing moves when it appears. */
:root:not([data-theme]) .directory-chrome .desk-theme { visibility: hidden; }
.directory-chrome .desk-theme button {
  display: inline-flex;
  align-items: center;
  gap: .35rem;
  min-height: 34px;
  padding: .2rem .8rem;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--river-muted);
  font: 500 .85rem/1 var(--sans);
  cursor: pointer;
}
.directory-chrome .desk-theme button:hover { color: var(--river-text); }
.directory-chrome .desk-theme button[aria-pressed="true"] { background: var(--river-text); color: var(--river); font-weight: 600; }
.directory-chrome .desk-theme .glyph { width: 1rem; height: 1rem; }
.directory-chrome .desk-theme .glyph-fill-solid { fill: currentColor; stroke: none; }
.directory-chrome .desk-theme button:focus-visible { outline: 2px solid var(--river-link); outline-offset: 1px; }

@media (max-width: 34rem) {
  .directory-chrome .desk-footer-art { height: 120px; background-position: 58% bottom; }
  .directory-chrome.is-strip .desk-footer-art { height: 72px; background-size: 600px auto; background-position: 58% 82%; }
  .directory-chrome .desk-footer-inner { gap: 1rem; padding-block: 1rem 1.5rem; }
  .directory-chrome .desk-footer-links { display: grid; grid-template-columns: 1fr 1fr; column-gap: 1rem; }
  .directory-chrome .desk-footer-links a { min-height: 40px; }
  .directory-chrome .desk-theme { justify-self: start; }
  .directory-chrome .desk-masthead-inner { padding-block: .25rem; }
  /* Brand on one row, the five sections spread across the next. */
  .directory-chrome .desk-primary { justify-content: space-between; column-gap: .5rem; width: 100%; }
  .directory-chrome .desk-primary a { font-size: .88rem; }
  .directory-chrome .desk-footer-inner { grid-template-columns: 1fr; }
  .directory-chrome .patron-title::before,
  .directory-chrome .patron-title::after { display: none; }
}
/* Narrow phones: the sections stay on one row in smaller type. */
@media (max-width: 23rem) {
  .directory-chrome .desk-primary { column-gap: .35rem; }
  .directory-chrome .desk-primary a { font-size: .8rem; }
}
