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




/* ===== Mobile Top Bar + Drawer (FA5) — consolidated ===== */

/* PCでは非表示 */
#sp-topnav, #sp-drawer, .sp-overlay { display: none; }

@media (max-width:768px){
  /* バーの実高さ（48〜60pxで微調整OK） */
  :root{ --sp-topnav-h: 56px; }

  /* 本文はバー分だけ下げる（他は触らない） */
  body{ padding-top: var(--sp-topnav-h) !important; }

  /* 上部バー：常に最上部に固定 */
  #sp-topnav.sp-topnav{
    position: fixed !important;
    top: 0 !important; left: 0; right: 0;
    display: flex; gap: 0; padding: 8px 10px;
    background: #fff; border-bottom: 1px solid #ddd;
    z-index: 2147483646; box-sizing: border-box;
  }
  #sp-topnav .item{
    flex: 1 1 0;
    display: flex; align-items: center; justify-content: center; gap: 8px;
    padding: 8px 0; text-decoration: none; white-space: nowrap;
    color: #000 !important; font-weight: 600; font-size: 14px; line-height: 1.1;
  }
  #sp-topnav .item i{ font-size: 20px; }

  /* オーバーレイ */
  .sp-overlay{
    position: fixed; inset: 0; background: rgba(0,0,0,.35);
    opacity: 0; pointer-events: none; transition: opacity .2s ease;
    z-index: 2147483645; display: block;
  }

  /* ドロワー */
  #sp-drawer.sp-drawer{
    position: fixed; top: 0; left: 0; bottom: 0;
    width: 80vw; max-width: 320px;
    background: #fff; box-shadow: 2px 0 12px rgba(0,0,0,.15);
    transform: translateX(-100%); transition: transform .25s ease;
    z-index: 2147483647; display: block;
  }

  .sp-drawer__header{
    display: flex; align-items: center; justify-content: space-between; gap: 8px;
    padding: 12px 14px; border-bottom: 1px solid #eee;
  }
  .sp-drawer__header .title{ font-weight:700; font-size:16px; }
  .sp-drawer__header .close{ display:flex; align-items:center; justify-content:center; padding:8px; }
  .sp-drawer__header .close i{ font-size:20px; }

  /* リスト */
  .sp-drawer__list{ list-style:none; margin:0; padding:8px 0; }
  .sp-drawer__list > li{ position:relative; }
  .sp-drawer__list > li > a{
    display:block; padding:14px 16px; padding-right:44px; /* 矢印スペース */
    text-decoration:none; color:#111; font-size:15px; line-height:1.3; font-weight:700;
    border-bottom:1px solid #f1f1f1;
  }

  /* --- サブメニュー（アコーディオン／マーカー無し） --- */
  /* マーカー削除（テーマの ::marker / ::before 対策込み） */
  .sp-drawer__list, 
  .sp-drawer__list li,
  .sp-drawer__list .sub-menu,
  .sp-drawer__list .sub-menu li{
    list-style: none !important;
    padding-left: 0;
    margin: 0;
  }
  .sp-drawer__list li::marker,
  .sp-drawer__list li::before{ content:'' !important; }

  /* 階層の見た目：左ガイド線＋インデント。孫以降は破線に */
  .sp-drawer__list .sub-menu{
    display: none !important;                 /* アコーディオン前提 */
    margin: 0 0 8px 12px;
    padding: 4px 0 8px 14px;
    border-left: 2px solid #eee;
  }
  .sp-drawer__list .sub-menu .sub-menu{
    margin-left: 10px;
    border-left: 1px dashed #e6e6e6;
  }
  .sp-drawer__list .sub-menu a{
    display:block; padding:10px 14px; font-size:14px; font-weight:500; color:#222;
  }

	/* チェックONで展開＆矢印反転 */
  .sp-drawer__list > li > .sp-subtoggle:checked ~ .sp-subtoggle-btn::before{ content:"\f107"; } /* ˅ */
  .sp-drawer__list > li > .sp-subtoggle:checked ~ .sub-menu{ display:block !important; }

  /* ドロワー開閉 */
  .sp-nav-toggle:checked ~ #sp-drawer{ transform: translateX(0); }
  .sp-nav-toggle:checked ~ .sp-overlay{ opacity:1; pointer-events:auto; }
}

/* ログイン中（管理バー ≈46px）のときにずらす */
@media (max-width:782px){
  body.admin-bar #sp-topnav.sp-topnav{ top: 46px !important; }
  body.admin-bar{ padding-top: calc(46px + var(--sp-topnav-h)) !important; }
}

/* （任意）ダーク配色
@media (max-width:768px){
  #sp-topnav.sp-topnav{ background:#11263C; border-bottom-color:transparent; }
  #sp-topnav .item, #sp-topnav .item i{ color:#fff !important; }
}
*/




/* ==== モバイルドロワー：矢印を右上に固定＆子リンクにかぶせない ==== */
@media (max-width:768px){
  /* 各行を相対基準に */
  .sp-drawer__list > li{ position: relative; text-align: left; }

  /* 親リンクの行。右端に矢印スペースを確保（48pxはお好みで） */
  .sp-drawer__list > li > a{
    display: block;
    padding: 14px 48px 14px 16px;  /* 右に余白＝矢印の場所 */
    min-height: 44px;
  }

  /* ★ 開閉ラベルを“右端だけ”に限定（前の inset:0 を打ち消す） */
  .sp-drawer__list > li.menu-item-has-children > .sp-subtoggle-btn{
    position: absolute;
    top: 0; right: 0;
    width: 48px; height: 100%;     /* 行の右端だけがタップ領域 */
    inset: auto;                   /* ← これで inset:0 を上書き */
    z-index: 2;
    cursor: pointer;
    background: transparent;
  }

  /* 矢印は常に右上に固定 */
  .sp-drawer__list > li.menu-item-has-children > .sp-subtoggle-btn::before{
    content: "\f105";               /* ＞ */
    font-family: "Font Awesome 5 Free";
    font-weight: 900;
    font-size: 16px;
    position: absolute;
    right: 14px; top: 12px;         /* ← ここを1〜2px単位で微調整可 */
    line-height: 1;
    transform: none;
  }

  /* 開いたら ˅ に */
  .sp-drawer__list > li > .sp-subtoggle:checked ~ .sp-subtoggle-btn::before{
    content: "\f107";
  }

  /* サブメニュー表示＆タップ優先度（ラベルに負けないように） */
  .sp-drawer__list .sub-menu{
    position: relative; z-index: 1;
    display: none !important;
  }
  .sp-drawer__list > li > .sp-subtoggle:checked ~ .sub-menu{
    display: block !important;
  }
  .sp-drawer__list .sub-menu a{ position: relative; z-index: 3; }
}




/* ==== ドロワー矢印の競合を解消し、右上に固定する（モバイル） ==== */
@media (max-width:768px){


  /* 2) 各行は相対基準に */
  .sp-drawer__list > li{ position: relative; }

  /* 3) 親リンクテキスト：右に矢印用スペースを確保して改行を減らす */
  .sp-drawer__list > li > a{
    display: block !important;        /* flex指定があっても上書き */
    padding: 14px 52px 14px 16px;     /* 右に52pxの余白（矢印の居場所） */
    line-height: 1.3;
    min-height: 44px;
    white-space: normal;              /* 必要なら nowrap → normal に */
    box-sizing: border-box;
  }

  /* 4) 開閉ラベルは“右端だけ”をタップ領域に（子メニューに被せない） */
  .sp-drawer__list > li.menu-item-has-children > .sp-subtoggle-btn{
    position: absolute !important;
    top: 0; right: 0;                 /* ← 右端固定 */
    width: 52px; height: 100%;
    inset: auto !important;           /* 以前の inset:0 を打ち消す */
    z-index: 2;
    cursor: pointer;
    background: transparent;
  }

  /* 5) 矢印アイコンは右上固定（中央寄せを無効化） */
  .sp-drawer__list > li.menu-item-has-children > .sp-subtoggle-btn::before{
    content: "\f105";                 /* ＞ */
    font-family: "Font Awesome 5 Free";
    font-weight: 900;
    position: absolute;
    right: 14px !important;
    left: auto !important;            /* 万一leftが残っていても打消し */
    top: 12px;                        /* 好みで 10〜14px */
    transform: none !important;       /* 50%中央寄せを無効化 */
    line-height: 1;
    font-size: 16px;
  }

  /* 開いたときは ˅ に */
  .sp-drawer__list > li > .sp-subtoggle:checked ~ .sp-subtoggle-btn::before{
    content: "\f107";
  }

  /* 6) サブメニューはラベルより前面。子リンクが確実に押せるように */
  .sp-drawer__list .sub-menu{
    position: relative; z-index: 3;
    display: none !important;
    margin: 0 0 8px 12px;
    padding: 4px 0 8px 14px;
    border-left: 2px solid #eee;
  }
  .sp-drawer__list > li > .sp-subtoggle:checked ~ .sub-menu{
    display: block !important;
  }
}



/* ==== モバイルドロワー：矢印は右上固定／子リンクに被せない／改行崩れ防止 ==== */
@media (max-width:768px){

  /* a::after の矢印は完全停止（競合回避） */
  .sp-drawer__list > li.menu-item-has-children > a::after{
    content: none !important;
  }

  /* 各行は相対基準 */
  .sp-drawer__list > li{
    position: relative; text-align: left;
  }

  /* 親リンクテキスト：右に矢印用スペース。改行で崩れにくく */
  .sp-drawer__list > li > a{
    display: block !important;
    padding: 14px 52px 14px 16px;   /* 右に52px＝矢印の居場所 */
    line-height: 1.3;
    min-height: 44px;
    white-space: normal;            /* 改行OKで不自然な折返しを軽減 */
    box-sizing: border-box;
  }

  /* 開閉ラベルは“右端だけ”がタップ領域（子メニューに被せない） */
  .sp-drawer__list > li.menu-item-has-children > .sp-subtoggle-btn{
    position: absolute !important;
    top: 0; right: 0;
    width: 52px; height: 100%;
    inset: auto !important;         /* 旧 inset:0 を打ち消す */
    z-index: 2;
    cursor: pointer;
    background: transparent;
  }

  /* 矢印は右上固定（中央寄せ無効） */
  .sp-drawer__list > li.menu-item-has-children > .sp-subtoggle-btn::before{
    content: "\f105";               /* ＞ */
    font-family: "Font Awesome 5 Free";
    font-weight: 900;
    font-size: 16px;
    position: absolute;
    right: 14px !important;
    left: auto !important;
    top: 12px;                      /* 好みで 10〜14px */
    transform: none !important;
    line-height: 1;
  }
  /* 開いたら ˅ に */
  .sp-drawer__list > li > .sp-subtoggle:checked ~ .sp-subtoggle-btn::before{
    content: "\f107";
  }

  /* サブメニューは前面に。子リンクは確実に押せる */
  .sp-drawer__list .sub-menu{
    position: relative; z-index: 3;
    display: none !important;
    margin: 0 0 8px 12px;
    padding: 4px 0 8px 14px;
    border-left: 2px solid #eee;
  }
  .sp-drawer__list > li > .sp-subtoggle:checked ~ .sub-menu{
    display: block !important;
  }
  .sp-drawer__list .sub-menu a{
    position: relative; z-index: 4; display: block; padding: 10px 14px;
  }
}




/* ==== 最終上書き：SPドロワーの矢印は右上固定／子リンクに被せない ==== */
@media (max-width:768px){

  /* 0) 旧スタイルの影響を消す（inset:0 や中央寄せを無効化） */
  .sp-drawer__list > li.menu-item-has-children > .sp-subtoggle-btn{
    inset: auto !important;
    left: auto !important;
  }
  .sp-drawer__list > li.menu-item-has-children > a::after{
    content: none !important;   /* a::after 矢印は使わない */
  }

  /* 1) 行のレイアウト */
  .sp-drawer__list > li{
    position: relative !important;
    text-align: left;
  }
  .sp-drawer__list > li > a{
    display: block !important;
    padding: 14px 56px 14px 16px !important; /* 右に矢印スペースを確保 */
    min-height: 44px;
    line-height: 1.3;
    box-sizing: border-box;
    white-space: normal;
  }

  /* 2) 開閉ラベル＝右端だけをタップ領域に */
  .sp-drawer__list > li.menu-item-has-children > .sp-subtoggle-btn{
    position: absolute !important;
    top: 0 !important; right: 0 !important;
    width: 56px !important; height: 100% !important;
    z-index: 2 !important;
    background: transparent !important;
    cursor: pointer;
  }

  /* 3) 矢印は右上に固定（中央寄せ解除） */
  .sp-drawer__list > li.menu-item-has-children > .sp-subtoggle-btn::before{
    content: "\f105"; /* ＞ */
    font-family: "Font Awesome 5 Free";
    font-weight: 900;
    position: absolute !important;
    right: 16px !important;
    top: 12px !important;
    transform: none !important;
    left: auto !important;
    font-size: 16px;
    line-height: 1;
  }
  .sp-drawer__list > li > .sp-subtoggle:checked ~ .sp-subtoggle-btn::before{
    content: "\f107"; /* ˅ */
  }

  /* 4) サブメニューは前面に（子リンクのタップを優先） */
  .sp-drawer__list .sub-menu{
    position: relative; z-index: 3;
    display: none !important;
    margin: 0 0 8px 12px;
    padding: 4px 0 8px 14px;
    border-left: 2px solid #eee;
  }
  .sp-drawer__list > li > .sp-subtoggle:checked ~ .sub-menu{
    display: block !important;
  }
  .sp-drawer__list .sub-menu a{
    position: relative; z-index: 4; display: block; padding: 10px 14px;
  }
}


@media (max-width:768px){
  .sp-drawer__list > li.menu-item-has-children > a{
    pointer-events: auto !important;
  }
}
