/*
 * The app's blog at tobefair.app/blog/. Since 21 September 2026 it wears the landing page's look,
 * the way the card pages and the games pages do: `home.css` is inlined into the blog's shell by the
 * build, and this file draws the classes `services/api/src/tbf_api/blog/render.py` writes in its
 * `--home-*` tokens. No colour is written here.
 *
 * The pieces are the ones a reader has already met on /card/: display headings with one ember
 * mark, sulfur tags, paper cards on the stock, and a note drawn the way the app draws one, slightly
 * off square. Nothing moves under Reduce Motion.
 *
 * One breakpoint, a media query at 700px, as on the work blog.
 */

.blog-site main {
  padding-bottom: var(--home-section);
}
.blog-site .stamp {
  display: inline-flex;
  width: fit-content;
  border-radius: var(--home-radius-button);
  background: var(--home-sulfur);
  color: var(--home-on-accent);
  padding: 6px 12px;
  font: 500 var(--home-meta) / 1.5 var(--home-body);
  letter-spacing: 0;
  text-transform: none;
}

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

.idxhead {
  display: grid;
  gap: var(--home-space-3);
  padding: var(--home-space-5) 0 var(--home-space-5);
}
.idxhead h1 {
  font-size: clamp(64px, 11vw, 148px);
}
.idxhead h1 i {
  font-style: normal;
  color: var(--home-ember);
}
.idxhead p {
  margin: 0;
  max-width: 34ch;
  color: var(--home-muted);
  font: 400 20px / 1.4 var(--home-body);
  text-wrap: pretty;
}

.list {
  display: grid;
  gap: var(--home-space-3);
}
.item {
  position: relative;
  display: grid;
  gap: 10px;
  padding: var(--home-space-4);
  border-radius: var(--home-radius-feature);
  background: var(--home-paper);
  box-shadow: var(--home-shadow);
  transition:
    transform 0.4s var(--home-ease),
    box-shadow 0.4s var(--home-ease);
}
.item:nth-child(odd):hover {
  transform: rotate(-0.6deg) translateY(-2px);
  box-shadow: var(--home-shadow-lift);
}
.item:nth-child(even):hover {
  transform: rotate(0.6deg) translateY(-2px);
  box-shadow: var(--home-shadow-lift);
}
.item .when {
  color: var(--home-muted);
  font: 500 var(--home-small) / 1.4 var(--home-body);
  white-space: nowrap;
}
.blog-site .item h2 {
  font-size: clamp(34px, 4vw, 52px);
  line-height: 1;
}
.item h2 a {
  color: var(--home-ink);
  text-decoration: none;
}
.item h2 a::after {
  content: '';
  position: absolute;
  inset: 0;
}
.item p {
  margin: 0;
  max-width: 62ch;
  color: var(--home-muted);
  font: 400 var(--home-copy) / 1.5 var(--home-body);
  text-wrap: pretty;
}

.tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 6px;
}
.tags span {
  border-radius: var(--home-radius-button);
  background: var(--home-stock);
  color: var(--home-ink);
  padding: 4px 10px;
  font: 500 var(--home-meta) / 1.5 var(--home-body);
}

/*
 * Past forty rows the board drops the description and rules by month. Title and date carry it.
 */
.list--dense {
  gap: 0;
}
.list--dense .item {
  grid-template-columns: 150px minmax(0, 1fr) auto;
  align-items: baseline;
  padding: 16px 0;
  border-radius: 0;
  background: none;
  box-shadow: none;
  border-bottom: var(--home-rule) solid var(--home-line);
}
.list--dense .item:hover {
  transform: none;
  box-shadow: none;
}
.blog-site .list--dense .item h2 {
  font-size: 28px;
}
.list--dense .tags {
  justify-content: flex-end;
  margin: 0;
}
.monthrule {
  padding: var(--home-space-4) 0 10px;
  border-bottom: var(--home-rule) solid var(--home-line);
  color: var(--home-verdigris);
  font: 500 var(--home-small) / 1.4 var(--home-body);
}

/* The first week. One row and a quiet line under it, never an empty grid or a placeholder card. */
.empty {
  padding: var(--home-space-4) 0 0;
  color: var(--home-muted);
  font: 400 var(--home-copy) / 1.5 var(--home-body);
}

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

.art {
  display: grid;
  grid-template-columns: 240px minmax(0, 720px);
  gap: 0 72px;
  padding: var(--home-space-5) 0 0;
  align-items: start;
}
.arthead {
  grid-column: 2;
  grid-row: 1;
  display: grid;
  gap: var(--home-space-3);
  margin-bottom: var(--home-space-5);
}
.blog-site .arthead h1 {
  font-size: clamp(52px, 7.4vw, 104px);
  line-height: 0.98;
}
.arthead .desc {
  margin: 0;
  color: var(--home-muted);
  font: 400 20px / 1.45 var(--home-body);
  text-wrap: pretty;
}

.toc {
  grid-column: 1;
  grid-row: 3;
  position: sticky;
  top: var(--home-space-3);
  display: grid;
  gap: var(--home-space-2);
  padding: var(--home-space-3);
  border-radius: var(--home-radius-card);
  background: var(--home-paper);
  box-shadow: var(--home-shadow);
}
.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: 400 15px / 1.4 var(--home-body);
}
.toc li::before {
  content: counter(t);
  font: 700 17px / 1.1 var(--home-display);
  color: var(--home-verdigris);
}
.toc a {
  color: var(--home-ink);
  text-decoration: none;
}
.toc a:hover {
  color: var(--home-verdigris);
}

.body {
  grid-column: 2;
  grid-row: 3;
}
.body > * {
  max-width: 64ch;
}
.body p {
  margin: 0 0 22px;
  color: var(--home-ink);
  font: 400 19px / 1.7 var(--home-body);
  text-wrap: pretty;
}
.body a {
  color: var(--home-ink);
  text-decoration-color: var(--home-verdigris);
  text-decoration-thickness: 2px;
  text-underline-offset: 3px;
}
.body a:hover {
  color: var(--home-verdigris);
}
.blog-site .body h2 {
  margin: var(--home-space-6) 0 var(--home-space-3);
  font-size: clamp(38px, 4.4vw, 60px);
  line-height: 1;
}
.blog-site .body h3 {
  margin: var(--home-space-4) 0 12px;
  font: 600 var(--home-h3) / 1.3 var(--home-body);
}
.blog-site .body h4 {
  margin: var(--home-space-3) 0 10px;
  font: 600 19px / 1.35 var(--home-body);
}
.body ul,
.body ol {
  margin: 0 0 22px;
  padding-left: 22px;
}
.body li {
  margin-bottom: 10px;
  font: 400 19px / 1.65 var(--home-body);
  text-wrap: pretty;
}
.body li::marker {
  color: var(--home-verdigris);
  font-weight: 600;
}
.body strong {
  font-weight: 600;
}

/* A quotation is a note on the table, drawn the way the app draws one. */
.body blockquote {
  margin: var(--home-space-4) 0;
  padding: var(--home-space-3);
  border-radius: var(--home-radius-note);
  background: var(--home-paper);
  box-shadow: var(--home-shadow);
  transform: rotate(-1deg);
}
.body blockquote:nth-of-type(even) {
  transform: rotate(0.8deg);
}
.body blockquote + blockquote {
  margin-top: calc(-1 * var(--home-space-2));
}
.body blockquote p {
  margin: 0;
  font: 400 var(--home-note-size) / 1.45 var(--home-note);
}
.body hr {
  margin: var(--home-space-5) 0;
  border: 0;
  border-top: var(--home-rule) solid var(--home-line);
}
.body table {
  width: 100%;
  margin: 0 0 var(--home-space-3);
  border-collapse: separate;
  border-spacing: 0;
  overflow: hidden;
  border-radius: var(--home-radius-card);
  background: var(--home-paper);
  box-shadow: var(--home-shadow);
  font: 400 17px / 1.5 var(--home-body);
}
.body th,
.body td {
  text-align: left;
  padding: 12px 16px;
  border-bottom: 1px solid var(--home-line);
}
.body tr:last-child td {
  border-bottom: 0;
}
.body th {
  background: var(--home-stock);
  color: var(--home-ink);
  font: 500 var(--home-small) / 1.4 var(--home-body);
}
.body code {
  font-size: 0.9em;
}
.body pre {
  overflow-x: auto;
  padding: 16px 18px;
  border-radius: var(--home-radius-card);
  background: var(--home-paper);
}

/* The one sulfur panel on the page. */
.key-takeaway,
.pro-tip {
  display: grid;
  gap: 10px;
  margin: var(--home-space-5) 0;
  padding: var(--home-space-4);
}
.key-takeaway {
  border-radius: var(--home-radius-feature);
  background: var(--home-sulfur);
  color: var(--home-on-accent);
}
.key-takeaway::before {
  content: 'What to take away';
  font: 500 var(--home-small) / 1.4 var(--home-body);
}
.key-takeaway p {
  margin: 0;
  color: var(--home-on-accent);
  font: 500 21px / 1.45 var(--home-body);
}
/* The tip is a note: the handwriting face, a little off square. */
.pro-tip {
  border-radius: var(--home-radius-note);
  background: var(--home-paper);
  box-shadow: var(--home-shadow-lift);
  transform: rotate(-1.2deg);
}
.pro-tip::before {
  content: 'If you write one thing';
  color: var(--home-muted);
  font: 500 var(--home-small) / 1.4 var(--home-body);
}
.pro-tip p {
  margin: 0;
  font: 400 var(--home-hand) / 1.35 var(--home-note);
}

figure.feat {
  grid-column: 2;
  grid-row: 2;
  display: grid;
  gap: 10px;
  margin: 0 0 var(--home-space-5);
  padding: 8px;
  border-radius: var(--home-radius-feature);
  background: var(--home-paper);
  box-shadow: var(--home-shadow);
}
figure.feat img {
  display: block;
  width: 100%;
  height: 340px;
  object-fit: cover;
  border-radius: var(--home-radius-card);
}
figure.feat figcaption.stamp {
  padding: 0 8px 6px;
  background: none;
  color: var(--home-muted);
}

.arttags {
  grid-column: 2;
  grid-row: 4;
  margin-top: var(--home-space-3);
}
.arttags .tags span {
  background: var(--home-paper);
  box-shadow: var(--home-shadow);
}
.artfoot {
  grid-column: 2;
  grid-row: 5;
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: var(--home-space-5);
  padding-top: var(--home-space-4);
  border-top: var(--home-rule) solid var(--home-line);
}
.artfoot a {
  display: inline-flex;
  align-items: center;
  min-height: var(--home-hit);
  padding: 0 20px;
  border: var(--home-rule) solid var(--home-ink);
  border-radius: var(--home-pill);
  color: var(--home-ink);
  font: 500 var(--home-small) / 1 var(--home-body);
  text-decoration: none;
}
.artfoot a:hover {
  background: var(--home-button);
  color: var(--home-on-button);
}

@media (prefers-reduced-motion: reduce) {
  .item,
  .item:hover,
  .item:nth-child(odd):hover,
  .item:nth-child(even):hover,
  .body blockquote,
  .body blockquote:nth-of-type(even),
  .pro-tip {
    transition: none;
    transform: none;
  }
}

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

@media (max-width: 700px) {
  .idxhead {
    padding: var(--home-space-4) 0 var(--home-space-4);
  }
  .idxhead p {
    font-size: 18px;
  }
  .item {
    padding: var(--home-space-3);
  }
  .list--dense .item {
    grid-template-columns: minmax(0, 1fr);
    gap: 6px;
  }
  .list--dense .tags {
    justify-content: flex-start;
  }
  .art {
    grid-template-columns: minmax(0, 1fr);
    gap: 0;
    padding-top: var(--home-space-4);
  }
  .arthead,
  .body,
  .toc,
  .artfoot,
  .arttags,
  figure.feat {
    grid-column: 1;
    grid-row: auto;
  }
  .arthead {
    margin-bottom: var(--home-space-3);
  }
  /* Contents becomes a card between the description and the body. */
  .toc {
    position: static;
    margin: 0 0 var(--home-space-4);
  }
  .arthead .desc {
    font-size: 18px;
  }
  .body p,
  .body li {
    font-size: 18px;
  }
  .blog-site .body h2 {
    margin-top: var(--home-space-5);
  }
  .body table {
    font-size: 15px;
  }
  .body th,
  .body td {
    padding: 10px 12px;
  }
  figure.feat img {
    height: 210px;
  }
}
