/* ==========================================================================
   リセットと基本タイポグラフィ（v4）
   文字を大きく、行間と字間をゆったりと。文章は 40em を超えて伸ばさない。
   ========================================================================== */

*,
*::before,
*::after { box-sizing: border-box; }

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--phn-header-h) + 24px);
}
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  margin: 0;
  background-color: var(--phn-ivory);
  color: var(--phn-ink);
  font-family: var(--phn-font-sans);
  font-size: var(--phn-text-base);
  font-weight: 400;
  line-height: var(--phn-leading-body);
  letter-spacing: var(--phn-tracking-body);
  font-feature-settings: "palt" 1;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

h1, h2, h3, h4, h5, h6 {
  margin: 0;
  font-family: var(--phn-font-head);
  font-weight: 700;
  line-height: var(--phn-leading-head);
  letter-spacing: var(--phn-tracking-head);
  color: var(--phn-deep);
  text-wrap: balance;
  word-break: auto-phrase; /* 対応ブラウザでは文節で折り返す（「研究テー／マ」のような分断を避ける） */
}
h1 { font-size: var(--phn-h1); line-height: 1.3; letter-spacing: 0.04em; }
h2 { font-size: var(--phn-h2); line-height: 1.4; }
h3 { font-size: var(--phn-h3); line-height: 1.5; }
h4 { font-size: var(--phn-h4); line-height: 1.6; }

p { margin: 0 0 1.25em; }
/* 日本語は文節で折り返し、行末に「す。」だけが残る状態を避ける */
p, li, dd, dt, figcaption, summary, .phn-lead, .phn-card__body, .phn-features__body {
  word-break: auto-phrase;
  text-wrap: pretty;
}
p:last-child { margin-bottom: 0; }

ul, ol { margin: 0; padding: 0; }
li { list-style: none; }

img, svg { max-width: 100%; height: auto; display: block; }

a {
  color: var(--phn-green-ink);
  text-underline-offset: 0.28em;
  text-decoration-thickness: 1px;
  transition: color var(--phn-duration) var(--phn-ease);
}
a:hover { color: var(--phn-sky-ink); }

:focus-visible {
  outline: 3px solid var(--phn-sky-ink);
  outline-offset: 3px;
  border-radius: 6px;
}

button { font: inherit; color: inherit; letter-spacing: inherit; }

strong, b { font-weight: 700; }

/* 長い英語論文名・DOI・URL が画面からはみ出さないようにする。
   日本語は文節で折り返す（auto-phrase は欧文には影響しない）。 */
.phn-breakable { overflow-wrap: anywhere; word-break: auto-phrase; line-break: strict; }

.screen-reader-text {
  position: absolute !important;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}
.screen-reader-text:focus {
  position: fixed !important;
  top: 12px; left: 12px;
  width: auto; height: auto;
  clip-path: none;
  z-index: 2000;
  padding: 12px 20px;
  background: var(--phn-deep);
  color: #fff;
  border-radius: var(--phn-radius-sm);
  font-weight: 700;
}

/* --- スマートフォン（2026-09-26）-----------------------------------------
   `word-break: auto-phrase`（文節折り返し）は、1 行に 15〜20 文字しか入らない幅では
   行末が大きく凸凹になり、段落の右側に不自然な空白が残る（「〜では、誰もが／
   自分らしく生きられるよう／…」のように、行の 3 割が空く）。
   スマートフォンでは通常の折り返しに戻し、はみ出しは overflow-wrap で防ぐ。 */
@media (max-width: 767px) {
  h1, h2, h3, h4, h5, h6,
  p, li, dd, dt, figcaption, summary,
  .phn-lead, .phn-card__body, .phn-features__body {
    word-break: normal;
    overflow-wrap: break-word;
    line-break: strict;
  }
  /* 長い URL・メールアドレスだけは、どこででも折れるようにしておく */
  .phn-breakable { overflow-wrap: anywhere; word-break: normal; }
}
