/* ==========================================================
   構造設計ナビ — 共通スタイル(クリーン・メディア型)
   配色: 白基調 × 紺(--navy) × オレンジ(--accent)
   ========================================================== */
:root {
  --ink: #1f2933;
  --sub: #6b7785;
  --line: #e7ebf0;
  --bg: #ffffff;
  --bg-soft: #f7f9fb;
  --navy: #1a3a5c;
  --navy-deep: #132b45;
  --accent: #e8843c;
  --accent-dark: #d06f28;
  --accent-soft: #fdf1e7;
  --radius: 14px;
  --shadow: 0 2px 10px rgba(26, 58, 92, 0.06);
  --shadow-hover: 0 10px 26px rgba(26, 58, 92, 0.12);
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html { scroll-behavior: smooth; scroll-padding-top: 84px; }

body {
  font-family: "Noto Sans JP", "Hiragino Kaku Gothic ProN", "Hiragino Sans",
    Meiryo, sans-serif;
  background: var(--bg);
  color: var(--ink);
  line-height: 1.9;
  font-size: 15.5px;
}

img { max-width: 100%; display: block; }
a { color: var(--accent-dark); text-decoration: none; }
a:hover { text-decoration: underline; }

.container { max-width: 1120px; margin: 0 auto; padding: 0 24px; }

/* ---------- ヘッダー ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: #fff;
  border-bottom: 1px solid var(--line);
}
.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 68px;
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--navy);
  font-weight: 900;
  font-size: 1.3rem;
  letter-spacing: 0.04em;
  text-decoration: none;
}
.brand:hover { text-decoration: none; opacity: 0.85; }
.brand .logo-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  background: var(--navy);
  color: #fff;
  border-radius: 9px;
  font-size: 1.05rem;
  font-weight: 800;
  flex: 0 0 auto;
}
.brand small {
  display: block;
  font-size: 0.6rem;
  font-weight: 500;
  color: var(--sub);
  letter-spacing: 0.16em;
  line-height: 1.4;
}

.global-nav ul {
  display: flex;
  gap: 6px;
  list-style: none;
  align-items: center;
}
.global-nav a {
  display: block;
  padding: 8px 14px;
  color: var(--ink);
  font-size: 0.9rem;
  font-weight: 500;
  border-bottom: 2px solid transparent;
  text-decoration: none;
  transition: color 0.2s, border-color 0.2s;
}
.global-nav a:hover,
.global-nav a.active {
  color: var(--navy);
  border-bottom-color: var(--accent);
}

.nav-toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px;
}
.nav-toggle span {
  display: block;
  width: 24px;
  height: 2px;
  background: var(--navy);
  margin: 5px 0;
  border-radius: 2px;
  transition: transform 0.25s, opacity 0.25s;
}
.nav-toggle.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-toggle.open span:nth-child(2) { opacity: 0; }
.nav-toggle.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ---------- ヒーロー(検索) ---------- */
.hero {
  background: var(--bg-soft);
  border-bottom: 1px solid var(--line);
  padding: 60px 0 52px;
  text-align: center;
}
.hero h1 {
  font-size: clamp(1.45rem, 3.4vw, 2.05rem);
  font-weight: 900;
  color: var(--navy);
  letter-spacing: 0.03em;
  line-height: 1.6;
}
.hero h1 .marker {
  background: linear-gradient(transparent 62%, #ffd9b3 62%);
  padding: 0 2px;
}
.hero p {
  color: var(--sub);
  margin: 14px auto 26px;
  font-size: 0.93rem;
  max-width: 580px;
}
.search-box {
  max-width: 540px;
  margin: 0 auto;
  display: flex;
  background: #fff;
  border: 2px solid var(--navy);
  border-radius: 999px;
  overflow: hidden;
  position: relative;
}
.search-box input {
  flex: 1;
  border: none;
  padding: 14px 24px;
  font-size: 0.95rem;
  outline: none;
  font-family: inherit;
}
.search-box button {
  background: var(--navy);
  color: #fff;
  border: none;
  padding: 0 28px;
  font-weight: 700;
  font-size: 0.9rem;
  cursor: pointer;
  font-family: inherit;
}
.search-wrap { position: relative; max-width: 540px; margin: 0 auto; }
.search-results {
  position: absolute;
  top: calc(100% + 8px);
  left: 12px;
  right: 12px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 12px;
  box-shadow: var(--shadow-hover);
  text-align: left;
  z-index: 60;
  overflow: hidden;
  display: none;
}
.search-results a {
  display: block;
  padding: 12px 18px;
  font-size: 0.88rem;
  color: var(--ink);
  border-bottom: 1px solid var(--line);
}
.search-results a:last-child { border-bottom: none; }
.search-results a:hover { background: var(--bg-soft); text-decoration: none; color: var(--navy); }
.search-results .nohit { padding: 12px 18px; font-size: 0.85rem; color: var(--sub); }
.hot-words {
  margin-top: 18px;
  display: flex;
  gap: 10px;
  justify-content: center;
  flex-wrap: wrap;
  font-size: 0.8rem;
}
.hot-words span { color: var(--sub); }
.hot-words a {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 4px 14px;
  color: var(--navy);
}
.hot-words a:hover { border-color: var(--accent); color: var(--accent-dark); text-decoration: none; }

/* ---------- ボタン ---------- */
.btn {
  display: inline-block;
  padding: 13px 28px;
  border-radius: 999px;
  font-weight: 700;
  font-size: 0.92rem;
  text-decoration: none;
  transition: transform 0.15s, background 0.2s;
}
.btn:hover { text-decoration: none; transform: translateY(-2px); }
.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent-dark); color: #fff; }
.btn-ghost { background: #fff; color: var(--navy); border: 2px solid var(--navy); }

/* ---------- セクション共通 ---------- */
.section { padding: 56px 0 16px; }
.section-title {
  font-size: 1.3rem;
  font-weight: 900;
  color: var(--navy);
  letter-spacing: 0.05em;
  display: flex;
  align-items: baseline;
  gap: 12px;
  border-bottom: 2px solid var(--navy);
  padding-bottom: 10px;
  margin-bottom: 10px;
}
.section-title small {
  font-size: 0.68rem;
  color: var(--accent);
  letter-spacing: 0.22em;
  font-weight: 700;
}
.section-lead { color: var(--sub); margin-bottom: 28px; font-size: 0.9rem; }

/* ---------- カテゴリカード ---------- */
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 16px;
}
.category-card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 24px 16px 20px;
  text-align: center;
  text-decoration: none;
  color: var(--ink);
  transition: transform 0.2s, box-shadow 0.2s, border-color 0.2s;
  display: block;
}
.category-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-hover);
  border-color: var(--accent);
  text-decoration: none;
}
.category-card .icon {
  width: 54px;
  height: 54px;
  margin: 0 auto 10px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  background: var(--accent-soft);
}
.category-card h3 {
  font-size: 0.95rem;
  color: var(--navy);
  margin-bottom: 2px;
  font-weight: 700;
}
.category-card p { font-size: 0.76rem; color: var(--sub); line-height: 1.7; }

/* ---------- 記事カード ---------- */
.article-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 22px;
}
.article-card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  text-decoration: none;
  color: var(--ink);
  transition: transform 0.2s, box-shadow 0.2s;
  display: flex;
  flex-direction: column;
}
.article-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-hover);
  text-decoration: none;
}
.article-card .thumb {
  aspect-ratio: 1.91 / 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  color: #fff;
  position: relative;
}
.thumb .t-cat {
  position: absolute;
  top: 12px;
  left: 12px;
  background: rgba(255, 255, 255, 0.92);
  color: var(--navy);
  font-size: 0.68rem;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: 4px;
}
.thumb .t-icon { font-size: 2.1rem; line-height: 1; }
.thumb .t-title {
  font-size: 1.02rem;
  font-weight: 900;
  letter-spacing: 0.06em;
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.2);
}
.thumb-blue { background: linear-gradient(135deg, #1a3a5c, #2d6190); }
.thumb-teal { background: linear-gradient(135deg, #0e7d6b, #16a085); }
.thumb-orange { background: linear-gradient(135deg, #b3582a, #e8843c); }
.thumb-purple { background: linear-gradient(135deg, #5b4a9e, #7e6ac8); }
.article-card .body { padding: 15px 18px 17px; flex: 1; }
.article-card .tag {
  display: inline-block;
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--accent-dark);
  background: var(--accent-soft);
  padding: 2px 10px;
  border-radius: 999px;
  margin-bottom: 8px;
}
.article-card h3 {
  font-size: 0.96rem;
  color: var(--ink);
  line-height: 1.65;
  font-weight: 700;
}
.article-card p { font-size: 0.8rem; color: var(--sub); margin-top: 6px; }
.article-card .meta {
  margin-top: 10px;
  font-size: 0.72rem;
  color: var(--sub);
  display: flex;
  gap: 14px;
}

/* ---------- 2カラムレイアウト ---------- */
.page-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 300px;
  gap: 40px;
  padding: 36px 0 72px;
  align-items: start;
}
.breadcrumb {
  font-size: 0.78rem;
  color: var(--sub);
  padding: 16px 0 0;
}
.breadcrumb a { color: var(--sub); }
.breadcrumb a:hover { color: var(--accent-dark); }

/* ---------- 記事ページ本文 ---------- */
.article-main {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 40px 44px 48px;
  min-width: 0;
}
.article-main .meta {
  display: flex;
  gap: 12px;
  align-items: center;
  font-size: 0.78rem;
  color: var(--sub);
  margin-bottom: 16px;
  flex-wrap: wrap;
}
.article-main .meta .tag {
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--accent-dark);
  background: var(--accent-soft);
  padding: 3px 12px;
  border-radius: 999px;
}
.article-main h1 {
  font-size: 1.65rem;
  color: var(--navy);
  line-height: 1.55;
  margin-bottom: 28px;
  font-weight: 900;
  letter-spacing: 0.02em;
}
.article-main h2 {
  font-size: 1.25rem;
  color: var(--navy);
  margin: 46px 0 18px;
  padding: 10px 16px;
  background: var(--bg-soft);
  border-left: 5px solid var(--accent);
  border-radius: 0 8px 8px 0;
  font-weight: 700;
}
.article-main h3 {
  font-size: 1.05rem;
  color: var(--navy);
  margin: 32px 0 14px;
  padding-bottom: 8px;
  border-bottom: 2px solid var(--line);
  font-weight: 700;
}
.article-main p { margin-bottom: 16px; }
.article-main ul, .article-main ol { margin: 0 0 16px 1.4em; }
.article-main li { margin-bottom: 6px; }

.diagram {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 22px 16px 10px;
  margin: 22px 0;
  text-align: center;
}
.diagram svg { max-width: 100%; height: auto; display: inline-block; }
.diagram .cap {
  font-size: 0.78rem;
  color: var(--sub);
  margin: 10px 0 8px;
}

.formula {
  background: var(--bg-soft);
  border: 1px solid var(--line);
  border-left: 4px solid var(--navy);
  border-radius: 8px;
  padding: 18px 22px;
  margin: 20px 0;
  text-align: center;
  font-size: 1.15rem;
  font-family: "Times New Roman", "Hiragino Mincho ProN", serif;
  overflow-x: auto;
}
.formula .note {
  display: block;
  font-size: 0.76rem;
  color: var(--sub);
  margin-top: 10px;
  font-family: "Noto Sans JP", sans-serif;
  text-align: left;
}

.point-box {
  background: var(--accent-soft);
  border: 1px solid #f3d9bd;
  border-radius: 10px;
  padding: 18px 22px;
  margin: 24px 0;
}
.point-box .label {
  display: inline-block;
  font-weight: 800;
  color: #b35309;
  font-size: 0.85rem;
  letter-spacing: 0.08em;
  margin-bottom: 8px;
}
.point-box p:last-child, .point-box ul:last-child { margin-bottom: 0; }

.note-box {
  background: #eef5f0;
  border: 1px solid #d3e5d9;
  border-radius: 10px;
  padding: 18px 22px;
  margin: 24px 0;
}
.note-box .label {
  display: inline-block;
  font-weight: 800;
  color: #1d7a3a;
  font-size: 0.85rem;
  letter-spacing: 0.08em;
  margin-bottom: 8px;
}
.note-box p:last-child { margin-bottom: 0; }

table.data {
  width: 100%;
  border-collapse: collapse;
  margin: 20px 0;
  font-size: 0.88rem;
}
table.data th, table.data td {
  border: 1px solid var(--line);
  padding: 10px 14px;
  text-align: left;
}
table.data th { background: var(--navy); color: #fff; font-weight: 600; }
table.data tr:nth-child(even) td { background: var(--bg-soft); }

/* ---------- サイドバー ---------- */
.sidebar { display: flex; flex-direction: column; gap: 24px; }
.widget {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 22px;
}
.widget h4 {
  font-size: 0.95rem;
  color: var(--navy);
  font-weight: 900;
  margin-bottom: 12px;
  padding-bottom: 10px;
  border-bottom: 2px solid var(--accent);
  display: flex;
  align-items: center;
  gap: 8px;
}
.widget ul { list-style: none; }
.widget li { border-bottom: 1px dashed var(--line); }
.widget li:last-child { border-bottom: none; }
.widget li a {
  display: block;
  padding: 10px 2px;
  font-size: 0.85rem;
  color: var(--ink);
  line-height: 1.7;
}
.widget li a:hover { color: var(--accent-dark); }

/* ランキング */
.rank { list-style: none; counter-reset: rank; }
.rank li {
  counter-increment: rank;
  display: flex;
  gap: 14px;
  align-items: flex-start;
  padding: 13px 0;
  border-bottom: 1px dashed var(--line);
}
.rank li:last-child { border-bottom: none; }
.rank li::before {
  content: counter(rank);
  flex: 0 0 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--navy);
  color: #fff;
  font-size: 0.8rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-top: 4px;
}
.rank li:nth-child(1)::before { background: var(--accent); }
.rank li:nth-child(2)::before { background: #c98f5d; }
.rank li a { font-size: 0.85rem; line-height: 1.65; color: var(--ink); }
.rank li a:hover { color: var(--accent-dark); }

/* ツールバナー */
.tool-banner {
  background: linear-gradient(135deg, var(--navy), #2d6190);
  border-radius: var(--radius);
  color: #fff;
  padding: 26px 22px;
  text-align: center;
}
.tool-banner .tb-ic { font-size: 2rem; line-height: 1; }
.tool-banner h4 { font-size: 1rem; font-weight: 900; margin: 10px 0 4px; }
.tool-banner p { font-size: 0.78rem; color: #c9d8e8; margin-bottom: 16px; }
.tool-banner a {
  display: inline-block;
  background: var(--accent);
  color: #fff;
  font-size: 0.85rem;
  font-weight: 700;
  padding: 10px 26px;
  border-radius: 999px;
}
.tool-banner a:hover { background: var(--accent-dark); text-decoration: none; }

.ad-slot {
  background: repeating-linear-gradient(45deg, #f3f5f7, #f3f5f7 12px, #eceff2 12px, #eceff2 24px);
  border: 1px dashed #c3ccd6;
  border-radius: var(--radius);
  min-height: 250px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #9aa5b1;
  font-size: 0.8rem;
}

/* ---------- 学習ロードマップ ---------- */
.roadmap {
  background: var(--bg-soft);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 28px 32px;
  margin-top: 44px;
}
.roadmap h2 {
  font-size: 1.05rem;
  font-weight: 900;
  color: var(--navy);
  margin-bottom: 18px;
}
.steps { display: grid; grid-template-columns: repeat(4, 1fr); gap: 0; }
.step { position: relative; padding-right: 22px; }
.step:not(:last-child)::after {
  content: "›";
  position: absolute;
  right: 6px;
  top: 50%;
  transform: translateY(-50%);
  color: #c3ccd6;
  font-size: 1.6rem;
}
.step .no {
  font-size: 0.66rem;
  font-weight: 900;
  color: var(--accent);
  letter-spacing: 0.18em;
}
.step h5 { font-size: 0.9rem; color: var(--navy); margin: 2px 0 4px; }
.step p { font-size: 0.74rem; color: var(--sub); line-height: 1.7; }
.step a { color: inherit; }
.step a:hover { text-decoration: none; color: var(--accent-dark); }

/* ---------- 記事一覧(カテゴリページ) ---------- */
.article-list {
  list-style: none;
  counter-reset: al;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 8px 24px;
  margin-bottom: 40px;
}
.article-list li { counter-increment: al; border-bottom: 1px dashed var(--line); }
.article-list li:last-child { border-bottom: none; }
.article-list a {
  display: flex;
  gap: 16px;
  padding: 15px 2px;
  align-items: flex-start;
  color: var(--ink);
}
.article-list a::before {
  content: counter(al, decimal-leading-zero);
  font-weight: 800;
  color: var(--accent);
  font-size: 0.85rem;
  margin-top: 2px;
  flex: 0 0 auto;
}
.article-list a:hover { text-decoration: none; }
.article-list a:hover h3 { color: var(--accent-dark); }
.article-list h3 { font-size: 0.97rem; font-weight: 700; line-height: 1.6; color: var(--navy); }
.article-list p { font-size: 0.78rem; color: var(--sub); margin-top: 2px; }

/* ---------- 計算ツール ---------- */
.tool-panel {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 32px;
  margin: 24px 0;
}
.tool-panel .field { margin-bottom: 18px; }
.tool-panel label {
  display: block;
  font-weight: 700;
  font-size: 0.9rem;
  color: var(--navy);
  margin-bottom: 6px;
}
.tool-panel input[type="number"],
.tool-panel select {
  width: 100%;
  max-width: 320px;
  padding: 11px 14px;
  border: 1.5px solid var(--line);
  border-radius: 8px;
  font-size: 1rem;
  font-family: inherit;
  transition: border-color 0.2s;
}
.tool-panel input:focus, .tool-panel select:focus {
  outline: none;
  border-color: var(--accent);
}
.tool-panel .unit { font-size: 0.85rem; color: var(--sub); margin-left: 8px; }
.btn-calc {
  background: var(--accent);
  color: #fff;
  border: none;
  padding: 13px 36px;
  border-radius: 999px;
  font-size: 1rem;
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
  transition: background 0.2s, transform 0.15s;
}
.btn-calc:hover { background: var(--accent-dark); transform: translateY(-2px); }
.result-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
  margin-top: 26px;
}
.result-item {
  background: var(--bg-soft);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 16px 18px;
  text-align: center;
}
.result-item .name { font-size: 0.76rem; color: var(--sub); margin-bottom: 4px; }
.result-item .value {
  font-size: 1.3rem;
  font-weight: 800;
  color: var(--navy);
  word-break: break-all;
}
.result-item .unit { font-size: 0.74rem; color: var(--sub); }

/* ---------- CTAバンド ---------- */
.cta-band {
  background: linear-gradient(135deg, var(--navy), #2d6190);
  border-radius: 16px;
  color: #fff;
  padding: 40px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  flex-wrap: wrap;
}
.cta-band h3 { font-size: 1.25rem; margin-bottom: 8px; font-weight: 900; }
.cta-band p { color: #c9d8e8; font-size: 0.9rem; }

/* ---------- フッター ---------- */
.site-footer {
  background: var(--navy);
  color: #bccadb;
  margin-top: 64px;
  padding: 44px 0 0;
  font-size: 0.84rem;
}
.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  gap: 36px;
  padding-bottom: 36px;
}
.site-footer h5 {
  color: #fff;
  font-size: 0.95rem;
  font-weight: 900;
  margin-bottom: 12px;
  letter-spacing: 0.06em;
}
.site-footer ul { list-style: none; }
.site-footer li { margin-bottom: 8px; }
.site-footer a { color: #bccadb; }
.site-footer a:hover { color: #fff; }
.footer-bottom {
  border-top: 1px solid rgba(255, 255, 255, 0.14);
  padding: 16px 0;
  text-align: center;
  font-size: 0.74rem;
  color: #8da2b8;
}

/* ---------- レスポンシブ ---------- */
@media (max-width: 860px) {
  .page-layout { grid-template-columns: 1fr; }
  .article-main { padding: 28px 22px 36px; }
  .article-grid { grid-template-columns: 1fr; }
  .card-grid { grid-template-columns: repeat(2, 1fr); }
  .footer-grid { grid-template-columns: 1fr; gap: 24px; }
  .steps { grid-template-columns: 1fr; gap: 14px; }
  .step:not(:last-child)::after { display: none; }

  .nav-toggle { display: block; }
  .global-nav {
    position: absolute;
    top: 68px;
    left: 0;
    right: 0;
    background: #fff;
    display: none;
    border-bottom: 1px solid var(--line);
    box-shadow: 0 12px 20px rgba(26, 58, 92, 0.12);
  }
  .global-nav.open { display: block; }
  .global-nav ul { flex-direction: column; padding: 12px 16px 18px; align-items: stretch; }
  .global-nav a { padding: 12px 14px; border-bottom: none; }
}
