@charset "UTF-8";
/* words — 公開サイトのスタイル
   辞典らしい上品さ：白ベース・明朝(見出し/見出し語)×ゴシック(本文/UI)・朱と金の差し色。
   青紫（hue 240–290）は不使用。375px で水平オーバーフローが出ないこと（AGENTS/architecture §7）。 */

/* ---- トークン ------------------------------------------------------------ */
:root {
  --paper:      #faf8f3;   /* 温かいオフホワイト */
  --surface:    #ffffff;
  --surface-2:  #f4f1ea;
  --ink:        #2a2724;   /* 主文字（暖色寄りの黒） */
  --ink-soft:   #5d574e;   /* 副次テキスト */
  --ink-faint:  #8c857a;
  --line:       #e7e1d6;   /* 罫線（暖色ヘアライン） */
  --line-2:     #d8d0c2;
  --accent:     #9a3b34;   /* 朱（辞典のリボン） hue≈4 */
  --accent-deep:#7c2f2a;
  --gold:       #ac8a54;   /* 金の細線 hue≈38 */
  --focus:      #9a3b34;

  --serif: "Hiragino Mincho ProN", "Yu Mincho", "YuMincho", "Noto Serif JP", "MS PMincho", serif;
  --sans:  "Hiragino Kaku Gothic ProN", "Yu Gothic", "YuGothic", "Meiryo", "Noto Sans JP", system-ui, sans-serif;

  --wrap: 1000px;
  --radius: 8px;
  --shadow: 0 1px 2px rgba(42, 39, 36, .05), 0 6px 20px rgba(42, 39, 36, .05);
}

/* ---- リセット ------------------------------------------------------------ */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--sans);
  color: var(--ink);
  background: var(--paper);
  line-height: 1.75;
  font-size: 16px;
  overflow-wrap: break-word;
}
img { max-width: 100%; height: auto; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3, h4 { font-family: var(--serif); font-weight: 600; line-height: 1.35; color: var(--ink); }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; border-radius: 3px; }

.wrap { width: 100%; max-width: var(--wrap); margin-inline: auto; padding-inline: 20px; }
.visually-hidden {
  position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.skip-link {
  position: absolute; left: -9999px; top: 0; background: var(--ink); color: #fff;
  padding: 8px 14px; z-index: 100;
}
.skip-link:focus { left: 8px; top: 8px; }

/* ---- ヘッダー ------------------------------------------------------------ */
.site-header {
  background: var(--surface);
  border-bottom: 1px solid var(--line);
}
.header-inner {
  display: flex; align-items: center; gap: 16px 24px; flex-wrap: wrap;
  padding-block: 12px;
}
.brand { display: inline-flex; align-items: center; gap: 10px; color: var(--ink); }
.brand:hover { text-decoration: none; }
.brand__mark {
  font-family: var(--serif); font-size: 20px; line-height: 1;
  width: 38px; height: 38px; display: grid; place-items: center;
  background: var(--accent); color: #fff; border-radius: 6px;
}
.brand__name { font-family: var(--serif); font-size: 20px; letter-spacing: .04em; }
.site-nav { display: flex; gap: 18px; flex-wrap: wrap; margin-inline-start: 4px; }
.site-nav a { color: var(--ink-soft); font-size: 14px; }
.header-search { display: flex; gap: 6px; margin-inline-start: auto; }
.header-search input {
  font: inherit; font-size: 14px; padding: 7px 12px; border: 1px solid var(--line-2);
  border-radius: 6px; background: var(--surface); min-width: 0; width: min(220px, 46vw);
}
.header-search button {
  font: inherit; font-size: 14px; padding: 7px 14px; border: 0; border-radius: 6px;
  background: var(--ink); color: #fff; cursor: pointer;
}
.header-search button:hover { background: var(--accent-deep); }

/* ---- ヒーロー ------------------------------------------------------------ */
.hero {
  position: relative; overflow: hidden;
  /* JS 無効時の静止ポスター（CSSのみ）。暖色×淡いティールのグラデ（青紫不使用） */
  background:
    radial-gradient(120% 90% at 15% 0%, #fffdf8 0%, #f3efe6 45%, #ece6d9 100%),
    linear-gradient(180deg, #f6f2ea, #efe9dd);
  border-bottom: 1px solid var(--line);
}
.hero__canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.hero__scrim {
  position: absolute; inset: 0;
  background: radial-gradient(90% 120% at 20% 30%, rgba(255,253,248,.85) 0%, rgba(250,248,243,.55) 45%, rgba(250,248,243,.25) 100%);
}
.hero__inner { position: relative; padding-block: clamp(48px, 9vw, 92px); }
.hero__eyebrow {
  margin: 0 0 10px; font-size: 12px; letter-spacing: .22em; color: var(--gold);
  font-weight: 600;
}
.hero__title {
  margin: 0 0 16px; font-size: clamp(30px, 6vw, 52px); letter-spacing: .02em;
  color: var(--ink);
}
.hero__lead { margin: 0 0 26px; color: var(--ink-soft); font-size: clamp(15px, 2.4vw, 18px); max-width: 40em; }
.hero__search { display: flex; gap: 8px; flex-wrap: wrap; max-width: 560px; }
.hero__search input {
  flex: 1 1 240px; min-width: 0; font: inherit; font-size: 16px; padding: 13px 16px;
  border: 1px solid var(--line-2); border-radius: 8px; background: rgba(255,255,255,.92);
}
.hero__search button {
  font: inherit; font-size: 16px; padding: 13px 22px; border: 0; border-radius: 8px;
  background: var(--accent); color: #fff; cursor: pointer; font-family: var(--serif);
}
.hero__search button:hover { background: var(--accent-deep); }
.hero__count { margin: 18px 0 0; color: var(--ink-soft); font-size: 14px; }
.hero__count strong { font-family: var(--serif); font-size: 18px; color: var(--accent); }

/* ---- セクション見出し --------------------------------------------------- */
.home-section { padding-block: clamp(28px, 5vw, 48px); }
.section-head { display: flex; align-items: baseline; gap: 14px; flex-wrap: wrap; margin-bottom: 20px; }
.section-title {
  margin: 0; font-size: clamp(20px, 3.4vw, 26px); position: relative; padding-inline-start: 14px;
}
.section-title::before {
  content: ""; position: absolute; inset-inline-start: 0; top: .18em; bottom: .18em; width: 5px;
  background: var(--accent); border-radius: 3px;
}
.section-note { margin: 0; color: var(--ink-faint); font-size: 13px; }

.page-title { font-size: clamp(24px, 4.6vw, 34px); margin: 0 0 6px; }

/* ---- 用語カードグリッド（約4列） ---------------------------------------- */
.term-grid {
  list-style: none; margin: 0; padding: 0;
  display: grid; gap: 14px;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
}
.term-card {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 16px 18px; box-shadow: var(--shadow); transition: transform .12s ease, box-shadow .12s ease, border-color .12s ease;
  display: flex; flex-direction: column; gap: 8px; min-height: 0;
}
.term-card:hover { transform: translateY(-2px); border-color: var(--line-2); box-shadow: 0 2px 4px rgba(42,39,36,.06), 0 12px 28px rgba(42,39,36,.08); }
.term-card__link { display: block; color: var(--ink); }
.term-card__link:hover { text-decoration: none; }
.term-card__title { display: block; font-family: var(--serif); font-size: 18px; color: var(--ink); overflow-wrap: anywhere; line-height: 1.35; }
.term-card:hover .term-card__title { color: var(--accent); }
.term-card__reading { display: block; font-size: 12px; color: var(--ink-faint); margin-top: 3px; }
.term-card__meta { display: flex; flex-wrap: wrap; gap: 6px; }
/* 幅に応じて最大4行。サーバは先頭の地の文を渡し、… は CSS */
.term-card__snippet {
  display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 4; line-clamp: 4;
  overflow: hidden; margin: 0;
  font-size: 13px; color: var(--ink-soft); line-height: 1.65;
}
.term-card__snippet mark { background: #fbeecb; color: inherit; padding: 0 1px; border-radius: 2px; }
.term-card.is-placeholder { color: transparent; background: var(--surface-2); box-shadow: none; min-height: 120px; }
.term-card.is-placeholder::after {
  content: ""; display: block; height: 12px; width: 60%; background: var(--line); border-radius: 4px; margin-top: 8px;
}

/* ---- チップ -------------------------------------------------------------- */
.chip-list { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.chip-list--sub { margin-bottom: 22px; }
.chip {
  display: inline-block; font-size: 13px; padding: 5px 12px; border-radius: 999px;
  background: var(--surface); border: 1px solid var(--line-2); color: var(--ink-soft);
}
.chip:hover { border-color: var(--accent); color: var(--accent); text-decoration: none; }
.chip--cat { background: var(--surface-2); font-size: 12px; }
.term-chips { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.term-chips .chip { font-family: var(--serif); font-size: 14px; }

/* 分野グループ（トップ） */
.cat-groups { display: grid; gap: 22px; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }
.cat-group { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 20px; }
.cat-group__title { margin: 0 0 12px; font-size: 18px; }
.cat-group__title a { color: var(--ink); }
.cat-group__title a:hover { color: var(--accent); }

/* ---- 一覧ヘッダ・ツール ------------------------------------------------- */
.list-head { padding-block: clamp(20px, 4vw, 34px) 8px; }
.list-head__count { margin: 4px 0 0; color: var(--ink-faint); font-size: 14px; }
.list-tools { display: flex; align-items: center; gap: 8px; margin: 8px 0 20px; font-size: 14px; color: var(--ink-soft); }
.list-tools select, .search-form select {
  font: inherit; font-size: 14px; padding: 6px 10px; border: 1px solid var(--line-2);
  border-radius: 6px; background: var(--surface);
}
.empty { color: var(--ink-soft); background: var(--surface-2); border: 1px dashed var(--line-2); border-radius: var(--radius); padding: 24px; text-align: center; }

/* ---- パンくず ------------------------------------------------------------ */
.breadcrumb { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; font-size: 13px; color: var(--ink-faint); padding-top: 20px; }
.breadcrumb a { color: var(--ink-soft); }
.breadcrumb__current { color: var(--ink-faint); }

/* ---- 用語詳細 ------------------------------------------------------------ */
.term { padding-bottom: 40px; }
.term__header { padding-block: 12px 20px; border-bottom: 2px solid var(--line); margin-bottom: 26px; }
.term__title { font-size: clamp(28px, 5.6vw, 42px); margin: 6px 0 8px; }
.term__reading { margin: 0 0 10px; color: var(--ink-faint); font-size: 15px; letter-spacing: .04em; }
.term__cat { margin: 0; }
.term__body { font-size: 16.5px; }

.prose p { margin: 0 0 1.1em; }
.prose h2 { font-size: 22px; margin: 1.6em 0 .6em; padding-bottom: .2em; border-bottom: 1px solid var(--line); }
.prose h3 { font-size: 18px; margin: 1.4em 0 .5em; }
.prose h4 { font-size: 16px; margin: 1.2em 0 .5em; }
.prose ul { margin: 0 0 1.1em; padding-inline-start: 1.4em; }
.prose li { margin: .2em 0; }
.prose a { text-decoration: underline; }

.related { margin-top: 40px; padding-top: 24px; border-top: 1px solid var(--line); }
.related__heading { font-size: 20px; margin: 0 0 14px; }
.related__more { margin-top: 12px; }
.related__more summary { cursor: pointer; color: var(--ink-soft); font-size: 14px; }
.related__more summary:hover { color: var(--accent); }
.related__more .term-chips { margin-top: 12px; }

.recent { margin-top: 40px; padding-top: 24px; border-top: 1px solid var(--line); }
.recent__heading { font-size: 20px; margin: 0 0 14px; }

/* ---- 五十音索引 ---------------------------------------------------------- */
.index-rows {
  list-style: none; margin: 20px 0 0; padding: 0;
  display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
}
.index-rows--extra { grid-template-columns: repeat(auto-fill, minmax(88px, 1fr)); }
.index-subhead { font-size: 16px; margin: 34px 0 0; color: var(--ink-soft); }
.index-row a, .index-row > span:first-child { text-decoration: none; }
.index-row {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.index-row a, .index-row {
  display: flex; align-items: baseline; justify-content: space-between; gap: 8px;
}
.index-row a { padding: 16px 18px; color: var(--ink); border-radius: var(--radius); }
.index-row > span { padding: 16px 18px; }
.index-row--empty { opacity: .45; box-shadow: none; }
.index-row--empty > span { padding-block: 16px; }
.index-row__kana { font-family: var(--serif); font-size: 22px; }
.index-row__count { font-size: 13px; color: var(--ink-faint); }
.index-row a:hover { background: var(--surface-2); }
.index-row a:hover .index-row__kana { color: var(--accent); }

.row-jump { list-style: none; margin: 0 0 22px; padding: 0; display: flex; flex-wrap: wrap; gap: 6px; }
.row-jump__item {
  display: inline-block; font-family: var(--serif); font-size: 16px; width: 42px; text-align: center;
  padding: 6px 0; border: 1px solid var(--line-2); border-radius: 6px; background: var(--surface); color: var(--ink-soft);
}
.row-jump__item:hover { border-color: var(--accent); color: var(--accent); text-decoration: none; }
.row-jump__item.is-active { background: var(--accent); color: #fff; border-color: var(--accent); }

/* ---- 検索 ---------------------------------------------------------------- */
.search-form { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px; margin: 8px 0 22px; box-shadow: var(--shadow); }
.search-form__row { display: flex; gap: 8px; margin-bottom: 12px; }
.search-form__row input {
  flex: 1 1 auto; min-width: 0; font: inherit; font-size: 16px; padding: 11px 14px;
  border: 1px solid var(--line-2); border-radius: 8px; background: var(--surface);
}
.search-form__row button { font: inherit; padding: 11px 22px; border: 0; border-radius: 8px; background: var(--accent); color: #fff; cursor: pointer; font-family: var(--serif); }
.search-form__row button:hover { background: var(--accent-deep); }
.search-form__opts { display: flex; align-items: center; gap: 8px 14px; flex-wrap: wrap; font-size: 14px; color: var(--ink-soft); }
.search-summary { color: var(--ink-soft); margin: 0 0 16px; }
.search-summary strong { color: var(--ink); }
.search-hint { color: var(--ink-soft); }
.search-results .term-card__title { font-size: 19px; }

/* ---- ページャ ------------------------------------------------------------ */
.pager { display: flex; align-items: center; justify-content: center; gap: 16px; margin: 32px 0 8px; }
.pager__link { display: inline-block; padding: 9px 18px; border: 1px solid var(--line-2); border-radius: 8px; background: var(--surface); color: var(--ink); font-size: 14px; }
.pager__link:hover { border-color: var(--accent); color: var(--accent); text-decoration: none; }
.pager__status { font-size: 14px; color: var(--ink-faint); font-family: var(--serif); }

/* ---- 汎用ボタン --------------------------------------------------------- */
.btn {
  display: inline-block; font: inherit; font-size: 15px; padding: 11px 20px; border: 1px solid var(--accent);
  border-radius: 8px; background: var(--accent); color: #fff; cursor: pointer; font-family: var(--serif);
}
.btn:hover { background: var(--accent-deep); border-color: var(--accent-deep); text-decoration: none; }
.btn--ghost { background: transparent; color: var(--accent); }
.btn--ghost:hover { background: var(--surface-2); color: var(--accent-deep); }

/* ---- 静的ページ --------------------------------------------------------- */
.static-page { padding-block: 30px 60px; max-width: 760px; }
.static-page p, .static-page li { color: var(--ink); }
.history-clear { margin-top: 34px; padding: 22px 24px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
.history-clear h2 { margin: 0 0 10px; font-size: 18px; }
.history-clear__msg { margin-inline-start: 10px; color: var(--accent); font-size: 14px; }
.fine { color: var(--ink-faint); font-size: 13px; }

/* ---- フッター ------------------------------------------------------------ */
.site-footer { margin-top: 48px; border-top: 1px solid var(--line); background: var(--surface); }
.footer-inner { padding-block: 30px 40px; }
.footer-nav { display: flex; flex-wrap: wrap; gap: 10px 22px; margin-bottom: 14px; }
.footer-nav a { color: var(--ink-soft); font-size: 14px; }
.footer-fine { margin: 0; color: var(--ink-faint); font-size: 13px; }
.footer-fine a { color: var(--accent); text-decoration: underline; }
.portfolio-admin { margin-top: 1.25em; }

/* ---- レスポンシブ ------------------------------------------------------- */
@media (max-width: 640px) {
  .header-inner { gap: 10px 16px; }
  .header-search { margin-inline-start: 0; width: 100%; }
  .header-search input { width: 100%; }
  .site-nav { order: 3; width: 100%; }
  .term-grid { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); }
}
@media (max-width: 420px) {
  .wrap { padding-inline: 16px; }
  .term-grid { grid-template-columns: 1fr; }
}

/* ---- モーション低減：ヒーロー粒子は hero.js 側で静止。CSS の transition も抑制 ---- */
@media (prefers-reduced-motion: reduce) {
  * { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; }
}
