/*
 * The work blog, unit 32. Board `23 At work blog` in the handoff project, redrawn in the work
 * site's own tokens by unit 40: the display face on every heading, Geist 500 for the rest,
 * dotted rules, 24px corners, and every colour a --work-* token from work.css.
 *
 * Only the classes the board draws that the shell does not already have. The header, the nav, the
 * footer and the stock, the grain, the marks and the type scale all come from the shell and from
 * /tokens.css, so nothing here restates them: this file is the index rows and the article, and
 * that is all.
 *
 * The board scopes its own frame with `container-type: inline-size` and `@container`. A real page
 * is the viewport, so the one breakpoint is a media query at the same 700px.
 */

/* ---------------------------------------------------------------- the index */

.idxhead {
  display: grid;
  gap: 14px;
  padding: 64px 0 36px;
}
.idxhead h1 {
  font-family: var(--work-display);
  font-weight: 700;
  letter-spacing: 0.02em;
  font-size: var(--work-h2);
  line-height: 0.96;
  margin: 0;
}
.idxhead h1 i {
  font-style: normal;
  color: var(--work-link);
  display: inline-block;
}
.idxhead p {
  margin: 0;
  font-family: var(--work-body);
  font-weight: 500;
  font-size: 22px;
  line-height: 1.45;
  color: var(--work-muted);
  max-width: 52ch;
  text-wrap: pretty;
}

.list {
  border-top: var(--work-rule) dotted var(--work-line);
}
.item {
  display: grid;
  grid-template-columns: 150px minmax(0, 1fr);
  gap: 8px 40px;
  padding: 28px 0;
  border-bottom: var(--work-rule) dotted var(--work-line);
  align-items: baseline;
}
.item .when {
  grid-row: span 3;
  font-family: var(--work-body);
  font-weight: 500;
  font-size: var(--work-small);
  color: var(--work-muted);
  white-space: nowrap;
}
.item h2 {
  font-family: var(--work-display);
  font-weight: 700;
  letter-spacing: 0.02em;
  margin: 0;
  font-size: 32px;
  line-height: 1;
  text-wrap: pretty;
}
.item h2 a {
  color: var(--work-ink);
  text-decoration: none;
}
.item h2 a:hover {
  color: var(--work-link);
}
.idxhead .stamp,
.arthead .stamp,
.toc .stamp {
  font: 500 var(--work-small) / 1.5 var(--work-body);
  letter-spacing: 0;
  text-transform: none;
  color: var(--work-muted);
}
.item p {
  margin: 0;
  font-size: 17px;
  line-height: 1.65;
  color: var(--work-muted);
  max-width: 62ch;
  text-wrap: pretty;
}

.tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 14px;
  font-family: var(--work-body);
  font-weight: 500;
  font-size: var(--work-small);
  color: var(--work-muted);
}

/*
 * Past forty rows the board drops the description and rules by month. Title and date carry it.
 */
.list--dense .item {
  grid-template-columns: 150px minmax(0, 1fr) auto;
  padding: 16px 0;
  align-items: baseline;
}
.list--dense .item .when {
  grid-row: auto;
}
.list--dense .item h2 {
  font-family: var(--work-display);
  font-weight: 700;
  letter-spacing: 0.02em;
  font-size: 24px;
  line-height: 1.1;
}
.list--dense .tags {
  justify-content: flex-end;
}
.monthrule {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  padding: 30px 0 10px;
  font-family: var(--work-body);
  font-weight: 500;
  font-size: var(--work-small);
  color: var(--work-link);
  border-bottom: var(--work-rule) dotted var(--work-line);
}

/* The first week. One row and a quiet line under it, never an empty grid or a placeholder card. */
.empty {
  padding: 34px 0 0;
  font-size: 17px;
  color: var(--work-muted);
}

/* ---------------------------------------------------------------- the article */

.art {
  display: grid;
  grid-template-columns: 240px minmax(0, 700px);
  gap: 0 72px;
  padding: 56px 0 24px;
  align-items: start;
}
.arthead {
  grid-column: 2;
  grid-row: 1;
  margin-bottom: 34px;
}
.arthead .stamp {
  display: block;
  margin-bottom: 16px;
}
.arthead h1 {
  font-family: var(--work-display);
  font-weight: 700;
  letter-spacing: 0.02em;
  font-size: var(--work-h2);
  line-height: 0.96;
  margin: 0 0 18px;
  text-wrap: pretty;
}
.arthead .desc {
  margin: 0;
  font-family: var(--work-body);
  font-weight: 500;
  font-size: 22px;
  line-height: 1.5;
  color: var(--work-muted);
  text-wrap: pretty;
}

.toc {
  grid-column: 1;
  grid-row: 3;
  position: sticky;
  top: 24px;
  display: grid;
  gap: 12px;
  padding-top: 6px;
  border-top: var(--work-rule) dotted var(--work-line);
}
.toc .stamp {
  display: block;
}
.toc ol {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 10px;
  counter-reset: t;
}
.toc li {
  counter-increment: t;
  display: grid;
  grid-template-columns: 26px minmax(0, 1fr);
  gap: 8px;
  font-size: 15px;
  line-height: 1.45;
}
.toc li::before {
  content: counter(t, decimal-leading-zero);
  font-family: var(--work-body);
  font-weight: 500;
  font-size: 11px;
  letter-spacing: 0.08em;
  color: var(--work-link);
  padding-top: 3px;
}
.toc a {
  color: var(--work-muted);
  text-decoration: none;
}
.toc a:hover {
  color: var(--work-link);
}

.body {
  grid-column: 2;
  grid-row: 3;
}
.body > * {
  max-width: 66ch;
}
.body p {
  font-size: 19px;
  line-height: 1.75;
  margin: 0 0 22px;
  color: var(--work-ink);
  text-wrap: pretty;
}
.body h2 {
  font-family: var(--work-display);
  font-weight: 700;
  letter-spacing: 0.02em;
  font-size: 32px;
  line-height: 1;
  margin: 44px 0 16px;
  text-wrap: pretty;
}
.body h3 {
  font-family: var(--work-body);
  font-weight: 500;
  font-size: 22px;
  line-height: 1.3;
  margin: 32px 0 12px;
}
.body h4 {
  font-family: var(--work-body);
  font-weight: 500;
  font-size: 19px;
  line-height: 1.35;
  margin: 26px 0 10px;
}
.body ul,
.body ol {
  margin: 0 0 22px;
  padding-left: 22px;
}
.body li {
  font-size: 19px;
  line-height: 1.75;
  margin-bottom: 10px;
  text-wrap: pretty;
}
/*
 * A run of numbered messages arrives as one paragraph with a bold number before each and a
 * newline between them ("What to write in a leaving card" has six such), and read as one block
 * they run together. A paragraph with two or more bold runs keeps its newlines, so each message
 * stands on its own line; every other paragraph has none and is untouched.
 */
.body p:has(> strong:nth-of-type(2)) {
  white-space: pre-line;
}
.body li::marker {
  color: var(--work-link);
}
.body blockquote {
  margin: 32px 0;
  padding: 0 0 0 24px;
  border-left: var(--work-rule) solid var(--work-link);
}
.body blockquote p {
  font-family: var(--tbf-font-statement);
  font-size: 24px;
  line-height: 1.5;
  color: var(--work-ink);
  margin: 0;
}
.body hr {
  border: 0;
  border-top: var(--work-rule) dotted var(--work-line);
  margin: 36px 0;
}
.body table {
  border-collapse: collapse;
  width: 100%;
  margin: 0 0 22px;
  font-size: 17px;
}
.body th,
.body td {
  text-align: left;
  padding: 10px 14px 10px 0;
  border-bottom: var(--work-rule) dotted var(--work-line);
  line-height: 1.55;
}
.body th {
  font-family: var(--work-body);
  font-weight: 500;
  font-size: var(--work-small);
  color: var(--work-muted);
  font-weight: 400;
}
.body code {
  font-family: var(--tbf-font-stamp);
  font-size: 0.9em;
}
.body pre {
  overflow-x: auto;
  padding: 16px 18px;
  border: var(--work-rule) dotted var(--work-line);
  border-radius: var(--work-radius);
  background: var(--work-card);
}

.key-takeaway,
.pro-tip {
  margin: 32px 0;
  padding: 22px 24px;
  border: var(--work-rule) dotted var(--work-line);
  border-radius: var(--work-radius);
  background: var(--work-card);
  display: grid;
  gap: 10px;
}
.key-takeaway {
  border-color: var(--work-link);
}
.key-takeaway::before {
  content: 'What to take away';
  font-family: var(--work-body);
  font-weight: 500;
  font-size: var(--work-small);
  color: var(--work-link);
}
.pro-tip::before {
  content: 'If you write one thing';
  font-family: var(--work-body);
  font-weight: 500;
  font-size: var(--work-small);
  color: var(--work-muted);
}
.key-takeaway p,
.pro-tip p {
  margin: 0;
  font-size: 19px;
  line-height: 1.6;
}

figure.feat {
  grid-column: 2;
  grid-row: 2;
  margin: 0 0 40px;
  background: var(--work-card);
  border: var(--work-rule) dotted var(--work-line);
  border-radius: var(--work-radius);
  padding: 8px;
  display: grid;
  gap: 10px;
}
figure.feat img {
  display: block;
  width: 100%;
  height: 340px;
  object-fit: cover;
  border-radius: var(--work-note-radius);
}
figure.feat figcaption {
  padding: 0 8px 6px;
}

.arttags {
  grid-column: 2;
  grid-row: 4;
  margin-top: 28px;
}
.artfoot {
  grid-column: 2;
  grid-row: 5;
  margin-top: 40px;
  padding: 24px 0 0;
  border-top: var(--work-rule) dotted var(--work-line);
  display: flex;
  gap: 28px;
  flex-wrap: wrap;
}
.artfoot a {
  font-size: 17px;
  text-decoration: none;
  color: var(--work-muted);
}
.artfoot a:hover {
  color: var(--work-link);
}

/* ---------------------------------------------------------------- 390, frames 4 and 7 */

@media (max-width: 700px) {
  .idxhead {
    padding: 32px 0 22px;
  }
  .idxhead h1 {
    font-size: 32px;
  }
  .idxhead p {
    font-size: 18px;
  }
  .item,
  .list--dense .item {
    grid-template-columns: minmax(0, 1fr);
    gap: 10px;
    padding: 22px 0;
  }
  .item .when {
    grid-row: auto;
  }
  .item h2,
  .list--dense .item h2 {
    font-size: 22px;
  }
  .list--dense .tags {
    justify-content: flex-start;
  }
  .art {
    grid-template-columns: minmax(0, 1fr);
    gap: 0;
    padding: 28px 0 0;
  }
  .arthead,
  .body,
  .toc,
  .artfoot,
  .arttags,
  figure.feat {
    grid-column: 1;
    grid-row: auto;
  }
  /* Contents becomes a block between the description and the body. Callouts keep their measure. */
  .toc {
    position: static;
    margin: 28px 0 8px;
    padding-top: 14px;
  }
  .arthead h1 {
    font-size: 32px;
  }
  .arthead .desc {
    font-size: 19px;
  }
  .body p,
  .body li {
    font-size: 18px;
  }
  .body h2 {
    font-size: 25px;
    margin-top: 34px;
  }
  figure.feat img {
    height: 210px;
  }
}
