/* A single piece of writing: shared by every page made from post-template.html */

.bar {
  position: sticky; top: 0; z-index: 10;
  background: rgba(245, 240, 230, .78);
  -webkit-backdrop-filter: blur(18px) saturate(140%); backdrop-filter: blur(18px) saturate(140%);
}
.bar-in { max-width: 1180px; margin: 0 auto; padding: 14px var(--gutter); display: flex; justify-content: space-between; align-items: center; gap: 16px; }
.bar-back {
  display: inline-flex; align-items: center; min-height: 44px; padding: 0 18px; border-radius: 999px;
  font-size: 15px; font-weight: 500; background: #E4DCCC; transition: background .2s ease, scale 120ms ease-out;
}
.bar-back:hover { background: #D3CAB7; }
.bar-back:active { scale: .96; }
/* Reading progress: a coral line along the bottom of the bar */
.progress { position: absolute; left: 0; right: 0; bottom: 0; height: 2px; background: var(--accent); transform-origin: left; transform: scaleX(var(--p, 0)); }
@supports (animation-timeline: scroll()) {
  .progress { animation: progress linear both; animation-timeline: scroll(root); }
  @keyframes progress { from { transform: scaleX(0); } to { transform: scaleX(1); } }
}

.piece { max-width: 1180px; margin: 0 auto; padding: 0 var(--gutter) 96px; }
.piece-head { padding: 96px 0 64px; max-width: 900px; }
.piece-kind { margin: 0 0 28px; font-size: 15px; color: var(--muted); }
.piece-kind a { color: var(--soft); text-decoration: underline; text-decoration-thickness: 1.5px; text-underline-offset: 5px; text-decoration-color: var(--off); transition: color .2s ease, text-decoration-color .2s ease; }
.piece-kind a:hover { color: var(--fg); text-decoration-color: var(--accent); }
.piece-title {
  margin: 0 0 32px; max-width: 18ch;
  font-family: var(--serif); font-weight: var(--serif-w); font-variation-settings: var(--serif-cut-lg);
  font-size: clamp(44px, 6.2vw, 84px); line-height: 1; letter-spacing: -0.03em; text-wrap: balance;
  view-transition-name: piece-title;
}
.standfirst { margin: 0 0 28px; max-width: 46ch; font-size: 22px; line-height: 1.5; color: var(--body); }
.piece-meta { margin: 0; font-size: 15px; color: var(--muted); }

.piece-grid { display: grid; grid-template-columns: 200px minmax(0, 680px); gap: 80px; align-items: start; }
.toc { position: sticky; top: 112px; }
.toc-label { margin: 0 0 14px; font-size: 14px; color: var(--muted); }
.toc ol { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 2px; }
.toc a {
  position: relative; display: block; padding: 7px 0 7px 16px; font-size: 15px; line-height: 1.35; color: var(--dim);
  transition: color .3s ease;
}
.toc a::before { content: ''; position: absolute; left: 0; top: calc(.5em + 7px); width: 6px; height: 6px; border-radius: 50%; background: var(--accent); scale: 0; transition: scale .4s var(--ease); }
.toc a:hover { color: var(--fg); }
.toc a[aria-current="true"] { color: var(--fg); }
.toc a[aria-current="true"]::before { scale: 1; }

.body { font-size: 19px; line-height: 1.7; color: var(--body); }
.body > :first-child { margin-top: 0; }
.body p { margin: 0 0 1.2em; }
.body h2 {
  margin: 2.2em 0 .6em; scroll-margin-top: 104px;
  font-family: var(--serif); font-weight: var(--serif-w); font-variation-settings: var(--serif-cut);
  font-size: 34px; line-height: 1.12; letter-spacing: -0.01em; color: var(--fg);
}
.body ul, .body ol { margin: 0 0 1.2em; padding-left: 1.2em; }
.body li { margin: .4em 0; }
.body li::marker { color: var(--accent); }
.body a { color: var(--fg); text-decoration: underline; text-decoration-thickness: 1.5px; text-underline-offset: 4px; text-decoration-color: var(--accent); }
.body strong { color: var(--fg); font-weight: 600; }
.body blockquote {
  margin: 1.8em 0; padding: 4px 0 4px 26px; border-left: 2px solid var(--accent);
  font-family: var(--serif); font-weight: var(--serif-w); font-variation-settings: var(--serif-cut); font-style: italic;
  font-size: 28px; line-height: 1.3; color: var(--fg);
}
.body blockquote p { margin: 0; }
.body figure { margin: 2em 0; }
.body figure img { display: block; width: 100%; height: auto; border-radius: 12px; }
.body figcaption { margin-top: 10px; font-size: 14px; color: var(--muted); }
.figure-slot {
  display: grid; place-items: center; aspect-ratio: 16 / 9; border-radius: 14px; padding: 24px; text-align: center;
  background: linear-gradient(180deg, rgba(15,61,62,.045), rgba(15,61,62,.015));
  border: 1px solid rgba(15,61,62,.07); font-size: 15px; color: var(--muted);
}
.body .sources { font-size: 15px; line-height: 1.55; color: var(--muted); }

.piece-end {
  margin: 96px 0 0 280px; max-width: 680px; padding: 40px; border-radius: 16px; background: var(--raised);
  display: flex; flex-direction: column; gap: 24px;
}
.end-ask { margin: 0; font-family: var(--serif); font-weight: var(--serif-w); font-variation-settings: var(--serif-cut); font-size: 32px; line-height: 1.15; letter-spacing: -0.01em; }
.end-ways { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 28px; }

/* Arrival: the headline carries over from the list; everything else settles in beneath it */
@media (prefers-reduced-motion: no-preference) {
  .piece-kind, .standfirst, .piece-meta, .piece-grid { animation: settle .8s var(--ease) both; }
  .standfirst { animation-delay: .08s; }
  .piece-meta { animation-delay: .14s; }
  .piece-grid { animation-delay: .2s; }
  @keyframes settle { from { opacity: 0; translate: 0 14px; } }
}

@media (max-width: 1000px) {
  .piece-grid { grid-template-columns: minmax(0, 1fr); }
  .toc { display: none; }
  .piece-end { margin-left: 0; }
}
@media (max-width: 760px) {
  .piece-head { padding: 56px 0 40px; }
  .standfirst { font-size: 19px; }
  .body { font-size: 17px; }
  .body h2 { font-size: 28px; }
  .body blockquote { font-size: 23px; }
  .piece-end { padding: 28px 24px; margin-top: 64px; }
  .end-ask { font-size: 26px; }
  .bar .brand-name { font-size: 20px; }
}
