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

:root {
  color: #202122;
  background: #f8f9fa;
  font: 16px/1.55 system-ui, sans-serif;
}

body { margin: 0; }

main {
  max-width: 1180px;
  margin: 0 auto;
  padding: 3rem 1.25rem;
}

h1 {
  margin-bottom: 0;
  border-bottom: 1px solid #a2a9b1;
  font: 2.2rem Georgia, serif;
}

.lede {
  margin-top: .35rem;
  color: #54595d;
}

h2 {
  margin-top: 2.5rem;
  border-bottom: 1px solid #a2a9b1;
  font: 1.6rem Georgia, serif;
}

.tag {
  display: inline-block;
  background: #eaecf0;
  color: #202122;
  border-radius: 999px;
  padding: .15rem .55rem;
  font-size: .8rem;
  margin: 0 .25rem .25rem 0;
}

.filter {
  display: grid;
  gap: .35rem;
  max-width: 32rem;
  margin: 2rem 0 1rem;
  font-weight: 600;
}

input {
  padding: .65rem .75rem;
  border: 1px solid #c3c8ce;
  border-radius: 6px;
  font: inherit;
  background: white;
}

input:focus {
  outline: 2px solid #36c;
  outline-offset: 1px;
}

.copy-link {
  display: grid;
  gap: .35rem;
  max-width: 40rem;
  margin: 1rem 0;
  font-weight: 600;
}

.copy-row {
  display: flex;
  gap: .5rem;
}

.copy-row input {
  flex: 1;
  min-width: 0;
  font-family: ui-monospace, monospace;
  font-size: .85rem;
  color: #54595d;
}

.copy-row button {
  flex: none;
  padding: .55rem 1rem;
  border: 1px solid #36c;
  border-radius: 6px;
  background: #36c;
  color: white;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
  transition: background .15s ease;
}

.copy-row button:hover { background: #2a4b8d; }

.count {
  margin-top: .5rem;
  color: #54595d;
  font-size: .85rem;
}

td.bool { text-align: center; }

/*
 * data-table sizes its contents against the width of its own container
 * (e.g. a narrow Squarespace column), not the browser viewport. Without
 * this, a `@media` breakpoint based on screen width would never kick in
 * inside a narrow embed on a wide monitor, and vice versa. Establishing an
 * inline-size containment context here lets the `@container` rule below
 * respond to the actual rendered width of the <data-table> element.
 */
data-table {
  display: block;
  container-type: inline-size;
  container-name: data-table;
}

.table-scroll {
  overflow: auto;
  max-height: 70vh;
  -webkit-overflow-scrolling: touch;
  border: 1px solid #d5d9de;
  border-radius: 8px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, .06);
}

table {
  width: 100%;
  min-width: 100%;
  border-collapse: collapse;
  background: white;
  font-size: .88rem;
}

th, td {
  min-width: 6rem;
  max-width: 22rem;
  padding: .6rem .75rem;
  border-bottom: 1px solid #e2e5e9;
  border-right: 1px solid #eef0f2;
  text-align: left;
  vertical-align: top;
}

th:last-child, td:last-child { border-right: none; }

th {
  position: sticky;
  top: 0;
  background: #eaecf0;
  font-size: .8rem;
  text-transform: uppercase;
  letter-spacing: .03em;
  color: #3d3d3d;
}

tbody tr:nth-child(even) { background: #f8f9fb; }
tbody tr:hover { background: #eef4ff; }

td.name {
  min-width: 8rem;
  font-weight: 700;
}

td.intro { min-width: 8rem; }

table.has-name-header tr.name-row th {
  position: static;
  background: #dde3ea;
  border-top: 3px solid #36c;
  font-size: .95rem;
  text-transform: none;
  letter-spacing: normal;
  font-weight: 700;
  color: #202122;
  text-align: left;
}

table.has-name-header tr.name-row + tr {
  border-bottom: 2px solid #d5d9de;
}

table.has-name-header tbody tr:nth-child(4n),
table.has-name-header tbody tr:nth-child(4n-1) {
  background: #f8f9fb;
}

table.has-name-header tbody tr.name-row:hover,
table.has-name-header tbody tr:hover { background: #eef4ff; }

/*
 * Narrow-container variant (was `@media (max-width: 600px)`, which reacts
 * to the viewport rather than the space the table is actually laid out
 * in). `container-name: data-table` is declared above.
 */
@container data-table (max-width: 600px) {
  th, td {
    min-width: 6.5rem;
    max-width: 14rem;
    padding: .5rem;
    font-size: .82rem;
  }
  table { font-size: .82rem; }
}

ul {
  margin: 0;
  padding-left: 1.2rem;
}

a { color: #36c; }

.truncated .full[hidden],
.truncated .preview[hidden] { display: none; }

.truncated .toggle {
  display: inline-block;
  margin-left: .35rem;
  padding: 0;
  border: none;
  background: none;
  color: #36c;
  font: inherit;
  font-weight: 600;
  text-decoration: underline;
  cursor: pointer;
}

li.ellipsis { list-style: none; margin-left: -1.2rem; color: #72777d; }

.error { color: #b32424; }

/*
 * group-grid: a 4-across icon grid (like data-table, sized against its own
 * container rather than the viewport, so it works inside narrow embeds).
 */
group-grid {
  display: block;
  container-type: inline-size;
  container-name: group-grid;
}

.group-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1rem;
}

.group-tile {
  display: grid;
  justify-items: center;
  gap: .5rem;
  padding: 1rem .5rem;
  border: 1px solid #d5d9de;
  border-radius: 10px;
  background: white;
  box-shadow: 0 1px 3px rgba(0, 0, 0, .06);
  font: inherit;
  color: inherit;
  cursor: pointer;
  transition: background .15s ease, border-color .15s ease;
}

.group-tile:hover { background: #eef4ff; }

.group-tile:focus-visible {
  outline: 2px solid #36c;
  outline-offset: 2px;
}

.group-tile.is-open {
  border-color: #36c;
  background: #eef4ff;
}

.group-icon {
  width: 3.5rem;
  height: 3.5rem;
  border-radius: 50%;
  object-fit: cover;
}

.group-icon--placeholder {
  display: grid;
  place-items: center;
  background: #36c;
  color: white;
  font: 700 1.4rem Georgia, serif;
}

.group-name {
  font-size: .85rem;
  font-weight: 600;
  text-align: center;
  line-height: 1.3;
}

.group-detail {
  grid-column: 1 / -1;
  background: white;
  border: 1px solid #d5d9de;
  border-top: 3px solid #36c;
  border-radius: 8px;
  padding: 1.25rem 1.5rem;
  box-shadow: 0 1px 3px rgba(0, 0, 0, .06);
}

.group-detail h3 {
  margin: 0 0 .75rem;
  font: 1.3rem Georgia, serif;
  color: #202122;
}

.group-detail section {
  margin-top: 1rem;
}

.group-detail section:first-of-type {
  margin-top: 0;
}

.group-detail h4 {
  margin: 0 0 .35rem;
  font-size: .8rem;
  text-transform: uppercase;
  letter-spacing: .03em;
  color: #54595d;
}

.group-detail p { margin: 0; }

.group-detail ul {
  margin: 0;
  padding-left: 1.2rem;
}

@container group-grid (max-width: 720px) {
  .group-grid { grid-template-columns: repeat(3, 1fr); }
}

@container group-grid (max-width: 520px) {
  .group-grid { grid-template-columns: repeat(2, 1fr); }
}

@container group-grid (max-width: 320px) {
  .group-grid { grid-template-columns: 1fr; }
}

/* The filter sits below the grid here (rather than above, like
   data-table's), so it doesn't need the same top margin. */
group-grid .filter {
  margin-top: 1.5rem;
}

@media (max-width: 600px) {
  main { padding: 1.5rem .75rem; }
}
