@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
*/

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

/************************************
** カラー変数の定義（将来の拡張用）
************************************/
:root {
  --color-primary: #34495e;
  --color-accent: #c9a96e;
  --color-bg: #ffffff;
  --color-bg-alt: #f8fafb;
  --color-text: #333333;
  --color-border: #e0e0e0;
  --color-link: #0066cc;
  --color-link-hover: #004499;
  --transition-normal: 0.3s ease;
}

/************************************
** 見出しのデザイン
************************************/

/* H2: ネイビー背景 + ゴールド左線 */
.article h2 {
  background-color: #34495e !important;
  color: #ffffff !important;
  padding: 15px 20px !important;
  border: none !important;
  border-left: 8px solid #c9a96e !important;
}

/* H3: L字スタイル */
.article h3 {
  background: transparent !important;
  color: #34495e !important;
  border: none !important;
  border-left: 15px solid #34495e !important; /* 【修正】15x → 15px */
  border-bottom: 2px solid #34495e !important;
  padding: 8px 15px !important;
}

/* H4: チェックマークアイコン付き */
.article h4 {
  border: none !important;
  padding: 5px 0 5px 30px !important;
  position: relative !important;
  color: #34495e !important;
  background: transparent !important;
  display: flex;
  align-items: center;
}

.article h4::before {
  content: "";
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-55%);
  width: 22px;
  height: 22px;
  background-image: url('https://clashofclans.cloudfree.jp/wp-content/uploads/coc-checkmark-icon.png');
  background-size: contain;
  background-repeat: no-repeat;
  background-position: center;
}

/* 見出しの上の余白を調整して、セクションの区切りを明確にする */
.article h2, .article h3 {
  margin-top: 1.3em !important;
  margin-bottom: 0.5em !important;
}

.article h4 {
  margin-top: 1.3em !important;
  margin-bottom: 0.8em !important;
}

/************************************
** テーブルのデザイン
************************************/

/* テーブルヘッダーの背景色 */
.entry-content th {
  background-color: #5d7285 !important;
  color: #ffffff !important;
}

/* ストライプを無効化し、ベースの色を適用 */
.entry-content tr, 
.entry-content tr:nth-child(even) {
  background-color: #edf1f4 !important;
}

/* テーブル全体の枠線と隙間の設定 */
.article table {
  border-collapse: collapse !important;
  border: 1px solid #cccccc !important;
  margin-bottom: 20px !important;
  width: 100%;
}

/* ヘッダー(th)とセル(td)の枠線 */
.article table th,
.article table td {
  border: 1px solid #cccccc !important;
  padding: 12px 15px !important;
}

/************************************
** ヘッダーのデザイン
************************************/

/* メニュー全体の背景を白にし、上下に薄いグレーの線を引く */
.navi, .navi-in {
  background-color: #f8fafb !important;
  border-top: 1px solid #e0e0e0 !important;
  border-bottom: 1px solid #e0e0e0 !important;
}

/* 各メニュー項目の設定（隙間をゼロにする） */
.navi-in > ul > li {
  margin: 0 !important;
}

/* メニューの文字と境界線 */
.navi-in > ul > li > a {
  color: #34495e !important;
  border-right: 1px solid #e0e0e0 !important;
  padding: 10px 15px !important;
  font-weight: bold !important;
  transition: all var(--transition-normal);
}

/* 一番左の項目に左線を追加して閉じる */
.navi-in > ul > li:first-child > a {
  border-left: 1px solid #e0e0e0 !important;
}



/************************************
** 固定ページ：新着記事のデザイン
************************************/

/* リスト全体を囲む外枠 */
.new-entry-cards {
  border: 1px solid #e0e0e0 !important;
  padding: 10px !important;
  border-radius: 4px !important;
  background-color: #ffffff !important;
}

/* 記事ごとの区切り線 */
.new-entry-cards .a-wrap {
  border-bottom: 1px solid #e0e0e0 !important;
  margin-bottom: 0 !important;
  padding: 15px 10px !important;
  transition: background-color var(--transition-normal);
}

/* 一番下の記事だけは区切り線を消す（外枠があるため） */
.new-entry-cards .a-wrap:last-child {
  border-bottom: none !important;
}

/* マウスを乗せた時の反応（背景を薄くグレーに） */
.new-entry-cards .a-wrap:hover {
  background-color: #f9f9f9 !important;
}

/************************************
** ブログカードのデザイン
************************************/

/* 内部ブログカードの土台デザイン */
.internal-blogcard {
  background-color: #f8fafb !important;
  border: 2px solid #c9a96e !important;
}

/* ブログカード下部の投稿日・更新日を非表示 */
.blogcard-post-date,
.blogcard-update-date,
.blogcard-footer {
  display: none !important;
}

/* タイトルの文字サイズを大きくする */
.blogcard-title {
  font-size: 1.2em !important;
  font-weight: bold;
  margin-bottom: 5px !important;
}

/************************************
** 目次のデザイン
************************************/
/* 目次全体のデザイン変更 */
.toc {
  width: 100% !important;
  background-color: #ffffff;
  border: 2px solid #c9a96e;
  border-radius: 4px;
  box-sizing: border-box;
  padding: 15px !important;
}

/* 「目次」のタイトル部分（一番上の文字） */
.toc-title {
  color: #34495e !important;
  font-size: 20px !important;
  font-weight: bold !important;
  text-align: center;
  border-bottom: 1px solid #c9a96e; 
  padding-bottom: 10px;
  margin-bottom: 15px !important;
}

/* 目次内のリンク文字（項目名） */
.toc-content a {
  color: #0052a3 !important;
  font-size: 16px !important;
  text-decoration: none;
  line-height: 1.6;
}

/* リストの余白調整 */
.toc-list li {
  margin-top: 8px;
}

/* 目次内のすべての項目リンクの直下に点線を入れる */
.toc-content li > a {
  display: block;
  border-bottom: 1px dashed #dcdcdc;
  padding: 8px 0;
  text-decoration: none;
  transition: color var(--transition-normal);
}

/* 最後の項目の点線を消す */
.toc-content li:last-child > a {
  border-bottom: none;
}

/* リンクのホバー時 */
.toc-content li > a:hover {
  color: #003d7a !important;
}


}

/************************************
** サイドバーのデザイン
************************************/

/* サイドバーのナビゲーションメニュー全体 */
.widget_nav_menu ul {
  list-style: none !important;
  padding: 0 !important;
  margin: 0 !important;
}

/* メニューの各項目 */
.widget_nav_menu li {
  border-bottom: 1px dashed #dcdcdc;
  margin: 0 !important;
  padding: 0 !important;
}

/* 最後の項目の線は消す */
.widget_nav_menu li:last-child {
  border-bottom: none;
}

/* リンクテキストの設定 */
.widget_nav_menu li a {
  display: block;
  padding: 12px 10px;
  color: #0066cc !important;
  text-decoration: none;
  font-weight: bold;
  font-size: 16px;
  transition: all var(--transition-normal);
}

/* 子要素（階層がある場合）のインデント */
.widget_nav_menu li ul {
  margin-left: 1.5em !important;
  border-top: 0.5px dashed #dcdcdc;
}

/************************************
** ボタンのデザイン
************************************/

/* 画像のホバーエフェクト */
a:hover img {
  opacity: 0.7;
  filter: alpha(opacity=70);
  -ms-filter: "alpha(opacity=70)";
  transition: opacity var(--transition-normal);
}

/* アウトラインボタンのスタイル */
.is-style-outline {
  transition: background-color var(--transition-normal);
}

.is-style-outline:hover {
  background: #34495e !important;
}

.is-style-outline a {
  transition: color var(--transition-normal) !important;
}

.is-style-outline:hover a {
  color: #ffffff !important;
  opacity: 1.0 !important;
}

/************************************
** レスポンシブデザイン用のメディアクエリ
************************************/

/* ① 1023px以下（タブレット・小型PC用） */
@media screen and (max-width: 1023px) {
  /* ヘッダーメニューの調整 */
  .navi-in > ul > li > a {
    padding: 12px 10px;
    font-size: 14px;
  }
  
  /* 見出しの余白を少し詰める */
  .article h2, .article h3 {
    margin-top: 1em !important;
  }
  
  /* テーブルを画面幅に収める（修正） */
  .article table {
    width: 100%;
    display: table;
  }
  
  .article table th,
  .article table td {
    padding: 10px 12px !important;
    font-size: 14px;
  }
  
  /* サイドバーの調整 */
  .widget_nav_menu li a {
    font-size: 15px;
  }
}

/* ② 599px以下（スマホ用） */
@media screen and (max-width: 599px) {
  /* ========== ヘッダーメニュー ========== */
  /* メニューを3列グリッド表示に */
  .navi-in > ul {
    display: grid !important;
    grid-template-columns: repeat(3, 1fr); /* 3列 */
    gap: 0;
    width: 100%;
  }
  
  .navi-in > ul > li {
    margin: 0 !important;
  }
  
  .navi-in > ul > li > a {
    padding: 8px 4px !important; /* 12px 8px → 8px 4px に縮小 */
    font-size: 12px !important; /* 14px → 12px に縮小 */
    min-height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    border: 1px solid #e0e0e0 !important;
    border-left: none !important;
    border-top: none !important;
    line-height: 1.3; /* 行間を詰める */
  }
  
  /* 左端の項目に左ボーダーを追加 */
  .navi-in > ul > li:nth-child(3n+1) > a {
    border-left: 1px solid #e0e0e0 !important;
  }
  
  /* 上段の項目に上ボーダーを追加 */
  .navi-in > ul > li:nth-child(-n+3) > a {
    border-top: 1px solid #e0e0e0 !important;
  }
  
  /* ========== 見出し ========== */
  .article h2 {
    padding: 12px 15px !important;
    font-size: 1.3em;
    border-left: 6px solid #c9a96e !important; /* 少し細く */
  }
  
  .article h3 {
    padding: 8px 12px !important;
    font-size: 1.2em;
    border-left: 12px solid #34495e !important;
  }
  
  .article h4 {
    font-size: 1.1em;
    padding-left: 28px !important;
  }
  
  .article h4::before {
    width: 20px;
    height: 20px;
  }
  
  /* ========== テーブル ========== */
  /* テーブルを画面幅いっぱいに */
  .article table {
    width: 100% !important;
    display: table;
    table-layout: auto;
    font-size: 13px;
  }
  
  .article table th,
  .article table td {
    padding: 8px 10px !important;
    word-wrap: break-word;
    word-break: break-word;
    white-space: normal;
  }
  
  /* 画像が入っているセルの調整 */
  .article table td img,
  .article table th img {
    max-width: 100% !important;
    height: auto !important;
    display: block;
    margin: 0 auto;
  }
  
  /* ========== 目次 ========== */
  .toc {
    padding: 12px !important;
  }
  
  .toc-title {
    font-size: 18px !important;
  }
  
  .toc-content a {
    font-size: 14px !important;
  }
  
  /* ========== ブログカード ========== */
  .blogcard-title {
    font-size: 1em !important;
  }
  
  /* ========== サイドバー ========== */
  .widget_nav_menu li a {
    font-size: 15px;
    padding: 10px 8px;
    min-height: 44px; /* タップしやすいサイズ */
    display: flex;
    align-items: center;
  }
  
  /* ========== 新着記事カード ========== */
  .new-entry-cards .a-wrap {
    padding: 12px 8px !important;
  }
}

/************************************
** パフォーマンス最適化（オプション）
************************************/

/* GPUアクセラレーションの有効化 */
.navi-in > ul > li > a,
.new-entry-cards .a-wrap,
.widget_nav_menu li a {
  will-change: transform;
  transform: translateZ(0);
}

/************************************
** 印刷用スタイル（オプション）
************************************/
@media print {
  /* 印刷時は不要な要素を非表示 */
  .navi,
  .sidebar,
  .widget_nav_menu {
    display: none;
  }
  
  /* 見出しの背景色を調整 */
  .article h2 {
    background-color: transparent !important;
    color: #000000 !important;
    border-left: 4px solid #000000 !important;
  }
  
  /* テーブルの枠線を濃く */
  .article table,
  .article table th,
  .article table td {
    border: 1px solid #000000 !important;
  }
}

/************************************
** 広告の設定
************************************/

/* 英語の広告ラベルをさらに控えめにする */
.ad-label {
    font-size: 9px;         /* 英語なら10px以下でも読みやすいです */
    color: #aaaaaa;         /* 灰色 */
    letter-spacing: 1px;    /* 文字の間隔を少し広げるとオシャレに見えます */
    text-transform: uppercase; /* 小文字で入力しても大文字（ADS）に固定する場合 */
}


/************************************
** 見出し上下の余白の設定
************************************/

/* ブログカード同士の間隔をあける */
.blogcard {
    margin-top: 2.0em !important;    /* カードの上の余白 */
    margin-bottom: 1.2em !important; /* カードの下の余白 */
}

/* 横ライン（hrタグ）の上下にスペースを作る */
.article hr {
    margin-top: 8px !important;    /* 上側の余白 */
    margin-bottom: 8px !important; /* 下側の余白 */
    border: 0;
    border-top: 1px solid #ccc;    /* ラインの色と太さ（お好みで） */
}