/* Stardust Log — shared stylesheet */

:root{
  --bg: #0b0e1a;
  --bg-panel: #12162a;
  --line: rgba(233,231,242,0.12);
  --line-strong: rgba(233,231,242,0.16);
  --text: #e9e7f2;
  --text-muted: #9c9ab8;
  --text-faint: #85839f;
  --violet: #8481c4;
  --teal: #5c9a92;
  --ember: #cf9d6c;
  --accent: var(--violet);
}

/* per-article accent themes — layout/type stay shared, only the accent
   color (tag, link hover, motif dot) shifts by topic. Applied via a
   "cat-*" class on the post-list <article> (index.html) or the page
   <div class="wrap"> (posts/*.html). */
.cat-ai{      --accent: #8481c4; }  /* AI・機械学習 — violet */
.cat-space{   --accent: #6f8fc9; }  /* 宇宙・天文学 — starlight blue */
.cat-bio{     --accent: #5c9a92; }  /* 生命科学・医療 — teal */
.cat-energy{  --accent: #cf9d6c; }  /* エネルギー・材料科学 — ember */
.cat-quantum{ --accent: #6db8c4; }  /* 量子コンピューティング — ice cyan */
.cat-robotics{--accent: #b98a5e; }  /* ロボティクス — bronze */
.cat-neuro{   --accent: #a97fb0; }  /* 脳科学・神経科学 — orchid */
.cat-climate{ --accent: #6fae7c; }  /* 気候テクノロジー — leaf green */
.cat-semicon{ --accent: #8a93a8; }  /* 半導体 — silicon gray-blue */

*{ box-sizing: border-box; }

html{ background: var(--bg); }

body{
  margin:0;
  background: var(--bg);
  color: var(--text);
  font-family: 'Noto Sans JP', sans-serif;
  font-weight: 400;
  line-height: 1.9;
  -webkit-font-smoothing: antialiased;
}

.serif{ font-family: 'Shippori Mincho', serif; }
.en{ font-family: 'EB Garamond', serif; }

a{ color: inherit; }
img{ max-width: 100%; }
::selection{ background: rgba(132,129,196,0.35); }

.wrap{ max-width: 980px; margin: 0 auto; padding: 0 40px; position: relative; }

/* header, shared on every page */
header{
  display:flex; justify-content: space-between; align-items: baseline;
  padding: 44px 0 60px;
  border-bottom: 1px solid var(--line);
}
.brand{ text-decoration: none; }
.brand .en{ font-size: 22px; letter-spacing: 0.12em; color: var(--text); }
.brand p{ margin: 6px 0 0; font-size: 12.5px; color: var(--text-faint); letter-spacing: 0.04em; }
nav{ display:flex; gap: 32px; font-size: 13.5px; color: var(--text-muted); }
nav a{ color: inherit; text-decoration: none; border-bottom: 1px solid transparent; padding-bottom: 3px; transition: border-color 0.3s, color 0.3s; }
nav a:hover{ color: var(--text); border-color: var(--line-strong); }

/* hero (index only) */
.hero{ position: relative; padding: 90px 0 110px; overflow: hidden; }
.glow{
  position: absolute; top: -160px; right: -220px; width: 620px; height: 620px;
  background: radial-gradient(circle at 40% 40%, rgba(132,129,196,0.30), rgba(207,157,108,0.12) 45%, transparent 70%);
  filter: blur(30px);
  pointer-events: none;
}
.ring{
  position: absolute; top: 40px; right: -60px; width: 340px; height: 340px;
  border: 1px solid rgba(233,231,242,0.10);
  border-radius: 50%;
  transform: rotate(-18deg);
  pointer-events: none;
}
.stars{ position: absolute; inset: 0; pointer-events: none; }
.star{ position: absolute; border-radius: 50%; background: var(--text); }

.hero-inner{ position: relative; max-width: 560px; }
.hero h1{
  font-size: 38px; font-weight: 600; margin: 0 0 26px; letter-spacing: 0.02em;
  line-height: 1.65;
}
.hero p{ font-size: 15px; color: var(--text-muted); max-width: 420px; margin: 0 0 34px; }
.hero-link{ font-size: 13.5px; color: var(--text); text-decoration: none; border-bottom: 1px solid var(--line-strong); padding-bottom: 4px; transition: color 0.3s, border-color 0.3s; }
.hero-link:hover{ color: var(--ember); border-color: var(--ember); }

main{ padding-bottom: 100px; }
.section-label{ font-size: 13px; color: var(--text-faint); margin: 0 0 30px; font-weight: 400; }

/* post list (index.html) — styled as a running log: each entry gets a
   small marker on its date, connected to the next by a thin line, like
   consecutive entries in a logbook. */
.post{
  display: grid; grid-template-columns: 100px 1fr; gap: 28px;
  padding: 30px 0; border-top: 1px solid var(--line);
  position: relative;
}
.post:last-child{ border-bottom: 1px solid var(--line); }
.post time{
  font-size: 12.5px; color: var(--text-faint); letter-spacing: 0.03em; padding-top: 4px;
  position: relative; padding-left: 15px;
}
.post time::before{
  content: ''; position: absolute; left: 0; top: 5px; width: 6px; height: 6px;
  border-radius: 50%; background: var(--accent);
}
.post time::after{
  content: ''; position: absolute; left: 2.5px; top: 15px; bottom: -31px; width: 1px;
  background: var(--line-strong);
}
.post:last-child time::after{ display: none; }
.post h2{ font-size: 19px; font-weight: 600; margin: 0 0 10px; letter-spacing: 0.01em; }
.post h2 a{ color: var(--text); text-decoration: none; }
.post h2 a:hover{ color: var(--accent); }
.post .excerpt{ font-size: 13.5px; color: var(--text-muted); margin: 0; max-width: 520px; }
.post .tag{ display:inline-block; font-size: 11.5px; color: var(--accent); margin-top: 12px; letter-spacing: 0.03em; }

.empty-note{
  color: var(--text-faint); font-size: 13.5px; padding: 30px 0; border-top: 1px solid var(--line);
}

/* article pages (posts/*.html) */
.back-link{
  display:inline-block; font-size: 13px; color: var(--text-muted); text-decoration: none;
  margin: 44px 0 20px; border-bottom: 1px solid transparent; padding-bottom: 3px;
  transition: color 0.3s, border-color 0.3s;
}
.back-link:hover{ color: var(--text); border-color: var(--line-strong); }

article.post-body{ padding-bottom: 100px; max-width: 640px; }
.post-head time{ font-size: 12.5px; color: var(--text-faint); letter-spacing: 0.03em; }
.post-head .tag{ display:inline-block; font-size: 11.5px; color: var(--accent); letter-spacing: 0.03em; margin-left: 14px; }
.tag::before{
  content: ''; display: inline-block; width: 5px; height: 5px; margin-right: 7px;
  border-radius: 50%; background: var(--accent); vertical-align: middle;
}
article.post-body h1{
  font-size: 32px; font-weight: 600; line-height: 1.6; letter-spacing: 0.01em;
  margin: 20px 0 40px;
}
article.post-body h2{
  font-size: 19px; font-weight: 600; letter-spacing: 0.01em;
  margin: 46px 0 18px;
}
article.post-body p{ font-size: 15px; color: var(--text); margin: 0 0 22px; }
article.post-body p.lead{ color: var(--text-muted); }

.sources{ margin-top: 54px; padding-top: 28px; border-top: 1px solid var(--line); }
.sources h4{
  font-size: 12px; color: var(--text-faint); letter-spacing: 0.08em; text-transform: uppercase;
  font-weight: 400; margin: 0 0 14px;
}
.sources ol{ margin: 0; padding-left: 1.2em; font-size: 13px; color: var(--text-muted); }
.sources li{ margin-bottom: 8px; }
.sources a{ color: var(--text-muted); text-decoration: none; border-bottom: 1px solid var(--line-strong); }
.sources a:hover{ color: var(--accent); border-color: var(--accent); }

/* popular-posts widget & related-posts (added for on-site navigation) */
.widget{ margin-top: 60px; padding-top: 28px; border-top: 1px solid var(--line); }
.widget-title{
  font-size: 12px; color: var(--text-faint); letter-spacing: 0.08em; text-transform: uppercase;
  font-weight: 400; margin: 0 0 18px;
}
.widget-list{ list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 13px; }
.widget-list a{
  display: flex; gap: 12px; align-items: baseline; color: var(--text); text-decoration: none;
  font-size: 14px; line-height: 1.6;
}
.widget-list a:hover{ color: var(--accent); }
.widget-list .wnum{ font-family: 'EB Garamond', serif; font-size: 12.5px; color: var(--text-faint); flex-shrink: 0; }

.related-posts{ margin-top: 54px; padding-top: 28px; border-top: 1px solid var(--line); }
.related-grid{ display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 22px 24px; }
.related-card a{ color: var(--text); text-decoration: none; font-size: 14px; font-weight: 500; line-height: 1.6; }
.related-card a:hover{ color: var(--accent); }
.related-card .tag{ display: block; margin-top: 8px; font-size: 11.5px; color: var(--accent); letter-spacing: 0.03em; }

footer{
  border-top: 1px solid var(--line); padding: 30px 0 50px;
  display: flex; justify-content: space-between; align-items: center;
  font-size: 12px; color: var(--text-faint);
}
footer a{ color: var(--text-faint); text-decoration: none; }
footer a:hover{ color: var(--text-muted); }

@media (max-width: 640px){
  .wrap{ padding: 0 22px; }
  header{ flex-direction: column; align-items: flex-start; gap: 18px; }
  nav{ gap: 20px; }
  .hero{ padding: 60px 0 70px; }
  .hero h1{ font-size: 28px; }
  .glow{ width: 380px; height: 380px; right: -160px; }
  .post{ grid-template-columns: 1fr; gap: 8px; }
  .post time::after{ display: none; }
  article.post-body h1{ font-size: 26px; }
  .related-grid{ grid-template-columns: 1fr; }
}

/* hero の星の明滅。以前は index.html のインラインscriptが動的に <style> を
   挿入していたが、CSP(style-src 'self')適用のためここへ移設した(2026-09-04) */
@keyframes twinkle{0%,100%{opacity:0.15}50%{opacity:0.75}}


/* 購読ブロック(記事末尾・一覧ページ末尾)。読み終えた人が次に取れる行動を
   「別の記事を読む」以外にも用意するために追加した(2026-09-04) */
.subscribe{
  margin: 52px 0 0;
  padding: 26px 28px;
  background: var(--bg-panel);
  border: 1px solid var(--line);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}
.subscribe p{ margin: 0; }
.subscribe-lead{ font-size: 13.5px; color: var(--text-muted); letter-spacing: 0.02em; line-height: 1.8; }
.subscribe-links{ display: flex; gap: 10px; flex-wrap: wrap; }
.subscribe-btn{
  display: inline-block;
  font-size: 12.5px;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  text-decoration: none;
  padding: 8px 17px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  white-space: nowrap;
  transition: color 0.3s, border-color 0.3s, background 0.3s;
}
.subscribe-btn:hover{ color: var(--text); border-color: var(--accent); background: rgba(132,129,196,0.10); }

@media (max-width: 640px){
  .subscribe{ flex-direction: column; align-items: flex-start; padding: 22px 20px; }
}

/* いいね・コメント欄(記事ページ・年表ページ)。
   2026-08-31 の機能実装時から、このブロックのスタイルがどのCSSファイルにも
   入っていないまま公開されていた。ボタンとフォームがブラウザ既定の見た目
   (Arial・outsetの灰色ボタン)で出ていたのを 2026-09-17 に追加して直した。
   CSP対応(2026-09-04)でインラインstyleを撤去したときの移設漏れと思われる。 */
.social{ margin-top: 60px; padding-top: 30px; border-top: 1px solid var(--line); }

.like-row{ display: flex; align-items: center; flex-wrap: wrap; gap: 12px; }
.like-btn{
  display: inline-flex; align-items: center; gap: 8px;
  font-family: inherit; font-size: 12.5px; font-weight: 400; letter-spacing: 0.05em;
  color: var(--text-muted); background: transparent;
  padding: 8px 17px; border: 1px solid var(--line-strong); border-radius: 999px;
  cursor: pointer; white-space: nowrap;
  transition: color 0.3s, border-color 0.3s, background 0.3s;
}
.like-btn:hover{ color: var(--text); border-color: var(--accent); background: rgba(132,129,196,0.10); }
.like-btn:disabled{ opacity: 0.55; cursor: default; }
.like-icon{ fill: none; stroke: currentColor; stroke-width: 1.5; flex-shrink: 0; transition: fill 0.3s; }
.like-btn.is-liked{ color: var(--accent); border-color: var(--accent); }
.like-btn.is-liked .like-icon{ fill: currentColor; }
.like-count{ font-family: 'EB Garamond', serif; font-size: 14px; color: var(--text-faint); }

.comments{ margin-top: 46px; }
.comments-title{ font-size: 17px; font-weight: 600; letter-spacing: 0.01em; margin: 0 0 22px; }
.comment-list{ margin-bottom: 38px; }
.comment-empty{ margin: 0; font-size: 13.5px; color: var(--text-faint); }
.comment-item{ padding: 18px 0; border-top: 1px solid var(--line); }
.comment-item:last-child{ border-bottom: 1px solid var(--line); }
.comment-item-meta{ display: flex; align-items: baseline; gap: 14px; margin-bottom: 4px; }
.comment-item-name{ font-size: 13px; color: var(--text); letter-spacing: 0.02em; }
.comment-item-date{ font-family: 'EB Garamond', serif; font-size: 12px; color: var(--text-faint); }
.comment-item-body{ margin: 0; font-size: 14px; color: var(--text-muted); white-space: pre-wrap; }

.comment-form{ padding: 26px 28px; background: var(--bg-panel); border: 1px solid var(--line); }
.comment-form-row{ margin-bottom: 18px; }
.comment-form-row label{
  display: block; font-size: 12px; color: var(--text-faint);
  letter-spacing: 0.05em; margin-bottom: 8px;
}
.comment-form input[type="text"], .comment-form textarea{
  display: block; width: 100%;
  font-family: inherit; font-size: 14px; font-weight: 400; line-height: 1.8;
  color: var(--text); background: rgba(11,14,26,0.55);
  border: 1px solid var(--line-strong); border-radius: 2px;
  padding: 10px 13px;
  transition: border-color 0.3s;
}
.comment-form input[type="text"]:focus, .comment-form textarea:focus{ outline: none; border-color: var(--accent); }
.comment-form input[type="text"]::placeholder, .comment-form textarea::placeholder{ color: var(--text-faint); opacity: 1; }
.comment-form textarea{ resize: vertical; min-height: 96px; }
.comment-form button[type="submit"]{
  font-family: inherit; font-size: 12.5px; letter-spacing: 0.05em;
  color: var(--text-muted); background: transparent;
  padding: 9px 22px; border: 1px solid var(--line-strong); border-radius: 999px;
  cursor: pointer;
  transition: color 0.3s, border-color 0.3s, background 0.3s;
}
.comment-form button[type="submit"]:hover{ color: var(--text); border-color: var(--accent); background: rgba(132,129,196,0.10); }
.comment-form button[type="submit"]:disabled{ opacity: 0.55; cursor: default; }

/* ハニーポット(スパム判定用の罠)。読者からは見えてはいけない。
   ここが見えていたせいで「ウェブサイト」欄が全ページに露出していた。 */
.hp-field{
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

.comment-form-status{ margin: 14px 0 0; font-size: 12.5px; color: var(--text-muted); min-height: 1.2em; }
.comment-form-status.is-error{ color: var(--ember); }
.comment-form-note{ margin: 10px 0 0; font-size: 11.5px; color: var(--text-faint); }

@media (max-width: 640px){
  .comment-form{ padding: 22px 20px; }
  .comments-title{ font-size: 16px; }
}


/* ── 2026-09-18 読みやすさの改修(v5) ─────────────────────────
   ダークな背景では明るい文字が光ってにじみ、実際より細く見える。
   そのため body を 300 から 400 にした(Noto Sans JP は 400 も読み込み済み)。
   --text-faint は #0b0e1a に対するコントラスト比が 3.67 しかなく
   WCAG AA(4.5)を下回っていたので 5.2 まで明るくした。
   記事本文のリンクは下線だけで色が付いていなかったので、
   下線にアクセント色を与えた(記事のカテゴリごとに色が変わる)。 */

.post-body a{
  text-decoration-color: var(--accent);
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
  transition: color 0.3s;
}
.post-body a:hover{ color: var(--accent); }

.post{ transition: background-color 0.35s; }
.post:hover{ background-color: rgba(233,231,242,0.022); }


/* ── 2026-09-18 アクセシビリティ(v6) ─────────────────────────
   キーボードだけで来た人が nav の4項目を飛ばして本文へ行けるようにした。
   リンクは画面外に置き、フォーカスが当たったときだけ左上に現れる。
   飛び先は各ページの </header> 直後に置いた <a id="main" tabindex="-1">。
   動きを減らす設定にしている人には、トップの星の明滅と
   ホバーの遷移を止める(CSPの制約でJSは使わない)。 */

.skip-link{ position: absolute; left: -9999px; top: 0; z-index: 100; }
.skip-link:focus{
  left: 10px; top: 10px;
  background: var(--bg-panel); color: var(--text);
  padding: 10px 18px; border: 1px solid var(--accent); border-radius: 2px;
  font-size: 13px; letter-spacing: 0.03em; text-decoration: none;
}

@media (prefers-reduced-motion: reduce){
  *, *::before, *::after{
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* ── 演出と仕上げ(2026-09-25 追加。?v=7) ─────────────────────
   どれも CSS だけで動き、対応していないブラウザでは何も起きない(従来どおり)。 */

/* (1) ページを移るときのなめらかな切り替え(ページをまたぐ View Transitions)。
   header はページをまたいで動かさず、本文だけがふわっと入れ替わる。
   「動きを減らす」設定では切り替えそのものを行わない(下の @media)。 */
@view-transition{ navigation: auto; }
header{ view-transition-name: site-header; }
::view-transition-group(site-header){ animation-duration: 0s; }
::view-transition-old(site-header){ display: none; }
::view-transition-new(site-header){ animation: none; }
::view-transition-old(root){ animation: vt-out 0.2s ease-in both; }
::view-transition-new(root){ animation: vt-in 0.4s cubic-bezier(0.2, 0.7, 0.2, 1) both; }
@keyframes vt-out{ to{ opacity: 0; } }
@keyframes vt-in{ from{ opacity: 0; transform: translateY(8px); } }

/* (3) 記事ページの読み進めた量を、画面の上端に細い線で出す(色は記事のカテゴリ色)。
   記事本文(article.post-body)が画面を覆い始めてから読み終わるまでで 0→100%。
   about も post-body を使うが、記事ページだけ .wrap に cat- クラスが付くので区別できる。
   timeline-scope で名前付きタイムラインを .wrap まで持ち上げ、.wrap の ::before から参照する。 */
@supports (animation-timeline: view()){
  .wrap[class*="cat-"]:has(> article.post-body){ timeline-scope: --article; }
  .wrap[class*="cat-"] > article.post-body{ view-timeline: --article block; }
  .wrap[class*="cat-"]:has(> article.post-body)::before{
    content: ""; position: fixed; top: 0; left: 0; right: 0; height: 2px; z-index: 90;
    background: var(--accent); transform-origin: 0 50%; transform: scaleX(0);
    pointer-events: none;
    animation: read-progress linear both;
    animation-timeline: --article;
    animation-range: contain 0% contain 100%;
  }
}
@keyframes read-progress{ to{ transform: scaleX(1); } }

/* (4) 見出しの改行を整える。日本語は文節の区切りで折り返し(word-break: auto-phrase)、
   日英とも行の長さをそろえる(text-wrap: balance)。
   「距/離」のように単語の途中で割れるのを防ぐ。 */
h1, h2, h3, .related-card a, .tl-card-title{ text-wrap: balance; }
:lang(ja) :is(h1, h2, h3, .related-card a, .tl-card-title){ word-break: auto-phrase; }

@media (prefers-reduced-motion: reduce){
  @view-transition{ navigation: none; }
}

/* ── 背景の透かし(2026-09-25 追加。?v=8) ─────────────────────
   全ページ共通。画面の右下に、星図(同心円・赤経の線・外周の目盛り)と、
   トップ・OGP・ファビコンと同じ5点の星座を、ごく薄く敷く。
   画面に固定しているので、スクロールしても透かしは動かず、本文だけが流れる。
   body::before を position: fixed; z-index: 0 で置き、position: relative の .wrap が
   ツリー順で後に描かれるので、本文は必ず透かしの上に乗る(html と body の両方に背景色が
   あるため、z-index: -1 にすると body の背景に隠れて見えなくなる点に注意)。
   画像は SVG の data URL(CSP の img-src data: で許可されている)。
   外周の目盛りは破線の円で描いている(間隔 = 2πr/72 と 2πr/36)。 */
body::before{
  content: ""; position: fixed; inset: 0; z-index: 0; pointer-events: none;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 1000 1000'%3E%3Cg transform='translate(500 500)' fill='none' stroke='%23e9e7f2'%3E%3Ccircle r='110' stroke-opacity='.06'/%3E%3Ccircle r='200' stroke-opacity='.055'/%3E%3Ccircle r='290' stroke-dasharray='2 6' stroke-opacity='.05'/%3E%3Ccircle r='380' stroke-opacity='.05'/%3E%3Ccircle r='470' stroke-opacity='.045'/%3E%3Ccircle r='466' stroke-width='7' stroke-dasharray='1 39.666' stroke-opacity='.06'/%3E%3Ccircle r='463' stroke-width='14' stroke-dasharray='1 79.809' stroke-opacity='.06'/%3E%3Cpath d='M110 0L470 0M95 55L407 235M55 95L235 407M0 110L0 470M-55 95L-235 407M-95 55L-407 235M-110 0L-470 0M-95 -55L-407 -235M-55 -95L-235 -407M0 -110L0 -470M55 -95L235 -407M95 -55L407 -235' stroke-opacity='.03'/%3E%3C/g%3E%3Cpath d='M150 120L231 188L310 148L388 215L350 290' fill='none' stroke='%23a9adec' stroke-opacity='.1' stroke-width='1.2' stroke-linejoin='round'/%3E%3Cg fill='%23f2ecdc' fill-opacity='.14'%3E%3Ccircle cx='150' cy='120' r='2.6'/%3E%3Ccircle cx='231' cy='188' r='2.6'/%3E%3Ccircle cx='310' cy='148' r='2.6'/%3E%3Ccircle cx='388' cy='215' r='2.6'/%3E%3C/g%3E%3Ccircle cx='350' cy='290' r='3.2' fill='%23d1a862' fill-opacity='.16'/%3E%3Cg fill='%23e9e7f2' fill-opacity='.08'%3E%3Ccircle cx='98' cy='534' r='1.2'/%3E%3Ccircle cx='438' cy='96' r='1'/%3E%3Ccircle cx='623' cy='578' r='1'/%3E%3Ccircle cx='538' cy='567' r='1.5'/%3E%3Ccircle cx='380' cy='545' r='1'/%3E%3Ccircle cx='670' cy='432' r='1.2'/%3E%3Ccircle cx='570' cy='524' r='1.2'/%3E%3Ccircle cx='907' cy='426' r='1.5'/%3E%3Ccircle cx='749' cy='569' r='1.2'/%3E%3Ccircle cx='684' cy='589' r='1.5'/%3E%3Ccircle cx='717' cy='321' r='1.5'/%3E%3Ccircle cx='803' cy='298' r='1.2'/%3E%3Ccircle cx='284' cy='685' r='1'/%3E%3Ccircle cx='511' cy='185' r='1.2'/%3E%3C/g%3E%3C/svg%3E") no-repeat right -260px bottom -300px / 900px 900px;
}
@media (max-width: 640px){
  body::before{ background-position: right -300px bottom -330px; background-size: 640px 640px; }
}
@media print{
  body::before{ display: none; }
}

/* ── 2026-09-27 nav を5項目に(用語辞典を追加)。?v=9 ─────────────
   5項目でも1行に収まるように、項目の中で折り返さない・狭い幅では間隔と文字を少し詰める。
   実測: 375px幅で nav 313px(使える幅331px)、645px幅でもブランド名と重ならない。
   さらに狭い端末では、項目単位で2行目に送る(語の途中では切れない)。 */
nav a{ white-space: nowrap; }
@media (min-width: 641px) and (max-width: 820px){ nav{ gap: 20px; } }
@media (max-width: 640px){ nav{ gap: 8px 12px; flex-wrap: wrap; font-size: 13px; } }

/* ── 2026-09-30 nav の末尾に検索(虫眼鏡)。?v=10 ─────────────
   リンク先は search.html(英語版 en/search.html)。アイコンだけなので aria-label と title を必ず付ける。
   640px 以下では nav が折り返すので、項目を増やさず header の右上(ブランド名の行)に置く。 */
header{ position: relative; }
@media (min-width: 641px) and (max-width: 820px){ nav{ gap: 16px; font-size: 13px; } }   /* 6項目目が増えた分。645px幅でブランド名との隙間 約35px */
nav a.nav-search{ display: inline-flex; align-items: center; justify-content: center; border-bottom: 0; padding: 0 2px 3px; }
.nav-search-icon{ width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; }
@media (max-width: 640px){
  nav a.nav-search{ position: absolute; top: 43px; right: -12px; width: 44px; height: 44px; padding: 0; }
  .nav-search-icon{ width: 18px; height: 18px; }
}

/* footer: プライバシーポリシーへのリンクを足したので、狭い幅では折り返す(v11・2026-10-03) */
footer{ flex-wrap: wrap; gap: 6px 20px; }
footer span{ white-space: nowrap; }

/* 2026-10-08 追加(?v= は上げていない。キャッシュは max-age=3600 なので1時間で行き渡る)
   - a.tag … 分野のタグをリンクにした(記事一覧の分野の見出しへ飛ぶ)
   - .notice … 記事冒頭の注記(連載「精神医学の歴史」)
   - .author-note … 記事末の「筆者のひとこと」 */
a.tag{ text-decoration: none; }
a.tag:hover{ text-decoration: underline; text-underline-offset: 3px; }
.section-label[id]{ scroll-margin-top: 24px; }
article.post-body p.notice{
  margin: 18px 0 6px; padding: 13px 18px;
  border: 1px solid var(--line-strong);
  font-size: 13px; line-height: 1.85; color: var(--text-muted);
}
article.post-body .author-note{
  margin: 48px 0 0; padding: 18px 22px 16px;
  background: var(--bg-panel); border-left: 2px solid var(--ember);
}
article.post-body .author-note p{ margin: 0 0 10px; font-size: 14.5px; }
article.post-body .author-note p:last-child{ margin-bottom: 0; }
article.post-body .author-note p.author-note-label{ margin: 0 0 8px; font-size: 12px; letter-spacing: 0.08em; color: var(--ember); }

/* ── 2026-10-12 nav に「随想 / Essays」を追加(用語辞典の次)。?v=11 のまま ─────────────
   7項目(検索の虫眼鏡を含む)になったぶん、狭い幅で間隔と文字を少し詰める。
   実測: 645px幅でブランド名との隙間 約25px(副題が2行に折り返さない)。
   375px幅で1行(nav 318px / 使える幅 331px)、360px幅でも1行。 */
@media (min-width: 641px) and (max-width: 820px){ nav{ gap: 12px; font-size: 12.5px; } }
@media (max-width: 400px){ nav{ gap: 8px 10px; font-size: 12px; } }
@media (max-width: 370px){ nav{ gap: 8px 8px; } }
