/*
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;
}

/* ✅ スライドサイドバー（右＆左）スタイル */
#slide-sidebar,
#slide-sidebar-right {
  position: fixed;
  top: 0;
  width: 270px;
  height: 100%;
  background-color: #fff;
  box-shadow: 2px 0 5px rgba(0,0,0,0.2);
  z-index: 9998;
  padding: 16px;
  overflow-y: auto;
  transition: all 0.3s ease;
}

#slide-sidebar {
  left: -270px;
}
#slide-sidebar.open {
  left: 0;
}

#slide-sidebar-right {
  right: -270px;
}
#slide-sidebar-right.open {
  right: 0;
}

/* ✅ スライドボタンの基本スタイル */
#menu-toggle,
#slide-toggle-btn {
  position: fixed;
  top: 15px;
  z-index: 9999;
}

#menu-toggle {
  left: 15px;
}

#slide-toggle-btn {
  right: 15px;
}

#menu-toggle button,
#slide-toggle-btn button {
  font-size: 24px;
  background: none;
  border: none;
  cursor: pointer;
}
/* ✅ スライドサイドバー表示用ボタンのスタイル */
#slide-toggle-btn {
  position: fixed;
  top: 50%;
  right: 0;
  transform: translateY(-50%);
  z-index: 10000;
  background: #333;
  color: #fff;
  padding: 10px 15px;
  border-radius: 8px 0 0 8px;
  cursor: pointer;
  font-size: 20px;
}
/* 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;
}
/* hamburger mobile only (no markup, ASCII only) */
@media (max-width:1100px){
  ul.mobile-header-menu-buttons{background:transparent!important;box-shadow:none!important;border:none!important;height:auto!important;padding:0!important;margin:0!important;pointer-events:none!important}
  ul.mobile-header-menu-buttons *{pointer-events:none!important}
  ul.mobile-header-menu-buttons button{pointer-events:auto!important;position:fixed!important;left:12px;top:12px;z-index:12000!important;width:38px;height:38px;padding:0!important;margin:0!important;display:inline-flex!important;align-items:center;justify-content:center;background:#fff!important;border:1px solid #bbb!important;border-radius:10px!important;box-shadow:0 2px 6px rgba(0,0,0,.12)!important;color:#333!important;line-height:1;font-size:0!important}
  body.admin-bar ul.mobile-header-menu-buttons button{top:64px}
  ul.mobile-header-menu-buttons button::before{content:"";position:absolute;left:50%;top:50%;width:18px;height:2px;background:currentColor;transform:translate(-50%,-50%);box-shadow:0 -6px 0 currentColor,0 6px 0 currentColor;pointer-events:none!important}
  body.drawer-open ul.mobile-header-menu-buttons button{display:none!important}
}
@media (min-width:1101px){
  ul.mobile-header-menu-buttons button{display:none!important}
}
/* ================================================
 * カテゴリ説明を「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;
}
