@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){
  /*必要ならばここにコードを書く*/
}
.entry-title {
font-size: 30px;
}/* 記事内の画像に自動で番号を振る */
.entry-content {
  counter-reset: image-counter; /* カウンターをリセット */
}

.entry-content img {
  counter-increment: image-counter; /* 画像ごとにカウントアップ */
}

.entry-content .wp-block-image::before {
  content: "No. " counter(image-counter); /* 表示するテキスト */
  display: block;
  font-weight: bold;
  color: #fff;
  background: #333; /* 番号の背景色 */
  padding: 2px 8px;
  width: fit-content;
  border-radius: 4px;
  margin-bottom: 5px;
add_action( 'wp_insert_comment', function( $id, $comment ) {
    // 投稿されたコメントに「ひらがな」が1文字もなければ、その場で即座に削除してエラーを出す
    if ( !preg_match('/[ぁ-ん]/u', $comment->comment_content) ) {
        wp_delete_comment( $id, true ); // データベースに入る瞬間に抹殺
        wp_die('【スパム対策】エラー：ひらがなを入力してください。English only is not allowed.');
    }
}, 10, 2 );