/* kokone 記事詳細ページ専用スタイル v3.1 — single.php で使用 */

/* ── CSS変数（記事ページスコープ・--kkart-プレフィックスで衝突回避） ── */
body.single, body.home {
  --kkart-bg:       #FFFFFF;
  --kkart-bg2:      #F6F5F0;
  --kkart-ink:      #2F2D28;
  --kkart-ink2:     #75736B;
  --kkart-line:     #E6E5DF;
  --kkart-teal:     #3FA9A1;
  --kkart-blue:     #5B7FD6;
  --kkart-purple:   #8F6FCB;
  --kkart-pink:     #E39FC7;
  --kkart-pink-l:   #F8E7F1;
  --kk-content-maxw: 1380px;
  --kkart-maxw:     1280px;
  font-family: 'Zen Maru Gothic', sans-serif;
  font-size: 16px;
  line-height: 1.8;
  color: var(--kkart-ink);
  background: var(--kkart-bg);
  padding-bottom: 80px;
}

/* ── Astra コンテンツエリア上書き ── */
/* ast-two-container が .ast-container に flex row を強制するため block に戻す */
body.single #content .ast-container,
body.single .ast-container { display: block !important; max-width: none !important; padding: 0 !important; }
body.single #primary { padding: 0 !important; }
body.single .ast-separate-container #primary { padding: 0 !important; }
body.single article.ast-article-single { padding-top: 0 !important; }
body.single .entry-header,
body.single .entry-content { padding: 0 !important; }

/* ── ユーティリティ ── */
.kk-pill {
  display: inline-flex; align-items: center;
  border: 1.5px solid var(--kkart-ink); border-radius: 999px;
  padding: 2px 12px; font-size: 12px; font-weight: 700;
  background: var(--kkart-bg); white-space: nowrap;
}
.kk-pill-blue   { border-color: var(--kkart-blue);   color: var(--kkart-blue);   }
.kk-pill-teal   { border-color: var(--kkart-teal);   color: var(--kkart-teal);   }
.kk-pill-purple { border-color: var(--kkart-purple); color: var(--kkart-purple); }
.kk-pill-pink   { border-color: var(--kkart-pink);   color: var(--kkart-pink);   }

/* ── カテゴリーバー ── */
.kk-catbar { border-bottom: 1px solid var(--kkart-line); background: var(--kkart-bg); overflow-x: auto; }
.kk-catbar::-webkit-scrollbar { display: none; }
.kk-catbar-in {
  max-width: var(--kkart-maxw); margin: 0 auto;
  display: flex; justify-content: center; padding: 0 24px; min-width: max-content;
}
.kk-cat-item {
  display: flex; flex-direction: column; align-items: center; gap: 4px;
  padding: 12px 20px; cursor: pointer;
  border-bottom: 2.5px solid transparent;
  font-size: 11px; font-weight: 700; color: var(--kkart-ink2);
  text-decoration: none; transition: border-color .15s;
  line-height: 1;
}
.kk-cat-item:hover, .kk-cat-item.active { border-color: var(--kkart-ink); color: var(--kkart-ink); }
.kk-cat-icon { width: 28px; height: 28px; display: block; flex-shrink: 0; }

/* ════ 2カラムグリッドレイアウト ════ */
.kokone-single-wrap {
  max-width: var(--kk-content-maxw);
  margin: 0 auto;
  padding: 0 24px;
}

.kk-article-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 287px;
  gap: 48px;
  align-items: start;
}

@media (max-width: 900px) {
  .kk-article-grid { grid-template-columns: 1fr; }
  .kk-sidebar { display: none; }
}

/* ── パンくず ── */
.kk-breadcrumb {
  margin: 20px 0 0;
  font-size: 12px; color: var(--kkart-ink2);
  display: flex; align-items: center; gap: 6px; flex-wrap: wrap;
}
.kk-breadcrumb a { color: var(--kkart-ink2); text-decoration: none; }
.kk-breadcrumb a:hover { color: var(--kkart-teal); }
.kk-breadcrumb .sep { color: var(--kkart-line); }

/* ── 記事ヘッダー ── */
.kk-art-header { margin: 16px 0 0; }
.kk-art-cat-pill { margin-bottom: 12px; }
.elementor-kit-8 .kk-art-title,
body.single .kk-art-title {
  font-family: 'Zen Kaku Gothic New', 'Zen Maru Gothic', 'Hiragino Kaku Gothic ProN', 'Hiragino Sans', 'Yu Gothic', 'Noto Sans JP', sans-serif;
  font-size: 28px !important; font-weight: 900; line-height: 1.4;
  color: var(--kkart-ink); margin-bottom: 20px;
}
@media (max-width: 600px) {
  .elementor-kit-8 .kk-art-title,
  body.single .kk-art-title { font-size: 22px !important; }
}

/* ── 著者行 ── */
.kk-author-row {
  display: flex; align-items: center; gap: 12px;
  padding: 16px 0;
  border-top: 1.5px dashed var(--kkart-line);
  border-bottom: 1.5px dashed var(--kkart-line);
}
.kk-avatar {
  width: 44px; height: 44px; flex-shrink: 0;
  border-radius: 50%; border: 1.5px solid var(--kkart-line);
  background: var(--kkart-bg2);
  display: flex; align-items: center; justify-content: center;
  overflow: hidden;
}
.kk-avatar img { width: 100%; height: 100%; object-fit: cover; }
.kk-author-meta { flex: 1; }
.kk-author-role { font-size: 11px; color: var(--kkart-ink2); }
.kk-author-name { font-size: 14px; font-weight: 700; }
.kk-author-name a { color: inherit; text-decoration: none; }
.kk-author-name a:hover { color: var(--kkart-teal); }
.kk-art-date { font-size: 12px; color: var(--kkart-ink2); margin-left: auto; white-space: nowrap; }

/* ── 監修者ボックス（背景塗り・外枠破線なし） ── */
.kk-reviewer-box { margin: 24px 0 0; }
.kk-reviewer-inner {
  background: var(--kkart-bg2);
  border-radius: 16px;
  padding: 20px 24px;
}
.kk-reviewer-label {
  font-size: 11px; font-weight: 700; color: var(--kkart-ink2);
  letter-spacing: .04em;
  padding-bottom: 12px;
  border-bottom: 1px dashed var(--kkart-line);
  margin-bottom: 14px;
}
.kk-reviewer-row { display: flex; align-items: flex-start; gap: 12px; }
.kk-reviewer-meta { flex: 1; }
.kk-reviewer-role { font-size: 11px; color: var(--kkart-ink2); }
.kk-reviewer-name { font-size: 14px; font-weight: 700; margin-bottom: 8px; }
.kk-reviewer-name a { color: inherit; text-decoration: none; }
.kk-reviewer-name a:hover { color: var(--kkart-teal); }
.kk-reviewer-comment {
  font-size: 13px; line-height: 1.7; color: var(--kkart-ink);
  padding-top: 10px; border-top: 1px dashed var(--kkart-line);
  margin-top: 12px;
}

/* ── アイキャッチ（横長 3:2・本文幅85%・角丸10px） ── */
.kk-eyecatch-wrap {
  margin: 28px 0 0;
  display: flex;
  justify-content: center;
}
.kk-eyecatch {
  width: 85%;
  aspect-ratio: 3/2;
  border: 1.5px solid var(--kkart-ink);
  border-radius: 10px;
  background: var(--kkart-bg2);
  overflow: hidden;
}
.kk-eyecatch img { width: 100%; height: 100%; object-fit: cover; }

/* ── 目次 ── */
.kk-toc-wrap { margin: 32px 0 0; }
.kk-toc-box {
  border: 1.5px dashed var(--kkart-line);
  border-radius: 16px; background: var(--kkart-bg2); padding: 20px 24px;
}
.kk-toc-title {
  font-size: 13px; font-weight: 700; color: var(--kkart-ink2);
  margin-bottom: 12px; display: flex; align-items: center; gap: 6px;
}
.kk-toc-list { list-style: none; padding: 0; margin: 0; }
.kk-toc-list li { border-bottom: 1px solid var(--kkart-line); }
.kk-toc-list li:last-child { border-bottom: none; }
.kk-toc-list a {
  display: flex; align-items: center; gap: 8px;
  padding: 8px 4px; font-size: 13px; font-weight: 700;
  color: var(--kkart-ink); text-decoration: none;
}
.kk-toc-list a:hover { color: var(--kkart-teal); }
.kk-toc-num {
  font-family: 'Poppins', sans-serif; font-size: 11px;
  color: var(--kkart-ink2); flex-shrink: 0; width: 20px;
}

/* ── 本文 ── */
.kk-article-body { margin: 40px 0 0; }

/* H2：背景塗りつぶしボックス＋左丸ドットマーカー */
/* .elementor-kit-8 prefix で specificity 21 → TypeSquare の h2:lang(ja) (11) に勝つ */
.elementor-kit-8 .kk-article-body h2 {
  font-family: 'Zen Kaku Gothic New', 'Zen Maru Gothic', 'Hiragino Kaku Gothic ProN', 'Hiragino Sans', 'Yu Gothic', 'Noto Sans JP', sans-serif;
  font-size: 20px; font-weight: 900; line-height: 1.5;
  margin: 56px 0 16px;
  padding: 14px 16px 14px 44px;
  position: relative;
  background: var(--kkart-bg2);
  border-radius: 10px;
  color: var(--kkart-ink);
}
.elementor-kit-8 .kk-article-body h2::before {
  content: '';
  position: absolute;
  left: 17px;
  top: 50%;
  transform: translateY(-50%);
  width: 10px; height: 10px;
  border-radius: 50%;
  background: var(--kkart-teal);
  flex-shrink: 0;
}
.elementor-kit-8 .kk-article-body h2:first-child { margin-top: 0; }

.elementor-kit-8 .kk-article-body h3 {
  font-family: 'Zen Kaku Gothic New', 'Zen Maru Gothic', 'Hiragino Kaku Gothic ProN', 'Hiragino Sans', 'Yu Gothic', 'Noto Sans JP', sans-serif;
  font-size: 17px; font-weight: 700; line-height: 1.5;
  margin: 32px 0 12px; color: var(--kkart-ink);
  display: flex; align-items: center; gap: 8px;
}
.elementor-kit-8 .kk-article-body h3::before {
  content: ''; display: inline-block;
  width: 8px; height: 8px; border-radius: 2px;
  background: var(--kkart-blue); flex-shrink: 0;
}
.kk-article-body p { margin: 0 0 16px; }
.kk-article-body ul,
.kk-article-body ol { padding-left: 24px; margin: 0 0 16px; }
.kk-article-body li { margin-bottom: 6px; }
.kk-article-body strong { font-weight: 700; }
.kk-article-body a { color: var(--kkart-teal); text-decoration: underline; }
.kk-article-body hr { border: none; border-top: 1.5px dashed var(--kkart-line); margin: 32px 0; }
.kk-article-body table {
  width: 100%; border-collapse: collapse; margin: 20px 0;
  font-size: 14px;
}
.kk-article-body th,
.kk-article-body td {
  border: 1px solid var(--kkart-line);
  padding: 10px 12px;
  text-align: left;
}
.kk-article-body th { background: var(--kkart-bg2); font-weight: 700; }
.kk-article-body details {
  border: 1.5px solid var(--kkart-line);
  border-radius: 10px; padding: 12px 16px; margin: 12px 0;
}
.kk-article-body summary { font-weight: 700; cursor: pointer; }
.kk-note-box {
  background: var(--kkart-bg2); border-radius: 12px;
  padding: 16px 20px; margin: 20px 0;
  font-size: 14px; border-left: 3px solid var(--kkart-teal);
}

/* ── タグ行 ── */
.kk-tags-wrap { margin: 48px 0 0; }
.kk-tags-row {
  padding: 16px 0;
  border-top: 1.5px dashed var(--kkart-line);
  border-bottom: 1.5px dashed var(--kkart-line);
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
}
.kk-tag-grade {
  border: 1.5px solid var(--kkart-ink2); border-radius: 999px;
  padding: 2px 10px; font-size: 12px; font-weight: 700; color: var(--kkart-ink2);
}
.kk-tag-hash { font-size: 12px; font-weight: 700; color: var(--kkart-ink2); }
.kk-tag-sep { width: 1px; height: 14px; background: var(--kkart-line); margin: 0 4px; }

/* ── クロスリンクボックス ── */
.kk-cross-link-wrap { margin: 48px 0 0; }
.kk-cross-link-box {
  border: 2px solid var(--kkart-teal); border-radius: 16px;
  background: #F0FAF9; padding: 24px; position: relative;
}
.kk-cross-link-box::before {
  content: 'あわせて読みたい';
  position: absolute; top: -12px; left: 20px;
  background: var(--kkart-teal); color: #fff;
  border-radius: 999px; padding: 2px 12px;
  font-size: 11px; font-weight: 700;
}
.kk-cross-link-lead { font-size: 14px; color: var(--kkart-ink); margin-bottom: 12px; }
.kk-cross-link-card {
  display: flex; align-items: center; gap: 12px;
  background: var(--kkart-bg); border: 1.5px solid var(--kkart-line);
  border-radius: 12px; padding: 12px 16px;
  text-decoration: none; color: var(--kkart-ink); transition: border-color .15s;
}
.kk-cross-link-card:hover { border-color: var(--kkart-teal); }
.kk-cross-link-icon {
  width: 40px; height: 40px; border-radius: 8px;
  background: var(--kkart-teal); flex-shrink: 0;
  display: flex; align-items: center; justify-content: center; font-size: 20px;
}
.kk-cross-link-info { flex: 1; }
.kk-cross-link-cat { font-size: 11px; color: var(--kkart-teal); font-weight: 700; }
.kk-cross-link-text { font-size: 14px; font-weight: 700; }
.kk-cross-link-arr {
  font-family: 'Poppins', sans-serif; font-size: 18px; color: var(--kkart-teal);
}

/* ── 関連記事 ── */
.kk-related-wrap { margin: 48px 0 0; }
.kk-related-title {
  font-size: 18px; font-weight: 900; margin-bottom: 20px;
  display: flex; align-items: center; gap: 10px;
}
.kk-related-title .en {
  font-family: 'Poppins', sans-serif; font-size: 22px; font-weight: 700;
  -webkit-text-stroke: 1.3px var(--kkart-ink); color: transparent;
}
.kk-related-grid {
  display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px;
}
@media (min-width: 640px) { .kk-related-grid { grid-template-columns: repeat(4, 1fr); } }
.kk-rel-card { display: flex; flex-direction: column; }
.kk-rel-thumb {
  aspect-ratio: 1/1;
  border: 1.5px solid var(--kkart-ink); border-radius: 12px;
  background: var(--kkart-bg2); overflow: hidden;
  margin-bottom: 8px;
  display: flex; align-items: center; justify-content: center;
}
.kk-rel-thumb img { width: 100%; height: 100%; object-fit: cover; }
.kk-rel-thumb-placeholder { opacity: .4; }
.kk-rel-cat { margin-bottom: 4px; }
.kk-rel-title { font-size: 12px; font-weight: 700; line-height: 1.5; flex: 1; }
.kk-rel-dashed { border-top: 1.5px dashed var(--kkart-line); margin: 6px 0; }
.kk-rel-footer {
  display: flex; align-items: center; justify-content: space-between;
  font-size: 10px; color: var(--kkart-ink2);
}
.kk-rel-author { display: flex; align-items: center; gap: 4px; }
.kk-rel-avatar {
  width: 18px; height: 18px; border-radius: 50%;
  border: 1px solid var(--kkart-line); background: var(--kkart-bg2);
  display: flex; align-items: center; justify-content: center;
  overflow: hidden;
}

/* ── CTA ── */
.kk-cta-wrap { margin: 48px 0; }
.kk-cta-box {
  border-radius: 20px; background: var(--kkart-bg2);
  padding: 32px 28px; text-align: center;
}
.kk-cta-label {
  font-size: 12px; font-weight: 700; color: var(--kkart-teal);
  letter-spacing: .06em; text-transform: uppercase; margin-bottom: 8px;
}
.kk-cta-lead { font-size: 18px; font-weight: 900; color: var(--kkart-ink); margin-bottom: 8px; line-height: 1.5; }
.kk-cta-sub { font-size: 13px; color: var(--kkart-ink2); margin-bottom: 20px; line-height: 1.6; }
.kk-cta-btn {
  background: var(--kkart-ink); color: #fff; border-radius: 999px;
  padding: 14px 36px; font-size: 15px; font-weight: 700;
  display: inline-flex; align-items: center; gap: 8px; text-decoration: none;
}
.kk-cta-note { font-size: 11px; color: var(--kkart-ink2); margin-top: 12px; }

/* ════ サイドバー ════ */
.kk-sidebar {
  position: sticky;
  top: 70px;
  padding-top: 20px;
}

/* サイドバーウィジェット 見出し（Poppins アウトライン＋先頭1文字カラー） */
.kk-sw-heading {
  display: block;
  margin-bottom: 12px;
  line-height: 1.1;
}
.kk-sw-ha {
  font-family: 'Poppins', sans-serif;
  font-size: 22px; font-weight: 600;
  -webkit-text-stroke: 0;
}
.kk-sw-ho {
  font-family: 'Poppins', sans-serif;
  font-size: 22px; font-weight: 600;
  color: transparent;
  -webkit-text-stroke: 1.3px var(--kkart-ink);
}

/* ウィジェット リスト */
.kk-sw-list { margin-top: 4px; }

/* ウィジェット アイテム */
.kk-sw-item {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  text-decoration: none;
  color: var(--kkart-ink);
  padding: 12px 0;
  border-bottom: 1px solid var(--kkart-line);
  transition: opacity .15s;
}
.kk-sw-item:last-child { border-bottom: none; }
.kk-sw-item:hover { opacity: .75; }

/* サムネイル（90×90・正方形・角丸5px） */
.kk-sw-thumb {
  width: 90px; height: 90px;
  flex-shrink: 0;
  border-radius: 5px;
  border: 1.5px solid var(--kkart-ink);
  background: var(--kkart-bg2);
  overflow: hidden;
  display: flex; align-items: center; justify-content: center;
}
.kk-sw-thumb img { width: 100%; height: 100%; object-fit: cover; }
.kk-sw-no-img { opacity: .4; font-size: 24px; }

/* アイテム右側コンテンツ */
.kk-sw-body { flex: 1; min-width: 0; }
.kk-sw-ttl {
  font-size: 12px; font-weight: 700; line-height: 1.5;
  margin: 4px 0 4px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.kk-sw-dat { font-size: 11px; color: var(--kkart-ink2); }

/* 空状態 */
.kk-sw-empty {
  font-size: 12px; color: var(--kkart-ink2);
  text-align: center;
  padding: 20px 0;
}

/* ── Weekly Ranking ウィジェット ── */
.kk-sw-subtitle {
  font-size: 11px; font-weight: 500; color: var(--kkart-ink2);
  letter-spacing: .04em; margin: -6px 0 12px;
}
.kk-rank-tabs { display: flex; gap: 6px; margin-bottom: 14px; }
.kk-rank-tab {
  border: 1.5px solid var(--kkart-line); border-radius: 99px;
  padding: 4px 14px; font-size: 11px; font-weight: 700;
  color: var(--kkart-ink2); background: none; cursor: pointer;
  line-height: 1.4; font-family: 'Zen Maru Gothic', sans-serif;
  transition: border-color .15s, background .15s, color .15s;
}
.kk-rank-tab.active {
  border-color: var(--kkart-ink); background: var(--kkart-ink); color: #fff;
}
.kk-rank-item {
  display: flex; gap: 10px; align-items: flex-start;
  padding: 10px 0; border-bottom: 1px solid var(--kkart-line);
  text-decoration: none; color: var(--kkart-ink); transition: opacity .15s;
}
.kk-rank-item:last-child { border-bottom: none; }
.kk-rank-item:hover { opacity: .75; }
.kk-rank-label { flex-shrink: 0; width: 36px; padding-top: 2px; }
.kk-rank-no {
  display: block; font-family: 'Poppins', sans-serif;
  font-size: 7px; font-weight: 600; color: var(--kkart-ink2);
  line-height: 1; letter-spacing: .04em; text-transform: lowercase;
}
.kk-rank-num {
  display: block; font-family: 'Poppins', sans-serif;
  font-size: 20px; font-weight: 700; color: var(--kkart-ink); line-height: 1;
}
.kk-rank-card { display: flex; gap: 8px; flex: 1; min-width: 0; }
.kk-rank-thumb {
  width: 72px; height: 72px; flex-shrink: 0;
  border-radius: 5px; border: 1.5px solid var(--kkart-ink);
  background: var(--kkart-bg2); overflow: hidden;
  display: flex; align-items: center; justify-content: center;
}
.kk-rank-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.kk-rank-no-img { opacity: .4; font-size: 18px; }
.kk-rank-body { flex: 1; min-width: 0; }
.kk-rank-ttl {
  font-size: 12px; font-weight: 700; line-height: 1.5; margin: 2px 0 3px;
  display: -webkit-box; -webkit-line-clamp: 2;
  -webkit-box-orient: vertical; overflow: hidden;
}
.kk-rank-htags { display: flex; flex-wrap: wrap; gap: 3px; margin-bottom: 3px; }
.kk-rank-htag { font-size: 10px; color: var(--kkart-ink2); font-weight: 500; }
.kk-rank-dat { font-size: 10px; color: var(--kkart-ink2); }
.kk-rank-empty {
  font-size: 12px; color: var(--kkart-ink2); text-align: center; padding: 24px 0;
}

/* ── モバイルタブバー ── */
.kk-tabbar {
  position: fixed; bottom: 0; left: 0; right: 0; z-index: 200;
  background: var(--kkart-bg); border-top: 1px solid var(--kkart-line);
  display: flex; height: 60px;
}
.kk-tabbar a {
  flex: 1; display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 2px;
  font-size: 10px; font-weight: 700; color: var(--kkart-ink2);
  text-decoration: none;
}
.kk-tabbar a.active { color: var(--kkart-ink); }
.kk-tabbar-icon { font-size: 20px; }
.kk-tabbar-icon svg { width: 24px; height: 24px; display: block; }
@media (min-width: 768px) { .kk-tabbar { display: none; } }
