/* ==========================================================================
   Cookalc ツールカード（トップ・計算ツール一覧の「用途別ツール一覧」用）
   2026-10-03 作成

   ・このファイルはサーバーの実ファイル（public_html/assets/css/toolcard.css）。
     各カードのCustom HTML（HTMLボックス）の先頭で <link> で読み込む。
   ・サイト全体に効くので、セレクタは必ず .cktc- で始める（ハンドブック §7-1）。
     素の a / img / h3 などを単独で書かないこと。
   ・中身を変えたら、各ブロックの <link> の ?v= を上げる（§7-4）。
   ========================================================================== */

/* ---------- カード本体（カード全体が1つのリンク） ---------- */
a.cktc-card,
a.cktc-card:hover,
a.cktc-card:visited {
  color: #2a211c;
  text-decoration: none;
}
.cktc-card {
  display: flex;
  align-items: center;
  gap: 14px;
  box-sizing: border-box;
  width: 100%;
  padding: 12px 14px 12px 12px;
  background: #ffffff;
  border-radius: 14px;
  font-family: 'M PLUS 1p', 'Hiragino Sans', 'Hiragino Kaku Gothic ProN', Meiryo, sans-serif;
  transition: box-shadow .2s ease, transform .2s ease;
}
.cktc-card:hover {
  box-shadow: 0 6px 18px rgba(42, 33, 28, .10);
  transform: translateY(-1px);
}
.cktc-card:focus-visible {
  outline: 3px solid #fa9735;
  outline-offset: 2px;
}

/* サムネイル（写真） */
.cktc-card .cktc-thumb {
  flex: none;
  display: block;
  width: 84px;
  height: 64px;
  max-width: none;
  margin: 0;
  border-radius: 10px;
  object-fit: cover;
  background: #f3e6dd;
}
/* 写真がまだ無いツール用：アイコンを置いた代わりのタイル */
.cktc-card .cktc-thumb--icon {
  display: flex;
  align-items: center;
  justify-content: center;
  color: #94500c;
}
.cktc-card .cktc-thumb--icon svg {
  width: 30px;
  height: 30px;
}

/* 文字の部分 */
.cktc-card .cktc-body {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 5px;
}
.cktc-card .cktc-head {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 4px 8px;
}
.cktc-card .cktc-title {
  margin: 0;
  padding: 0;
  font-family: inherit;
  font-size: 15px;
  font-weight: 700;
  line-height: 1.4;
  letter-spacing: 0;
  text-align: left;
  text-transform: none;
  color: #2a211c;
  word-break: auto-phrase; /* 対応ブラウザでは文節で改行する */
}
.cktc-card .cktc-desc {
  margin: 0;
  font-size: 12.5px;
  line-height: 1.6;
  color: #6b5a4a;
  word-break: auto-phrase;
}
/* 計算ツール一覧ページだけで使う、長めの説明文 */
.cktc-card .cktc-detail {
  margin: 2px 0 0;
  font-size: 13px;
  line-height: 1.8;
  color: #5b4b3a;
}

/* 右端の「›」 */
.cktc-card .cktc-chev {
  flex: none;
  width: 18px;
  height: 18px;
  color: #b9a593;
}

/* ---------- バッジ（3種類＋NEW） ---------- */
.cktc-badge {
  display: inline-block;
  align-self: flex-start;
  box-sizing: border-box;
  padding: 2px 9px;
  border: 1px solid transparent;
  border-radius: 999px;
  font-family: 'M PLUS 1p', 'Hiragino Sans', 'Hiragino Kaku Gothic ProN', Meiryo, sans-serif;
  font-size: 11.5px;
  font-weight: 700;
  line-height: 1.5;
  white-space: nowrap;
}
/* 登録不要・無料 */
.cktc-badge--free {
  background: #eef1e3;
  border-color: #eef1e3;
  color: #45512f;
}
/* 無料会員で全機能 */
.cktc-badge--member {
  background: #ffffff;
  border-color: #a9b67f;
  color: #45512f;
}
/* 一部 Standard・Pro会員 */
.cktc-badge--paid {
  background: #fff1e2;
  border-color: #f6c88f;
  color: #8f4c0b;
}
/* NEW（data-cktc-new-until の日付を過ぎたらスクリプトが hidden にする） */
.cktc-new {
  display: inline-block;
  padding: 1px 6px;
  border-radius: 4px;
  background: #2a211c;
  color: #ffffff;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 1px;
  line-height: 1.5;
}
.cktc-new[hidden] {
  display: none !important;
}

/* ---------- 一覧ページ用：説明文つきの大きいカード ---------- */
.cktc-card.cktc-card--detail {
  align-items: flex-start;
  gap: 18px;
  padding: 16px 18px 18px 16px;
}
.cktc-card.cktc-card--detail .cktc-thumb {
  width: 132px;
  height: 99px;
  border-radius: 12px;
}
.cktc-card.cktc-card--detail .cktc-title {
  font-size: 17px;
  line-height: 1.45;
}
.cktc-card.cktc-card--detail .cktc-chev {
  align-self: center;
}

/* ---------- 「こんな計算がほしい」リクエスト枠 ---------- */
a.cktc-request,
a.cktc-request:hover,
a.cktc-request:visited {
  color: #2a211c;
  text-decoration: none;
}
.cktc-request {
  display: flex;
  flex-direction: column;
  gap: 8px;
  box-sizing: border-box;
  width: 100%;
  padding: 18px 18px 20px;
  border: 1.5px dashed #d3bfae;
  border-radius: 14px;
  font-family: 'M PLUS 1p', 'Hiragino Sans', 'Hiragino Kaku Gothic ProN', Meiryo, sans-serif;
  transition: background .2s ease;
}
.cktc-request:hover {
  background: rgba(255, 255, 255, .6);
}
.cktc-request .cktc-request-ttl {
  font-size: 15px;
  font-weight: 700;
  line-height: 1.5;
}
.cktc-request .cktc-request-txt {
  font-size: 12.5px;
  line-height: 1.6;
  color: #6b5a4a;
}
.cktc-request .cktc-request-go {
  font-size: 13px;
  font-weight: 700;
  color: #94500c;
}

/* ---------- バッジの見かた ---------- */
.cktc-legend {
  box-sizing: border-box;
  width: 100%;
  padding: 18px 22px;
  background: #ffffff;
  border-radius: 16px;
  font-family: 'M PLUS 1p', 'Hiragino Sans', 'Hiragino Kaku Gothic ProN', Meiryo, sans-serif;
  color: #2a211c;
}
.cktc-legend .cktc-legend-sum {
  display: flex;
  align-items: center;
  gap: 10px;
  list-style: none;
  cursor: pointer;
  min-height: 28px;
}
.cktc-legend .cktc-legend-sum::-webkit-details-marker {
  display: none;
}
.cktc-legend .cktc-legend-ttl {
  font-size: 13px;
  font-weight: 700;
  color: #5b4b3a;
  white-space: nowrap;
}
/* 閉じているときだけ、見出しの横にバッジ3つを並べる */
.cktc-legend .cktc-legend-mini {
  display: none;
  flex-wrap: wrap;
  gap: 6px;
  flex: 1;
}
.cktc-legend:not([open]) .cktc-legend-mini {
  display: flex;
}
.cktc-legend .cktc-legend-arrow {
  flex: none;
  width: 18px;
  height: 18px;
  margin-left: auto;
  color: #8a7a68;
  transition: transform .2s ease;
}
.cktc-legend[open] .cktc-legend-arrow {
  transform: rotate(180deg);
}
.cktc-legend .cktc-legend-list {
  list-style: none;
  margin: 10px 0 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.cktc-legend .cktc-legend-list li {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 0;
  padding: 0;
}
.cktc-legend .cktc-legend-list .cktc-badge {
  flex: none;
  width: 150px;
  text-align: center;
  align-self: center;
}
.cktc-legend .cktc-legend-txt {
  font-size: 13px;
  line-height: 1.6;
  color: #5b4b3a;
}
.cktc-legend .cktc-legend-foot {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 6px 16px;
  margin-top: 12px;
  padding-top: 10px;
  border-top: 1px solid #efe4da;
  font-size: 12px;
  color: #6b5a4a;
}
.cktc-legend a.cktc-legend-link,
.cktc-legend a.cktc-legend-link:visited {
  font-size: 13px;
  font-weight: 700;
  color: #94500c;
  text-decoration: none;
  padding: 6px 0;
}
.cktc-legend a.cktc-legend-link:hover {
  color: #6e3a07;
  text-decoration: underline;
}

/* ---------- スマホ ---------- */
@media (max-width: 500px) {
  .cktc-card {
    gap: 12px;
    padding: 12px;
  }
  .cktc-card .cktc-thumb {
    width: 72px;
    height: 56px;
    border-radius: 9px;
  }
  .cktc-card .cktc-title {
    font-size: 14.5px;
  }
  .cktc-card .cktc-desc {
    font-size: 12px;
  }
  .cktc-card .cktc-chev {
    display: none;
  }
  .cktc-card.cktc-card--detail {
    gap: 12px;
    padding: 14px;
  }
  .cktc-card.cktc-card--detail .cktc-thumb {
    width: 88px;
    height: 66px;
  }
  .cktc-card.cktc-card--detail .cktc-title {
    font-size: 15.5px;
  }
  .cktc-legend {
    padding: 14px 16px;
  }
  .cktc-legend .cktc-legend-list li {
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
  }
  .cktc-legend .cktc-legend-list .cktc-badge {
    width: auto;
  }
}

/* 動きを減らす設定の人には、浮き上がりを出さない */
@media (prefers-reduced-motion: reduce) {
  .cktc-card,
  .cktc-legend .cktc-legend-arrow {
    transition: none;
  }
  .cktc-card:hover {
    transform: none;
  }
}
