/* Blog preview — design v2 (essence from report/01) */

:root {
  /* Palette — matches report */
  --bg: oklch(0.985 0.002 95);
  --paper: oklch(0.99 0.002 95);
  --ink: oklch(0.18 0.005 260);
  --ink-soft: oklch(0.36 0.006 260);
  --ink-faint: oklch(0.55 0.008 260);
  --rule: oklch(0.88 0.005 260);
  --rule-soft: oklch(0.93 0.004 260);
  --accent: oklch(0.58 0.17 27);          /* vermilion */
  --accent-soft: oklch(0.58 0.17 27 / 0.12);
  --code-bg: oklch(0.96 0.004 95);

  /* Type — matches report */
  --font-body: "Noto Sans JP", "Inter Tight", -apple-system, system-ui, sans-serif;
  --font-display: "Noto Serif JP", "Inter Tight", Georgia, serif; /* serif for blog title (essay feel — differs from report) */
  --font-num: "Inter Tight", "Noto Sans JP", sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, monospace;

  --measure: 38rem;        /* slightly tighter than report's 44rem — blog is reading-first */
  --canvas-max: 72rem;
  --page-pad-gutter: clamp(1.5rem, 4vw, 3rem);
  --page-pad-x: max(var(--page-pad-gutter), calc((100vw - var(--canvas-max)) / 2));
  --gap: 1.15rem;
  /* A centred reading column that carries its own side gutter: content width = --measure. */
  --measure-box: calc(var(--measure) + 2 * var(--page-pad-gutter));
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--ink);
}

body {
  font-family: var(--font-body);
  font-weight: 400;
  font-size: 16px;
  line-height: 1.9;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  font-feature-settings: "palt";
  letter-spacing: 0.01em;
}

::selection { background: var(--accent); color: var(--paper); }

/* ——— Masthead ——— */
.masthead {
  border-bottom: 1px solid var(--ink);
  padding: 1.25rem var(--page-pad-x) 1rem;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 1rem;
  align-items: end;
}

.masthead .mark {
  font-family: var(--font-num);
  font-weight: 900;
  letter-spacing: -0.02em;
  font-size: 0.95rem;
  text-transform: uppercase;
}
.masthead .mark em {
  color: var(--accent);
  font-style: normal;
}

.masthead .meta {
  font-family: var(--font-num);
  font-size: 0.75rem;
  color: var(--ink-faint);
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.masthead a {
  color: inherit;
  text-decoration: none;
  border-bottom: 1px solid transparent;
}
.masthead a:hover { border-bottom-color: var(--accent); }

/* ——— Cover ——— */
.cover {
  padding: clamp(3rem, 8vh, 5rem) var(--page-pad-x) clamp(2rem, 5vh, 3.5rem);
  border-bottom: 1px solid var(--rule);
}

.cover-inner {
  max-width: var(--measure);
  margin: 0 auto;
}

.cover .eyebrow {
  font-family: var(--font-num);
  font-size: 0.72rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--ink-faint);
  margin-bottom: 1.75rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
}
.cover .eyebrow::before {
  content: "";
  width: 2rem;
  height: 1px;
  background: var(--accent);
}

h1.title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(1.4rem, 2.6vw, 1.9rem);
  line-height: 1.45;
  letter-spacing: 0.005em;
  margin: 0;
  max-width: 28ch;
  text-wrap: balance;
  color: var(--ink);
}

h1.title em {
  font-style: normal;
  color: var(--accent);
}

.cover .byline {
  margin: 2.25rem 0 0;
  padding-top: 1.25rem;
  border-top: 1px solid var(--rule);
  display: flex;
  gap: 2rem;
  flex-wrap: wrap;
  font-family: var(--font-num);
}

.byline .k {
  font-size: 0.65rem;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: var(--ink-faint);
  display: block;
  margin-bottom: 0.25rem;
}
.byline .v {
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--ink);
}

/* ——— Article body ——— */
article {
  padding: clamp(2.5rem, 6vh, 4rem) var(--page-pad-x) clamp(4rem, 10vh, 7rem);
}

.prose {
  max-width: var(--measure);
  margin: 0 auto;
}

.prose > * + * { margin-top: var(--gap); }
.prose > :first-child { margin-top: 0; }
/* Only zero the bottom margin. A full `margin: 0` here out-specifies the gap rule above
   and collapses every paragraph in a scene into one block (bug found 2026-09-16). */
.prose p { margin-bottom: 0; }

/* HR — line + label + line (report's hr-mark essence) */
.prose hr {
  border: none;
  text-align: center;
  font-family: var(--font-num);
  color: var(--ink-faint);
  letter-spacing: 0.3em;
  margin: 2.5rem 0;
  font-size: 0.65rem;
  text-transform: uppercase;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
}
.prose hr::before, .prose hr::after {
  content: "";
  flex: 0 0 2.5rem;
  height: 1px;
  background: var(--rule);
}
.prose hr::before { content: "·"; flex: 0; color: var(--accent); font-size: 1rem; line-height: 0; }
/* drop the duplicate ::before override — use the two pseudo elements simply */

/* Cleaner override: single dot mark */
.prose hr {
  border: none;
  margin: 2.75rem 0;
  text-align: center;
  height: 1px;
  background: linear-gradient(to right,
    transparent 0,
    var(--rule) 30%,
    var(--rule) 48%,
    transparent 48%,
    transparent 52%,
    var(--rule) 52%,
    var(--rule) 70%,
    transparent 100%);
  position: relative;
  overflow: visible;
}
.prose hr::after {
  content: "·";
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: var(--bg);
  color: var(--accent);
  padding: 0 0.6rem;
  font-size: 1.4rem;
  line-height: 0;
}

/* Inline code */
.prose code {
  font-family: var(--font-mono);
  font-size: 0.85em;
  background: var(--code-bg);
  padding: 1px 6px;
  border-radius: 2px;
  border: 1px solid var(--rule);
  color: var(--ink);
}

/* Code blocks */
.prose pre {
  background: var(--ink);
  color: oklch(0.92 0.003 95);
  border-radius: 2px;
  padding: 1.1rem 1.25rem;
  overflow-x: auto;
  font-size: 0.78rem;
  line-height: 1.75;
  font-family: var(--font-mono);
  margin: 1.5rem 0;
  position: relative;
}
.prose pre[data-lang]::before {
  content: attr(data-lang);
  position: absolute;
  top: 0;
  right: 0;
  background: var(--accent);
  color: var(--paper);
  font-family: var(--font-mono);
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.15em;
  padding: 0.2rem 0.55rem;
  text-transform: uppercase;
}
.prose pre code {
  background: none;
  border: none;
  padding: 0;
  color: inherit;
  font-size: inherit;
}

/* Lists — accent dash markers (report essence) */
.prose ul {
  margin-bottom: 0;
  padding: 0;
  list-style: none;
}
.prose ul li {
  position: relative;
  padding-left: 1.5rem;
  margin-top: 0.5rem;
}
.prose ul li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.95em;
  width: 0.6rem;
  height: 1px;
  background: var(--accent);
}

/* Strong / emphasis */
.prose strong { font-weight: 700; color: var(--ink); }
.prose em.accent { font-style: normal; color: var(--accent); font-weight: 500; }

/* ——— Footer ——— */
.colo-foot {
  padding: 1.5rem var(--page-pad-x);
  border-top: 1px solid var(--rule);
  font-family: var(--font-num);
  font-size: 0.65rem;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  color: var(--ink-faint);
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}

.colo-foot a {
  color: inherit;
  text-decoration: none;
  border-bottom: 1px solid transparent;
}
.colo-foot a:hover { border-bottom-color: var(--accent); }

/* Responsive */
@media (max-width: 720px) {
  body { font-size: 15.5px; line-height: 1.85; }
  .cover .byline { gap: 1.25rem; }
}

/* =====================================================================
   Added 2026-09-15 for the preview site build (build.mjs).
   Elements the original design did not cover: headings inside articles,
   tables, ordered lists, blockquotes, links, post nav — plus the index
   list styles that used to live inline in the sample index.html.
   ===================================================================== */

/* ——— Headings inside articles ——— */
.prose h2 {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.2rem;
  line-height: 1.5;
  letter-spacing: 0.005em;
  margin-top: 3rem;
  padding-top: 1rem;
  position: relative;
}
.prose h2::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 1.5rem;
  height: 1px;
  background: var(--accent);
}
.prose h3 {
  font-family: var(--font-body);
  font-weight: 700;
  font-size: 1rem;
  line-height: 1.6;
  margin-top: 2.25rem;
  color: var(--ink);
}
.prose hr + h2 { margin-top: 0; }

/* ——— Ordered lists ——— */
.prose ol {
  margin-bottom: 0;
  padding: 0;
  list-style: none;
  counter-reset: item;
}
.prose ol li {
  position: relative;
  padding-left: 1.75rem;
  margin-top: 0.5rem;
  counter-increment: item;
}
.prose ol li::before {
  content: counter(item, decimal-leading-zero);
  position: absolute;
  left: 0;
  top: 0.15em;
  font-family: var(--font-num);
  font-weight: 700;
  font-size: 0.75rem;
  color: var(--accent);
  letter-spacing: 0.02em;
}
.prose li > p { margin: 0; }
.prose li ul, .prose li ol { margin-top: 0.25rem; }

/* ——— Tables ——— */
.prose table {
  width: 100%;
  border-collapse: collapse;
  margin: 1.5rem 0;
  font-size: 0.9rem;
  line-height: 1.6;
  border-top: 1px solid var(--ink);
  border-bottom: 1px solid var(--ink);
}
.prose thead th {
  font-family: var(--font-num);
  font-weight: 600;
  font-size: 0.68rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--ink-faint);
  text-align: left;
  padding: 0.6rem 0.75rem 0.5rem;
  border-bottom: 1px solid var(--rule);
}
.prose td {
  padding: 0.6rem 0.75rem;
  border-bottom: 1px solid var(--rule-soft);
  vertical-align: top;
}
.prose tbody tr:last-child td { border-bottom: none; }
.prose th:first-child, .prose td:first-child { padding-left: 0; }
.prose th:last-child, .prose td:last-child { padding-right: 0; }
.prose table code { white-space: nowrap; }

/* ——— Blockquote ——— */
.prose blockquote {
  margin: 1.5rem 0;
  padding: 0.25rem 0 0.25rem 1.25rem;
  border-left: 2px solid var(--accent);
  color: var(--ink-soft);
}
.prose blockquote > * + * { margin-top: 0.75rem; }

/* ——— Links in prose ——— */
.prose a {
  color: var(--ink);
  text-decoration: none;
  border-bottom: 1px solid var(--accent);
  transition: background .15s;
}
.prose a:hover { background: var(--accent-soft); }

/* ——— Prev / next ——— */
.post-nav {
  max-width: var(--measure-box);
  margin: 0 auto;
  padding: 0 var(--page-pad-gutter) clamp(3rem, 8vh, 5rem);
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2rem;
}
.post-nav a {
  text-decoration: none;
  color: inherit;
  border-top: 1px solid var(--rule);
  padding-top: 1rem;
  font-family: var(--font-num);
}
.post-nav a.next { text-align: right; }
.post-nav .k {
  display: block;
  font-size: 0.65rem;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: var(--ink-faint);
  margin-bottom: 0.35rem;
}
.post-nav .v {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.9rem;
  line-height: 1.5;
  color: var(--ink);
}
.post-nav a:hover .v { color: var(--accent); }
@media (max-width: 720px) {
  .post-nav { grid-template-columns: 1fr; gap: 1rem; }
  .post-nav a.next { text-align: left; }
}

/* ——— Index list (moved from the sample index.html) ——— */
.picker {
  padding: clamp(2rem, 6vh, 4rem) var(--page-pad-gutter) clamp(4rem, 10vh, 7rem);
  max-width: var(--measure-box);
  margin: 0 auto;
}
.group-label {
  font-family: var(--font-num);
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.2em;
  color: var(--ink-faint);
  margin: 2rem 0 0.5rem;
}
.pick {
  display: grid;
  grid-template-columns: 3rem 1fr auto;
  align-items: baseline;
  gap: 1.25rem;
  padding: 1.1rem 0;
  border-top: 1px solid var(--rule);
  text-decoration: none;
  color: inherit;
  transition: padding-left .2s;
}
.pick.last { border-bottom: 1px solid var(--rule); }
.pick:hover { padding-left: 0.5rem; }
.pick .no {
  font-family: var(--font-num);
  font-weight: 900;
  font-size: 0.85rem;
  color: var(--accent);
  letter-spacing: -0.02em;
}
.pick h2 {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.05rem;
  line-height: 1.4;
  color: var(--ink);
}
.pick h2 .sub {
  display: block;
  font-family: var(--font-body);
  font-size: 0.78rem;
  font-weight: 400;
  color: var(--ink-faint);
  margin-top: 0.25rem;
}
.pick .arrow {
  font-family: var(--font-num);
  color: var(--ink-faint);
}

/* Tags in the byline (added 2026-09-16) */
.byline .v.tags { font-family: var(--font-body); font-weight: 400; word-spacing: 0.4em; }

/* Index summary + tag-only byline (added 2026-09-17) */
.pick h2 .sub { line-height: 1.7; margin-top: 0.4rem; }
.cover .eyebrow { font-variant-numeric: tabular-nums; }
.tag { white-space: nowrap; }

/* =====================================================================
   Added 2026-09-17: nav, author box, tag links/pages, pinned slot,
   phrase-aware line breaks, heading accent.
   ===================================================================== */

/* Titles/headings break at phrase boundaries (Chrome/Edge; others ignore the value). */
h1.title, .pick h2, .post-nav .v, .prose h2, .prose h3 { word-break: auto-phrase; }

/* Body-heading accent, automatic (no per-heading markup — works as-is in WordPress too):
   first letter picks up the brand red, echoing the masthead's <em>H</em>. */
.prose h2::first-letter { color: var(--accent); }

/* ——— Index site nav ——— */
.site-nav {
  display: flex;
  gap: 1.5rem;
  flex-wrap: wrap;
  font-family: var(--font-num);
  font-size: 0.75rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}
.site-nav a {
  color: var(--ink-soft);
  text-decoration: none;
  border-bottom: 1px solid transparent;
}
.site-nav a:hover { color: var(--ink); border-bottom-color: var(--accent); }

/* ——— Tag links ——— */
.tag { white-space: nowrap; }
a.tag {
  color: var(--ink-soft);
  text-decoration: none;
  border-bottom: 1px solid var(--rule);
  transition: color .15s, border-color .15s;
}
a.tag:hover { color: var(--accent); border-bottom-color: var(--accent); }

/* Tag pages list full dates in the left column */
.pick.wide-no { grid-template-columns: 6rem 1fr auto; }
.pick.wide-no .no { font-weight: 500; color: var(--ink-faint); }

/* ——— Author box ——— */
.author {
  max-width: var(--measure-box);
  margin: 0 auto;
  padding: 0 var(--page-pad-gutter) 3rem;
}
.author-inner {
  border-top: 1px solid var(--ink);
  padding-top: 1.5rem;
}
.author .k {
  font-family: var(--font-num);
  font-size: 0.65rem;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  color: var(--ink-faint);
  display: block;
  margin-bottom: 0.75rem;
}
.author .name {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.05rem;
  margin-bottom: 0.5rem;
}
.author p {
  margin: 0 0 1rem;
  font-size: 0.88rem;
  line-height: 1.85;
  color: var(--ink-soft);
  max-width: 34rem;
}
.author .links {
  display: flex;
  gap: 1.5rem;
  font-family: var(--font-num);
  font-size: 0.75rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}
.author .links a {
  color: var(--ink);
  text-decoration: none;
  border-bottom: 1px solid var(--accent);
}
.author .links a:hover { background: var(--accent-soft); }

/* ——— Pinned slot at the top of the index ——— */
.pinned-pick {
  display: block;
  text-decoration: none;
  color: inherit;
  border: 1px solid var(--ink);
  padding: 1.4rem 1.6rem 1.5rem;
  margin: 1rem 0 2.5rem;
  position: relative;
  background: var(--paper);
  transition: border-color .15s;
}
.pinned-pick:hover { border-color: var(--accent); }
.pinned-pick .pin-label {
  font-family: var(--font-num);
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--paper);
  background: var(--accent);
  padding: 0.25rem 0.6rem;
  position: absolute;
  top: -0.75rem;
  left: 1.25rem;
}
.pinned-pick h2 {
  margin: 0.25rem 0 0.4rem;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.1rem;
  line-height: 1.5;
}
.pinned-pick p {
  margin: 0;
  font-size: 0.82rem;
  line-height: 1.75;
  color: var(--ink-faint);
}

/* Masthead: keep the mark on one line; nav wraps under it on narrow screens instead. */
.masthead { grid-template-columns: auto 1fr; }
.masthead .mark { white-space: nowrap; }
.masthead .meta, .masthead .site-nav { justify-self: end; justify-content: flex-end; }
@media (max-width: 540px) {
  .masthead { grid-template-columns: 1fr; }
  .masthead .meta, .masthead .site-nav { justify-self: start; justify-content: flex-start; }
}

/* ——— 2026-09-17b: article-title first letter in brand red; SNS icons ——— */
.cover-article h1.title::first-letter { color: var(--accent); }
.icon { width: 1.1em; height: 1.1em; fill: currentColor; vertical-align: -0.18em; }
a.sns { color: var(--ink-soft); text-decoration: none; border-bottom: none !important; }
a.sns:hover { color: var(--accent); }
.site-nav a.current { color: var(--ink); border-bottom-color: var(--ink); }
.author .links a.sns { border-bottom: none; }
.author .links a.sns:hover { background: none; }
