/*
Theme Name: Cocoon Child
Template: cocoon-master
*/

/* ✅ PC表示用：バナー画像とキャッチコピーの調整 */
@media screen and (min-width: 768px){
  .pc-banner img {
    max-width: 70% !important;
    height: auto;
    max-height: 300px;
    display: block;
    margin: 0 auto;
  }

  .pc-banner .catchphrase {
    text-align: center;
    font-size: 14px;
    color: #666;
    margin-top: 6px;
  }

  .sidebar {
    display: block !important;
  }
}

/* ✅ モバイル表示用：ナビメニュー＆説明文非表示 */
@media screen and (max-width: 768px){
  .navi-menu-content a {
    color: #0066cc !important;
    text-decoration: underline !important;
    padding: 10px 15px;
    display: block;
    font-size: 16px;
    border-bottom: 1px solid #ccc;
  }

  .navi-menu-content a:hover {
    background-color: #eef7ff;
  }

  .sub-menu-description {
    display: none !important;
    height: 0 !important;
    line-height: 0 !important;
    padding: 0 !important;
    margin: 0 !important;
    visibility: hidden !important;
  }
}

/* ✅ その他の画像調整 */
.entry-thumb img {
  max-width: 70%;
  height: auto;
}

/* ✅ カテゴリボックスの調整 */
@media screen and (min-width: 768px) {
  .category-flex {
    display: flex;
    justify-content: center;
    gap: 16px;
  }

  .category-flex .cat-box {
    width: 30%;
  }
}

@media screen and (max-width: 767px) {
  .category-flex {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 10px;
  }

  .category-flex .cat-box {
    width: 45%;
  }

  .category-flex .cat-box:nth-child(1) {
    width: 70%;
    margin: 0 auto;
  }
}

/* ✅ カテゴリラベルとトップ矢印非表示 */
.cat-label,
.top-menu-icon .fa-arrow-up {
  display: none !important;
}


/* 404タイトルの色を変更 */
body.error404 h1.entry-title{
  color:#e60033 !important;
}

/* デフォ404画像を消す */
body.error404 img.not-found{
  display:none !important;
}
/* 404タイトルの色を変更（当たり確認） */
body.error404 h1.entry-title{
  color: #e60033 !important;
}

/* Cocoonのデフォ404画像を消す */
body.error404 img.not-found{
  display: none !important;
}
/* 404タイトルの色を強制変更 */
html body.error404 h1.entry-title {
  color: #e60033 !important;
  background: rgba(230,0,51,.08) !important;
  border: 2px solid #e60033 !important;
  padding: 6px !important;
}

/* Cocoonのデフォ404画像を強制で消す */
html body.error404 img.not-found {
  display: none !important;
}
/* 404専用：ページ内に「.not-found」画像があるときだけ適用（:has を使用） */
article.post:has(img.not-found) h1.entry-title{
  color:#e60033 !important;
  background:rgba(230,0,51,.08) !important;
  border:2px solid #e60033 !important;
  padding:6px !important;
}

/* 404のグレー画像を消す */
article.post:has(img.not-found) img.not-found{
  display:none !important;
}

/* タイトル直下に自作イラストを表示（画像URLを差し替え） */
article.post:has(img.not-found) h1.entry-title::after{
  content:"";
  display:block;
  width:320px; height:220px;
  margin:12px auto 8px;
  background:url("https://YOUR-DOMAIN/wp-content/uploads/your-404.png") no-repeat center/contain;
}
/* 404タイトルの色だけ変更 */
article.post:has(img.not-found) h1.entry-title {
  color: #e60033 !important;
}

/* Cocoonのデフォ404画像を消す */
article.post:has(img.not-found) img.not-found {
  display: none !important;
}

/* タイトル直下に自作イラストを表示 */
article.post:has(img.not-found) h1.entry-title::after {
  content: "";
  display: block;
  width: 320px;
  height: 220px;
  margin: 12px auto 8px;
  background: url("https://te-tsuduki-guide.com/wp-content/uploads/2025/08/toramiteru-mu5.png") no-repeat center/contain;
}
ul.mobile-header-menu-buttons {
  background: rgba(255, 255, 255, 0.9); /* 半透明の白背景 */
  border-radius: 6px;
}

/* ================================================
 * カテゴリ説明を「2行」表示に固定
 * 作成：2025-10-20 / 修正歴：-
 * 貼付場所：子テーマ style.css（または 追加CSS）
 * 目的：1行に潰れる症状を防ぎ、常に2行まで表示（3行目以降は省略）
 * ポイント：line-height と max-height をペアで指定
 * 対象：WordPress標準の .term-description、Cocoon系の想定要素も網羅
 * ================================================ */
.category .term-description,
.archive.category .term-description,
.archive .category-description,
.category-description {
  /* 2行まで見せる（WebKit系の行数制御） */
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;

  /* 非WebKit向けの保険（2行分の高さに制限） */
  line-height: 1.6;
  max-height: calc(1em * 1.6 * 2);
  overflow: hidden;

  /* 文字詰まり防止・見た目微調整 */
  margin-top: .4em;
  color: #555;
  word-break: break-word;
}

/* Cocoonや他CSSで1行化される/高さが潰れるのを上書き */
.category .term-description p,
.archive .category-description p {
  margin: 0 !important;
  line-height: 1.6 !important;
}

/* もしどこかで display:inline; 指定が入り1行化している場合の保険 */
.category .term-description,
.archive .category-description {
  display: -webkit-box !important;
}
