/* ==========================================================================
   Writeups: listing and article typography. Loaded after style.css.
   ========================================================================== */

.page-head { padding: 96px 0 40px; }
.page-head h1 { font-size: clamp(34px, 5vw, 52px); font-weight: 600; letter-spacing: -.04em; line-height: 1.08; }
.page-head p { margin-top: 14px; max-width: 560px; color: var(--text-2); font-size: 17px; }
.crumb { display: inline-flex; gap: 8px; margin-bottom: 20px; font-size: 14px; color: var(--text-3); }
.crumb a:hover { color: var(--text); }

/* ---------- Post list (shared with the home page) ---------- */
.posts { display: grid; border-top: 1px solid var(--border); }
.post-link {
  display: grid; grid-template-columns: 140px 1fr auto; gap: 24px; align-items: baseline;
  padding: 22px 0; border-bottom: 1px solid var(--border); transition: background .15s;
}
.post-link time { font-family: var(--mono); font-size: 13px; color: var(--text-3); }
.post-link h3 { font-size: 17px; font-weight: 600; letter-spacing: -.01em; }
.post-link p { margin-top: 4px; font-size: 14.5px; color: var(--text-2); }
.post-link .read { font-size: 13px; color: var(--text-3); white-space: nowrap; }
.post-link:hover h3 { text-decoration: underline; text-underline-offset: 4px; text-decoration-color: var(--text-3); }
.post-link:hover { background: var(--bg-hover); box-shadow: -16px 0 0 var(--bg-hover), 16px 0 0 var(--bg-hover); }
.post-link:hover .read { color: var(--accent); }
.post-link:active { opacity: .85; }

/* ---------- Article ---------- */
.article { max-width: 700px; margin: 0 auto; padding: 0 24px 96px; }
.article-head { padding: 88px 0 36px; border-bottom: 1px solid var(--border); margin-bottom: 40px; }
.article-head h1 { font-size: clamp(32px, 5vw, 46px); font-weight: 600; letter-spacing: -.04em; line-height: 1.1; }
.article-head .lede { margin-top: 16px; font-size: 18px; color: var(--text-2); }
.byline { display: flex; align-items: center; gap: 12px; margin-top: 28px; font-size: 14px; color: var(--text-2); }
.byline img { width: 36px; height: 36px; border-radius: 50%; }
.byline b { color: var(--text); font-weight: 500; }
.byline .sep { color: var(--text-3); }

.prose { font-size: 16.5px; line-height: 1.75; color: color-mix(in srgb, var(--text) 88%, var(--bg)); }
.prose > * + * { margin-top: 1.15em; }
.prose h2 { margin-top: 2.2em; font-size: 24px; font-weight: 600; letter-spacing: -.025em; line-height: 1.3; color: var(--text); }
.prose h3 { margin-top: 1.8em; font-size: 18px; font-weight: 600; color: var(--text); }
.prose a { color: var(--text); text-decoration: underline; text-underline-offset: 3px; text-decoration-color: var(--text-3); }
.prose a:hover { text-decoration-color: var(--text); }
.prose strong { color: var(--text); font-weight: 600; }
.prose ul, .prose ol { padding-left: 1.3em; }
.prose ul { list-style: disc; }
.prose ol { list-style: decimal; }
.prose li + li { margin-top: .4em; }
.prose li::marker { color: var(--text-3); }
.prose code {
  font-family: var(--mono); font-size: .86em; padding: .15em .4em; border-radius: 6px;
  background: var(--bg-hover); border: 1px solid var(--border);
}
.prose pre {
  position: relative; overflow-x: auto; padding: 18px 20px; border-radius: 12px; border: 1px solid var(--border);
  background: var(--bg-elev); font-size: 13.5px; line-height: 1.65;
}
.prose pre code { padding: 0; border: 0; background: none; font-size: inherit; }
.prose blockquote { padding: 4px 0 4px 18px; border-left: 2px solid var(--border-strong); color: var(--text-2); }
.prose table { width: 100%; border-collapse: collapse; font-size: 15px; }
.prose th, .prose td { padding: 10px 12px; border-bottom: 1px solid var(--border); text-align: left; }
.prose th { font-weight: 500; color: var(--text-2); font-size: 13.5px; }
.prose td.num { font-family: var(--mono); }
.prose figure figcaption { margin-top: 8px; font-size: 13.5px; color: var(--text-3); text-align: center; }
.callout { padding: 16px 18px; border: 1px solid var(--border); border-radius: 12px; background: var(--bg-elev); font-size: 15px; }

.copy-code {
  position: absolute; top: 10px; right: 10px; padding: 4px 8px; border-radius: 6px; border: 1px solid var(--border);
  background: var(--bg); color: var(--text-3); font-family: var(--mono); font-size: 11.5px; opacity: 0; transition: opacity .15s, color .15s;
}
.prose pre:hover .copy-code, .copy-code:focus-visible { opacity: 1; }
.copy-code:hover { color: var(--text); }

.article-foot { margin-top: 64px; padding-top: 28px; border-top: 1px solid var(--border); display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; font-size: 14.5px; }
.article-foot a { color: var(--text-2); }
.article-foot a:hover { color: var(--text); }

@media (max-width: 720px) {
  .page-head { padding: 64px 0 28px; }
  .post-link { grid-template-columns: 1fr; gap: 6px; }
  .post-link .read { display: none; }
  .article { padding: 0 16px 72px; }
  .article-head { padding: 56px 0 28px; }
  .prose { font-size: 16px; }
}

/* Sub-page header: links stay visible on phones (no menu button there) */
@media (max-width: 720px) {
  .nav-links--static {
    display: flex; position: static; flex-direction: row; margin: 0 0 0 auto; padding: 0; border: 0; background: none;
  }
  .nav-links--static a { padding: 6px 8px; font-size: 14px; }
  .nav-links--static + .nav-actions { margin-left: 0; }
  .nav--sub .brand span { display: none; }
}
