/* はやりことばじてん - Wiki風・まるっぽいUI
   生成りの背景 + やわらかいアクセント / 角丸大きめ / やさしい影 */

:root {
  --bg: #fbf7ee;          /* 生成り */
  --bg-soft: #f5efe2;
  --surface: #ffffff;
  --surface-2: #fdfaf3;
  --ink: #2f2a20;         /* 本文 */
  --ink-soft: #6b6151;
  --ink-faint: #948a78;
  --line: #ece3d1;
  --line-strong: #e0d4bb;
  --accent: #f2b705;      /* やわらかい山吹 */
  --accent-deep: #d99a00;
  --accent-soft: #fdf3d4;
  --accent-ink: #4a3c12;
  --amazon: #e8930c;
  --x-ink: #1a1a1a;
  --link: #b57e00;
  --link-hover: #8a5f00;
  --radius: 16px;
  --radius-lg: 20px;
  --radius-sm: 12px;
  --shadow: 0 4px 18px rgba(120, 96, 40, 0.08);
  --shadow-sm: 0 2px 8px rgba(120, 96, 40, 0.07);
  --maxw: 1080px;
  --font: "Hiragino Maru Gothic ProN", "Hiragino Maru Gothic Pro",
    "Quicksand", "Rounded Mplus 1c", "Zen Maru Gothic", "Hiragino Kaku Gothic ProN",
    "Yu Gothic", "Meiryo", system-ui, sans-serif;
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--font);
  color: var(--ink);
  background: var(--bg);
  line-height: 1.85;
  font-size: 16px;
  letter-spacing: 0.01em;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

.wrap { max-width: var(--maxw); margin: 0 auto; padding: 0 20px; }

a { color: var(--link); text-decoration: none; }
a:hover { color: var(--link-hover); text-decoration: underline; }

h1, h2, h3 { line-height: 1.4; color: var(--ink); }

.skip-link {
  position: absolute; left: -999px; top: 0;
  background: var(--accent); color: var(--accent-ink);
  padding: 8px 14px; border-radius: 0 0 var(--radius-sm) 0; z-index: 100;
}
.skip-link:focus { left: 0; }

/* ---------- ヘッダー ---------- */
.site-header {
  background: var(--surface);
  border-bottom: 1px solid var(--line);
  position: sticky; top: 0; z-index: 50;
  box-shadow: var(--shadow-sm);
}
.header-inner {
  display: flex; align-items: center; justify-content: space-between;
  gap: 16px; padding-top: 12px; padding-bottom: 12px; flex-wrap: wrap;
}
.brand { display: flex; align-items: center; gap: 12px; color: var(--ink); }
.brand:hover { text-decoration: none; }
.brand-mark {
  width: 44px; height: 44px; border-radius: 14px;
  background: var(--accent); color: var(--accent-ink);
  display: grid; place-items: center; font-weight: 700; font-size: 24px;
  box-shadow: var(--shadow-sm); flex: none;
}
.brand-text { display: flex; flex-direction: column; line-height: 1.25; }
.brand-name { font-weight: 700; font-size: 20px; }
.brand-tag { font-size: 12px; color: var(--ink-faint); }
.site-nav { display: flex; gap: 6px; flex-wrap: wrap; }
.site-nav a {
  color: var(--ink-soft); font-size: 15px; font-weight: 600;
  padding: 8px 14px; border-radius: 999px;
}
.site-nav a:hover { background: var(--accent-soft); color: var(--accent-ink); text-decoration: none; }
.site-nav a[aria-current="page"] { background: var(--accent-soft); color: var(--accent-ink); }

/* ---------- Hero ---------- */
.hero {
  background: linear-gradient(180deg, var(--accent-soft) 0%, var(--bg) 100%);
  border-bottom: 1px solid var(--line);
}
.hero-inner { padding: 56px 20px 48px; text-align: center; }
.hero-title { font-size: clamp(30px, 6vw, 46px); margin: 0 0 14px; letter-spacing: 0.02em; }
.hero-lead { max-width: 640px; margin: 0 auto 26px; color: var(--ink-soft); font-size: 17px; }
.hero-actions { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }

/* ---------- ボタン ---------- */
.btn {
  display: inline-block; padding: 12px 22px; border-radius: 999px;
  font-weight: 700; font-size: 15px; border: 2px solid transparent;
  transition: transform .06s ease, box-shadow .15s ease, background .15s ease;
}
.btn:hover { text-decoration: none; transform: translateY(-1px); }
.btn-primary { background: var(--accent); color: var(--accent-ink); box-shadow: var(--shadow-sm); }
.btn-primary:hover { background: var(--accent-deep); color: #fff; }
.btn-ghost { background: var(--surface); color: var(--accent-ink); border-color: var(--line-strong); }
.btn-ghost:hover { background: var(--accent-soft); }
.btn-x { background: var(--x-ink); color: #fff; }
.btn-x:hover { background: #000; color: #fff; }
.btn-x-outline { background: var(--surface); color: var(--x-ink); border-color: var(--line-strong); }
.btn-amazon { background: var(--amazon); color: #fff; }
.btn-amazon:hover { background: #cf7f04; color: #fff; }

/* ---------- ブロック ---------- */
.block { margin: 40px 0; }
.block-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 18px; flex-wrap: wrap; }
.block-head h2, .block > h2 {
  font-size: 22px; margin: 0 0 18px;
  padding-bottom: 8px; border-bottom: 2px solid var(--accent-soft);
}
.block-head h2 { margin-bottom: 0; border-bottom: none; }
.more-link { font-size: 14px; font-weight: 600; }

.page-head { margin: 28px 0 8px; }
.page-head h1 { font-size: clamp(26px, 5vw, 34px); margin: 0 0 10px; }
.page-lead { color: var(--ink-soft); margin: 0 0 8px; }

/* ---------- 語カード ---------- */
.card-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 14px;
}
.related-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px; }

.word-card {
  display: flex; gap: 12px; align-items: flex-start;
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 16px 18px;
  box-shadow: var(--shadow-sm); color: var(--ink);
  transition: transform .08s ease, box-shadow .15s ease, border-color .15s ease;
  height: 100%;
}
.word-card:hover { text-decoration: none; transform: translateY(-2px); box-shadow: var(--shadow); border-color: var(--line-strong); }
.card-body { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.card-head { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.card-word { font-weight: 700; font-size: 18px; }
.card-reading { font-size: 12px; color: var(--ink-faint); }
.card-meta { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.card-cat {
  font-size: 11px; font-weight: 700; color: var(--accent-ink);
  background: var(--accent-soft); padding: 2px 10px; border-radius: 999px;
}
.card-date { font-size: 11px; color: var(--ink-faint); }
.card-meaning { font-size: 13px; color: var(--ink-soft); line-height: 1.6; }

.rank-badge {
  flex: none; width: 34px; height: 34px; border-radius: 12px;
  background: var(--accent-soft); color: var(--accent-ink);
  display: grid; place-items: center; font-weight: 800; font-size: 16px;
}

/* ---------- ランキングリスト ---------- */
.rank-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
.rank-list-full { grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); }
.rank-list li:nth-child(1) .rank-badge { background: var(--accent); color: var(--accent-ink); }
.rank-list li:nth-child(2) .rank-badge { background: #efe2c0; }
.rank-list li:nth-child(3) .rank-badge { background: #f3e7cd; }

/* ---------- pill ---------- */
.pill-row { display: flex; flex-wrap: wrap; gap: 10px; }
.pill {
  display: inline-block; padding: 8px 16px; border-radius: 999px;
  background: var(--surface); border: 1px solid var(--line-strong);
  color: var(--ink-soft); font-weight: 600; font-size: 14px;
}
.pill:hover { background: var(--accent-soft); color: var(--accent-ink); text-decoration: none; }
.pill-kana { min-width: 44px; text-align: center; }

.jump-nav { display: flex; gap: 12px; align-items: baseline; margin: 14px 0; flex-wrap: wrap; }
.jump-title { font-weight: 700; color: var(--ink-soft); font-size: 14px; flex: none; }

/* ---------- 記事レイアウト ---------- */
.layout-article {
  display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 34px;
  align-items: start; margin: 24px auto 60px;
}
.article {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius-lg); padding: 30px 34px; box-shadow: var(--shadow);
}
.article-header { border-bottom: 1px solid var(--line); padding-bottom: 18px; margin-bottom: 8px; }
.article-title-row { display: flex; align-items: baseline; gap: 14px; flex-wrap: wrap; }
.article-title { font-size: clamp(28px, 6vw, 40px); margin: 0; }
.article-reading { color: var(--ink-faint); font-size: 16px; font-weight: 600; }
.article-lead { color: var(--ink-soft); margin: 14px 0 12px; font-size: 16px; }
.chip-row { display: flex; gap: 8px; flex-wrap: wrap; }
.chip {
  font-size: 12px; font-weight: 700; padding: 4px 12px; border-radius: 999px;
  background: var(--accent-soft); color: var(--accent-ink);
}
.chip-plain { background: var(--bg-soft); color: var(--ink-soft); }

.word-section { margin: 26px 0; scroll-margin-top: 80px; }
.word-section h2 {
  font-size: 20px; margin: 0 0 14px; padding-left: 14px;
  border-left: 5px solid var(--accent); border-radius: 2px;
}
.word-section p { margin: 0 0 14px; }

.info-table {
  width: 100%; border-collapse: collapse; margin: 0 0 18px;
  background: var(--surface-2); border-radius: var(--radius-sm); overflow: hidden;
  border: 1px solid var(--line);
}
.info-table th, .info-table td { text-align: left; padding: 11px 16px; border-bottom: 1px solid var(--line); font-size: 15px; }
.info-table tr:last-child th, .info-table tr:last-child td { border-bottom: none; }
.info-table th { width: 34%; background: var(--bg-soft); color: var(--ink-soft); font-weight: 700; white-space: nowrap; }

.post-links { display: flex; flex-direction: column; gap: 10px; align-items: flex-start; }
.note-small { font-size: 12px; color: var(--ink-faint); }

.amazon-section { background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px 22px; }
.disclosure { font-size: 13px; color: var(--ink-soft); }
.amazon-list { list-style: none; margin: 12px 0 0; padding: 0; display: flex; flex-direction: column; gap: 10px; align-items: flex-start; }

.source-list { padding-left: 20px; margin: 0; }
.source-list li { margin-bottom: 8px; word-break: break-all; }

/* ---------- サイドバー ---------- */
.sidebar { position: sticky; top: 80px; display: flex; flex-direction: column; gap: 18px; }
.toc-box, .side-box {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 18px 20px; box-shadow: var(--shadow-sm);
}
.side-title { font-size: 15px; margin: 0 0 12px; color: var(--ink-soft); font-weight: 700; }
.toc { margin: 0; padding-left: 20px; display: flex; flex-direction: column; gap: 8px; }
.toc a { color: var(--ink-soft); font-size: 14px; }
.toc a:hover { color: var(--link-hover); }
.side-ranking { list-style: none; margin: 0 0 12px; padding: 0; display: flex; flex-direction: column; gap: 9px; }
.side-ranking li { display: flex; gap: 10px; align-items: baseline; }
.side-rank { flex: none; width: 22px; height: 22px; border-radius: 8px; background: var(--accent-soft); color: var(--accent-ink); display: grid; place-items: center; font-size: 12px; font-weight: 700; }
.side-ranking a { font-size: 14px; }
.side-more { font-size: 13px; font-weight: 600; }

/* ---------- パンくず ---------- */
.breadcrumb { margin: 4px 0 18px; }
.breadcrumb ol { list-style: none; display: flex; flex-wrap: wrap; gap: 6px; margin: 0; padding: 0; font-size: 13px; color: var(--ink-faint); }
.breadcrumb li:not(:last-child)::after { content: "›"; margin-left: 6px; color: var(--ink-faint); }
.breadcrumb a { color: var(--ink-soft); }

/* ---------- index groups ---------- */
.index-group, .period-group { margin: 24px 0; scroll-margin-top: 80px; }
.index-label, .period-label {
  font-size: 18px; margin: 0 0 12px; display: inline-flex; align-items: center; gap: 10px;
  padding: 4px 16px; background: var(--accent-soft); color: var(--accent-ink); border-radius: 999px;
}
.index-desc { color: var(--ink-soft); font-size: 14px; margin: 0 0 12px; }

/* ---------- prose (固定ページ) ---------- */
.layout-prose { margin: 24px auto 60px; }
.prose {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius-lg); padding: 32px 36px; box-shadow: var(--shadow);
  max-width: 780px; margin: 0 auto;
}
.prose h1 { font-size: clamp(26px, 5vw, 32px); margin: 0 0 18px; }
.prose h2 { font-size: 20px; margin: 30px 0 12px; padding-left: 14px; border-left: 5px solid var(--accent); }
.prose p { margin: 0 0 14px; }
.prose ul { padding-left: 22px; }
.prose li { margin-bottom: 8px; }

/* ---------- フッター ---------- */
.site-footer { background: var(--surface); border-top: 1px solid var(--line); margin-top: 40px; }
.footer-inner { padding: 34px 20px 40px; display: flex; flex-direction: column; gap: 14px; }
.footer-brand .brand-name { font-size: 18px; }
.footer-desc { color: var(--ink-faint); font-size: 13px; margin: 4px 0 0; }
.footer-nav { display: flex; flex-wrap: wrap; gap: 8px 18px; }
.footer-nav a { color: var(--ink-soft); font-size: 14px; font-weight: 600; }
.footer-note { font-size: 12px; color: var(--ink-faint); line-height: 1.7; max-width: 760px; }
.copyright { font-size: 13px; color: var(--ink-faint); margin: 0; }

/* ---------- サイト内検索 ---------- */
.visually-hidden {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.header-search-wrap { padding-top: 0; padding-bottom: 12px; }
.header-search { display: flex; gap: 8px; width: 100%; max-width: 520px; }
.search-input {
  flex: 1; min-width: 0;
  font-family: inherit; font-size: 15px; color: var(--ink);
  background: var(--surface-2);
  border: 1px solid var(--line-strong); border-radius: 999px;
  padding: 10px 16px; appearance: none;
}
.search-input::placeholder { color: var(--ink-faint); }
.search-input:focus {
  outline: none; border-color: var(--accent-deep);
  box-shadow: 0 0 0 3px var(--accent-soft); background: var(--surface);
}
.search-btn {
  flex: none; font-family: inherit; font-size: 15px; font-weight: 700;
  color: var(--accent-ink); background: var(--accent);
  border: none; border-radius: 999px; padding: 10px 20px; cursor: pointer;
  box-shadow: var(--shadow-sm);
}
.search-btn:hover { background: var(--accent-deep); color: #fff; }

.search-page-form { margin: 8px 0 6px; }
.search-input-lg { max-width: 640px; font-size: 17px; padding: 14px 20px; }
.search-summary { color: var(--ink-soft); margin: 4px 0 16px; font-size: 15px; }
.search-results { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
.search-hit {
  display: block; background: var(--surface);
  border: 1px solid var(--line); border-radius: var(--radius-sm);
  padding: 14px 16px; box-shadow: var(--shadow-sm); color: var(--ink);
}
.search-hit:hover { text-decoration: none; border-color: var(--line-strong); box-shadow: var(--shadow); transform: translateY(-1px); }
.search-hit-head { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.search-hit-word { font-weight: 700; font-size: 18px; }
.search-hit-reading { font-size: 13px; color: var(--ink-faint); }
.search-hit-cat {
  display: inline-block; margin: 4px 0; font-size: 12px; font-weight: 600;
  color: var(--accent-ink); background: var(--accent-soft);
  border-radius: 999px; padding: 2px 10px;
}
.search-hit-meaning { display: block; color: var(--ink-soft); font-size: 14px; line-height: 1.7; margin-top: 2px; }
.search-empty { color: var(--ink-soft); }

/* ---------- 人気ポストの概要 ---------- */
.post-summary {
  background: var(--surface-2); border: 1px solid var(--line);
  border-radius: var(--radius-sm); padding: 14px 18px; margin: 4px 0 16px;
}
.post-summary-title { margin: 0 0 6px; font-size: 15px; color: var(--accent-ink); }
.post-summary p { margin: 0 0 8px; }
.post-summary p:last-child { margin-bottom: 0; }
.reading-note { color: var(--ink-soft); }

/* ---------- よくある質問（FAQ） ---------- */
.faq-list { margin: 0; }
.faq-q {
  font-weight: 700; color: var(--ink); margin-top: 14px;
  padding-left: 22px; position: relative;
}
.faq-q::before {
  content: "Q"; position: absolute; left: 0; top: 0;
  color: var(--accent-deep); font-weight: 800;
}
.faq-q:first-child { margin-top: 0; }
.faq-a {
  margin: 4px 0 0; padding-left: 22px; position: relative;
  color: var(--ink-soft); line-height: 1.8;
}
.faq-a::before {
  content: "A"; position: absolute; left: 0; top: 0;
  color: var(--ink-faint); font-weight: 800;
}

/* ---------- レスポンシブ ---------- */
@media (max-width: 860px) {
  .layout-article { grid-template-columns: 1fr; }
  .sidebar { position: static; order: 2; }
  .article { padding: 24px 20px; }
  .prose { padding: 24px 20px; }
}
@media (max-width: 560px) {
  body { font-size: 15px; }
  .hero-inner { padding: 40px 16px 34px; }
  .card-grid { grid-template-columns: 1fr; }
  .rank-list-full { grid-template-columns: 1fr; }
  .site-nav a { padding: 6px 11px; font-size: 14px; }
  .brand-tag { display: none; }
  .header-search { max-width: none; }
}
