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

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

/************************************
** 投稿ページ：追従目次と読みやすさ（第1段階）
************************************/
body.single .entry-content p {
  margin-bottom: 1.5em;
}

body.single .entry-content h2 {
  margin-top: 2.4em;
  margin-bottom: 1em;
}

body.single .entry-content h3 {
  margin-top: 2em;
  margin-bottom: 0.8em;
}

body.single .entry-content img {
  max-width: 100%;
  height: auto;
}

body.single .entry-content pre,
body.single .entry-content .wp-block-code,
body.single .entry-content .enlighter-default,
body.single .entry-content .enlighter-code {
  max-width: 100%;
  overflow-x: auto;
  white-space: pre;
  overflow-wrap: normal;
  word-break: normal;
}

body.single .entry-content .wp-block-table {
  max-width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

body.single .entry-content .wp-block-table table {
  width: max-content;
  min-width: 100%;
}

@media screen and (min-width: 1024px) {
  body.single #content .content-in:has(#sidebar-scroll .toc-widget-box) {
    align-items: flex-start;
    justify-content: center;
    flex-wrap: nowrap;
    gap: 32px;
  }

  body.single #content .content-in:has(#sidebar-scroll .toc-widget-box) main#main.main {
    flex: 1 1 auto;
    width: auto;
    max-width: 900px;
  }

  body.single #content .content-in:has(#sidebar-scroll .toc-widget-box) #sidebar.sidebar {
    flex: 0 0 260px;
    width: 260px;
    padding: 16px;
  }

  body.single #sidebar-scroll {
    top: 16px;
    max-height: calc(100vh - 32px);
    overflow-y: auto;
    overscroll-behavior: contain;
    scrollbar-gutter: stable;
  }

  body.single #sidebar-scroll .toc-widget-box .toc {
    font-size: 0.88em;
    line-height: 1.55;
  }

  body.single #content .content-in:has(#sidebar-scroll .toc-widget-box) main#main #toc.toc {
    display: none;
  }

}

/************************************
** レスポンシブデザイン用のメディアクエリ
************************************/
/*1023px以下*/
@media screen and (max-width: 1023px){
  body.single #content .content-in {
    display: block;
  }

  body.single #sidebar.sidebar {
    display: none;
  }

  body.single main#main.main {
    width: 100%;
    max-width: 100%;
    margin-right: 0;
    margin-left: 0;
    padding-right: clamp(16px, 4vw, 28px);
    padding-left: clamp(16px, 4vw, 28px);
  }

  body.single main#main #toc.toc {
    display: block;
  }

  body.single .entry-content table {
    max-width: 100%;
  }
}

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

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