/* ==========================================================
   IT業界案内図 — 共通スタイル
   コンセプト: 鉄道路線図・駅サインのデザイン言語で
   IT業界を「迷わず歩ける」ように案内する
   ========================================================== */

:root {
  /* 基本色 */
  --paper: #f7f8f6;
  --card: #ffffff;
  --ink: #15181d;
  --muted: #5a6069;
  --rule: #dcdfd8;
  --rule-strong: #b8bcb2;

  /* 路線カラー（職種） */
  --line-design: #e4649f;  /* Webデザイナー */
  --line-front: #e8574b;   /* フロントエンド */
  --line-back: #2e6fe0;    /* バックエンド */
  --line-infra: #1fa36b;   /* インフラ */
  --line-qa: #e39a0b;      /* QA */
  --line-data: #7b5cd6;    /* データアナリスト */
  --line-pm: #3d4854;      /* プロジェクトマネージャー */

  /* 本線（開発の流れ） */
  --line-main: #15181d;

  --font-jp: "Zen Kaku Gothic New", "Hiragino Kaku Gothic ProN", "Yu Gothic", sans-serif;
  --font-num: "Inter", "Zen Kaku Gothic New", sans-serif;

  --maxw: 1080px;
  --radius: 10px;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-jp);
  font-size: 16px;
  line-height: 1.9;
  -webkit-font-smoothing: antialiased;
}

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

a { color: inherit; }

:focus-visible {
  outline: 3px solid var(--line-back);
  outline-offset: 2px;
  border-radius: 2px;
}

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

/* ---------- ヘッダー（駅サイン風） ---------- */

.site-header {
  background: var(--card);
  border-bottom: 3px solid var(--ink);
  position: sticky;
  top: 0;
  z-index: 50;
}

.site-header .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 64px;
  flex-wrap: wrap;
  padding-top: 8px;
  padding-bottom: 8px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  font-weight: 900;
  font-size: 1.05rem;
  letter-spacing: 0.04em;
}

/* 駅マーク: 路線図の駅を表す二重丸 */
.brand-mark {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 5px solid var(--ink);
  background: var(--card);
  flex: none;
}

.brand small {
  display: block;
  font-size: 0.62rem;
  font-weight: 500;
  letter-spacing: 0.22em;
  color: var(--muted);
  line-height: 1.2;
}

.global-nav {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
}

.global-nav a {
  text-decoration: none;
  font-weight: 700;
  font-size: 0.88rem;
  padding: 8px 14px;
  border-radius: 6px;
  border-bottom: 4px solid transparent;
  line-height: 1.4;
}

.global-nav a:hover { background: var(--paper); }

.global-nav a[data-line="flow"]   { border-bottom-color: var(--line-main); }
.global-nav a[data-line="roles"]  { border-bottom-color: var(--line-back); }
.global-nav a[data-line="words"]  { border-bottom-color: var(--line-infra); }
.global-nav a[data-line="learn"]  { border-bottom-color: var(--line-qa); }

.global-nav a[aria-current="page"] { background: var(--ink); color: #fff; }

/* ---------- ページ共通の見出し帯 ---------- */

.page-head {
  padding: 56px 0 32px;
  border-bottom: 1px solid var(--rule);
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.18em;
  color: var(--muted);
  margin: 0 0 10px;
}

.eyebrow::before {
  content: "";
  width: 26px;
  height: 6px;
  border-radius: 3px;
  background: var(--accent, var(--ink));
}

.page-head h1 {
  margin: 0 0 12px;
  font-size: clamp(1.7rem, 4.5vw, 2.6rem);
  font-weight: 900;
  line-height: 1.35;
  letter-spacing: 0.02em;
}

.page-head .lead {
  margin: 0;
  max-width: 46em;
  color: var(--muted);
  font-size: 0.98rem;
}

/* ---------- セクション ---------- */

section { padding: 48px 0; }

.section-title {
  font-size: clamp(1.25rem, 3vw, 1.6rem);
  font-weight: 900;
  margin: 0 0 8px;
  letter-spacing: 0.02em;
}

.section-note {
  color: var(--muted);
  font-size: 0.95rem;
  margin: 0 0 28px;
  max-width: 46em;
}

/* ---------- カード ---------- */

.card {
  background: var(--card);
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  padding: 24px 26px;
}

/* ---------- 例え話ボックス（家づくり） ---------- */

.analogy {
  background: var(--paper);
  border: 1px dashed var(--rule-strong);
  border-radius: 8px;
  padding: 14px 18px;
  font-size: 0.92rem;
  margin: 14px 0 0;
}

.analogy strong {
  display: inline-block;
  font-size: 0.78rem;
  letter-spacing: 0.12em;
  color: var(--muted);
  margin-right: 8px;
}

/* ---------- フッター ---------- */

.site-footer {
  margin-top: 40px;
  border-top: 3px solid var(--ink);
  background: var(--card);
  padding: 32px 0 40px;
  font-size: 0.85rem;
  color: var(--muted);
}

.site-footer .foot-lines {
  display: flex;
  gap: 6px;
  margin-bottom: 18px;
}

.site-footer .foot-lines span {
  width: 34px;
  height: 6px;
  border-radius: 3px;
}

.site-footer nav {
  display: flex;
  gap: 18px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}

.site-footer nav a { text-decoration: none; font-weight: 700; color: var(--ink); }
.site-footer nav a:hover { text-decoration: underline; }

/* ==========================================================
   トップページ
   ========================================================== */

.hero {
  padding: 64px 0 40px;
}

.hero .eyebrow { color: var(--ink); }

.hero h1 {
  margin: 0 0 18px;
  font-size: clamp(2rem, 6vw, 3.4rem);
  font-weight: 900;
  line-height: 1.3;
  letter-spacing: 0.02em;
}

.hero h1 .accent-line {
  background: linear-gradient(transparent 62%, rgba(46, 111, 224, 0.25) 62%);
}

/* 見出しが語の途中で折り返されないよう、意味のまとまり単位で改行させる */
.hero h1 .accent-line,
.hero h1 .no-break {
  display: inline-block;
}

.hero .lead {
  max-width: 40em;
  color: var(--muted);
  margin: 0 0 32px;
  font-size: 1.02rem;
}

.hero-map {
  background: var(--card);
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  padding: 12px 8px 4px;
  overflow-x: auto;
}

.hero-map svg { display: block; min-width: 860px; margin: 0 auto; }

/* イラスト内の番号と職種の対応表 */
.map-legend {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px 18px;
  padding: 12px 8px 2px;
  font-size: 0.85rem;
  font-weight: 700;
}

.map-legend > span {
  display: flex;
  align-items: center;
  gap: 7px;
}

.map-legend .num-badge { transform: none; }

.hero-map-caption {
  font-size: 0.8rem;
  color: var(--muted);
  text-align: center;
  margin: 4px 0 8px;
}

/* 3つの入口カード */

.gates {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 20px;
}

.gate {
  display: flex;
  flex-direction: column;
  gap: 10px;
  background: var(--card);
  border: 1px solid var(--rule);
  border-top: 6px solid var(--gate-color, var(--ink));
  border-radius: var(--radius);
  padding: 24px 24px 20px;
  text-decoration: none;
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}

.gate:hover {
  transform: translateY(-3px);
  box-shadow: 0 10px 24px rgba(21, 24, 29, 0.1);
}

.gate .gate-no {
  font-family: var(--font-num);
  font-weight: 700;
  font-size: 0.78rem;
  letter-spacing: 0.1em;
  color: var(--gate-color, var(--ink));
}

.gate h3 { margin: 0; font-size: 1.2rem; font-weight: 900; }

.gate p { margin: 0; font-size: 0.9rem; color: var(--muted); flex: 1; }

.gate .gate-go {
  font-weight: 700;
  font-size: 0.85rem;
  color: var(--gate-color, var(--ink));
}

/* こんな人のためのサイト */

.for-whom ul {
  margin: 0;
  padding: 0;
  list-style: none;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px 24px;
}

.for-whom li {
  background: var(--card);
  border: 1px solid var(--rule);
  border-radius: 8px;
  padding: 12px 18px;
  font-size: 0.95rem;
  display: flex;
  gap: 10px;
  align-items: baseline;
}

.for-whom li::before {
  content: "";
  flex: none;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  border: 3px solid var(--ink);
  background: #fff;
  transform: translateY(1px);
}

/* ==========================================================
   開発の流れページ（各駅停車）
   ========================================================== */

.flow-line {
  position: relative;
  margin-top: 8px;
}

/* 本線: 左側を貫く太い線 */
.flow-line::before {
  content: "";
  position: absolute;
  left: 27px;
  top: 0;
  bottom: 0;
  width: 10px;
  border-radius: 5px;
  background: var(--line-main);
}

.station {
  position: relative;
  padding: 26px 0 26px 88px;
}

/* 駅マーク */
.station::before {
  content: "";
  position: absolute;
  left: 16px;
  top: 38px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #fff;
  border: 6px solid var(--line-main);
}

.station-no {
  display: inline-block;
  font-family: var(--font-num);
  font-weight: 700;
  font-size: 0.8rem;
  letter-spacing: 0.08em;
  color: #fff;
  background: var(--line-main);
  border-radius: 6px;
  padding: 2px 10px;
  margin-bottom: 6px;
}

.station h2 {
  margin: 0 0 4px;
  font-size: clamp(1.3rem, 3vw, 1.7rem);
  font-weight: 900;
}

.station .station-en {
  font-family: var(--font-num);
  font-size: 0.78rem;
  letter-spacing: 0.14em;
  color: var(--muted);
  text-transform: uppercase;
  margin: 0 0 14px;
}

.station .card p { margin: 0 0 12px; }
.station .card p:last-child { margin-bottom: 0; }

.station dl {
  margin: 16px 0 0;
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 6px 16px;
  font-size: 0.92rem;
}

.station dt {
  font-weight: 700;
  color: var(--muted);
  white-space: nowrap;
}

.station dd { margin: 0; }

/* コラム（ウォーターフォール／アジャイル等） */

.column-box {
  background: var(--card);
  border: 1px solid var(--rule);
  border-left: 8px solid var(--line-qa);
  border-radius: var(--radius);
  padding: 22px 26px;
  margin: 8px 0;
}

.column-box h3 { margin: 0 0 8px; font-size: 1.05rem; font-weight: 900; }
.column-box p { margin: 0 0 10px; font-size: 0.95rem; }
.column-box p:last-child { margin-bottom: 0; }

/* ==========================================================
   職種図鑑ページ（路線ガイド）
   ========================================================== */

/* 路線一覧（ページ内リンク） */
.line-index {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 10px;
  margin-top: 24px;
}

.line-index a {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--card);
  border: 1px solid var(--rule);
  border-radius: 8px;
  padding: 10px 14px;
  text-decoration: none;
  font-weight: 700;
  font-size: 0.9rem;
}

.line-index a:hover { border-color: var(--ink); }

.line-symbol {
  flex: none;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  border: 4px solid var(--line-color, var(--ink));
  background: #fff;
  color: var(--line-color, var(--ink));
  font-family: var(--font-num);
  font-weight: 700;
  font-size: 0.85rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}

/* 職種セクション */

.role {
  border-top: 1px solid var(--rule);
  padding: 44px 0;
  scroll-margin-top: 90px;
}

.role-head {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 4px;
}

.role-head .line-symbol {
  width: 44px;
  height: 44px;
  border-width: 6px;
  font-size: 1.1rem;
}

.role-head h2 {
  margin: 0;
  font-size: clamp(1.35rem, 3vw, 1.8rem);
  font-weight: 900;
}

.role-head .role-en {
  display: block;
  font-family: var(--font-num);
  font-size: 0.75rem;
  letter-spacing: 0.14em;
  color: var(--muted);
  text-transform: uppercase;
  font-weight: 500;
}

.role-summary {
  font-size: 1.02rem;
  font-weight: 700;
  margin: 10px 0 20px;
  padding-left: 16px;
  border-left: 6px solid var(--line-color, var(--ink));
}

.role-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.role-grid .card h3 {
  margin: 0 0 8px;
  font-size: 0.85rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  color: var(--muted);
}

.role-grid .card p, .role-grid .card ul { margin: 0; font-size: 0.94rem; }

.role-grid .card ul { padding-left: 1.3em; }
.role-grid .card li { margin-bottom: 4px; }

.tools {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.tools li {
  background: var(--paper);
  border: 1px solid var(--rule);
  border-radius: 999px;
  padding: 3px 14px;
  font-size: 0.85rem;
  font-weight: 500;
  margin: 0 !important;
}

/* 工程×職種マトリクス */

.matrix-wrap { overflow-x: auto; }

.matrix {
  border-collapse: collapse;
  width: 100%;
  min-width: 680px;
  background: var(--card);
  font-size: 0.88rem;
}

.matrix caption {
  caption-side: bottom;
  text-align: left;
  font-size: 0.8rem;
  color: var(--muted);
  padding: 10px 4px;
}

.matrix th, .matrix td {
  border: 1px solid var(--rule);
  padding: 10px 12px;
  text-align: center;
}

.matrix thead th {
  background: var(--ink);
  color: #fff;
  font-weight: 700;
  font-size: 0.82rem;
}

.matrix tbody th {
  text-align: left;
  font-weight: 700;
  white-space: nowrap;
}

.matrix tbody th .dot {
  display: inline-block;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  margin-right: 8px;
  vertical-align: -1px;
}

.matrix td.on  { font-weight: 900; }
.matrix td.sub { color: var(--muted); }

/* ==========================================================
   用語集ページ（駅名標カード）
   ========================================================== */

.glossary-controls {
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin-bottom: 28px;
}

.search-box {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--card);
  border: 2px solid var(--ink);
  border-radius: 999px;
  padding: 10px 20px;
  max-width: 520px;
}

.search-box input {
  border: none;
  outline: none;
  background: transparent;
  font-family: var(--font-jp);
  font-size: 1rem;
  width: 100%;
  color: var(--ink);
}

.search-box svg { flex: none; }

.cat-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.cat-chips button {
  font-family: var(--font-jp);
  font-weight: 700;
  font-size: 0.85rem;
  border: 1px solid var(--rule-strong);
  background: var(--card);
  color: var(--ink);
  border-radius: 999px;
  padding: 6px 16px;
  cursor: pointer;
}

.cat-chips button:hover { border-color: var(--ink); }

.cat-chips button[aria-pressed="true"] {
  background: var(--ink);
  color: #fff;
  border-color: var(--ink);
}

.glossary-count {
  font-size: 0.85rem;
  color: var(--muted);
  margin: 0 0 16px;
}

.glossary-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 16px;
}

/* 駅名標風カード: 上下の帯＋中央に用語名 */
.term-card {
  background: var(--card);
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.term-card .term-band {
  height: 8px;
  background: var(--cat-color, var(--ink));
}

.term-card .term-body { padding: 16px 20px 18px; flex: 1; }

.term-card h3 {
  margin: 0;
  font-size: 1.1rem;
  font-weight: 900;
  line-height: 1.4;
}

.term-card .term-read {
  font-family: var(--font-num);
  font-size: 0.72rem;
  letter-spacing: 0.1em;
  color: var(--muted);
  margin: 0 0 8px;
}

.term-card .term-cat {
  display: inline-block;
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--cat-color, var(--ink));
  border: 1px solid currentColor;
  border-radius: 999px;
  padding: 1px 10px;
  margin: 0 0 10px;
}

.term-card p { margin: 0; font-size: 0.9rem; }

.term-card .term-hint {
  margin-top: 10px;
  font-size: 0.82rem;
  color: var(--muted);
  background: var(--paper);
  border-radius: 6px;
  padding: 8px 12px;
}

.glossary-empty {
  text-align: center;
  color: var(--muted);
  padding: 48px 0;
}

/* ==========================================================
   マスコット（ルートン）
   ========================================================== */

.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr);
  gap: 28px;
  align-items: end;
  margin-bottom: 32px;
}

.mascot-box {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  padding-bottom: 4px;
}

.mascot-box .mascot-svg {
  width: min(230px, 62%);
  height: auto;
}

.speech-bubble {
  position: relative;
  background: var(--card);
  border: 2px solid var(--ink);
  border-radius: 14px;
  padding: 10px 18px;
  font-weight: 700;
  font-size: 0.92rem;
  line-height: 1.6;
  text-align: center;
}

.speech-bubble::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: -9px;
  width: 14px;
  height: 14px;
  background: var(--card);
  border-right: 2px solid var(--ink);
  border-bottom: 2px solid var(--ink);
  transform: translateX(-50%) rotate(45deg);
}

.mascot-name {
  margin: 0;
  font-size: 0.8rem;
  color: var(--muted);
  text-align: center;
}

.mascot-name strong { color: var(--ink); }

@media (prefers-reduced-motion: no-preference) {
  .mascot-svg .mascot-wing-flag {
    animation: flag-wave 2.6s ease-in-out infinite;
    transform-origin: 178px 120px;
  }
  @keyframes flag-wave {
    0%, 100% { transform: rotate(0deg); }
    50% { transform: rotate(-10deg); }
  }
}

/* ==========================================================
   イラスト・図解
   ========================================================== */

/* 工程アイコン（開発の流れ）: カード右上に回り込み配置 */
.station-icon {
  float: right;
  width: 58px;
  height: 58px;
  margin: 0 0 10px 14px;
}

/* 職種アイコン */
.role-head .role-icon {
  margin-left: auto;
  width: 54px;
  height: 54px;
  flex: none;
}

/* 図解ボックス */
.diagram {
  margin: 20px 0 0;
  background: var(--card);
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  padding: 18px 18px 10px;
  overflow-x: auto;
}

.diagram svg { display: block; margin: 0 auto; }

.diagram figcaption {
  font-size: 0.8rem;
  color: var(--muted);
  text-align: center;
  padding: 8px 0 6px;
}

/* 家の断面図の凡例 */
.diagram-legend {
  margin: 16px 0 0;
  padding: 0;
  list-style: none;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px 20px;
  font-size: 0.9rem;
}

.diagram-legend li {
  display: flex;
  gap: 10px;
  align-items: baseline;
}

.num-badge {
  flex: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--badge-color, var(--ink));
  color: #fff;
  font-family: var(--font-num);
  font-weight: 700;
  font-size: 0.75rem;
  transform: translateY(3px);
}

/* 家の断面図 v2: 凡例カードとハイライト連動 */
.house-map [data-role] { transition: opacity 0.25s ease; }
.house-map [data-role].dim { opacity: 0.15; }

.legend-cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 12px;
  margin-top: 16px;
}

.legend-card {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  background: var(--card);
  border: 1px solid var(--rule);
  border-radius: 10px;
  padding: 14px 16px;
  text-align: left;
  font-family: var(--font-jp);
  font-size: 1rem;
  color: var(--ink);
  cursor: pointer;
  transition: border-color 0.2s ease, opacity 0.25s ease;
}

.legend-card:hover { border-color: var(--ink); }
.legend-card.dim { opacity: 0.45; }
.legend-card .num-badge { transform: translateY(2px); }

.legend-card .lc-title {
  display: block;
  font-size: 0.95rem;
  font-weight: 900;
}

.legend-card .lc-desc {
  display: block;
  margin-top: 2px;
  font-size: 0.82rem;
  color: var(--muted);
  line-height: 1.7;
}

.legend-card .lc-desc b { color: var(--lc, var(--ink)); }

/* たとえ話カードの家アイコン */
.house-hint-icon {
  float: left;
  width: 68px;
  height: 68px;
  margin: 4px 18px 6px 0;
}

/* ==========================================================
   学び方ガイド（教材カタログ）
   ========================================================== */

.page-head-flex {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  flex-wrap: wrap;
}

.page-head-flex > div:first-child { flex: 1 1 480px; min-width: 0; }

.head-mascot {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  flex: none;
}

.head-mascot .mascot-svg { width: 128px; height: auto; }

.head-mascot .speech-bubble { font-size: 0.82rem; padding: 8px 14px; }

.material-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 16px;
}

.material-card {
  background: var(--card);
  border: 1px solid var(--rule);
  border-top: 6px solid var(--mat-color, var(--ink));
  border-radius: var(--radius);
  padding: 20px 22px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.mat-head {
  display: flex;
  align-items: center;
  gap: 12px;
}

.mat-icon { width: 42px; height: 42px; flex: none; }

.mat-head h3 { margin: 0; font-size: 1.1rem; font-weight: 900; }

.mat-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.mat-tags span {
  font-size: 0.72rem;
  font-weight: 700;
  border: 1px solid var(--rule-strong);
  border-radius: 999px;
  padding: 1px 10px;
  color: var(--muted);
  white-space: nowrap;
}

.material-card > p { margin: 0; font-size: 0.92rem; flex: 1; }

.material-card .term-hint {
  margin: 0;
  font-size: 0.82rem;
  color: var(--muted);
  background: var(--paper);
  border-radius: 6px;
  padding: 8px 12px;
}

/* ==========================================================
   スクロール登場アニメーション
   ========================================================== */

/* JSが有効なとき（html.js）だけ隠す。JSなしでも内容は必ず読める */
@media (prefers-reduced-motion: no-preference) {
  .js .reveal {
    opacity: 0;
    transform: translateY(14px);
    transition: opacity 0.5s ease, transform 0.5s ease;
  }
  .js .reveal.is-visible {
    opacity: 1;
    transform: none;
  }
}

/* ==========================================================
   レスポンシブ
   ========================================================== */

@media (max-width: 860px) {
  .gates { grid-template-columns: 1fr; }
  .role-grid { grid-template-columns: 1fr; }
  .for-whom ul { grid-template-columns: 1fr; }
  .hero-grid { grid-template-columns: 1fr; }
  .mascot-box .mascot-svg { width: 160px; }
  .diagram-legend { grid-template-columns: 1fr; }
}

@media (max-width: 640px) {
  body { font-size: 15px; }
  .station { padding-left: 64px; }
  .flow-line::before { left: 19px; }
  .station::before { left: 8px; }
  .page-head { padding-top: 40px; }
  .hero { padding-top: 44px; }
}

/* ==========================================================
   用語詳細ページ・記事ページ
   ========================================================== */

/* 用語カードをリンク化 */
a.term-card {
  text-decoration: none;
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}

a.term-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 10px 24px rgba(21, 24, 29, 0.1);
}

.term-card .term-more {
  margin: 12px 0 0 !important;
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--cat-color, var(--ink));
}

/* パンくずリスト */
.breadcrumb { font-size: 0.8rem; color: var(--muted); padding: 16px 0 0; }

.breadcrumb ol {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.breadcrumb li + li::before { content: "›"; margin-right: 8px; color: var(--rule-strong); }

.breadcrumb a { color: var(--muted); text-decoration: none; }
.breadcrumb a:hover { text-decoration: underline; color: var(--ink); }

/* 用語ページの読み・英語表記 */
.term-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 16px;
  margin: 0 0 14px;
  font-size: 0.82rem;
  color: var(--muted);
}

.term-meta .term-cat {
  display: inline-block;
  font-size: 0.7rem;
  font-weight: 700;
  border: 1px solid currentColor;
  border-radius: 999px;
  padding: 1px 10px;
}

/* 記事本文 */
.article-body { max-width: 780px; }

.article-body h2 {
  font-size: 1.3rem;
  font-weight: 900;
  line-height: 1.5;
  margin: 44px 0 14px;
  padding-left: 14px;
  border-left: 8px solid var(--accent, var(--ink));
  scroll-margin-top: 90px;
}

.article-body h2:first-child { margin-top: 0; }

.article-body h3 { font-size: 1.05rem; font-weight: 900; margin: 28px 0 10px; }

.article-body p { margin: 0 0 16px; }

.article-body ul, .article-body ol { margin: 0 0 16px; padding-left: 1.5em; }
.article-body li { margin-bottom: 6px; }

/* たとえ話（大） */
.analogy-lg {
  background: var(--card);
  border: 1px dashed var(--rule-strong);
  border-radius: var(--radius);
  padding: 18px 22px;
  margin: 0 0 16px;
}

/* 現場での使われ方 */
.usage-item {
  background: var(--card);
  border: 1px solid var(--rule);
  border-left: 6px solid var(--accent, var(--ink));
  border-radius: 8px;
  padding: 14px 18px;
  margin: 0 0 12px;
}

.usage-item .usage-line { margin: 0 0 6px; font-weight: 700; }
.usage-item .usage-note { margin: 0; font-size: 0.9rem; color: var(--muted); }

/* よくある質問 */
.faq-list { margin: 0 0 16px; }

.faq-list .faq-item {
  background: var(--card);
  border: 1px solid var(--rule);
  border-radius: 8px;
  padding: 16px 20px;
  margin-bottom: 12px;
}

.faq-list dt {
  display: flex;
  gap: 10px;
  font-weight: 900;
  margin-bottom: 8px;
}

.faq-list dt::before {
  content: "Q.";
  font-family: var(--font-num);
  font-weight: 700;
  color: var(--accent, var(--ink));
  flex: none;
}

.faq-list dd { display: flex; gap: 10px; margin: 0; font-size: 0.95rem; }

.faq-list dd::before {
  content: "A.";
  font-family: var(--font-num);
  font-weight: 700;
  color: var(--muted);
  flex: none;
}

/* 関連用語チップ */
.related-terms {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  list-style: none;
  margin: 0 0 16px;
  padding: 0;
}

.related-terms a {
  display: inline-block;
  background: var(--card);
  border: 1px solid var(--rule-strong);
  border-radius: 999px;
  padding: 5px 16px;
  font-size: 0.88rem;
  font-weight: 700;
  text-decoration: none;
}

.related-terms a:hover { border-color: var(--ink); }

/* 前後の用語ナビ */
.term-nav {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin: 36px 0 0;
  flex-wrap: wrap;
}

.term-nav a {
  flex: 1 1 200px;
  background: var(--card);
  border: 1px solid var(--rule);
  border-radius: 8px;
  padding: 12px 16px;
  font-size: 0.92rem;
  font-weight: 700;
  text-decoration: none;
}

.term-nav a:hover { border-color: var(--ink); }

.term-nav .tn-label {
  display: block;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  color: var(--muted);
  margin-bottom: 2px;
}

.term-nav .tn-next { text-align: right; }

.article-cta { margin-top: 44px; }

/* 用語さくいん（glossary.html の静的リンク一覧） */
.words-index {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 24px;
}

.words-index-group h3 {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.95rem;
  font-weight: 900;
  margin: 0 0 10px;
}

.words-index-group h3 .dot {
  display: inline-block;
  width: 12px;
  height: 12px;
  border-radius: 50%;
}

.words-index-group ul { list-style: none; margin: 0; padding: 0; }
.words-index-group li { margin: 0 0 6px; }

.words-index-group a { font-size: 0.9rem; text-decoration: none; }
.words-index-group a:hover { text-decoration: underline; }

/* 記事一覧カード（トップ・職種図鑑からの導線） */
.article-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 16px;
}

.article-list .gate p { font-size: 0.9rem; }

/* ルートンがたとえ話をしゃべる吹き出しレイアウト */
.analogy-routon {
  display: flex;
  gap: 16px;
  align-items: flex-start;
  margin: 0 0 16px;
}

.analogy-routon .mascot-svg {
  width: 92px;
  flex: none;
  margin-top: 8px;
}

.analogy-routon .speech-bubble {
  margin: 0;
  text-align: left;
  font-weight: 500;
  font-size: 0.95rem;
  line-height: 1.9;
  padding: 14px 20px;
}

/* 吹き出しのしっぽを左向き（ルートン側）にする */
.analogy-routon .speech-bubble::after {
  left: -8px;
  top: 34px;
  bottom: auto;
  transform: rotate(135deg);
}

@media (max-width: 640px) {
  .analogy-routon { gap: 10px; }
  .analogy-routon .mascot-svg { width: 68px; }
}

/* FAQを開閉式にする（details/summary） */
details.faq-item summary {
  display: flex;
  gap: 10px;
  font-weight: 900;
  cursor: pointer;
  list-style: none;
}

details.faq-item summary::-webkit-details-marker { display: none; }

details.faq-item summary::before {
  content: "Q.";
  font-family: var(--font-num);
  font-weight: 700;
  color: var(--accent, var(--ink));
  flex: none;
}

details.faq-item summary::after {
  content: "＋";
  margin-left: auto;
  flex: none;
  color: var(--muted);
  font-weight: 500;
}

details.faq-item[open] summary::after { content: "－"; }

details.faq-item > p {
  display: flex;
  gap: 10px;
  margin: 10px 0 0;
  font-size: 0.95rem;
}

details.faq-item > p::before {
  content: "A.";
  font-family: var(--font-num);
  font-weight: 700;
  color: var(--muted);
  flex: none;
}

/* 記事の目次 */
.toc {
  background: var(--card);
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  padding: 18px 24px;
  margin: 0 0 32px;
  font-size: 0.92rem;
}

.toc .toc-title {
  margin: 0 0 8px;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  color: var(--muted);
}

.toc ol {
  margin: 0;
  padding-left: 1.4em;
}

.toc li { margin-bottom: 4px; }

.toc a { text-decoration: none; font-weight: 700; }
.toc a:hover { text-decoration: underline; }
