@charset "UTF-8";

/*!
Theme Name: Cocoon Child
Description: Cocoon専用の子テーマ
Theme URI: https://wp-cocoon.com/
Author: わいひら
Author URI: https://nelog.jp/
Template:   cocoon-master
Version:    1.1.3
*/

/************************************
** 子テーマ用のスタイルを書く
************************************/
/*必要ならばここにコードを書く*/

/************************************
** レスポンシブデザイン用のメディアクエリ
************************************/
/*1023px以下*/
@media screen and (max-width: 1023px){
  /*必要ならばここにコードを書く*/
}

/*834px以下*/
@media screen and (max-width: 834px){
  /*必要ならばここにコードを書く*/
}

/*480px以下*/
@media screen and (max-width: 480px){
  /*必要ならばここにコードを書く*/
}
/* ===============================
   Cocoon TOC — H2は番号なし、H3/H4のみ番号表示
   =============================== */

/* まず、目次ブロックの自動番号やリストマーカーを全面リセット */
:where(#toc, .toc) :where(ol, ul) {
  list-style: none !important;
  margin: 0;
  padding-left: 0;
}

/* H2（最上位）行：番号要素（::markerやspan.toc-number等）を見えなくする */
:where(#toc, .toc) .toc-list > li {
  position: relative;
  padding-left: 0;
}
:where(#toc, .toc) .toc-list > li::marker { content: "" !important; }
:where(#toc, .toc) .toc-list > li > a .toc-number { display: none !important; } /* spanで数字を出すテーマ対策 */

/* ─ H3（第2階層）：1. 2. 3. ─ */
:where(#toc, .toc) .toc-list > li > :is(ol, ul) {
  counter-reset: sub;
  margin-top: .25em;
}
:where(#toc, .toc) .toc-list > li > :is(ol, ul) > li {
  position: relative;
  padding-left: 1.4em;
}
:where(#toc, .toc) .toc-list > li > :is(ol, ul) > li::before {
  counter-increment: sub;
  content: counter(sub) ". ";
  position: absolute;
  left: 0;
  top: 0;
  color: #2563eb;
  font-weight: 700;
}

/* spanで数字を埋め込むタイプのテーマ向け（H3行の先頭span数字を隠す） */
:where(#toc, .toc) .toc-list > li > :is(ol, ul) > li > a .toc-number {
  display: none !important;
}

/* ─ H4（第3階層）：1.1 / 1.2 形式 ─ */
:where(#toc, .toc) .toc-list > li > :is(ol, ul) > li > :is(ol, ul) {
  counter-reset: sub2;
  margin-top: .15em;
}
:where(#toc, .toc) .toc-list > li > :is(ol, ul) > li > :is(ol, ul) > li {
  position: relative;
  padding-left: 2.2em;
}
:where(#toc, .toc) .toc-list > li > :is(ol, ul) > li > :is(ol, ul) > li::before {
  counter-increment: sub2;
  content: counters(sub, ".") "." counter(sub2) " ";
  position: absolute;
  left: .6em;
  top: 0;
  color: #2563eb;
  font-weight: 700;
}

/* 見た目の微調整（任意） */
:where(#toc, .toc) .toc-list a { text-decoration: none; }
:where(#toc, .toc) .toc-list a:hover {
  text-decoration: underline;
  text-underline-offset: .15em;
}
