@charset "utf-8";
/* ==========================================================================
   CNC自動旋盤総合ガイド — スタイルシート
   技術メディア/ポータル型デザイン（BtoB・製造業向け）
   ========================================================================== */

/* ---- デザイントークン ------------------------------------------------- */
:root {
  --navy: #0e2f4f;
  --navy-d: #0a2440;
  --navy-l: #1c4f7c;
  --blue: #0f63b8;          /* プライマリーカラー */
  --blue-d: #0c4e92;
  --accent: #0f63b8;        /* アクセントカラー（メルマガ/CTA）＝プライマリーブルー系 */
  --accent-d: #0c4e92;
  --steel: #5b6b7a;
  --ink: #1f2933;
  --ink-soft: #3d4a57;
  --muted: #6b7886;
  --line: #e2e8f0;
  --line-d: #cbd5e1;
  --bg: #f4f7fa;
  --bg-alt: #eef3f8;
  --white: #ffffff;
  --ok: #1f8a5b;
  --warn-bg: #fff7e8;
  --warn-bd: #f0c674;
  --pr: #1c4f7c;
  --radius: 8px;
  --radius-s: 5px;
  --shadow: 0 1px 3px rgba(16, 42, 67, .08), 0 6px 18px rgba(16, 42, 67, .06);
  --shadow-h: 0 4px 12px rgba(16, 42, 67, .12), 0 14px 32px rgba(16, 42, 67, .10);
  --maxw: 1180px;
  --font: "Noto Sans JP", "Hiragino Kaku Gothic ProN", "Hiragino Sans",
          "Yu Gothic Medium", "Meiryo", system-ui, sans-serif;
}

/* ---- リセット --------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
/* 固定ヘッダー分のオフセット：目次アンカーへ飛んだ際に見出しが隠れないようにする
   ヘッダー実高 ≒ topbar 65px + mainnav 58px = 123px → 余白込みで 140px */
[id] { scroll-margin-top: 140px; }
body {
  margin: 0;
  font-family: var(--font);
  color: var(--ink);
  background: var(--bg);
  line-height: 1.8;
  font-size: 16px;
  font-feature-settings: "palt";
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--blue); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3, h4 { line-height: 1.45; color: var(--navy); font-weight: 700; }
ul, ol { padding-left: 1.4em; }
table { border-collapse: collapse; width: 100%; }

.container { width: 100%; max-width: var(--maxw); margin-inline: auto; padding-inline: 20px; }
.skip-link {
  position: absolute; left: -9999px; top: 0; background: var(--navy); color: #fff;
  padding: 10px 16px; z-index: 1000;
}
.skip-link:focus { left: 8px; top: 8px; }

/* ==========================================================================
   ヘッダー
   ========================================================================== */
.site-header { position: sticky; top: 0; z-index: 200; box-shadow: var(--shadow); }
.topbar { background: var(--white); color: var(--ink); border-bottom: 1px solid var(--line); }
.topbar__inner { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 64px; }
.brand { display: flex; align-items: center; gap: 12px; color: var(--navy); text-decoration: none; }
.brand:hover { text-decoration: none; opacity: .85; }
.brand__logo { display: block; height: 36px; width: auto; max-width: 100%; object-fit: contain; }
.brand__mark {
  flex: none; width: 40px; height: 40px; border-radius: 7px;
  background: linear-gradient(135deg, var(--blue) 0%, var(--navy-l) 100%);
  display: grid; place-items: center; font-weight: 800; font-size: 13px; letter-spacing: 0;
  border: 1px solid rgba(255,255,255,.18); color: #fff;
}
.brand__text { display: flex; flex-direction: column; line-height: 1.25; }
.brand__name { font-weight: 800; font-size: 1.12rem; letter-spacing: .01em; }
.brand__tag { font-size: .68rem; color: var(--muted); letter-spacing: .04em; }
.topbar__actions { display: flex; align-items: center; gap: 10px; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  font-weight: 700; font-size: .92rem; line-height: 1; text-align: center;
  padding: 11px 18px; border-radius: var(--radius-s); border: 1px solid transparent;
  cursor: pointer; transition: background .15s, transform .05s, box-shadow .15s; white-space: nowrap;
}
.btn:hover { text-decoration: none; }
.btn:active { transform: translateY(1px); }
.btn--accent { background: var(--accent); color: #fff; box-shadow: 0 2px 0 var(--accent-d); }
.btn--accent:hover { background: var(--accent-d); color: #fff; }
.btn--primary { background: var(--blue); color: #fff; }
.btn--primary:hover { background: var(--blue-d); color: #fff; }
.btn--ghost { background: transparent; color: var(--navy); border-color: var(--line-d); }
.btn--ghost:hover { background: var(--bg-alt); color: var(--navy); }
.btn--lg { padding: 15px 30px; font-size: 1.02rem; }
.btn--block { display: flex; width: 100%; }

.icon-btn {
  background: transparent; border: 1px solid var(--line-d); color: var(--ink-soft);
  border-radius: var(--radius-s); padding: 9px 12px; font-size: .85rem; font-weight: 600;
  cursor: pointer; display: inline-flex; align-items: center; gap: 6px;
}
.icon-btn:hover { background: var(--bg-alt); }
.nav-toggle { display: none; }

/* インラインアイコン（Heroicons） */
.hi { width: 1.15em; height: 1.15em; flex: none; display: inline-block; vertical-align: -0.2em; }
.to-top .hi { width: 22px; height: 22px; vertical-align: middle; }

/* メインナビ（メガメニュー） */
.mainnav { background: var(--white); border-top: 1px solid var(--line); }
.mainnav__list { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; }
.mainnav__item { position: relative; }
.mainnav__item > a {
  display: block; color: var(--ink-soft); font-weight: 700; font-size: .95rem;
  padding: 14px 20px; letter-spacing: .02em; border-bottom: 3px solid transparent;
}
.mainnav__item > a:hover { background: var(--bg-alt); text-decoration: none; border-bottom-color: var(--blue); color: var(--navy); }
.mainnav__item.is-current > a { border-bottom-color: var(--blue); background: var(--bg-alt); color: var(--navy); }
.mainnav__item > a .hi { margin-right: 6px; color: var(--blue); }
.mega {
  position: absolute; top: 100%; left: 0; min-width: 320px; max-width: 460px;
  background: #fff; border: 1px solid var(--line); border-top: 3px solid var(--blue);
  box-shadow: var(--shadow-h); border-radius: 0 0 var(--radius) var(--radius);
  padding: 10px; opacity: 0; visibility: hidden; transform: translateY(6px);
  transition: opacity .15s, transform .15s, visibility .15s; z-index: 50;
}
.mainnav__item:hover .mega, .mainnav__item:focus-within .mega { opacity: 1; visibility: visible; transform: translateY(0); }
.mega ul { list-style: none; margin: 0; padding: 0; }
.mega a { display: block; padding: 9px 12px; border-radius: var(--radius-s); color: var(--ink); }
.mega a:hover { background: var(--bg-alt); text-decoration: none; }
.mega__t { font-weight: 700; color: var(--navy); display: block; }
.mega__d { font-size: .78rem; color: var(--muted); display: block; }

/* 検索バー */
.searchbar { background: #fff; border-bottom: 1px solid var(--line); }
.searchbar[hidden] { display: none; }
.searchbar__inner { padding: 14px 0; position: relative; }
.searchbar input {
  width: 100%; padding: 13px 16px; font-size: 1rem; border: 2px solid var(--line-d);
  border-radius: var(--radius-s); font-family: inherit;
}
.searchbar input:focus { outline: none; border-color: var(--blue); }
.search-results { list-style: none; margin: 8px 0 0; padding: 0; }
.search-results li { border-bottom: 1px solid var(--line); }
.search-results a { display: block; padding: 10px 8px; }
.search-results a:hover { background: var(--bg-alt); text-decoration: none; }
.search-results .sr-cat { font-size: .72rem; color: var(--blue); font-weight: 700; }
.search-results .sr-empty { padding: 12px 8px; color: var(--muted); }

/* ==========================================================================
   パンくず
   ========================================================================== */
.breadcrumb { background: var(--bg-alt); border-bottom: 1px solid var(--line); font-size: .8rem; }
.breadcrumb ol { list-style: none; margin: 0; padding: 10px 0; display: flex; flex-wrap: wrap; gap: 6px; color: var(--muted); }
.breadcrumb li { display: flex; align-items: center; gap: 6px; }
.breadcrumb li:not(:last-child)::after { content: "›"; color: var(--line-d); }
.breadcrumb a { color: var(--steel); }
.breadcrumb li:last-child { color: var(--ink-soft); font-weight: 600; }

/* ==========================================================================
   レイアウト（本文 + サイドバー）
   ========================================================================== */
.layout { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 40px; padding-top: 36px; padding-bottom: 56px; align-items: start; }
.layout--full { display: block; padding-top: 0; }
.content { min-width: 0; }
.sidebar { position: sticky; top: 92px; display: flex; flex-direction: column; gap: 22px; }

/* ==========================================================================
   記事
   ========================================================================== */
.article {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 36px 40px;
}
.article__header { border-bottom: 2px solid var(--line); padding-bottom: 18px; margin-bottom: 26px; }
.badge {
  display: inline-block; font-size: .72rem; font-weight: 800; letter-spacing: .08em;
  padding: 3px 9px; border-radius: 3px; margin-bottom: 12px;
}
.badge--pr { background: var(--pr); color: #fff; }
.badge--cat { background: var(--bg-alt); color: var(--blue); border: 1px solid var(--line); }
.article__header h1 { font-size: 1.92rem; margin: 4px 0 0; letter-spacing: .01em; }
.article__lead { font-size: 1.05rem; color: var(--ink-soft); margin: 16px 0 0; }
/* 第二階層TOP：タイトル背景バナー */
.category-hero {
  background: #1174e4 url("category-hero.png") center / cover no-repeat;
  border-radius: 14px;
  padding: clamp(44px, 8vw, 88px) 24px;
  text-align: center;
}
.article__header .category-hero h1 {
  color: #fff; font-size: clamp(1.45rem, 3.4vw, 2.25rem);
  margin: 0; letter-spacing: .03em;
  text-shadow: 0 1px 10px rgba(9, 62, 130, .28);
}
.category-hero__en {
  color: rgba(255, 255, 255, .92);
  font-size: clamp(.9rem, 1.9vw, 1.2rem);
  margin: 16px 0 0; letter-spacing: .05em;
}
.article__meta { display: flex; flex-wrap: wrap; gap: 16px; font-size: .8rem; color: var(--muted); margin-top: 16px; }
.article__meta .tag { color: var(--blue); font-weight: 700; }

.article__body { font-size: 1rem; }
.article__body > h2 {
  font-size: 1.42rem; margin: 2.4em 0 .9em; padding: 12px 0 12px 16px;
  border-left: 5px solid var(--blue); background: linear-gradient(90deg, var(--bg-alt), transparent);
}
.article__body > h2:first-child { margin-top: .4em; }
.article__body h3 { font-size: 1.16rem; margin: 1.9em 0 .7em; padding-bottom: 6px; border-bottom: 1px dashed var(--line-d); }
.article__body h4 { font-size: 1.02rem; margin: 1.5em 0 .5em; color: var(--navy-l); }
.article__body p { margin: 0 0 1.2em; }
.article__body ul, .article__body ol { margin: 0 0 1.4em; padding-left: 1.5em; }
.article__body li { margin-bottom: .5em; }
.article__body strong { color: var(--navy); font-weight: 700; }
.article__body a { font-weight: 600; text-decoration: underline; text-underline-offset: 2px; }
.article__body img { border: 1px solid var(--line); border-radius: var(--radius); margin: 1.4em 0; }
.article__body figure { margin: 1.6em 0; }
.article__body figure img { margin: 0 auto; }
.article__body .article__figure { position: relative; }
.article__body .article__figure img { width: 100%; aspect-ratio: 16/9; height: auto; object-fit: cover; margin: 0 auto; }
.article__body .article__figure figcaption { position: absolute; left: 12px; bottom: 12px; margin: 0; background: rgba(15,23,42,.32); color: rgba(255,255,255,.72); font-size: .66rem; line-height: 1.4; padding: 2px 10px; border-radius: 999px; text-align: left; }
.article__body figcaption { font-size: .82rem; color: var(--muted); text-align: center; margin-top: 8px; }

/* 表 */
.table-wrap { overflow-x: auto; margin: 1.4em 0; border-radius: var(--radius); border: 1px solid var(--line); }
.article__body table { font-size: .92rem; background: #fff; min-width: 520px; }
.article__body th, .article__body td { padding: 12px 14px; border: 1px solid var(--line); text-align: left; vertical-align: top; }
.article__body thead th { background: var(--navy); color: #fff; font-weight: 700; border-color: var(--navy-l); }
.article__body tbody th { background: var(--bg-alt); color: var(--navy); white-space: nowrap; }
.article__body tbody tr:nth-child(even) td { background: #fafcfe; }

/* コールアウト */
.callout { border-radius: var(--radius); padding: 16px 20px; margin: 1.6em 0; border: 1px solid var(--line); background: #fff; }
.callout__t { font-weight: 800; margin: 0 0 6px; display: flex; align-items: center; gap: 8px; color: var(--navy); }
.callout p:last-child { margin-bottom: 0; }
.callout--point { background: #eef6ff; border-color: #bcd9f4; }
.callout--point .callout__t { color: var(--blue-d); }
.callout--note { background: var(--warn-bg); border-color: var(--warn-bd); }
.callout--note .callout__t { color: #9a6a00; }
.callout--check { background: #eefaf2; border-color: #b6e3c8; }
.callout--check .callout__t { color: var(--ok); }

/* 用語の補足ボックス */
.deftable { margin: 1.4em 0; }

/* PR/関連の自然な誘導ボックス（記事内） */
.inline-pr {
  margin: 1.8em 0; padding: 20px 22px; border-radius: var(--radius);
  background: linear-gradient(120deg, #f3f8fd, #eaf2fb); border: 1px solid #cfe0f1;
}
.inline-pr .inline-pr__label { font-size: .7rem; font-weight: 800; color: var(--pr); letter-spacing: .08em; }
.inline-pr h4 { margin: 4px 0 8px; font-size: 1.12rem; }
.inline-pr p { margin: 0 0 12px; font-size: .94rem; color: var(--ink-soft); }

/* 目次 */
.toc { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 20px; margin: 0 0 30px; }
.toc__t { font-weight: 800; color: var(--navy); margin: 0 0 8px; font-size: .98rem; }
.toc ol { margin: 0; padding-left: 1.4em; }
.toc li { margin-bottom: 5px; font-size: .92rem; }
.toc a { color: var(--ink-soft); }

/* ステップリスト */
.steps { list-style: none; counter-reset: step; padding: 0; margin: 1.5em 0; }
.steps > li { position: relative; padding: 4px 0 18px 52px; }
.steps > li::before {
  counter-increment: step; content: counter(step);
  position: absolute; left: 0; top: 0; width: 34px; height: 34px; border-radius: 50%;
  background: var(--blue); color: #fff; font-weight: 800; display: grid; place-items: center;
}
.steps > li:not(:last-child)::after { content: ""; position: absolute; left: 16px; top: 36px; bottom: 2px; width: 2px; background: var(--line-d); }
.steps__t { font-weight: 700; color: var(--navy); display: block; margin-bottom: 2px; }

/* 関連記事 */
.related { margin-top: 44px; padding-top: 28px; border-top: 2px solid var(--line); }
.related__h { font-size: 1.2rem; margin: 0 0 16px; }
.related__grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; }
.related__card { display: block; padding: 14px 16px; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); transition: box-shadow .15s, transform .1s; }
.related__card:hover { box-shadow: var(--shadow); transform: translateY(-2px); text-decoration: none; }
.related__card .rc-cat { font-size: .72rem; color: var(--blue); font-weight: 700; }
.related__card .rc-t { font-weight: 700; color: var(--navy); margin-top: 3px; }

/* 記事末CTA */
.cta-band {
  margin-top: 40px; border-radius: var(--radius); overflow: hidden;
  background: linear-gradient(120deg, var(--navy), var(--navy-l)); color: #fff; padding: 30px 32px;
}
.cta-band h3 { color: #fff; font-size: 1.3rem; margin: 0 0 8px; }
.cta-band p { margin: 0 0 18px; color: #d7e6f3; font-size: .96rem; }
.cta-band__btns { display: flex; flex-wrap: wrap; gap: 12px; }

/* ==========================================================================
   サイドバー
   ========================================================================== */
.swidget { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.swidget__h { font-size: .95rem; font-weight: 800; color: #fff; background: var(--navy); padding: 12px 16px; display: flex; align-items: center; gap: 8px; }
.swidget__h::before {
  content: ""; flex: none; width: 1.15em; height: 1.15em; background: currentColor;
  -webkit-mask: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="%23000" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"><path d="M17.593 3.322c1.1.128 1.907 1.077 1.907 2.185V21L12 17.25 4.5 21V5.507c0-1.108.806-2.057 1.907-2.185a48.507 48.507 0 0 1 11.186 0Z"/></svg>') center / contain no-repeat;
  mask: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="%23000" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"><path d="M17.593 3.322c1.1.128 1.907 1.077 1.907 2.185V21L12 17.25 4.5 21V5.507c0-1.108.806-2.057 1.907-2.185a48.507 48.507 0 0 1 11.186 0Z"/></svg>') center / contain no-repeat;
}
.snews .swidget__h::before { content: none; } /* HTML側にインラインSVGアイコンが既にあるため */
.swidget__body { padding: 14px 16px; }
.snav { list-style: none; margin: 0; padding: 0; }
.snav li { border-bottom: 1px solid var(--line); }
.snav li:last-child { border-bottom: 0; }
.snav a { display: block; padding: 10px 16px; color: var(--ink-soft); font-size: .9rem; font-weight: 600; }
.snav a:hover { background: var(--bg-alt); color: var(--blue); text-decoration: none; }
.snav .is-active > a { color: var(--blue); border-left: 3px solid var(--blue); background: var(--bg-alt); }
.srank { list-style: none; margin: 0; padding: 0; counter-reset: rk; }
.srank li { counter-increment: rk; display: flex; gap: 12px; align-items: flex-start; padding: 10px 0; border-bottom: 1px dashed var(--line); }
.srank li:last-child { border-bottom: 0; }
.srank li::before { content: counter(rk); flex: none; width: 24px; height: 24px; border-radius: 4px; background: var(--bg-alt); color: var(--blue); font-weight: 800; font-size: .8rem; display: grid; place-items: center; }
.srank a { font-size: .88rem; font-weight: 600; color: var(--ink-soft); }
.srank li:nth-child(1)::before { background: var(--blue); color: #fff; }
.srank li:nth-child(2)::before { background: var(--navy-l); color: #fff; }
.srank li:nth-child(3)::before { background: var(--steel); color: #fff; }

.snews { background: linear-gradient(135deg, #12365a, #1c4f7c); color: #fff; border: 0; }
.snews .swidget__body { color: #dcebf7; }
.snews__t { font-weight: 800; font-size: 1.05rem; color: #fff; margin: 0 0 6px; }
.snews p { font-size: .85rem; margin: 0 0 14px; }
.snews ul { margin: 0 0 16px; padding-left: 1.2em; font-size: .83rem; }

.spr { border: 1px solid #cfe0f1; }
.spr .swidget__h { background: var(--pr); }
.spr__body { padding: 16px; }
.spr__label { font-size: .68rem; font-weight: 800; color: var(--pr); letter-spacing: .06em; }

/* ==========================================================================
   ホーム
   ========================================================================== */
.hero { background: linear-gradient(115deg, rgba(0,0,0,.55), rgba(0,0,0,.35)), url("/cnc/assets/365-back.png") center/cover no-repeat; color: #fff; position: relative; overflow: hidden; }
.hero::after { content: ""; position: absolute; inset: 0; background-image: radial-gradient(rgba(255,255,255,.05) 1px, transparent 1px); background-size: 22px 22px; opacity: .5; pointer-events: none; }
.hero__inner { position: relative; padding: 56px 0 60px; display: grid; grid-template-columns: 1.1fr .9fr; gap: 40px; align-items: center; }
.hero__eyebrow { display: inline-block; font-size: .76rem; font-weight: 700; letter-spacing: .12em; color: #9fc4e6; border: 1px solid rgba(255,255,255,.25); padding: 5px 12px; border-radius: 20px; margin-bottom: 18px; }
.hero h1 { color: #fff; font-size: 2.4rem; line-height: 1.4; margin: 0 0 16px; letter-spacing: .01em; }
.hero h1 .em { color: #ffd9a8; }
.hero__lead { font-size: 1.05rem; color: #cfe0f1; margin: 0 0 26px; }
.hero__btns { display: flex; flex-wrap: wrap; gap: 14px; }
.hero__card { background: rgba(255,255,255,.07); border: 1px solid rgba(255,255,255,.16); border-radius: 12px; padding: 24px; backdrop-filter: blur(2px); }
.hero__card .badge--pr { margin-bottom: 10px; }
.hero__card h2 { color: #fff; font-size: 1.25rem; margin: 0 0 10px; }
.hero__card p { color: #cfe0f1; font-size: .92rem; margin: 0 0 16px; }

.section { padding: 52px 0; }
.section--alt { background: var(--white); border-block: 1px solid var(--line); }
.section__head { text-align: center; margin-bottom: 34px; }
.section__head h2 { font-size: 1.7rem; margin: 0 0 8px; position: relative; display: inline-block; }
.section__head .en { display: block; font-size: .72rem; letter-spacing: .2em; color: var(--blue); font-weight: 700; margin-bottom: 6px; }
.section__head p { color: var(--steel); margin: 6px 0 0; font-size: .96rem; }

.cat-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 20px; }
.cat-card { position: relative; display: flex; flex-direction: column; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; transition: box-shadow .15s, transform .1s, border-color .15s; }
.cat-card:hover { box-shadow: var(--shadow-h); transform: translateY(-3px); border-color: #bcd9f4; }
/* .article__body a の underline / font-weight を打ち消す */
a.cat-card, a.cat-card:hover { text-decoration: none; font-weight: 400; }
.cat-card__thumb {
  display: grid; place-items: center; height: 128px;
  margin: -22px -22px 16px;
  background: linear-gradient(135deg, var(--bg-alt) 0%, #e0ebf6 100%);
  border-bottom: 1px solid var(--line);
  border-radius: calc(var(--radius) - 1px) calc(var(--radius) - 1px) 0 0;
  color: var(--blue);
}
.cat-card__thumb svg { width: 44px; height: 44px; }
.cat-card__cover { position: absolute; inset: 0; z-index: 1; border-radius: inherit; text-indent: -9999px; overflow: hidden; }
.cat-card__links { position: relative; z-index: 2; }
.cat-card__icon { width: 46px; height: 46px; border-radius: 10px; background: var(--bg-alt); color: var(--blue); display: grid; place-items: center; font-size: 1.4rem; margin-bottom: 14px; }
.cat-card__icon svg { width: 24px; height: 24px; display: block; }
.cat-card h3 { font-size: 1.14rem; margin: 0 0 6px; padding-bottom: 0; border-bottom: 0; }
.cat-card p { font-size: .88rem; color: var(--steel); margin: 0 0 12px; flex: 1; }
.cat-card__links { list-style: none; margin: 0; padding: 12px 0 0; border-top: 1px dashed var(--line); }
.cat-card__links li { font-size: .85rem; padding: 3px 0; }
.cat-card__links a { color: var(--ink-soft); }
.cat-card__more { font-size: .82rem; font-weight: 700; color: var(--blue); margin-top: 12px; }

/* ---- 知りたいテーマから探す（テーマカード） ----------------------- */
.theme-head { display: flex; align-items: center; gap: 28px; margin-bottom: 30px; }
.theme-head h2 { font-size: 1.85rem; font-weight: 800; color: var(--navy); margin: 0; white-space: nowrap; letter-spacing: .01em; }
.theme-head::after { content: ""; flex: 1; height: 1px; background: var(--line-d); }
.theme-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 22px 28px; }
.theme-card {
  display: flex; align-items: center; gap: 18px;
  background: #fafbfd; border: 1px solid var(--line); border-radius: 12px;
  padding: 24px 24px; color: inherit;
  transition: box-shadow .15s, transform .1s, border-color .15s, background .15s;
}
.theme-card:hover { background: #fff; border-color: #bcd9f4; box-shadow: var(--shadow-h); transform: translateY(-3px); text-decoration: none; }
.theme-card__icon {
  flex: 0 0 auto; width: 76px; height: 76px; border-radius: 50%;
  background: #e9eef8; color: var(--navy);
  display: grid; place-items: center;
}
.theme-card__icon svg { width: 38px; height: 38px; display: block; }
.theme-card__body { flex: 1 1 auto; min-width: 0; }
.theme-card__body h3 { font-size: 1.16rem; font-weight: 800; color: var(--navy); margin: 0 0 8px; }
.theme-card__body p { font-size: .92rem; color: var(--steel); margin: 0; line-height: 1.65; }
.theme-card__arrow {
  flex: 0 0 auto; width: 34px; height: 34px; border-radius: 50%;
  border: 1px solid var(--line-d); color: var(--navy);
  display: grid; place-items: center; transition: background .15s, border-color .15s, color .15s;
}
.theme-card__arrow svg { width: 18px; height: 18px; display: block; }
.theme-card:hover .theme-card__arrow { background: var(--navy); border-color: var(--navy); color: #fff; }

.feature-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 18px; }
.fcard { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; text-align: center; }
.fcard__n { font-size: 1.9rem; font-weight: 800; color: var(--blue); }
.fcard__t { font-weight: 700; color: var(--navy); margin: 4px 0 6px; }
.fcard p { font-size: .82rem; color: var(--steel); margin: 0; }

.post-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.pcard { display: flex; flex-direction: column; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; transition: box-shadow .15s, transform .1s; }
.pcard:hover { box-shadow: var(--shadow-h); transform: translateY(-3px); text-decoration: none; }
.pcard__thumb { aspect-ratio: 16/9; background: linear-gradient(135deg, var(--navy-l), var(--blue)); color: #fff; display: grid; place-items: center; font-size: .8rem; letter-spacing: .1em; opacity: .92; }
.pcard__thumb img { width: 100%; aspect-ratio: 16/9; height: auto; object-fit: cover; display: block; }
.pcard__body { padding: 16px 18px; display: flex; flex-direction: column; flex: 1; }
.pcard__cat { font-size: .72rem; font-weight: 700; color: var(--blue); }
.pcard__t { font-size: 1.02rem; font-weight: 700; color: var(--navy); margin: 5px 0 8px; line-height: 1.5; }
.pcard__d { font-size: .84rem; color: var(--steel); margin: 0; flex: 1; }

.home-news { background: linear-gradient(120deg, var(--navy), var(--navy-l)); color: #fff; }
.home-news__inner { display: grid; grid-template-columns: 1fr 1fr; gap: 40px; align-items: center; padding: 48px 0; }
.home-news h2 { color: #fff; font-size: 1.7rem; margin: 0 0 12px; }
.home-news p { color: #cfe0f1; margin: 0 0 12px; }
.home-news ul { color: #e5f0fa; margin: 0 0 8px; }
.mailform { background: #fff; border-radius: 12px; padding: 26px; color: var(--ink); box-shadow: var(--shadow-h); }

/* ==========================================================================
   新着情報（TOPページ）
   ========================================================================== */
.news-list { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--line); }
.news-list li { border-bottom: 1px solid var(--line); }
.news-list a {
  display: grid; grid-template-columns: 7.5em auto 1fr; align-items: center;
  gap: 8px 16px; padding: 16px 6px; color: var(--ink); text-decoration: none;
}
.news-list a:hover { background: var(--bg-alt); }
.news-list a:hover .news-list__t { color: var(--blue); text-decoration: underline; }
.news-list__date { color: var(--steel); font-size: .86rem; font-variant-numeric: tabular-nums; }
.news-list__cat {
  justify-self: start; font-size: .74rem; font-weight: 700; color: var(--blue);
  background: var(--bg-alt); border: 1px solid var(--line); border-radius: 999px;
  padding: 3px 12px; white-space: nowrap;
}
.news-list__t { font-weight: 600; color: var(--navy); font-size: .97rem; }
.news-more { text-align: right; margin: 22px 0 0; }
@media (max-width: 600px) {
  .news-list a { grid-template-columns: auto 1fr; padding: 14px 4px; }
  .news-list__t { grid-column: 1 / -1; }
}

/* 新着情報（TOPページ・カード型） */
.topnews__head { display: flex; align-items: center; gap: 24px; margin-bottom: 26px; }
.topnews__title { font-size: 1.7rem; margin: 0; white-space: nowrap; }
.topnews__rule { flex: 1 1 auto; height: 1px; background: var(--line-d); position: relative; }
.topnews__rule::before {
  content: ""; position: absolute; left: 0; top: 50%; transform: translateY(-50%);
  width: 52px; height: 3px; background: var(--blue);
}
.topnews__more { display: inline-flex; align-items: center; gap: 14px; flex-shrink: 0; color: var(--navy); font-weight: 700; font-size: .96rem; }
.topnews__more:hover { text-decoration: none; color: var(--blue); }
.topnews__more-label { white-space: nowrap; }
.topnews__more-arrow {
  display: inline-grid; place-items: center; width: 34px; height: 34px; border-radius: 50%;
  border: 1.5px solid var(--blue); color: var(--blue);
  transition: background .15s, color .15s;
}
.topnews__more-arrow::before {
  content: ""; width: 10px; height: 10px;
  border-top: 2px solid currentColor; border-right: 2px solid currentColor;
  transform: translateX(-2px) rotate(45deg);
}
.topnews__more:hover .topnews__more-arrow { background: var(--blue); color: #fff; }

.topnews__card { background: #fff; border: 1px solid var(--line); border-radius: 8px; box-shadow: var(--shadow); overflow: hidden; }
.topnews__list { list-style: none; margin: 0; padding: 0; }
.topnews__item + .topnews__item { border-top: 1px solid var(--line); }
.topnews__item a {
  display: grid; grid-template-columns: 7.5em 7em 1fr auto;
  grid-template-areas: "date cat title arrow";
  align-items: center; gap: 0 28px; padding: 16px 32px;
  color: var(--ink); text-decoration: none; transition: background .15s;
}
.topnews__item a:hover { background: var(--bg-alt); text-decoration: none; }
.topnews__item a:hover .topnews__t { color: var(--blue); }
.topnews__item a:hover .topnews__arrow { border-color: var(--blue); }
.topnews__date { grid-area: date; color: var(--navy); font-weight: 600; font-size: .92rem; font-variant-numeric: tabular-nums; white-space: nowrap; }
.topnews__cat {
  grid-area: cat; justify-self: stretch; text-align: center; font-size: .8rem; font-weight: 700;
  border-radius: 6px; padding: 5px 0; white-space: nowrap; line-height: 1.4;
}
.topnews__cat--news { background: #e7f0fb; color: #1f60ad; }
.topnews__cat--subsidy { background: #e3f4ea; color: #1f8a5b; }
.topnews__cat--column { background: #f1eafb; color: #7a4fc4; }
.topnews__t { grid-area: title; font-weight: 600; color: var(--navy); font-size: 1.02rem; line-height: 1.5; transition: color .15s; }
.topnews__arrow {
  grid-area: arrow; width: 10px; height: 10px; align-self: center; justify-self: end;
  border-top: 2px solid var(--line-d); border-right: 2px solid var(--line-d);
  transform: rotate(45deg); transition: border-color .15s;
}
@media (max-width: 600px) {
  .topnews__head { gap: 14px; margin-bottom: 18px; }
  .topnews__title { font-size: 1.35rem; }
  .topnews__more { font-size: .9rem; gap: 10px; }
  .topnews__more-arrow { width: 38px; height: 38px; }
  .topnews__item a {
    grid-template-columns: auto 1fr auto;
    grid-template-areas:
      "date cat   arrow"
      "title title arrow";
    gap: 8px 14px; padding: 18px;
  }
  .topnews__t { font-size: .96rem; }
}

/* ページネーション */
.pager { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 6px; margin: 34px 0 0; }
.pager a, .pager span {
  display: inline-flex; align-items: center; justify-content: center; min-width: 40px; height: 40px;
  padding: 0 12px; border: 1px solid var(--line-d); border-radius: var(--radius-s);
  font-size: .92rem; font-weight: 600; color: var(--blue); background: #fff;
}
.pager a:hover { background: var(--bg-alt); text-decoration: none; }
.pager .is-current { background: var(--blue); border-color: var(--blue); color: #fff; cursor: default; }
.pager .is-disabled { color: var(--line-d); background: var(--bg-alt); cursor: default; }
.news-count { color: var(--steel); font-size: .88rem; margin: 0 0 18px; }

/* ==========================================================================
   フォーム
   ========================================================================== */
.field { margin-bottom: 16px; }
.field label { display: block; font-weight: 700; font-size: .9rem; color: var(--navy); margin-bottom: 5px; }
.field .req { color: #c0392b; font-size: .78rem; margin-left: 6px; }
.field .opt { color: var(--muted); font-size: .76rem; margin-left: 6px; font-weight: 600; }
.field input, .field select, .field textarea {
  width: 100%; padding: 12px 14px; font-size: 1rem; font-family: inherit;
  border: 1.5px solid var(--line-d); border-radius: var(--radius-s); background: #fff;
}
.field input:focus, .field select:focus, .field textarea:focus { outline: none; border-color: var(--blue); box-shadow: 0 0 0 3px rgba(21,101,166,.12); }
.field .hint { font-size: .78rem; color: var(--muted); margin-top: 4px; }
.field--error input, .field--error select { border-color: #c0392b; }
.field__err { color: #c0392b; font-size: .8rem; margin-top: 4px; display: none; }
.field--error .field__err { display: block; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.checkline { display: flex; gap: 9px; align-items: flex-start; font-size: .88rem; }
.checkline input { width: auto; margin-top: 5px; }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.form-note { font-size: .8rem; color: var(--muted); margin-top: 10px; }
.form-success { background: #eefaf2; border: 1px solid #b6e3c8; border-radius: var(--radius); padding: 18px 20px; color: #176b46; font-weight: 600; }
.form-success[hidden] { display: none; }

/* ==========================================================================
   汎用パーツ
   ========================================================================== */
.lede { font-size: 1.08rem; color: var(--ink-soft); }
.note-block { background: var(--warn-bg); border: 1px solid var(--warn-bd); border-radius: var(--radius); padding: 16px 20px; font-size: .88rem; color: #6b4e12; margin: 1.6em 0; }
.note-block strong { color: #7a4d00; }
.pill-list { display: flex; flex-wrap: wrap; gap: 8px; list-style: none; padding: 0; margin: 1.2em 0; }
.pill-list li { background: var(--bg-alt); border: 1px solid var(--line); border-radius: 20px; padding: 5px 14px; font-size: .84rem; color: var(--ink-soft); }
.card-list { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; list-style: none; padding: 0; margin: 1.4em 0; }
.card-list > li { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 20px; }
.card-list h4 { margin: 0 0 6px; }
.card-list p { margin: 0; font-size: .9rem; color: var(--steel); }

.maker-card { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 22px 24px; margin: 16px 0; box-shadow: var(--shadow); }
.maker-card__head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; flex-wrap: wrap; border-bottom: 1px solid var(--line); padding-bottom: 10px; margin-bottom: 12px; }
.maker-card__name { font-size: 1.18rem; margin: 0; }
.maker-card__brand { font-size: .82rem; color: var(--blue); font-weight: 700; }
.maker-card dl { display: grid; grid-template-columns: 7em 1fr; gap: 4px 14px; margin: 0; font-size: .9rem; }
.maker-card dt { color: var(--muted); font-weight: 700; }
.maker-card dd { margin: 0; }
.is-recommended { border: 2px solid var(--accent); }
.is-recommended .maker-card__head { border-bottom-color: var(--accent); }
.reco-flag { background: var(--accent); color: #fff; font-size: .7rem; font-weight: 800; padding: 3px 9px; border-radius: 3px; }

/* ==========================================================================
   フッター
   ========================================================================== */
.site-footer { background: var(--navy-d); color: #c3d3e2; margin-top: 0; }
.footer-cta { background: var(--accent); color: #fff; }
.footer-cta__inner { display: flex; align-items: center; justify-content: space-between; gap: 20px; flex-wrap: wrap; padding: 26px 0; }
.footer-cta h3 { color: #fff; margin: 0; font-size: 1.3rem; }
.footer-cta p { margin: 4px 0 0; color: #fff4e8; font-size: .9rem; }
.footer-main { padding: 46px 0 30px; }
.footer-grid { display: grid; grid-template-columns: 1.4fr repeat(3, 1fr); gap: 30px; }
.footer-brand .brand { color: #fff; }
.footer-brand .brand__name { font-size: 1.1rem; color: #fff; }
/* Logo artwork is dark; render it light so it reads on the dark footer */
.footer-brand .brand__logo { height: 30px; filter: brightness(0) invert(1); }
.footer-brand p { font-size: .82rem; color: #9fb4c8; margin: 14px 0 0; line-height: 1.7; }
.footer-col h4 { color: #fff; font-size: .92rem; margin: 0 0 14px; }
.footer-col ul { list-style: none; margin: 0; padding: 0; }
.footer-col li { margin-bottom: 9px; }
.footer-col a { color: #b9cadb; font-size: .86rem; }
.footer-col a:hover { color: #fff; }
.footer-bottom { border-top: 1px solid rgba(255,255,255,.1); padding: 18px 0; font-size: .78rem; color: #8ba3ba; display: flex; justify-content: space-between; flex-wrap: wrap; gap: 10px; }
.footer-bottom a { color: #8ba3ba; }
.footer-bottom a + a { margin-left: 18px; }
.footer-disclaimer { font-size: .74rem; color: #7890a6; padding: 0 0 24px; line-height: 1.7; }

/* 戻るボタン */
.to-top { position: fixed; right: 18px; bottom: 18px; width: 46px; height: 46px; border-radius: 50%; background: var(--navy); color: #fff; border: 0; font-size: 1.2rem; cursor: pointer; box-shadow: var(--shadow-h); opacity: 0; pointer-events: none; transition: opacity .2s; z-index: 150; }
.to-top.show { opacity: .92; pointer-events: auto; }
.to-top:hover { opacity: 1; }

/* ==========================================================================
   レスポンシブ
   ========================================================================== */
@media (max-width: 980px) {
  .layout { grid-template-columns: 1fr; gap: 30px; }
  .sidebar { position: static; }
  .hero__inner { grid-template-columns: 1fr; gap: 28px; padding: 40px 0 44px; }
  .hero h1 { font-size: 2rem; }
  .cat-grid, .post-grid, .theme-grid { grid-template-columns: repeat(2, 1fr); }
  .feature-grid { grid-template-columns: repeat(2, 1fr); }
  .home-news__inner { grid-template-columns: 1fr; gap: 26px; }
}

@media (max-width: 720px) {
  body { font-size: 15.5px; }
  /* SP: mainnav は折りたたみでヘッダーは topbar(58px) のみ → オフセットを縮小 */
  [id] { scroll-margin-top: 76px; }
  .nav-toggle { display: inline-flex; }
  .topbar__inner { min-height: 58px; }
  .brand__logo { height: 28px; }
  .search-toggle { display: none; }
  /* SP: メルマガ登録・メニューはアイコンのみ表示（テキスト非表示・上下左右中央揃え） */
  .topbar__actions .btn--primary,
  .topbar__actions .nav-toggle {
    font-size: 0; gap: 0; padding: 0;
    width: 46px; height: 46px;
    display: inline-flex; align-items: center; justify-content: center;
  }
  .topbar__actions .btn--primary .hi,
  .topbar__actions .nav-toggle .hi { display: none; }
  .topbar__actions .btn--primary::before { content: "\2709"; font-size: 1.4rem; line-height: 1; }
  .topbar__actions .nav-toggle::before { content: "\2630"; font-size: 1.5rem; line-height: 1; position: relative; top: -3px; }
  .mainnav { display: none; }
  .mainnav.is-open { display: block; }
  .mainnav__list { flex-direction: column; }
  .mainnav__item > a { padding: 14px 20px; border-bottom: 1px solid var(--line); }
  .mainnav__item.has-mega > a::after { content: "＋"; float: right; color: var(--muted); }
  .mainnav__item.is-expanded.has-mega > a::after { content: "−"; }
  .mega { position: static; opacity: 1; visibility: visible; transform: none; box-shadow: none; max-width: none; min-width: 0; border-radius: 0; border: 0; border-top: 0; background: var(--bg-alt); display: none; padding: 4px 10px 10px; }
  .mainnav__item.is-expanded .mega { display: block; }
  .mega a { color: var(--ink); }
  .mega a:hover { background: var(--line); }
  .mega__t { color: var(--navy); }
  .mega__d { color: var(--muted); }
  .article { padding: 22px 20px; }
  .article__header h1 { font-size: 1.5rem; }
  .cat-grid, .post-grid, .feature-grid, .related__grid, .card-list, .theme-grid { grid-template-columns: 1fr; }
  .theme-head h2 { font-size: 1.5rem; white-space: normal; }
  .form-row { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .footer-brand { grid-column: 1 / -1; }
  .cta-band { padding: 24px; }
  .section { padding: 40px 0; }
}

@media (max-width: 460px) {
  .footer-grid { grid-template-columns: 1fr; }
  .hero h1 { font-size: 1.7rem; }
  .btn--lg { padding: 13px 22px; }
}

@media print {
  .site-header, .sidebar, .to-top, .cta-band, .related, .site-footer .footer-cta { display: none; }
  .layout { grid-template-columns: 1fr; }
  body { background: #fff; }
}
