/*
 * site.css — 共通スタイル（ヘッダー・フッター・セクション・カード・ボタン・グリッド）
 *
 * 他のツールへはこのファイルをそのままコピーして使う。ツール固有の見た目は各ツールの
 * CSS（例：loan.css）に書き、ここには書かない。
 *
 * ルール：
 *  - !important を使わない
 *  - IDセレクタ（#xxx）でスタイルを当てない（クラスだけで当てる）
 *  - 色・余白・幅は下の変数だけを参照する
 */

:root {
  /* ティール基調 */
  --teal-50: #f0fdfa;
  --teal-100: #ccfbf1;
  --teal-200: #99f6e4;
  --teal: #0d9488;
  --teal-dark: #0f766e; /* 白との比率 5.47:1。文字・ボタンの背景にはこちらを使う */
  --teal-darker: #115e59; /* ホバー用。白との比率 7.6:1 */

  /* 文字・面・線 */
  --ink: #0f172a;
  --text: #1e293b;
  --text-sub: #475569;
  --muted: #64748b;
  --muted-light: #94a3b8;
  --line: #e2e8f0;
  --line-strong: #cbd5e1;
  --bg: #f8fafc;
  --card: #ffffff;

  /* 形・余白 */
  --radius-card: 16px;
  --radius-item: 12px;
  --radius-small: 8px;
  --container: 1020px;
  --gutter: 16px;
  --section-gap: 28px;
  --shadow-card: 0 2px 8px rgba(15, 23, 42, 0.03);

  --font-base: "Hiragino Sans", "Hiragino Kaku Gothic ProN", "Yu Gothic UI", "Yu Gothic", Meiryo, system-ui, -apple-system, "Segoe UI", sans-serif;
}

/* ---------- リセット ---------- */
*, *::before, *::after { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-base);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, p, ul, figure { margin: 0; }
ul { padding: 0; list-style: none; }
a { color: inherit; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
img { max-width: 100%; }
::selection { background: var(--teal-100); }

/* ---------- ヘッダー ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 30;
  background: var(--card);
  border-bottom: 1px solid var(--line);
  padding: 13px 0;
}
.site-header__inner {
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 var(--gutter);
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 4px 12px;
}
.site-brand {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 17px;
  font-weight: 800;
  color: var(--teal-dark);
  text-decoration: none;
}
.site-brand__icon { font-size: 20px; line-height: 1; }
.site-nav { display: flex; align-items: center; gap: 16px; }
.site-nav__link {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-sub);
  text-decoration: none;
  white-space: nowrap;
}
.site-nav__link:hover { color: var(--teal-dark); }

/* ---------- ページタイトル ---------- */
.page-title {
  max-width: var(--container);
  margin: 0 auto;
  padding: 28px var(--gutter) 22px;
  text-align: center;
}
.page-title__h1 {
  font-size: clamp(24px, 4.5vw, 32px);
  font-weight: 900;
  line-height: 1.3;
  letter-spacing: -0.01em;
  color: var(--ink);
  margin-bottom: 8px;
}
.page-title__lead {
  max-width: 720px;
  margin: 0 auto;
  font-size: 14px;
  color: var(--muted);
}

/* ---------- セクション（幅・左右余白・縦の間隔はここだけで決める） ---------- */
.sec {
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 var(--gutter);
}
.sec + .sec { margin-top: var(--section-gap); }
/* ページタイトルがないページ（記事・一覧・運営者情報）で、ヘッダーとの間をあける */
.sec--first { margin-top: 28px; }

/* ---------- カード・見出し ---------- */
.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius-card);
  padding: 22px;
  box-shadow: var(--shadow-card);
}
.kicker {
  font-size: 11px;
  font-weight: 800;
  color: var(--teal-dark);
  margin-bottom: 4px;
}
.h2 { font-size: 20px; font-weight: 900; line-height: 1.35; color: var(--ink); }
.h3 { font-size: 16px; font-weight: 800; line-height: 1.4; color: var(--ink); }
.sub { margin-top: 4px; font-size: 13px; line-height: 1.6; color: var(--muted); }

.sec-head {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: flex-end;
  gap: 10px 12px;
  margin-bottom: 16px;
}
.sec-head__actions { display: flex; align-items: center; gap: 12px; }

/* ---------- ボタン・リンク・バッジ ---------- */
.btn {
  display: inline-block;
  border: none;
  border-radius: var(--radius-small);
  font-weight: 800;
  line-height: 1.4;
  white-space: nowrap;
  text-decoration: none;
  transition: background-color 0.15s ease;
}
.btn--soft { background: var(--teal-100); color: var(--teal-dark); padding: 8px 14px; font-size: 12px; }
.btn--soft:hover { background: var(--teal-200); }
.btn--primary { background: var(--teal-dark); color: #fff; padding: 9px 18px; font-size: 13px; }
.btn--primary:hover { background: var(--teal-darker); }
.btn-row { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 16px; }

.link-accent {
  font-size: 13px;
  font-weight: 800;
  color: var(--teal-dark);
  text-decoration: none;
  white-space: nowrap;
}
.link-accent:hover { text-decoration: underline; }

.badge {
  display: inline-block;
  background: var(--teal-100);
  color: var(--teal-dark);
  font-size: 11px;
  font-weight: 800;
  line-height: 1.5;
  padding: 3px 10px;
  border-radius: 6px;
}

/* ---------- A8.net の広告ボタン（ツール・記事で共通）。A8のタグ（<a>と<img>）は書き換えず、外側のラッパー .a8-cta から見た目を当てる ----------
 * グラデーションと影は使わない。白文字との比率は #b45309 で 5.0:1、ホバーの #92400e で 7.1:1。 */
.a8-cta { flex-shrink: 0; width: 100%; }
@media (min-width: 640px) {
  .a8-cta { width: 260px; }
}
.a8-cta a {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  padding: 12px 18px;
  border-radius: 8px;
  background: #b45309;
  font-size: 14px;
  font-weight: 700;
  line-height: 1.4;
  text-align: center;
  color: #fff;
  text-decoration: none;
  transition: background-color 0.15s ease;
}
.a8-cta a::after { content: "→"; font-weight: 800; }
.a8-cta a:hover { background: #92400e; }

/* ---------- 広告カード（A8）：ツールと記事で共通のコンパクトな部品 ----------
 * バッジ「PR・…」＋1〜2行の説明＋ボタン1つ。比較のときだけ、1枚のカードの中に行を2行まで置く。 */
.ad-card {
  padding: 10px 14px;
  background: #fffbeb;
  border: 1px solid #fde68a;
  border-radius: var(--radius-item);
}
.ad-card__badge {
  display: inline-block;
  padding: 1px 8px;
  border-radius: 5px;
  background: #b45309;
  font-size: 10.5px;
  font-weight: 700;
  line-height: 1.6;
  color: #fff;
}
.ad-card__row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 0 2px;
}
.ad-card__row + .ad-card__row { margin-top: 8px; padding-top: 10px; border-top: 1px solid #fde68a; }
.ad-card__body { flex: 1; min-width: 0; }
.ad-card__title { font-size: 13px; font-weight: 700; line-height: 1.5; color: var(--ink); }
.ad-card__text { margin-top: 1px; font-size: 12px; line-height: 1.5; color: var(--text-sub); }

/* A8のボタンは、この中だけコンパクトにする（A8のタグ自体は書き換えない） */
.ad-card .a8-cta { position: relative; flex-shrink: 0; width: 240px; max-width: 240px; }
.ad-card .a8-cta a { padding: 8px 14px; font-size: 12.5px; }
.ad-card .a8-cta img { position: absolute; left: 0; bottom: 0; }
@media (max-width: 560px) {
  .ad-card__row { flex-direction: column; align-items: stretch; gap: 8px; }
  .ad-card .a8-cta { width: 100%; max-width: none; }
}

/* ---------- 広告スロットの部品 ----------
 * assets/site-config.js の SHOW_AD_SLOTS が false（既定）のとき：すべての広告スロットは高さ0（表示しない）。
 *   仮置きの文言も枠線も出さず、隙間も作らない。
 * true のとき：<html> に .ads-on が付き、高さを確保して、破線の枠と「広告」ラベルを出す（レイアウトがずれない）。
 * スロットの場所：記事内（.ad-slot--article）、ツールの「3つの判断基準」の直後（.sec--ad > .ad-slot--wide）、
 *                 関連コラムの6セル目（.col-card--ad）。 */
.ad-slot__label { display: none; }
.ad-slot, .sec--ad, .col-card.col-card--ad { display: none; }
.ad-slot--article { margin-top: 24px; min-height: 120px; }
.ad-slot--wide { min-height: 140px; }

.ads-on .sec--ad { display: block; }
.ads-on .ad-slot {
  display: block;
  position: relative;
  background: var(--bg);
  border: 1.5px dashed var(--line-strong);
  border-radius: var(--radius-card);
}
.ads-on .col-card.col-card--ad {
  display: flex;
  position: relative;
  background: var(--bg);
  border: 1.5px dashed var(--line-strong);
  border-radius: var(--radius-card);
}
.ads-on .ad-slot__label {
  display: block;
  position: absolute;
  top: 8px;
  left: 12px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: var(--muted);
}

/* ---------- グリッド ---------- */
.grid-3 {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 16px;
  align-items: stretch;
}
@media (min-width: 900px) {
  .grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
.card .grid-3 { margin-top: 16px; }
/* 記事カードのように途中で2列にしたいとき */
@media (min-width: 600px) and (max-width: 899px) {
  .grid-3--tablet-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

.grid-2 {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 16px;
  align-items: stretch;
}
@media (min-width: 760px) {
  .grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* ---------- ミニカード（3つの判断基準など） ---------- */
.mini-card {
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: var(--radius-item);
  padding: 18px;
  min-width: 0;
}
.mini-card__no {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  border-radius: 999px;
  background: var(--teal-dark);
  color: #fff;
  font-size: 12px;
  font-weight: 800;
  margin-bottom: 10px;
}
.mini-card__title { font-size: 15px; font-weight: 800; line-height: 1.45; color: var(--ink); margin-bottom: 8px; }
.mini-card__text { font-size: 13px; line-height: 1.7; color: var(--text-sub); }
.mini-card__src { margin-top: 10px; font-size: 11px; line-height: 1.6; color: var(--muted); }
.mini-card__src a { color: var(--teal-dark); }

/* ---------- 他ツールへのリンクカード ---------- */
.tool-card {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 18px 20px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-card);
  color: var(--ink);
  text-decoration: none;
  transition: border-color 0.15s ease;
}
.tool-card:hover { border-color: var(--teal); }
.tool-card__name { font-size: 15px; font-weight: 800; }
.tool-card__desc { margin-top: 2px; font-size: 12px; color: var(--muted); }
.tool-card__go { font-size: 18px; color: var(--muted-light); flex-shrink: 0; }
.tool-card:hover .tool-card__go { color: var(--teal); }

/* ---------- 読み込み失敗・記事なしのときの案内文 ---------- */
.empty-note { grid-column: 1 / -1; padding: 14px 4px; font-size: 13px; color: var(--muted); }

/* ---------- 記事カード・広告枠カード ---------- */
.col-card {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-height: 192px;
  min-width: 0;
  padding: 18px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow: var(--shadow-card);
  color: var(--ink);
  text-decoration: none;
  transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
}
a.col-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(15, 23, 42, 0.07);
  border-color: var(--teal);
}
.col-card .badge { margin-bottom: 10px; }
.col-card__title {
  margin-bottom: 8px;
  font-size: 15px;
  font-weight: 800;
  line-height: 1.45;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.col-card__desc {
  margin-bottom: 12px;
  font-size: 12px;
  line-height: 1.6;
  color: var(--muted);
  display: -webkit-box;
  -webkit-line-clamp: 3;
  line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.col-card__date { margin-top: 6px; font-size: 11px; color: var(--muted); }
.col-card__more { font-size: 12px; font-weight: 800; color: var(--teal-dark); }

/* 広告枠：文言は出さず、高さだけ保つ（広告コードを入れたときにレイアウトが動かない） */
.col-card--ad { box-shadow: none; }

/* ---------- 全タイトル一覧 ---------- */
.title-list__head { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 10px; }
.title-list__item { border-bottom: 1px solid var(--line); }
.title-list__item:last-child { border-bottom: none; }
.title-list__link {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 4px 0;
  padding: 12px 14px;
  border-left: 4px solid transparent;
  border-radius: 10px;
  color: var(--text);
  font-size: 14px;
  font-weight: 600;
  line-height: 1.5;
  text-decoration: none;
  transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease, transform 0.15s ease;
}
.title-list__link:hover {
  background: var(--teal-100);
  border-left-color: var(--teal);
  color: var(--teal-dark);
  transform: translateX(4px);
}
.title-list__dot { flex-shrink: 0; font-size: 10px; color: var(--teal); }
.title-list__text { flex: 1; min-width: 0; }
.title-list__act { flex-shrink: 0; font-size: 12px; font-weight: 800; color: var(--teal-dark); opacity: 0.6; white-space: nowrap; transition: opacity 0.15s ease; }
.title-list__link:hover .title-list__act { opacity: 1; }

/* ---------- フッター ---------- */
.site-footer {
  margin-top: 44px;
  padding: 22px 0;
  background: var(--card);
  border-top: 1px solid var(--line);
  font-size: 12px;
  color: var(--muted);
}
.site-footer__inner {
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 var(--gutter);
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 8px 16px;
}
.site-footer__quiet { font-size: 11px; color: var(--muted-light); text-decoration: none; }
.site-footer__quiet:hover { text-decoration: underline; }

/* ---------- 前提・出典・注意書き（どのツールにも置く共通パーツ） ---------- */
.notes__h { margin: 18px 0 8px; font-size: 14px; font-weight: 800; color: var(--ink); }
.notes__h:first-of-type { margin-top: 12px; }
.notes__list { padding-left: 1.2em; list-style: disc; font-size: 13px; line-height: 1.8; color: var(--text-sub); }
.notes__list li + li { margin-top: 2px; }
.notes__text { font-size: 13px; line-height: 1.8; color: var(--text-sub); }
.notes__text a, .notes__list a { color: var(--teal-dark); }
.src-list { display: flex; flex-direction: column; gap: 10px; font-size: 13px; line-height: 1.6; }
.src-list__name { font-weight: 700; color: var(--text); }
.src-list__use { color: var(--muted); }
.src-list a { color: var(--teal-dark); word-break: break-all; }

/* ---------- 項目と内容を並べる表（運営者情報など） ---------- */
.facts { display: grid; grid-template-columns: minmax(0, 1fr); gap: 4px 20px; margin: 16px 0 0; }
.facts dt { font-size: 12px; font-weight: 700; color: var(--muted); }
.facts dd { margin: 0 0 12px; font-size: 14px; color: var(--text); }
@media (min-width: 640px) {
  .facts { grid-template-columns: 9em minmax(0, 1fr); }
  .facts dd { margin: 0; padding-bottom: 12px; }
}

/* ---------- 折りたたみ（<details>）：閉じた状態は1行。文字色は白に対して 4.76:1 ---------- */
.fold { padding-top: 10px; border-top: 1px solid var(--line); color: var(--muted); }
.fold__summary { cursor: pointer; font-size: 13px; line-height: 1.6; color: var(--muted); }
.fold__summary:hover { color: var(--text-sub); }
.fold__body { margin-top: 12px; }

/* ---------- スマホ ---------- */
@media (max-width: 480px) {
  .card { padding: 18px; }
  .site-brand { font-size: 15px; }
  .site-nav { gap: 12px; }
  .site-nav__link { font-size: 12px; }
  .title-list__act { display: none; }
}

/* ---------- hidden 属性（他の display 指定より後ろに置く） ---------- */
[hidden] { display: none; }
