@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
*/

/************************************
** 子テーマ用のスタイルを書く
************************************/
/*必要ならばここにコードを書く*/

/*全てをまとめて非表示*/
.home.page .entry-title,
.home.page .date-tags,
.home.page .author-info{
  display: none;
}



/************************************
** レスポンシブデザイン用のメディアクエリ
************************************/
/*1023px以下*/
@media screen and (max-width: 1023px){
  /*必要ならばここにコードを書く*/
}

/*834px以下*/
@media screen and (max-width: 834px){
  /*必要ならばここにコードを書く*/
}

/*480px以下*/
@media screen and (max-width: 480px){
  /*必要ならばここにコードを書く*/
}
// アイキャッチ画像を有効化
add_theme_support('post-thumbnails');

function credit_box_shortcode($atts) {
  // 初期値の定義
  $atts = shortcode_atts(array(
    'song' => '（曲名）',
    'artist' => '（アーティスト名）',
    'writer' => '（作詞・作曲者）',
    'date' => '（発売日）',
    'channel' => 'spitzclips（公式）',
    'released' => '2010年4月16日',
    'comment' => 'この楽曲は、代表作として今なお愛されています。',
  ), $atts);

  // 出力するHTML
  return '<div style="font-size:16px; line-height:1.4; background:#f0f8ff; padding:12px; border-left:4px solid #007acc;">
【クレジット】<br>
曲名：' . esc_html($atts['song']) . '<br>
アーティスト：' . esc_html($atts['artist']) . '<br>
作詞・作曲：' . esc_html($atts['writer']) . '<br>
発売日：' . esc_html($atts['date']) . '<br>
YouTubeチャンネル：' . esc_html($atts['channel']) . '<br>
動画公開日：' . esc_html($atts['released']) . '<br><br>
【2行解説】<br>
' . esc_html($atts['comment']) . '
</div>';
}
add_shortcode('credit_box', 'credit_box_shortcode');

function credit_box_simple($atts) {
  $atts = shortcode_atts(array(
    'song' => '',
    'artist' => '',
    'writer' => '',
    'date' => '',
    'channel' => '',
    'released' => '',
    'comment' => '',
  ), $atts);

  return '<div style="font-size:16px; line-height:1.4; background:#f0f8ff; padding:12px; border-left:4px solid #007acc;">
【クレジット】<br>
曲名：' . esc_html($atts['song']) . '<br>
アーティスト：' . esc_html($atts['artist']) . '<br>
作詞・作曲：' . esc_html($atts['writer']) . '<br>
発売日：' . esc_html($atts['date']) . '<br>
YouTubeチャンネル：' . esc_html($atts['channel']) . '<br>
動画公開日：' . esc_html($atts['released']) . '<br><br>
【2行解説】<br>
' . esc_html($atts['comment']) . '
</div>';
}
add_shortcode('c', 'credit_box_simple'); // ← 一文字ショートコード：[c]


return '<div style="～">
<p><strong>✅ クレジット情報</strong><br>
<strong>曲名：</strong>' . esc_html($atts['song']) . '<br>
<strong>アーティスト：</strong>' . esc_html($atts['artist']) . '<br>
...（以下略）


function custom_admin_columns_style() {
  echo '<style>
    th.column-tags, td.column-tags {
      width: 250px !important;
      white-space: normal !important;
      word-break: break-word !important;
    }
    th.column-pv, td.column-pv {
      width: 70px !important;
      padding-top: 4px !important;
      padding-bottom: 4px !important;
    }
  </style>';
}
add_action('admin_head', 'custom_admin_columns_style');
/* サイト全体のフォントと太さを調整 */
body {
  font-family: "Hiragino Sans", "Yu Gothic", "游ゴシック体", sans-serif !important;
  font-weight: 400 !important;
  line-height: 1.8 !important;
}

/* 強調部分の太さ調整 */
strong, b {
  font-weight: 600 !important;
}
/* 游ゴシック風フォントに変更 */
body {
  font-family: "Yu Gothic", "游ゴシック体", "Hiragino Kaku Gothic ProN", Meiryo, sans-serif;
}
/* フォントを強制的に游ゴシック系に変更 */
body,
.post, .post p, .post-content, .entry-content {
  font-family: "Yu Gothic", "游ゴシック体", "Hiragino Kaku Gothic ProN", Meiryo, sans-serif !important;
}

