/* Assessors page only. Loaded after site.css. */

/* --------------------------------------------------------------- hero */

/* The sub line under the title, then the body paragraph. Same shape as the
   hero on /our-mission/: one short line at lede weight, the detail below it
   at body weight, then the action. */

/*
 * Narrower than --measure-hero, because on this page the copy has a panel to
 * clear rather than a reading measure to keep.
 *
 * .assessors-hero__aside is absolutely positioned over the slab, so it cannot
 * push anything and the copy has to stop before it on its own. Above
 * --page-max that geometry is fixed: the inner column is 1240px with 32px of
 * padding, and the aside is 400px inset 32px from the column's right edge, so
 * there are 1240 - 32 - 32 - 400 = 776px of room before the panel starts.
 *
 * .page-hero__inner's track (--col) tops out at 800px, which is 24px more than
 * fits. On a display wide enough to reach that ceiling - 16vw >= 800px, so
 * about 2600px and up - the last line of the body ran under the panel and was
 * clipped mid-word. Measured at 2800px: the box ended 24px past the panel's
 * left edge and the text 9px past it.
 *
 * This predates unifying the hero ledes on --measure-hero. Caps of 820, 840
 * and 880 all overlap by exactly the same 9px, because the track holds the box
 * at 800 in every case, so the cap was never what decided it.
 *
 * 720px leaves a 56px gutter, and because both sides are fixed above
 * --page-max that gutter is the same at 2800px and at 5120px. Below --page-max
 * the track is narrower still and governs instead, which is why the panel's
 * own breakpoint at 1080px needs nothing here.
 */
.assessors-hero__lede,
.assessors-hero__body {
  max-width: calc(var(--page-max) - 464px - 56px);
  text-wrap: pretty;
}

.assessors-hero__body {
  margin-top: 10px;
}

/* Same 6px as the hero action row on /membership/. */

/* ------------------------------------------------- hero contracting panel */

/*
 * Sits over the blue slab on the right of the hero, the same way the stats
 * panel does on /our-mission/. Absolute against .page-hero, which is already
 * a containing block for the slab and the sliver.
 *
 * White rather than the grey it was when it sat in the page body: on the slab
 * a grey tint reads as a smudge, and the copy inside is dark text that needs
 * a light ground of its own.
 *
 * Hidden below 1080, which is the width the slab stops being drawn at. There
 * is no blue left to sit on, and the panel would cover the hero copy.
 */
.assessors-hero__aside {
  position: absolute;
  z-index: 2;
  top: 50%;
  right: max(32px, calc((100% - var(--page-max)) / 2 + 32px));
  transform: translateY(-50%);
  width: min(400px, 32vw);
  padding: 26px 28px;
  background: #fff;
  border-radius: var(--radius);
  box-shadow: var(--shadow-panel);
}

.assessors-hero__aside-heading {
  margin: 0 0 12px;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--navy-800);
}

.assessors-hero__aside p {
  font-size: 14px;
  line-height: 1.65;
}

.assessors-hero__aside p + p {
  margin-top: 12px;
}

@media (max-width: 1080px) {
  .assessors-hero__aside {
    display: none;
  }
}

/* -------------------------------------------------------------- intro */

/* Prose left, the "apply" call-out right. Collapses at the 900px grid
 * breakpoint like every other two-column block on the site. */
.assessors-intro {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr);
  gap: 64px;
  align-items: start;
}

.assessors-intro .body-lg {
  text-wrap: pretty;
}

.assessors-apply {
  display: grid;
  justify-items: start;
  gap: 20px;
  padding: 32px;
  background: var(--grey-100);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius);
}

.assessors-apply__icon {
  font-size: 34px;
  color: var(--primary);
}

.assessors-apply__text {
  font-size: 16px;
  line-height: 1.6;
  color: var(--navy-800);
}

.assessors-apply__doc {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
}

.assessors-apply__doc .material-icons {
  color: var(--error);
}

@media (max-width: 900px) {
  .assessors-intro {
    grid-template-columns: 1fr;
    gap: 40px;
  }
}

/* ------------------------------------------------------------- levels */

/* The panel scrolls rather than squashing: the table keeps a 640px floor. */
.levels__panel {
  background: #fff;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius);
  box-shadow: var(--shadow-card);
  overflow-x: auto;
}

.levels__table {
  width: 100%;
  min-width: 640px;
  border-collapse: collapse;
  font-size: 15px;
}

.levels__table thead tr {
  background: var(--grey-50);
}

.levels__table thead th {
  padding: 16px 24px;
  border-bottom: 1px solid var(--border-default);
  font-family: var(--font-display);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--navy-800);
  text-align: left;
}

.levels__corner {
  width: 26%;
}

.levels__table tbody tr {
  border-bottom: 1px solid var(--border-subtle);
}

.levels__table tbody th {
  padding: 20px 24px;
  background: var(--grey-50);
  font-size: 14px;
  font-weight: 500;
  color: var(--text-secondary);
  text-align: left;
  vertical-align: top;
}

.levels__table td {
  padding: 20px 24px;
  vertical-align: top;
}

.levels__list {
  list-style: none;
  display: grid;
  gap: 8px;
}

.levels__list li {
  display: flex;
  gap: 8px;
  line-height: 1.5;
}

.levels__list .material-icons {
  flex: 0 0 auto;
  font-size: 17px;
  color: var(--gold-500);
}

@media (max-width: 900px) {
  .levels__table {
    font-size: 13px;
  }
}

/* ---------------------------------------------------------- directory */

.directory__inner {
  display: grid;
  gap: 32px;
}

/* The max-width escape this used to carry moved to site.css: it is a
   site-wide selector and it belongs in the shared file. What is left is this
   page's own ink and wrapping. */
.directory__head .body-lg {
  color: var(--text-body);
  text-wrap: pretty;
}

/* Revealed by /js/assessors.js. Without it the controls would be inert. */
/* One height for every control in this row.
 *
 * They were declared 40px each and rendered 42, 38 and 40: the chip's padding
 * and text exceeded its min-height, and the select and the input disagree
 * about what 40px means. With align-items: flex-end that bottom-aligned the
 * controls and left the three labels above them on three different baselines,
 * which only became visible once the chips got a label of their own. */
.directory__filters {
  --control-h: 42px;
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 16px;
  padding: 24px;
  background: var(--grey-100);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius);
}

.directory__filters[hidden] {
  display: none;
}

.directory__chips {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

/*
 * Four chips break to 2x2, then to a single column, and never to 3+1.
 *
 * Left to wrap on their own they went three across with "Will Travel"
 * stranded underneath, because the four are different widths - 158, 146, 124,
 * 124 - and flex fits as many as it can. A grid decides the count instead, and
 * minmax(0, 1fr) makes every chip the width of its column, so a broken row is
 * a tidy block rather than a ragged one.
 *
 * The numbers are measured, not chosen. 704px is the last width where all four
 * hold one row; below it flex was already wrapping, so the grid takes over
 * exactly where the ragged row used to start. 440px is where two columns stop
 * fitting the widest chip: the panel's inner width is the viewport less 112px
 * of page and panel padding, and (328 - 12) / 2 is 158, which is what "Cloud
 * Assessor" needs.
 *
 * Both are a function of the labels, so if the copy changes these want
 * re-measuring - the widths above are what to check against.
 */
@media (max-width: 703px) {
  .directory__chips {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  /* The Skills field takes the panel so the 2x2 fills it. Left content-width
     the grid is only as wide as two chips - a 328px block sitting in a 590px
     panel with the rest empty - and it would disagree with the single column
     lower down, which is full width because .directory__field goes to 100%
     when the fields stack. First child rather than a new class: the chips are
     the first field and this is one rule, not a markup change. */
  .directory__filters > .directory__field:first-child {
    width: 100%;
  }
}

@media (max-width: 439px) {
  .directory__chips {
    grid-template-columns: minmax(0, 1fr);
  }
}

.filter-chip {
  display: inline-flex;
  align-items: center;

  /* Centred because a chip stops being content-width once the grid above
     makes it a column wide. Left-aligned, four equal buttons read as a list
     with a ragged right edge inside each one. */
  justify-content: center;
  gap: 8px;
  min-height: var(--control-h);
  padding: 9px 16px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-pill);
  background: #fff;
  color: var(--navy-800);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition:
    background var(--dur-micro) ease,
    border-color var(--dur-micro) ease,
    color var(--dur-micro) ease;
}

.filter-chip .material-icons {
  font-size: 18px;
}

.filter-chip:hover {
  border-color: var(--navy-800);
  background: #fff;
}

.filter-chip[aria-pressed='true'] {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
}

.filter-chip[aria-pressed='true']:hover {
  background: var(--primary-hover);
  border-color: var(--primary-hover);
}

.directory__field {
  display: grid;
  gap: 8px;
  min-width: 190px;
}

/*
 * Once Country Code and Search By Name are on separate rows they should be the
 * same width, and that width is the panel.
 *
 * Side by side the select is content-width at 190px and the search takes the
 * rest, which is right while they share a line. Stacked, it left a short
 * select sitting above a full-width input for no reason anyone could see.
 *
 * 516px is the last width where the two share a row, measured. */
@media (max-width: 515px) {
  .directory__field {
    width: 100%;
  }
}

.directory__field--grow {
  flex: 1 1 220px;
}

/*
 * Country Code fills whatever is left of its row once the three fields stop
 * fitting on one.
 *
 * Search already grows, Country did not, so between 1144px and 910px - where
 * Skills and Country share the top row and Search has wrapped below - the
 * select sat at its 190px content width with the rest of the row empty beside
 * it. Growing it closes that gap, and lower down, where Country and Search
 * share a row, it makes the two of them split it rather than leaving the
 * select short.
 *
 * Capped at 1144 so the widest layout is untouched: above it all three fields
 * are on one line and the select has no gap to fill. 1146px is the last width
 * where that holds, measured.
 *
 * nth-child(2) rather than a class because the field wrappers are hand-written
 * around a generated <option> list, and this needs no edit to that file. The
 * order is Skills, Country, Search.
 */
@media (max-width: 1144px) {
  .directory__filters > .directory__field:nth-child(2) {
    flex: 1 1 190px;
  }
}

.directory__label {
  font-size: 12px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--text-muted);
}

/* The caret is drawn rather than native so the control matches the inputs. */
.directory__select-wrap {
  position: relative;
  display: block;
}

/* select.field in site.css sets height: 38px with no comment saying why, and
   at (0,1,1) it out-specifies a plain class. Matching that specificity rather
   than raising it further, and scoped to this row so nothing else on the site
   moves - whatever that 38px is for elsewhere, it still applies there. */
select.directory__select {
  width: 100%;
  height: var(--control-h);
  padding: 0 40px 0 12px;
  appearance: none;
  -webkit-appearance: none;
}

.directory__caret {
  position: absolute;
  right: 11px;
  bottom: 9px;
  font-size: 22px;
  color: var(--navy-800);
  pointer-events: none;
}

.directory__search {
  height: var(--control-h);
}

.directory__count {
  font-size: 14px;
  color: var(--text-secondary);
}

/* ------------------------------------------------------ assessor card */

.assessor-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(320px, 100%), 1fr));
  gap: 20px;
}

/*
 * Three stacked bands: headshot and name, then the skill pills, then the
 * contact footer. Only the first band is two columns; the other two span the
 * card, which is what keeps it short - four pills in the 244px column beside
 * the headshot stack four deep, and across the full width they sit two or
 * three to a line.
 *
 * The grid stretches every card to match the tallest in its row, and the
 * leftover has to go somewhere. 1fr on the second row - the pills - puts it
 * under them: the pills stay tight beneath the name, the slack sits in the
 * middle, and the footer docks to the bottom edge. On the first row instead it
 * pushed the pills away from the name they belong to.
 *
 * Only two rows are declared, so the footer lands in an implicit third one.
 * align-self: end on the footer covers the case of a card with no pills, where
 * the footer itself is the item in the 1fr row. Rows sit closer together than
 * the 20px between the headshot and the text beside it.
 */
.assessor-card {
  display: grid;
  grid-template-columns: 88px minmax(0, 1fr);
  grid-template-rows: auto 1fr;
  gap: 16px 20px;
  align-items: start;
  padding: 24px;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius);
  box-shadow: var(--shadow-card);
}

/* .assessor-card sets display, which would otherwise beat the UA rule for
 * [hidden]. The filter script hides cards with the hidden attribute. */
.assessor-card[hidden] {
  display: none;
}

/*
 * A clipping frame around the headshot, rather than a rounded <img>.
 *
 * 13 of the 61 supplied photos carry a warm ring baked into the file, between
 * 1.7% and 2.2% of their width. Rounding the <img> itself clips to that file's
 * own edge, so the ring survived as an arc around the circle - visible on Ben
 * Ben-Aderet, and on twelve others nobody had looked at.
 *
 * So the frame owns the circle and the image inside it is scaled past the
 * frame. scale(1.06) takes 2.8% off each edge, clear of the worst ring at
 * 2.2%, and imperceptible on the 48 photos that never had one.
 */
.assessor-card__avatar {
  display: block;
  width: 88px;
  height: 88px;
  overflow: hidden;
  border-radius: 50%;
  border: 1px solid rgba(0, 0, 0, 0.05);
  box-shadow: var(--shadow-avatar);
  background: var(--grey-200);
}

.assessor-card__photo {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
  transform: scale(1.06);
}

.assessor-card__detail {
  display: grid;
  gap: 8px;
  min-width: 0;
}

.assessor-card__name {
  font-family: var(--font-display);
  font-size: 19px;
  font-weight: 600;
  line-height: 1.3;
  color: var(--navy-800);
}

.assessor-card__level {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.assessor-card__level--advanced {
  color: var(--gold-900);
}

.assessor-card__company {
  font-size: 14px;
  color: var(--text-body);
}

/*
 * The contact footer: the label, the address, the phone numbers.
 *
 * Across the whole card, and docked to its bottom edge, so the addresses line
 * up across a row of cards. It also has to be full width because the address
 * is the longest single string on the card and it must not break: beside an
 * 88px headshot the text column is 244px, and the longest address in the
 * directory measures 257px, so break-all shredded it mid-word. The full card
 * gives it 352px at the standard --page-max, which clears it with room over.
 * Measured, not guessed - re-measure if a longer address is ever added.
 */
.assessor-card__contact {
  grid-column: 1 / -1;
  align-self: end;
  display: grid;
  gap: 4px;
  padding-top: 14px;
  border-top: 1px solid var(--border-subtle);
}

.assessor-card__contact-label {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.assessor-card__email {
  font-size: 13px;
  white-space: nowrap;
}

/* Below the width where a single column cannot hold the longest address,
   wrapping is better than overflowing. `anywhere` rather than break-all so it
   only breaks the addresses that genuinely do not fit. */
@media (max-width: 700px) {
  .assessor-card__email {
    white-space: normal;
    overflow-wrap: anywhere;
  }
}

/* Across the card, not in the column beside the headshot. See .assessor-card
   for why: it is what keeps the cards short. */
.assessor-card__badges {
  grid-column: 1 / -1;
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.assessor-card__badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 10px;
  border: 1px solid var(--border-default);
  border-radius: var(--radius-pill);
  background: var(--grey-100);
  font-size: 11px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--navy-500);
}

.assessor-card__badge .material-icons {
  font-size: 14px;
}

.assessor-card__phones {
  list-style: none;
  display: grid;
  gap: 3px;
  font-size: 13px;
  color: var(--text-secondary);
}

/* The headshot stacks above the text rather than shrinking. */
@media (max-width: 420px) {
  .assessor-card {
    grid-template-columns: 1fr;
  }
}
