/* Writing hub (/writing/): the front page of the writing. The reader liked one post and wants more,
   so the eight topics come first as a legible set of paths (each with its own block icon),
   then the newest posts, then every post by month. Tokens from world.css. */

:root { --piece-x: #9aa1ad; } /* the eighth topic: a gray settled block, since there are seven pieces */

.page-writing main {
  background: var(--paper);
  padding-bottom: 56px;
}

/* Masthead: the top of the well. */
.pub-mast { position: relative; background: var(--field); color: var(--bone); padding: 4px var(--gutter) 24px; }
.pub-mast::after { content: ""; position: absolute; inset: auto 0 0; height: 8px; background: linear-gradient(90deg, var(--found) 0 33%, var(--understood) 33% 66%, var(--chosen) 66%); }
.pub-mast-in { max-width: var(--max); margin-inline: auto; }
.pub-crumb a { display: inline-flex; align-items: center; min-height: 44px; color: var(--bone-soft); font-size: 0.9rem; font-weight: 600; }
.pub-mast h1 { margin: 0 0 12px; font: 800 var(--h1-hub)/0.98 var(--face); font-stretch: 118%; letter-spacing: -0.025em; }
.pub-motto { margin: 0 0 14px; color: var(--bone); font-size: clamp(1.05rem, 0.95rem + 0.5vw, 1.4rem); font-weight: 600; line-height: 1.4; }
.pub-lede { margin: 0; color: var(--bone-soft); font-size: 1rem; line-height: 1.5; }
.pub-start { margin: 28px 0 0; font-size: 0.96rem; line-height: 1.5; }
.pub-start a { display: inline-flex; align-items: center; min-height: 44px; color: var(--ink); font-weight: 700; text-decoration-color: var(--work-ink); }
@media (min-width: 900px) {
  .pub-mast-in { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); gap: 0 clamp(32px, 5vw, 96px); align-items: start; }
  .pub-crumb, .pub-mast h1 { grid-column: 1 / -1; }
  .pub-motto { grid-column: 1; grid-row: 3; margin: 0; }
  .pub-lede { grid-column: 2; grid-row: 3; }
}

.pub-h { margin: 0 0 14px; font: 800 clamp(1.35rem, 1.1rem + 1vw, 2rem)/1.15 var(--face); font-stretch: 110%; }

/* Each topic is one clear doorway; its page owns the curated first article. */
.pub-topics { max-width: var(--max); margin: 18px auto 0; padding: 0 var(--gutter); }
.topic-grid { display: grid; grid-template-columns: 1fr; gap: 10px; margin: 0; padding: 0; list-style: none; }
@media (min-width: 800px) { .topic-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; } }
.topic-card {
  background: var(--sheet); border: 2px solid var(--ink); border-radius: var(--radius);
  box-shadow: 4px 4px 0 var(--tile);
}
.topic-link { display: grid; grid-template-columns: 40px minmax(0, 1fr) auto; gap: 10px; align-items: center; padding: 10px 12px; color: var(--ink); text-decoration: none; min-height: 72px; }
.topic-badge { display: grid; place-items: center; width: 40px; height: 40px; background: var(--field); border-radius: 3px; box-shadow: inset 0 -4px 0 rgba(0, 0, 0, 0.45); }
.topic-badge .topic-icon { width: 28px; height: 28px; }
.topic-text { display: grid; gap: 2px; min-width: 0; }
.topic-name { font-weight: 800; font-size: 1.02rem; line-height: 1.2; font-stretch: 108%; text-decoration: underline; text-decoration-color: var(--tile); text-decoration-thickness: 3px; text-underline-offset: 0.18em; }
.topic-short { color: var(--ink-soft); font-size: 0.88rem; line-height: 1.35; }
.topic-count { justify-self: end; padding: 2px 6px; background: var(--tile); color: var(--ink); border-radius: 2px; font-size: 0.78rem; font-weight: 800; white-space: nowrap; box-shadow: inset 0 -3px 0 rgba(0, 0, 0, 0.22); }
@media (hover: hover) { .topic-link:hover .topic-name { text-decoration-thickness: 5px; } }
@media (max-width: 360px) { .topic-link { grid-template-columns: 36px minmax(0, 1fr); } .topic-count { grid-column: 2; justify-self: start; } }
.px-ink { fill: #0e1014; }
.px-tile { fill: var(--tile); }
.px-white { fill: var(--bone); }
.topic-badge .px-ink { fill: #8a909c; }

/* Newest posts: one lead story on the playfield, the next four as sheets. */
.pub-latest { max-width: var(--max); margin: 56px auto 0; padding: 0 var(--gutter); }
.latest-grid { display: grid; gap: 16px; }
@media (min-width: 900px) {
  .latest-grid { grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr) minmax(0, 1fr); grid-template-rows: auto auto; gap: 20px 24px; }
  .story--lead { grid-row: 1 / span 2; }
}
.story { position: relative; background: var(--sheet); border: 2px solid var(--ink); border-radius: var(--radius); padding: 14px 16px 16px; box-shadow: 5px 5px 0 var(--tile); }
.story h3 { margin: 6px 0 6px; font: 800 1.2rem/1.25 var(--face); font-stretch: 104%; }
.story h3 a { display: inline-flex; align-items: center; min-height: 44px; color: var(--ink); text-decoration-color: var(--tile); text-decoration-thickness: 3px; text-underline-offset: 0.18em; }
.story-line { margin: 0; color: var(--ink-soft); font-size: 0.98rem; line-height: 1.5; }
.story-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 14px; margin: 0; color: var(--ink-soft); font-size: 0.85rem; font-weight: 700; }
.story-topic { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; color: var(--ink); text-decoration: none; }
.story-topic i, .month-topic i, .entry-also i { display: inline-block; width: 12px; height: 12px; background: var(--tile); box-shadow: inset 0 -2px 0 rgba(0, 0, 0, 0.25); }
@media (hover: hover) { .story-topic:hover { text-decoration: underline; } }
.story--lead { background: var(--field); color: var(--bone); border-color: var(--field); padding: 22px 22px 26px; }
.story--lead::before { content: ""; display: block; height: 16px; margin: -22px -22px 18px; background:
  linear-gradient(90deg, var(--tile) 0 16px, transparent 16px 18px) 0 0 / 18px 16px repeat-x; }
.story--lead h3 { font-size: clamp(1.5rem, 1.1rem + 1.6vw, 2.5rem); line-height: 1.1; font-stretch: 112%; }
.story--lead h3 a { color: var(--bone); }
.story--lead .story-line { color: var(--bone-soft); font-size: 1.05rem; }
.story--lead .story-meta, .story--lead .story-topic { color: var(--bone-soft); }
.story--lead .story-topic { color: var(--bone); }

/* Every post, by month: a quiet index. */
.pub-archive { max-width: var(--max); margin: 56px auto 0; padding: 0 var(--gutter); }
.month { display: grid; gap: 4px; padding: 14px 0; border-top: 2px solid var(--ink); }
@media (min-width: 900px) { .month { grid-template-columns: minmax(0, 1fr) minmax(0, 3fr); gap: 24px; } }
.month-h { margin: 4px 0 0; font: 800 1.05rem/1.2 var(--face); }
.month-list { margin: 0; padding: 0; list-style: none; display: grid; gap: 2px; }
@media (min-width: 900px) { .month-list { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 4px 32px; } }
.month-list li { padding: 4px 0 8px; }
.month-list > li > a { display: inline-flex; align-items: center; min-height: 44px; color: var(--ink); font-weight: 700; font-size: 1.05rem; line-height: 1.3; text-decoration-color: var(--work-ink); }
.month-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 2px 12px; margin: 0; color: var(--ink-soft); font-size: 0.85rem; }
.month-topic { display: inline-flex; align-items: center; gap: 6px; }

.pub-end { max-width: var(--max); margin: 48px auto 0; padding: 0 var(--gutter); font-size: 0.98rem; }
.pub-end p { margin: 0 0 6px; }
.pub-end ul { display: flex; flex-wrap: wrap; gap: 0 24px; margin: 0; padding: 0; list-style: none; }
.pub-end a { display: inline-flex; align-items: center; min-height: 44px; }
@media (max-width: 599px) { .story:nth-child(n+4) { display: none; } }
.pub-li { margin-block: 8px 32px; }
