/* Shared layout for every page under posts/.
   Site-wide rules (the Japanese gothic stack, .hl, .ul, the alignment rule)
   live in ../styles.css and must NOT be duplicated here: that split is
   pitfall 30 in the yao-personal-hp skill. What belongs here is only what is
   specific to a post page and shared by all of them. */

  /* Post-specific layout. Everything else is inherited from styles.css. */
  /* The article is 920px wide and centred; the nav's contents sit on the
     same edges instead of hugging the window, which left the mark 300px to
     the left of the text on a wide screen. */
  :root { --post-maxw: 920px; --post-gutter: max(var(--pad), calc((100% - var(--post-maxw)) / 2)); }
  .post-nav {
    position: sticky; top: 0; z-index: 100;
    display: flex; align-items: center; justify-content: space-between; gap: 16px;
    padding: 16px var(--post-gutter);
    background: color-mix(in oklab, var(--bg) 82%, transparent);
    backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
    border-bottom: 1px solid var(--line-soft);
    font-family: var(--font-sans); font-size: 12px;
    letter-spacing: 0.08em; text-transform: uppercase;
  }
  .post-nav .back { display: flex; align-items: center; gap: 10px; font-weight: 700; }
  .post-nav .back .dot { width: 8px; height: 8px; background: var(--accent); border-radius: 50%; }
  .post-nav .back:hover { color: var(--accent); }
  .post-nav-actions { display: flex; gap: 10px; align-items: center; }

  article.post { padding: clamp(44px, 7vh, 80px) var(--pad) 0; max-width: var(--post-maxw); margin: 0 auto; }
  .post-kicker {
    font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.18em;
    text-transform: uppercase; color: var(--muted);
    display: flex; align-items: center; gap: 12px; margin-bottom: 22px;
  }
  .post-kicker::before { content: ""; width: 28px; height: 1px; background: var(--fg); }
  .post-title {
    font-family: var(--font-serif); font-style: italic; font-weight: 400;
    font-size: clamp(30px, 3.6vw, 46px); line-height: 1.1;
    letter-spacing: -0.02em; max-width: none; margin-bottom: 18px;
  }
  .post-standfirst {
    /* same size as the body: it is set apart by colour, not by scale */
    font-family: var(--font-serif); font-size: 17px;
    line-height: 1.7; color: var(--muted); max-width: none; margin-bottom: 22px;
  }
  .post-meta {
    font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.06em;
    color: var(--muted); padding-bottom: 26px; border-bottom: 1px solid var(--line);
    display: flex; flex-wrap: wrap; gap: 6px 18px;
  }

  .post-body { max-width: none; padding: 38px 0 0; }
  .post-body h2 {
    font-family: var(--font-serif); font-style: italic; font-weight: 400;
    font-size: clamp(24px, 2.4vw, 32px); line-height: 1.2;
    margin: 52px 0 18px; letter-spacing: -0.01em;
  }
  .post-body h2:first-child { margin-top: 0; }
  .post-body p {
    font-size: 17px; line-height: 1.75; margin-bottom: 19px;
  }
  .post-body ul { margin: 0 0 20px 0; padding-left: 20px; }
  .post-body li { font-size: 17px; line-height: 1.68; margin-bottom: 8px; }
  .post-body a { color: var(--accent); text-decoration: underline;
    text-decoration-color: color-mix(in srgb, var(--accent) 35%, transparent);
    text-underline-offset: 3px; }
  .post-body a:hover { text-decoration-color: var(--accent); }
  .post-body strong { font-weight: 600; }
  .post-body code {
    font-family: var(--font-mono); font-size: 0.88em;
    background: rgba(10, 10, 10, 0.05); padding: 1px 6px;
    border: 1px solid var(--line-soft);
  }
  [data-theme="dark"] .post-body code { background: rgba(245, 245, 240, 0.07); }

  .pull {
    border-left: 2px solid var(--accent);
    padding: 4px 0 4px 22px; margin: 30px 0;
    font-family: var(--font-serif);
    font-size: clamp(18px, 1.7vw, 22px); line-height: 1.5;
  }

  figure.post-fig { margin: 34px 0; max-width: 100%; }
  figure.post-fig img,
  figure.post-fig video {
    width: 100%; height: auto; display: block;
    border: 1px solid var(--line-soft); background: #fff; padding: 10px;
  }
  /* A square screen recording at full column width is enormous. Cap it and
     centre it; the img rule above is unaffected because paper figures are
     wide, not square. */
  figure.post-fig video { max-width: 520px; margin: 0 auto; }
  figure.post-fig figcaption {
    font-family: var(--font-sans); font-size: 13px; line-height: 1.6;
    color: var(--muted); margin-top: 12px;
  }
  figure.post-fig figcaption b { color: var(--fg); font-weight: 600; }

  .post-foot {
    max-width: none; padding: 36px 0 0;
    border-top: 1px solid var(--line-soft); margin-top: 56px;
  }
  .post-foot p { font-size: 14px; line-height: 1.7; color: var(--muted); margin-bottom: 14px; }
  .post-foot a { color: var(--accent); }

  /* language blocks */
  [data-post-lang] { display: none; }
  [data-post-lang].on { display: block; }

  @media (max-width: 700px) {
    .post-body p, .post-body li, .post-standfirst { font-size: 15.5px; line-height: 1.68; }
    .post-body h2 { font-size: clamp(21px, 5.5vw, 26px); margin: 34px 0 14px; }
    figure.post-fig { margin: 24px 0; }
    figure.post-fig img { padding: 6px; }
    figure.post-fig figcaption { font-size: 12px; }
    .post-meta { font-size: 10px; gap: 4px 12px; }
  }
