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



/*リセットcss↓*/
html {
  overflow-y: scroll;
}
body,div,dl,dt,dd,ul,ol,li,h1,h2,h3,h4,h5,h6,pre,form,fieldset,input,textarea,p,blockquote,th,td {
  margin: 0;
  padding: 0;
}
address,caption,cite,code,dfn,em,strong,th,var {
  font-style: normal;
}
table {
  border-collapse: collapse;
  border-spacing: 0;
}
caption,th {
  text-align: left;
}
q:before,q:after {
  content: '';
}
object,embed {
  vertical-align: top;
}
hr,legend {
  display: none;
}
h1,h2,h3,h4,h5,h6 {
  font-size: 100%;
}
img,abbr,acronym,fieldset {
  border: 0;
}
li {
  list-style-type: none;
}
sup {
  vertical-align: super;
  font-size: 0.5em;
}
img {
  vertical-align: top;
}
i {
  font-style: normal;
}
/*----リセットcss*----/

/*デザインcss↓*/
.box_con {
  max-width: 900px;
  margin: 0  auto;
}
@media only screen and (max-width: 768px) {
  .box_con {
    width: 95%;
  }
}
.box_con form {
  width: 100%;
}
.box_con form table {
  width: 100%;
}
.box_con form table tr {
  position: relative;
}
.box_con form table tr:after {
  content: "";
  position: absolute;
  width: 100%;
  left: 0;
  bottom: 0;
  height: 1px;
  border-bottom: dotted #cdcdcd 1px;
}
.box_con form table tr th {
  width: 30%;
  font-weight: normal;
  padding: 1em .5em;
  -moz-box-sizing: border-box;
  -webkit-box-sizing: border-box;
  box-sizing: border-box;
}
@media only screen and (max-width: 768px) {
  .box_con form table tr th {
    text-align: center;
    width: 100%;
    display: block;
    background: #97ae88;
    padding: .8em .2em;
    color: #fff;
  }
}
.box_con form table tr th span {
  background: #cd6f55;
  padding: 0 .3em;
  color: #fff;
  margin-left: .5em;
  -moz-box-sizing: border-box;
  -webkit-box-sizing: border-box;
  box-sizing: border-box;
}
.box_con form table tr td {
  padding: 1em .5em;
  -moz-box-sizing: border-box;
  -webkit-box-sizing: border-box;
  box-sizing: border-box;
}
@media only screen and (max-width: 768px) {
  .box_con form table tr td {
    padding: 1.5em .5em;
    display: block;
    width: 100%;
  }
}
.box_con form table tr .box_br {
  display: block;
}
.box_con form table tr select {
  border: 1px solid #97ae88;
}
.box_con form table tr label input {
  cursor: pointer;
  display: none;
  vertical-align: middle;
}
.box_con form table tr .radio02-input + label {
  padding-left: 23px;
  margin-right: 20px;
  position: relative;
}
.box_con form table tr .radio02-input + label:before {
  content: "";
  display: block;
  position: absolute;
  top: 50%;
  left: 0;
  width: 16px;
  height: 16px;
  border: 1px solid #999;
  border-radius: 50%;
  -moz-transform: translateY(-50%);
  -ms-transform: translateY(-50%);
  -webkit-transform: translateY(-50%);
  transform: translateY(-50%);
}
.box_con form table tr .radio02-input:checked + label:after {
  content: "";
  display: block;
  position: absolute;
  top: 50%;
  left: 3px;
  width: 12px;
  height: 12px;
  background: #97ae88;
  border-radius: 50%;
  -moz-transform: translateY(-50%);
  -ms-transform: translateY(-50%);
  -webkit-transform: translateY(-50%);
  transform: translateY(-50%);
}
.box_con form table tr select, .box_con form table tr input, .box_con form table tr textarea {
  width: 100%;
  height: 3em;
  padding: .5em;
  -moz-box-sizing: border-box;
  -webkit-box-sizing: border-box;
  box-sizing: border-box;
}
.box_con form table tr textarea {
  height: 10em;
}

/*プライバシーのデザインcss↓*/
.con_pri {
  max-width: 700px;
  margin: 0  auto;
}
@media only screen and (max-width: 768px) {
  .con_pri {
    width: 95%;
  }
}
.con_pri .box_pri {
  height: 300px;
  overflow-y: scroll;
  border: 1px solid #cdcdcd;
  background: ghostwhite;
  -moz-box-sizing: border-box;
  -webkit-box-sizing: border-box;
  box-sizing: border-box;
  margin-top: 20px;
  padding: 20px 55px;
}
@media only screen and (max-width: 768px) {
  .con_pri .box_pri {
    margin-top: 4%;
    padding: 3%;
  }
}
@media only screen and (min-width: 769px) and (max-width: 1024px) {
  .con_pri .box_pri {
    padding: 4%;
  }
}
.con_pri .box_pri .box_tori {
  text-align: left;
  margin-top: 40px;
}
@media only screen and (max-width: 768px) {
  .con_pri .box_pri .box_tori {
    margin-top: 4%;
  }
}
.con_pri .box_pri .box_tori h4 {
  font-weight: normal;
  margin-bottom: 30px;
  font-size: 150%;
}
@media only screen and (max-width: 768px) {
  .con_pri .box_pri .box_tori h4 {
    margin-bottom: 4%;
  }
}
.con_pri .box_pri .box_tori .txt {
  padding: 0 20px;
}
@media only screen and (max-width: 768px) {
  .con_pri .box_pri .box_tori .txt {
    padding: 0;
  }
}
.con_pri .box_pri .box_num {
  margin-top: 30px;
}
@media only screen and (max-width: 768px) {
  .con_pri .box_pri .box_num {
    margin-top: 5%;
  }
}
.con_pri .box_pri .box_num h4 {
  font-weight: normal;
  font-size: 113%;
}
.con_pri .box_pri .box_num .txt {
  padding: 10px 0 0 20px;
}
@media only screen and (max-width: 768px) {
  .con_pri .box_pri .box_num .txt {
    padding: 3% 0 0 3%;
  }
}

.box_check {
  text-align: center;
  margin: 1em auto;
}
.box_check label {
  display: inline-block;
}
.box_check label span {
  margin-left: .3em;
}

.btn {
  text-align: center;
}
.btn input {
  display: inline-block;
  background: #eee;
  padding: .5em 4em;
  color: #000;
  text-decoration: none;
  cursor: pointer;
  border: none;
  -moz-transition: all 0.4s;
  -o-transition: all 0.4s;
  -webkit-transition: all 0.4s;
  transition: all 0.4s;
}
.btn input:hover {
  filter: progid:DXImageTransform.Microsoft.Alpha(Opacity=70);
  opacity: 0.7;
}


.ft {
  border-top: solid 1px lightgray;
  padding-bottom: 10px;
}

.ft ul {
  text-align: center;
}

.ft ul li {
  padding: 0 4px;
  display: inline;
}

.ft p {
  text-align: center;
}

.mw_wp_form_preview .con_pri {
  display: none;
}

.mw_wp_form_preview .confirm-hidden {
  display: none;
}

.mw_wp_form_preview .box_check label {
  display: none;
}



// メタボックスの追加
add_action( 'admin_menu', 'add_noindex_metabox' );
function add_noindex_metabox() {
    add_meta_box( 'custom_noindex', 'インデックス設定', 'create_noindex', array('post', 'page'), 'side' );
}

// 管理画面にフィールドを出力
function create_noindex() {
    $keyname = 'noindex';
    global $post;
    $get_value = get_post_meta( $post->ID, $keyname, true );
    wp_nonce_field( 'action_' . $keyname, 'nonce_' . $keyname );
    $value = 'noindex';
    $checked = '';
    if( $value === $get_value ) $checked = ' checked';
    echo '<label><input type="checkbox" name="' . $keyname . '" value="' . $value . '"' . $checked . '>' . $keyname . '</label>';
}

// カスタムフィールドの保存
add_action( 'save_post', 'save_custom_noindex' );
function save_custom_noindex( $post_id ) {
    $keyname = 'noindex';
    if ( isset( $_POST['nonce_' . $keyname] )) {
        if( check_admin_referer( 'action_' . $keyname, 'nonce_' . $keyname ) ) {
            if( isset( $_POST[$keyname] )) {
                update_post_meta( $post_id, $keyname, $_POST[$keyname] );
            } else {
                delete_post_meta( $post_id, $keyname, get_post_meta( $post_id, $keyname, true ) );
            }
        }
    }
}
