/*---------------------------------
管理画面の選択結果に応じてスタイルを変化させる部分(未設定部分)
---------------------------------*/
/* [選択:4.アイコンの選択]FontAwesomeを指定する設定(既定値はOFF(なにも記述しない)でラジオボタンでONになるとlabel要素に.caf-awesomeが読み込まれるように設定) */
[category_explorer_container] label.caf-awesome:before,[category_explorer_container] label.caf-awesome:after{font-family: 'FontAwesome';}

/* [選択:4.アイコンの選択]フォルダーと右矢印のアイコン(既定値はOFF(1行目)。ONになると下記スタイルが読み込まれるように設定) */
[category_explorer_container] label.caf-awesome:hover:after{content: '\f105';}/* 右矢印 */
[category_explorer_container] label.caf-awesome:before{content:'\f114';}/* フォルダアイコン(閉) */
[category_explorer_container] label.caf-awesome:has(>input:checked):before{content:'\f115';}/* フォルダアイコン(開) */

/* [選択:5.カラム幅]カラム幅の設定(せまい画面だとカラム分け出来ないため、ブレイクポイント769px以上に範囲を限定。カラムには右余白を1％とっている為、マイナス1％ずつ幅を設定) */
@media screen and (min-width:769px){
[category_explorer_container] > div{width:32%;}/* 5カラム(標準) */
[category_explorer_container] > div.cec-19{width:32%;}/* 5カラム */
[category_explorer_container] > div.cec-24{width:24%;}/* 4カラム */
[category_explorer_container] > div.cec-32{width:32%;}/* 3カラム */
[category_explorer_container] > div.cec-49{width:49%;}/* 2カラム */
}

/* [選択:6.アイキャッチ画像の設定]最大幅、アスペクト比率、角丸の大きさをそれぞれ設定。.aspect-ogimageを標準に) */
[category_explorer_container] .post a img{aspect-ratio: 1.191 / 1;max-width:64px !important;max-height:50px;object-fit: cover;border-radius:4px;}
[category_explorer_container] .aspect-ogimage img { aspect-ratio: 1.191 / 1; }/* 標準。OGイメージ準拠 */
[category_explorer_container] .aspect-4-3 img { aspect-ratio: 4 / 3; }
[category_explorer_container] .aspect-16-9 img { aspect-ratio: 16 / 9; }
[category_explorer_container] .aspect-1-1 img { aspect-ratio: 1 / 1; }/* 正方形 */

/*---------------------------------
共通のスタイル
---------------------------------*/

/* トランジション設定　>　左から右 */
@keyframes LeftToRight {
0% {opacity: 0;transform: translateX(-10px);}
100% {opacity: 1;transform: translateX(0);}
}
/* トランジション設定　>　左から右 */
@keyframes RightToLeft {
0% {opacity: 0;transform: translateX(10px);}
100% {opacity: 1;transform: translateX(0);}
}

/* トランジション適用箇所 */
[category_explorer_container] label:hover:after,
[category_explorer_container] > div > div > div
{animation-name: LeftToRight;animation-duration: 0.2s;transition: 0.3s ease-in-out;}

/* アイコン(デフォルト) */
[category_explorer_container] label:hover:after{content: '›';}
[category_explorer_container] label:before{content:'📁';}
[category_explorer_container] label:has(>input:checked):before{content:'📂';}

/* スクロール箇所とスクロールバー */
[category_explorer_container]{padding-bottom: 2em;overflow-x:auto;}
[category_explorer_container] div{overflow-y:auto;}
[category_explorer_container]::-webkit-scrollbar,[category_explorer_container] div::-webkit-scrollbar{width: 8px;height: 8px;background:#fff;transition: 0.2s ease-in-out;}
[category_explorer_container]::-webkit-scrollbar:hover,[category_explorer_container] div::-webkit-scrollbar:hover{background:#eee;}
[category_explorer_container]::-webkit-scrollbar-thumb,[category_explorer_container] div::-webkit-scrollbar-thumb{border-radius: 0px;background: #999;border-radius: 5px;}

/* ラジオボタン周り */
[category_explorer_container] label{display:block;cursor:pointer;border-radius:4px;padding:0.4em 0.8em;position:relative;transition: 0.3s ease-in-out;}
[category_explorer_container] label:hover{background:#eee;}
[category_explorer_container] input[type="radio"]{display:none;}

/* 投稿のアイキャッチ画像 */
[category_explorer_container] .post a{display:flex;}
[category_explorer_container] .post span{display:flex-box;}
[category_explorer_container] .post img{display:flex-box;width:100%;margin-right:0.4em;margin-top:0 !important;margin-bottom:0.2em;object-fit: cover;}

/* ボックス > リスト部分 */
[category_explorer_container] > div{position:relative;cursor:pointer;padding-right:0.5%;margin-right:0.5%;}
[category_explorer_container] > div > div > div{position:relative;margin-bottom:0.4em;border-radius:4px;}
[category_explorer_container] > div > div > div:hover{background:#eee;}
[category_explorer_container] label:after{position:absolute;}
[category_explorer_container] label:hover:after{position:absolute;}

/*---------------------------------
スマホ用のスタイル
---------------------------------*/

/*---------------------------------
タブレット用のスタイル
---------------------------------*/

@media screen and (min-width: 600px) and (max-width: 959px) {
}

/*---------------------------------
デスクトップ用のスタイル
---------------------------------*/

@media screen and (min-width:960px){
/* カラムを横並びに */
[category_explorer_container]{display:flex;}

/* 最低幅は240px、基本的には25%はスペースをとる */
[category_explorer_container] div{max-height:600px;}
[category_explorer_container] > div{min-width:240px;}

/* 末尾に右矢印をつける */
[category_explorer_container] label:after{right:0.6em;top:0.4em;transition: 0.3s ease-in-out;}
[category_explorer_container] label:hover:after{right:0.4em;}
}


/* =========================
   CAF Mobile: 1カラム表示 + 戻るバー
   ========================= */
@media (max-width: 768px){

  /* 深さごとのカラムは全部隠して、activeだけ表示 */
  [category_explorer_container] > div[depth]{
    display: none;
  }
  [category_explorer_container] > div[depth].caf-active{
    display: block;
  }

  /* 戻るバー（sticky） */
  .caf-nav{
    position: sticky;
    top: 0;
    z-index: 999;
    padding: 10px 12px;
    background: #fff;
  }
  .caf-nav-inner{
    display: flex;
    align-items: center;
    gap: 10px;
  }
  .caf-back{
    appearance: none;
    border: 1px solid rgba(0,0,0,.15);
    padding: 8px 10px;
    border-radius: 10px;
    font-size: 14px;
    line-height: 1;
    cursor: pointer;border:none;
  }
  
  .caf-back[disabled]{
    opacity: .45;
    cursor: default;
  }

  /* スマホでは押しやすく */
  [category_explorer_container] .category label{
    display: block;
    padding: 12px 10px;
    border-radius: 12px;
    margin-bottom: 8px;
  }

.wp-column-directory.caf-onecol {
  display: block;
}

.wp-column-directory .caf-header {
  margin: 0 0 8px;
}

.wp-column-directory .caf-back {
  padding: 10px 12px;
  background: #fff;
  border-radius: 8px;
  cursor: pointer;
}

.wp-column-directory .caf-nav {
  display: grid;
  gap: 8px;
}

.wp-column-directory .caf-cat {
  width: 100%;
  text-align: left;
  padding: 12px 14px;
  border: 1px solid #e5e5e5;
  background: #fff;
  border-radius: 10px;
  cursor: pointer;
}

.wp-column-directory .caf-content {
  margin-top: 10px;
  display: grid;
  gap: 10px;
}

.wp-column-directory .caf-post {
  display: grid;
  grid-template-columns: 64px 1fr;
  align-items: center;
  text-decoration: none;
  border-radius: 10px;
}

.wp-column-directory .caf-post img {
  object-fit: cover;
  border-radius: 8px;
}


/* ===== Drilldown UI ===== */
.caf-drill-header{
  position: sticky;
  top: 0;
  z-index: 10;
  background: #fff;
  padding: 10px 12px;
  display: flex;
  gap: 10px;
  align-items: center;
  -webkit-tap-highlight-color: transparent;
}

.caf-drill-header:focus,
.caf-drill-header:focus-visible,
.caf-drill-header:active{
  outline: none !important;
  box-shadow: none !important;
}

.caf-back{
  padding: 8px 10px;
  background: #fff;
  border-radius: 10px;
  font-size: 14px;
  -webkit-tap-highlight-color: transparent;
  animation-name: RightToLeft;animation-duration: 0.2s;transition: 0.3s ease-in-out;
  outline: none;                            /* フォーカス枠消す */
}
.caf-back:disabled{
  opacity: .4;
}

.caf-back:focus,
.caf-back:focus-visible,
.caf-back:active{
  outline: none !important;
  box-shadow: none !important;
}

.caf-back::-moz-focus-inner{
  border: 0; /* Firefox対策 */
}

.caf-crumb{
  font-size: 13px;
  opacity: .8;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.caf-list, .caf-posts{
  list-style: none;
  padding: 10px 12px;
  margin: 0;
  display: grid;
}

.caf-cat-btn{
  width: 100%;
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 12px;
  border: 1px solid rgba(0,0,0,.12);
  background: #fff;
  border-radius: 14px;
  text-align: left;
}

.caf-cat-name::before{
  content:'📁';
  display:inline-block;
  margin-right: .5em;
}



/* ドリルダウン側：li(caf-post)はレイアウトに関与させない */
.caf-post{
  display: block !important;
}

.caf-post-link{
  display: grid;
  grid-template-columns: 88px minmax(0, 1fr);
  gap: 14px;
  align-items: center;
  padding: 6px; /* タップ領域拡大 */
  border-radius: 14px;
  transition: background .15s ease;
}

.caf-post-link:active{
  background: rgba(0,0,0,.05);
}


.caf-post-link{
  display: grid;
  grid-template-columns: 88px 1fr;
  gap: 12px;
  align-items: center;
  width: 100%;
}

.caf-post-title{
  min-width: 0;          /* ←これが超重要 */
}

.caf-post-list,
.caf-posts,
.caf-post {
  width: 100%;
}

.caf-posts {
  padding-left: 0;
  margin: 0;
  list-style: none;
}

.caf-post-link{
  display: grid;
  grid-template-columns: 88px minmax(0, 1fr);
  gap: 12px;
  align-items: center;
  padding:14px 12px;
}

.caf-post-link > :nth-child(2),
.caf-post-title {
  min-width: 0;
}

/* サムネは“枠”を基準に揃える */
.caf-thumb{
  display: block;           /* inline由来のズレを消す */
  width: 88px;
  height: 56px;
  object-fit: cover;
  border-radius: 10px;
}

.caf-post-title{
  font-size: 14px;
  line-height: 1.3;
  color: #111;
}

.caf-empty{
  padding: 12px;
  opacity: .7;
  font-size: 14px;
}

/* 投稿カードを横並びで正しく広げる */
.wp-column-directory .post a{
  display: flex;
  align-items: center;
  gap: 12px;
}

/* 画像は固定幅 */
.wp-column-directory .post img{
  width: 72px;
  height: 72px;
  object-fit: cover;
  flex: 0 0 72px;
  border-radius: 12px;
}

/* タイトル側を“残り幅ぜんぶ”使わせる */
.wp-column-directory .post .title{
  flex: 1 1 auto;
  min-width: 0;          /* ← これ重要。flexで幅が広がらない問題を解消 */
  display: block;
  line-height: 1.35;
  word-break: break-word;
}

/* 1) 画面外にはみ出した分を隠す（スライドに必須） */
[category_explorer_container]{
  position: relative;
  overflow: hidden;
}

/* 2) パネルは重なれるように（スライド中に同時表示するため） */
[category_explorer_container] > div[depth]{
  position: absolute;
  inset: 0;
  width: 100%;
}

/* 3) 現在表示中だけ前面へ */
[category_explorer_container] > div[depth].caf-active{
  position: relative;   /* activeだけ通常フローに戻す or そのままでもOK */
  z-index: 2;
}

.caf-cat-btn,
.caf-posts,
.caf-post
{animation-name: LeftToRight;animation-duration: 0.2s;transition: 0.3s ease-in-out;}
}
