@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){
  /*必要ならばここにコードを書く*/
}
/* 子カテゴリのパディングを狭める */
.widget_categories ul li a {
    padding: 3px 0;
}

/* デフォルトで、子カテゴリを非表示状態にする */
.widget_categories ul li.cat-item > ul.children {
    display: none;
}

/* 親カテゴリの開閉時に「＋」「ー」を切り替える&右端に表示させる */
.widget_categories > ul > li.cat-item > a.cf {
    position: relative;
}

.widget_categories > ul > li.cat-item > a.cf::after{/* 閉じている時 */
    content: "＋";
    display:inline-block; /*改行させないようにする*/
    position: absolute;
    right: 5px;
}

.widget_categories > ul > li.cat-item > a.cf.active::after{/* 開いている時 */
    content: "－";
    display:inline-block; /*改行させないようにする*/
    position: absolute;
  right: 5px;
}

/* 親カテゴリのアイコンを変更する（各種） */
/* li.cat-item-[XX]の部分は、あなたの環境での番号に置き換えてください。 */
.widget_categories ul li.cat-item-7 > a.cf:before {
    font-family: "Font Awesome 5 Free";
    content: '\f0b1';
    width: 10%;
    padding-right: 7px;
    font-weight: 900;
    display: inline-block;
}
.widget_categories ul li.cat-item-2 > a.cf:before {
    font-family: "Font Awesome 5 Free";
    content: "\f109";
    width: 10%;
    padding-right: 7px;
    font-weight: 900;
    display: inline-block;
}
.widget_categories ul li.cat-item-32 > a.cf:before {
    font-family: "Font Awesome 5 Free";
    content: "\f121";
    width: 10%;
    padding-right: 7px;
    font-weight: 900;
    display: inline-block;
}
.widget_categories ul li.cat-item-15 > a.cf:before {
    font-family: "Font Awesome 5 Free";
    content: "\f6ec";
    width: 10%;
    padding-right: 7px;
    font-weight: 900;
    display: inline-block;
}

/* 子カテゴリのアイコンを変更する */
.widget_categories ul li.cat-item > ul.children > li.cat-item > a.cf:before {
    font-family: "Font Awesome 5 Free";
    content: "\f07c";
    padding-right: 7px;
    font-size: 0.8em;
    font-weight: 900;
}

/* 親カテゴリの記事数（post-count）を無効化（非表示） */
.widget_categories > ul > li.cat-item > .cf > .post-count {
    display: none;
}
// 親カテゴリのリンクを無効化
$('.widget_categories > ul > li.cat-item > .cf').attr('href', 'javascript: void(0)');

// クラスを追加し、スライドする
$('.widget_categories ul li.cat-item > .cf').click (function() {
	$(this).toggleClass('active');
	$(this).next('.widget_categories ul li.cat-item > ul.children').slideToggle();
});
add_action('init','add_categories_for_pages'); 
function add_categories_for_pages(){ 
   register_taxonomy_for_object_type('category', 'page'); 
} 
add_action( 'pre_get_posts', 'nobita_merge_page_categories_at_category_archive' ); 
function nobita_merge_page_categories_at_category_archive( $query ) { 
    if ( $query->is_category== true && $query->is_main_query() ) { 
    $query->set('post_type', array( 'post', 'page', 'nav_menu_item')); 
    } 
} 
