@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){
  /*必要ならばここにコードを書く*/
}


/************************************
** 目次
************************************/

/* 目次全体のスタイル */
.toc {
  background: #f7f9fa; /* ★背景色を最初の明るい色に戻しました */
  border: 2px solid #333333; /* 枠線も元に戻しました */
  border-radius: 8px; /* 角丸 */
  padding: 1.5em;
  margin: 2em 0;
}

/* 「目次」タイトルのスタイル */
.toc-title {
  color: #333333;
  font-size: 1.1em;
  font-weight: bold;
  text-align: center;
  border-bottom: 1px dashed #cccccc;
  padding-bottom: 0.5em;
  margin-bottom: 1em;
}

/* 目次リストのスタイル */
.toc-list {
  margin: 0;
  padding-left: 0;
  list-style: none; /* デフォルトの丸ポチを消す */
  counter-reset: toc-counter; /* 数字を数えるカウンターをリセット */
}

/* 見出しごとのスタイル（区切り線入り） */
.toc-list li {
  margin: 0;
  padding: 0.6em 0; 
  line-height: 1.6;
  border-bottom: 1px dashed #cccccc; /* 見出しの間の区切り線 */
  position: relative;
  padding-left: 1.8em; /* 数字が入るスペースを左側に確保 */
}

/* 見出しの先頭に自動で数字を追加 */
.toc-list li::before {
  counter-increment: toc-counter; /* カウンターを進める */
  content: counter(toc-counter) "."; /* 数字の後にドットを付ける（例: 1.） */
  position: absolute;
  left: 0;
  top: 0.6em;
  font-weight: bold;
  color: #333333; /* 数字の色 */
}

/* 最後の項目の下線だけを消す */
.toc-list li:last-child {
  border-bottom: none;
}

/* リンクの色とホバー効果 */
.toc-list a {
  text-decoration: none;
  color: #2b5c8f; /* リンクの色を元の青系に戻しました */
  display: block; 
}

.toc-list a:hover {
  text-decoration: underline;
}



/************************************
** 関連記事
************************************/

/* 関連記事エリア全体のスタイル */
.custom-related-entries-grid {
  margin: 3em 0;
}

.related-entry-heading {
  font-size: 1.25em;
  border-bottom: 2px solid #333;
  padding-bottom: 8px;
  margin-bottom: 20px;
}

/* タイル状に並べるグリッドシステム */
.related-grid-list {
  display: grid;
  grid-template-columns: 1fr; /* スマホ環境：デフォルトは1列並び */
  gap: 20px; /* カード同士の間隔 */
}

/* パソコン環境（画面横幅768px以上）では2カラム（2列）にする */
@media screen and (min-width: 768px) {
  .related-grid-list {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* リンクとカードの構造 */
.related-grid-card-wrap {
  text-decoration: none;
  color: inherit;
  display: block;
}

.related-grid-card {
  background: #fff;
  border: 1px solid #e5e5e5;
  border-radius: 6px;
  overflow: hidden;
  height: 100%;
  display: flex;
  flex-direction: column;
  transition: transform 0.2s, box-shadow 0.2s;
}

.related-grid-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
}

/* サムネイルを765:1080（1:1.411）の比率に強制固定 */
.related-grid-card-thumb {
  margin: 0;
  padding: 0;
  width: 100%;
  aspect-ratio: 765 / 1080; /* 比率を厳密に固定 */
  background-color: #f5f5f5;
  overflow: hidden;
}

.related-grid-image {
  width: 100%;
  height: 100%;
  object-fit: cover; /* 画像を歪ませずにトリミングして枠に収める */
  display: block;
}

/* テキストコンテンツエリア */
.related-grid-card-content {
  padding: 15px;
  flex-grow: 1;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.related-grid-card-title {
  font-size: 1em;
  font-weight: bold;
  margin: 0 0 10px 0;
  line-height: 1.5;
  /* タイトルが長すぎる場合に3行で省略する設定（1列・2列で見やすさを維持） */
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
  overflow: hidden;
}

.related-grid-card-meta {
  font-size: 0.8em;
  color: #888;
  margin-top: auto;
}




/************************************
** アコーディオン
************************************/
details.my-accordion {
    margin-bottom: 1rem;
    padding: 0.5rem 0;
}

/* タイトル部分に下線を追加 */
details.my-accordion summary.my-accordion-title {
    font-weight: bold;
    cursor: pointer;
    padding: 0.5rem 0;
    border-bottom: 1px solid #ddd; /* ここで下線の太さと色を指定 */
}

/* 本文部分（開いたとき）の余白調整 */
details.my-accordion .my-accordion-body {
    padding-top: 0.8rem;
    margin-top: 0;
}


/************************************
** カテゴリーショートコード
************************************/
/* カテゴリーリンク全体を中央寄せにするコンテナ */
.custom-post-category-text-links {
  display: flex;
  justify-content: center; /* 横方向の中央寄せ */
  flex-wrap: wrap; /* スマホ画面での折り返し */
  gap: 12px; /* リンク同士の左右の間隔 */
  margin: 0.5em 0; /* 縦幅（上下余白）をキュッと狭く調整（1.5em → 0.5em） */
  line-height: 1.2; /* 行間を詰めて縦幅を抑える */
}

/* 中央寄せテキストリンク単体のスタイル */
.cat-center-text-link {
  color: #2563eb; /* リンクの色 */
  font-size: 0.9em; /* 文字の大きさを少しだけコンパクトに */
  font-weight: 600; 
  text-decoration: none;
  padding: 2px 0; /* 縦方向の余白を最小限に */
  transition: color 0.2s ease;
}

/* リンクにマウスを乗せた（ホバーした）とき */
.cat-center-text-link:hover {
  color: #1d4ed8; 
  text-decoration: underline; /* ホバー時のみ下線を表示 */
}



/************************************
** タグショートコード
************************************/

/* タグリンク全体を中央寄せにするコンテナ */
.custom-post-tag-text-links {
  display: flex;
  justify-content: center; /* 横方向の中央寄せ */
  flex-wrap: wrap; /* スマホ画面での折り返し */
  align-items: center;
  margin: 0.5em 0; /* 縦幅（上下余白）をコンパクトに */
  line-height: 1.2; /* 行間を詰めて縦幅を抑える */
}

/* 中央寄せタグリンク単体のスタイル */
.tag-center-text-link {
  color: #2563eb; /* カテゴリーと同じ青色 */
  font-size: 0.9em; 
  font-weight: 600; 
  text-decoration: none;
  padding: 2px 0; 
  transition: color 0.2s ease;
}

/* タグリンクにマウスを乗せた（ホバーした）とき */
.tag-center-text-link:hover {
  color: #1d4ed8; 
  text-decoration: underline; 
}

/* 区切り文字「｜」のスタイル */
.tag-separator {
  color: #cccccc; 
  font-size: 0.8em; 
  margin: 0 8px; 
  user-select: none; 
}

/* タグが無い場合の「-」のスタイル（Cocoonの通常文字色を自動継承） */
.tag-no-data {
  color: inherit; /* グレー固定を廃止し、サイト全体のフォント色をそのまま引き継ぐ */
  font-size: 0.95em;
  font-weight: bold;
  user-select: none; /* テキスト選択を無効化 */
  opacity: 0.8;      /* 周りのテキストと馴染むよう、ほんの少しだけ透過させてバランスをとる設定です（不要ならこの行は消してOKです） */
}

