/* Directory.
 *
 * Three lists at three densities — leadership cards, pod cards that open into
 * their members, and a compact grid of everyone. The photo slot the design
 * drags images into is a neutral initials disc here; see directory.js. */

.dir { display: block; }

.dir-head { margin-bottom: var(--space-5); }

.dir-lede {
  font-size: 15px;
  color: var(--soft);
  max-width: 44em;
  margin: var(--space-1) 0 var(--space-3);
}

.dir-notice {
  background: var(--soon-bg);
  color: var(--ink);
  border-radius: var(--radius-control);
  padding: 12px 14px;
  font-size: var(--size-small);
  line-height: 1.5;
  max-width: 44em;
  margin: 0 0 18px;
}

.dir-notice a { color: var(--ink); }

.dir-search { display: block; max-width: 460px; }
.dir-search .field { width: 100%; }

/* Hidden while there is a query — the preamble is context when you are browsing
   and noise when you are looking for one person. `display: block` on .dir-lede
   would otherwise outrank the browser's [hidden]. */
.dir-lede[hidden], .dir-notice[hidden] { display: none; }

/* --- the 401 --------------------------------------------------------------
 *
 * An invitation, not an error panel: no red, no alert role, no apology. It sits
 * on the page like a page, because being asked to say who you are is a normal
 * thing to happen here and not a failure of anything. */

.dir-invite { max-width: 34rem; }
.dir-invite .dir-lede { margin: var(--space-3) 0 0; }

/* The row itself is `buttonRow()` (`components/ui.js`); this wrapper is only
 * the spacing above it. */
.dir-invite-actions { margin-top: var(--space-5); }

.dir-section { margin-bottom: var(--space-5); }

/* The heading is `sectionHead(…, { rule: true })` (`components/ui.js`) —
 * this drew the identical border, weight and letter-spacing under its own
 * name here. `.dir-section-note` is the one real addition this screen makes:
 * a second line of context ("tap a pod to see who is in it", a count) beside
 * the label, which the shared primitive has no slot for. */

.dir-section-note {
  font-weight: var(--weight-normal);
  letter-spacing: 0;
  text-transform: none;
  font-size: var(--size-micro);
}

/* --- leadership and pod cards --------------------------------------------- */

.dir-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(262px, 1fr));
  gap: var(--space-2);
  align-items: start;
}

.dir-card {
  background: var(--panel);
  color: var(--ink);
  border: 1px solid transparent;
  border-radius: var(--radius-card);
  padding: 14px 15px;
  display: flex;
  gap: 13px;
  align-items: center;
  text-align: left;
  width: 100%;
}

.dir-card-body { flex: 1; min-width: 0; }

/* A card that opens that person's page.
 *
 * It is a real `<button>`, so it needs the type inheriting and the alignment
 * putting back — and it needs to *look* like a door, because a card that is
 * tappable and looks exactly like one that is not teaches people that nothing
 * is. The cue is the border, which the cards already reserve as
 * `1px solid transparent`, so nothing moves when it appears. */
button.dir-card,
button.dir-person {
  font: inherit;
  text-align: left;
  width: 100%;
  cursor: pointer;
  min-height: var(--tap-min);
}

button.dir-card:hover,
button.dir-person:hover,
button.dir-card:focus-visible,
button.dir-person:focus-visible {
  border-color: var(--line);
}

button.dir-person.is-me:hover,
button.dir-person.is-me:focus-visible { border-color: var(--ink); }

.dir-card-name {
  display: block;
  font-size: var(--size-body);
  font-weight: var(--weight-semibold);
  margin: 0;
}

.dir-card-name.is-soft { color: var(--soft); font-weight: var(--weight-normal); }

.dir-card-sub {
  display: block;
  font-size: var(--size-small);
  color: var(--soft);
  margin: 0;
}

.dir-card-role {
  display: block;
  font-size: var(--size-small);
  font-weight: var(--weight-semibold);
  color: var(--t-tea-deep);
  margin: var(--space-1) 0 0;
}

.dir-photo {
  width: 64px;
  height: 64px;
  flex: none;
  border-radius: var(--radius-pill);
  background: var(--card);
  border: 1px dashed var(--line);
  color: var(--soft);
  font-size: var(--size-body);
  font-weight: var(--weight-semibold);
  letter-spacing: 0.04em;
  display: flex;
  align-items: center;
  justify-content: center;
}

.dir-photo.is-empty { font-size: 20px; }

/* A real photograph, where camp has given us one. Same disc, same footprint —
   the card does not change shape depending on who is in it, so a page of mostly
   initials does not read as a page of missing images. `cover` because a portrait
   that is not exactly square must crop rather than squash a face. */
.dir-photo--filled {
  border-style: solid;
  border-color: var(--line);
  background: var(--card);
  overflow: hidden;
  padding: 0;
}

.dir-photo-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* Two leaders, two discs. They overlap, the way a pair of faces reads as one
   group rather than two columns, and each is a size down — so the pair costs a
   pod card about as much width as one disc did and the name beside it does not
   start wrapping the moment a pod gains a second lead.

   The ring is what keeps the front disc legible against the one behind it. */
.dir-photos {
  flex: none;
  display: flex;
  align-items: center;
}

.dir-photos .dir-photo {
  width: 46px;
  height: 46px;
  font-size: var(--size-small);
  margin-right: -14px;
  box-shadow: 0 0 0 2px var(--panel);
}

.dir-photos .dir-photo:last-child { margin-right: 0; }

.dir-pod.is-open .dir-photos .dir-photo,
.dir-pod-button:hover .dir-photos .dir-photo { box-shadow: 0 0 0 2px var(--card); }

/* --- pods ----------------------------------------------------------------- */

.dir-pod { display: block; }
.dir-pod.is-open { grid-column: 1 / -1; }

.dir-pod-button {
  border-color: var(--line);
  cursor: pointer;
  font: inherit;
  min-height: var(--tap-min);
}

.dir-pod.is-open .dir-pod-button { background: var(--card); }

.dir-pod-name {
  display: block;
  font-family: var(--font-display);
  font-size: 18px;
}

.dir-pod-cta {
  display: block;
  font-size: var(--size-micro);
  font-weight: var(--weight-semibold);
  margin-top: 5px;
}

.dir-pod-open {
  background: var(--card);
  border-radius: var(--radius-card);
  padding: 14px 16px;
  margin-top: var(--space-2);
}

.dir-pod-open-head {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: var(--space-2);
}

.dir-pod-open-title {
  font-size: var(--size-small);
  font-weight: var(--weight-bold);
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

/* --- everyone ------------------------------------------------------------- */

.dir-people {
  display: grid;
  /* The design's 198px leaves a phone one card per row and a page thousands of
     pixels long. 158px fits two at 390px and still reads at arm's length. */
  grid-template-columns: repeat(auto-fit, minmax(158px, 1fr));
  gap: var(--space-2);
}

@media (min-width: 560px) {
  .dir-people { grid-template-columns: repeat(auto-fit, minmax(198px, 1fr)); }
}

.dir-more { margin-top: var(--space-3); }

.dir-person {
  background: var(--panel);
  border: 1px solid transparent;
  border-radius: var(--radius-control);
  padding: 11px 13px;
}

.dir-person.is-me { border-color: var(--ink); }

.dir-person-name {
  font-size: var(--size-small);
  font-weight: var(--weight-semibold);
  margin: 0;
  display: flex;
  gap: var(--space-2);
  align-items: baseline;
  flex-wrap: wrap;
}

.dir-you {
  font-size: var(--size-kicker);
  font-weight: var(--weight-bold);
  letter-spacing: var(--track-kicker);
  text-transform: uppercase;
  background: var(--ink);
  color: var(--bg);
  border-radius: var(--radius-pill);
  padding: 2px 7px;
}

.dir-person-shifts {
  font-size: var(--size-micro);
  font-weight: var(--weight-semibold);
  font-variant-numeric: tabular-nums;
  color: var(--soft);
  margin: 3px 0 0;
}

/* `.dir-empty` is gone — every "nobody here" case is now `emptyState()`
 * (`components/ui.js`), which drew this exact box (byte-identical to
 * `train.css`'s `.train-empty`, apart from the class name). */

@media (max-width: 480px) {
  .dir-photo { width: 52px; height: 52px; }
}
