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

/* ==================== STREAM BASE カスタムCSS ここから ==================== */

/* 配色トークン */
:root {
  --sb-bg: #090b16;
  --sb-bg-elev: #12142a;
  --sb-bg-elev-2: #181c3c;
  --sb-line: rgba(255, 255, 255, 0.09);
  --sb-line-strong: rgba(255, 255, 255, 0.16);
  --sb-text: #f4f5fb;
  --sb-text-soft: #a7adc9;
  --sb-text-faint: #6d7296;
  --sb-blue: #4f6bff;
  --sb-purple: #8b5cf6;
  --sb-pink: #ff5fa8;
  --sb-brand-grad: linear-gradient(135deg, var(--sb-blue), var(--sb-purple) 55%, var(--sb-pink));
}

@import url('https://fonts.googleapis.com/css2?family=Zen+Kaku+Gothic+New:wght@400;500;700;900&display=swap');

/* 全体 */
body {
  background: var(--sb-bg);
  color: var(--sb-text);
  font-family: 'Zen Kaku Gothic New', sans-serif;
}
a { color: var(--sb-text); }
a:hover { color: var(--sb-pink); }

/* ヘッダー・ロゴ・グローバルナビ */
#header-container,
.header-in,
.header-container-in {
  background: var(--sb-bg) !important;
  border-bottom: 1px solid var(--sb-line);
}
.site-name-text,
.site-name-text-link,
.tagline {
  color: var(--sb-text) !important;
}
#navi,
.navi-in {
  background: transparent !important;
}
#navi .navi-in a {
  color: var(--sb-text-soft) !important;
}
#navi .navi-in a:hover {
  color: var(--sb-text) !important;
}

/* 記事本文 */
h1.entry-title {
  color: var(--sb-text);
  font-weight: 900;
}
.article {
  background: var(--sb-bg-elev);
  border: 1px solid var(--sb-line);
  border-radius: 16px;
  color: var(--sb-text-soft);
}
.article h2 {
  color: var(--sb-text);
  border-bottom: 2px solid var(--sb-purple);
}
.article h3 {
  color: var(--sb-text);
  border-left: 4px solid var(--sb-blue);
}
.article a {
  color: var(--sb-pink);
}
.cat-link,
.tag-link {
  background: var(--sb-bg-elev-2) !important;
  color: var(--sb-text-soft) !important;
  border-color: var(--sb-line-strong) !important;
}

/* 記事一覧のカード */
.entry-card {
  background: var(--sb-bg-elev) !important;
  border: 1px solid var(--sb-line) !important;
}
.entry-card-title {
  color: var(--sb-text) !important;
}
.entry-card-snippet {
  color: var(--sb-text-soft) !important;
}
.cat-label {
  background: var(--sb-brand-grad) !important;
  color: #0a0b16 !important;
  font-weight: 700;
}

/* サイドバー・ウィジェット */
.sidebar {
  color: var(--sb-text-soft);
}
.sidebar h2,
.sidebar h3 {
  color: var(--sb-text);
  border-bottom: 1px solid var(--sb-line-strong);
}
.widget {
  background: var(--sb-bg-elev) !important;
  border: 1px solid var(--sb-line) !important;
}
.widget_categories ul li a,
.widget_recent_entries a,
.widget_nav_menu a {
  color: var(--sb-text-soft) !important;
}
.search-box,
input.search-edit {
  background: var(--sb-bg-elev-2) !important;
  border: 1px solid var(--sb-line-strong) !important;
  color: var(--sb-text) !important;
}
.tagcloud a {
  background: var(--sb-bg-elev-2) !important;
  color: var(--sb-text-soft) !important;
  border-color: var(--sb-line-strong) !important;
}

/* フッター */
.footer-in,
.footer-bottom,
.footer-widgets {
  background: var(--sb-bg) !important;
  border-top: 1px solid var(--sb-line);
  color: var(--sb-text-faint) !important;
}
.footer-left a,
.footer-center a,
.footer-right a {
  color: var(--sb-text-soft) !important;
}

/* ボタン */
.btn,
.key-btn {
  background: var(--sb-brand-grad) !important;
  border: none !important;
  color: #0a0b16 !important;
  font-weight: 700 !important;
  border-radius: 999px !important;
}
.btn:hover,
.key-btn:hover {
  filter: brightness(1.08);
}

/* 表（比較表・TablePress） */
table {
  background: var(--sb-bg-elev) !important;
  border: 1px solid var(--sb-line) !important;
  border-radius: 12px;
  overflow: hidden;
}
table th {
  background: var(--sb-bg-elev-2) !important;
  color: var(--sb-text) !important;
  border-bottom: 1px solid var(--sb-line-strong) !important;
}
table td {
  color: var(--sb-text-soft) !important;
  border-bottom: 1px solid var(--sb-line) !important;
}
table tr:nth-of-type(2n+1) {
  background: rgba(255, 255, 255, 0.02) !important;
}

/* ブログカード */
.blogcard {
  background: var(--sb-bg-elev) !important;
  border: 1px solid var(--sb-line) !important;
}
.blogcard-title {
  color: var(--sb-text) !important;
}
.blogcard-snippet,
.blogcard-domain {
  color: var(--sb-text-faint) !important;
}

/* ページネーション */
.page-numbers,
.pagination a {
  background: var(--sb-bg-elev) !important;
  color: var(--sb-text-soft) !important;
  border: 1px solid var(--sb-line-strong) !important;
}
.page-numbers.current {
  background: var(--sb-brand-grad) !important;
  color: #0a0b16 !important;
}

/* ==================== STREAM BASE カスタムCSS ここまで ==================== */

/* コンテンツ全体を囲むラッパー（白い余白が残っていた箇所への対処） */
#content,
#main,
.container,
.content-wrap,
.home main,
main {
  background: var(--sb-bg) !important;
}
/* 白い余白の追加対策 */
#wrapper,
#content-in,
#content-bottom,
#sidebar {
  background: var(--sb-bg) !important;
}
add_action( 'init', function () {
	register_post_type( 'gear', array(
		'labels' => array(
			'name'               => '機材',
			'singular_name'      => '機材',
			'add_new'            => '新規追加',
			'add_new_item'       => '機材を追加',
			'edit_item'          => '機材を編集',
			'new_item'           => '新しい機材',
			'view_item'          => '機材を表示',
			'search_items'       => '機材を検索',
			'not_found'          => '機材が見つかりません',
			'not_found_in_trash' => 'ゴミ箱に機材はありません',
			'menu_name'          => '機材',
		),
		'public'       => true,
		'has_archive'  => true,
		'rewrite'      => array( 'slug' => 'gear', 'with_front' => false ),
		'menu_icon'    => 'dashicons-microphone',
		'supports'     => array( 'title', 'editor', 'thumbnail', 'excerpt' ),
		'show_in_rest' => true,
	) );
} );

add_action( 'rest_api_init', function () {
	register_rest_field( 'gear', 'acf', array(
		'get_callback' => function ( $post ) {
			return get_fields( $post['id'] );
		},
	) );
} );
