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

/************************************
** 子テーマ用のスタイルを書く
************************************/
/*必要ならばここにコードを書く*/
/* ========================================
   TakKa note レイアウト
======================================== */

/* サイドバーなし・1カラム */
#content-in {
  display: block;
}

/* ヘッダーメニューと本文の間はbody背景を見せる */
#content {
  background: transparent !important;
  padding-top: 24px !important;
}

#main {
  width: 100%;
  max-width: none;
  margin-top: 0 !important;
  background-color: #f4f5f7 !important;
}

/* フッターとの間も背景を見せる */
.footer {
  margin-top: 20px !important;
}


/* ========================================
   PCグローバルナビ
======================================== */
@media screen and (min-width: 835px) {

  /* ロゴは流し、ナビバーだけ上部に固定 */
  #navi {
    position: sticky !important;
    top: 0;
    z-index: 10000;
    background-color: #3DB696 !important;
    box-shadow: 0 1px 6px rgba(0, 0, 0, .08);
  }

  /* WordPressログイン中の管理バー分 */
  .admin-bar #navi {
    top: 32px;
  }

  #navi-in,
  #navi .menu-header {
    background-color: #3DB696 !important;
  }

  /* 通常 */
  #navi .menu-header > .menu-item > a {
    background-color: transparent !important;
    color: #fff !important;
  }

  /* 現在位置・ホバー */
  #navi .menu-header > .current-menu-item > a,
  #navi .menu-header > .current-menu-ancestor > a,
  #navi .menu-header > .menu-item:hover > a {
    background-color: #87CFB8 !important;
    color: #fff !important;
  }

  /* PCナビは1段を維持する。検索フォームも同じflex行の中で縮む。 */
  #navi-in,
  #navi .menu-header {
    min-width: 0;
  }

  #navi .menu-header {
    display: flex !important;
    flex-wrap: nowrap !important;
    align-items: stretch !important;
    width: 100% !important;
  }

  #navi .menu-header > .menu-item:not(.takka-nav-search) {
    flex: 0 0 auto !important;
    width: auto !important;
    min-width: max-content !important;
  }

  /* Cocoon標準のellipsisより、メニュー名を全文表示することを優先 */
  #navi .menu-header > .menu-item:not(.takka-nav-search) .item-label {
    overflow: visible !important;
    text-overflow: clip !important;
  }

  #navi .menu-header > .menu-item > a {
    padding-left: clamp(12px, 2.1vw, 34px) !important;
    padding-right: clamp(12px, 2.1vw, 34px) !important;
    white-space: nowrap !important;
  }

  #navi .menu-header > .takka-nav-search {
    flex: 1 1 320px !important;
    min-width: 180px !important;
    max-width: 520px !important;
    margin-left: auto !important;
    display: flex !important;
    align-items: center !important;
    padding: 0 10px !important;
  }

  #navi .takka-nav-search-form {
    display: flex !important;
    width: 100% !important;
    min-width: 0 !important;
    margin: 0 !important;
  }

  #navi .takka-nav-search-form input[type="search"] {
    width: 100% !important;
    min-width: 0 !important;
  }

  /* 835px以上はPCナビだけを使い、Cocoonのモバイル下部メニューとの重複を防ぐ */
  .mobile-footer-menu-buttons.mobile-menu-buttons {
    display: none !important;
  }

  /* ナビの高さ・文字サイズを検索UI相当に揃える */
  #navi-in,
  #navi .menu-header,
  #navi .menu-header > .menu-item {
    min-height: 38px !important;
    height: 38px !important;
  }

  #navi .menu-header {
    align-items: center !important;
  }

  #navi .menu-header > .menu-item:not(.takka-nav-search) > a {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    height: 38px !important;
    min-height: 38px !important;
    padding-top: 0 !important;
    padding-bottom: 0 !important;
    font-size: 14px !important;
    line-height: 1.2 !important;
  }

  #navi .menu-header > .takka-nav-search,
  #navi .takka-nav-search-form,
  #navi .takka-nav-search-form input[type="search"],
  #navi .takka-nav-search-form button,
  #navi .takka-nav-search-form input[type="submit"] {
    min-height: 38px !important;
    height: 38px !important;
    box-sizing: border-box;
  }

  @media screen and (max-width: 1180px) {
    #navi .menu-header > .menu-item > a {
      padding-left: 10px !important;
      padding-right: 10px !important;
      font-size: 14px !important;
    }

    #navi .menu-header > .takka-nav-search {
      flex-basis: 220px !important;
      min-width: 150px !important;
      padding-left: 6px !important;
      padding-right: 6px !important;
    }
  }
}


/* ========================================
   投稿末尾プロフィール
======================================== */
.single-post #single-content-bottom .author-box,
.single-post .single-content-bottom .author-box {
  margin-top: 36px;
  margin-bottom: 24px;
}

/* ワイドコンテンツでもプロフィールカードは通常記事相当の可読幅に戻す */
body.takka-wide-content .author-box {
  width: calc(100% - 40px);
  max-width: 860px;
  margin-left: auto !important;
  margin-right: auto !important;
  box-sizing: border-box;
}

@media screen and (max-width: 834px) {
  body.takka-wide-content .author-box {
    width: calc(100% - 24px);
  }
}


/* ========================================
   横長の薬比較表
======================================== */
.pmc-v37-shell {
  width: calc(100vw - 20px) !important;
  max-width: none !important;
  margin-left: calc(50% - 50vw + 10px) !important;
}


/* ========================================
   モバイル
======================================== */
@media screen and (max-width: 834px) {

  /* PC用stickyは無効 */
  #navi {
    position: static !important;
    box-shadow: none;
  }
}

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

/*1023px以下: Cocoonのモバイルドロワー全域*/
@media screen and (max-width: 1023px){
  /* モバイルのメニュードロワーをサイドバーと同系統のカード/リストUIにする */
  #navi-menu-content.navi-menu-content {
    width: min(88vw, 390px) !important;
    max-width: 390px !important;
    padding: 56px 12px 24px !important;
    background: #fff !important;
    box-shadow: 2px 0 14px rgba(0, 0, 0, .18);
    box-sizing: border-box;
  }

  #navi-menu-content .menu-close-button {
    top: 10px !important;
    right: 12px !important;
    width: 38px !important;
    height: 38px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    font-size: 26px !important;
    color: #303840 !important;
  }

  #navi-menu-content .menu-drawer {
    margin: 0 !important;
    padding: 0 !important;
    list-style: none !important;
  }

  #navi-menu-content .menu-drawer > .menu-item {
    margin: 0 0 8px !important;
    padding: 0 !important;
  }

  #navi-menu-content .menu-drawer > .menu-item > a {
    display: flex !important;
    align-items: center !important;
    min-height: 44px !important;
    margin: 0 !important;
    padding: 9px 12px !important;
    border: 1px solid #e2e7ea !important;
    border-radius: 5px !important;
    background: #f4f5f7 !important;
    color: #202830 !important;
    font-size: 16px !important;
    font-weight: 600 !important;
    line-height: 1.35 !important;
    box-sizing: border-box;
    text-decoration: none !important;
  }

  #navi-menu-content .menu-drawer > .current-menu-item > a,
  #navi-menu-content .menu-drawer > .current-menu-ancestor > a {
    border-color: #3DB696 !important;
    background: #eaf7f3 !important;
  }

  #navi-menu-content .menu-drawer .sub-menu {
    margin: 2px 0 2px 12px !important;
    padding: 0 !important;
    border-left: 2px solid #dfe7e4;
    background: #fff !important;
  }

  #navi-menu-content .menu-drawer .sub-menu .menu-item {
    margin: 0 !important;
    padding: 0 !important;
  }

  #navi-menu-content .menu-drawer .sub-menu a {
    display: block !important;
    min-height: 40px !important;
    margin: 0 !important;
    padding: 9px 12px 9px 16px !important;
    border: 0 !important;
    border-bottom: 1px solid #edf0f2 !important;
    background: #fff !important;
    color: #27313a !important;
    font-size: 15px !important;
    line-height: 1.4 !important;
    box-sizing: border-box;
    text-decoration: none !important;
  }

  #navi-menu-content .menu-drawer .sub-menu .menu-item:last-child > a {
    border-bottom: 0 !important;
  }

  #navi-menu-content .search-box {
    margin-top: 16px !important;
    border: 1px solid #d7dee2 !important;
    border-radius: 22px !important;
    overflow: hidden;
    background: #fff !important;
  }

  .mobile-footer-menu-buttons .profile-menu-button .menu-button-in {
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    justify-content: center !important;
    width: 100% !important;
    height: 100% !important;
  }
}

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


/* ========================================
   プロフィールカード
======================================== */
/* カード全体がリンクなので、著者名だけを個別リンク風に見せない */
.author-box .author-name a,
.author-box .author-name a:hover,
.author-box:hover .author-name a {
  color: var(--cocoon-text-color) !important;
  text-decoration: none !important;
  border-bottom: 0 !important;
  box-shadow: none !important;
}


/* ========================================
   ホーム一覧のページ送り
======================================== */
/* 番号ページャーと重複するCocoonの「次のページ」単独ボタンを非表示 */
.home .pagination-next {
  display: none !important;
}

/* 前後リンクは矢印だけでなく文字も表示 */
.home .pagination .prev.page-numbers,
.home .pagination .next.page-numbers {
  width: auto !important;
  min-width: 96px;
  padding-left: 14px;
  padding-right: 14px;
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
  gap: 6px;
  white-space: nowrap;
}

.home .pagination .prev.page-numbers .screen-reader-text,
.home .pagination .next.page-numbers .screen-reader-text {
  position: static !important;
  width: auto !important;
  height: auto !important;
  margin: 0 !important;
  padding: 0 !important;
  overflow: visible !important;
  clip: auto !important;
  clip-path: none !important;
  white-space: nowrap !important;
  border: 0 !important;
}

.home .pagination .prev.page-numbers .fa {
  order: -1;
}


/* ========================================
   ワイドコンテンツ投稿テンプレート
======================================== */
/*
 * データ表・3Dビューア・可視化ツール等のための全幅コンテンツ領域。
 * 個別コンテンツ側では100vwへの脱出を行わず、与えられた領域を100%使う。
 */
body.takka-wide-content #content {
  width: 100% !important;
  max-width: none !important;
}

body.takka-wide-content #content-in {
  width: 100% !important;
  max-width: none !important;
  margin-left: auto !important;
  margin-right: auto !important;
  padding-left: 12px;
  padding-right: 12px;
  box-sizing: border-box;
}

body.takka-wide-content #main {
  width: 100% !important;
  max-width: none !important;
  min-width: 0;
  margin-left: 0 !important;
  margin-right: 0 !important;
  padding-left: 0 !important;
  padding-right: 0 !important;
  box-sizing: border-box;
}

body.takka-wide-content .article,
body.takka-wide-content .entry-content {
  width: 100% !important;
  max-width: none !important;
  min-width: 0;
  box-sizing: border-box;
}

body.takka-wide-content #sidebar {
  display: none !important;
}

/* 長文だけ通常の可読幅へ戻したい場合の任意クラス */
body.takka-wide-content .takka-reading-width {
  width: min(100%, 1100px);
  margin-left: auto;
  margin-right: auto;
}

/* 表・canvas・iframe等のインタラクティブ領域に共通で使える任意クラス */
body.takka-wide-content .takka-wide-interactive,
body.takka-wide-content .takka-wide-viewer,
body.takka-wide-content iframe.takka-wide-interactive,
body.takka-wide-content iframe.takka-pov-viewer {
  display: block;
  width: 100%;
  max-width: none;
  min-width: 0;
  box-sizing: border-box;
}

/* POV-Ray 3D視点移動ビューワー用。操作系のoverflow/touch-actionはここでは制限しない。 */
body.takka-wide-content iframe.takka-pov-viewer {
  height: min(75vh, 760px);
  border: 0;
}

@media screen and (max-width: 834px) {
  body.takka-wide-content #content-in {
    padding-left: 6px;
    padding-right: 6px;
  }

  body.takka-wide-content iframe.takka-pov-viewer {
    height: 55vh;
    min-height: 320px;
  }

  /* ワイドテンプレートでは狭い画面で下部モバイルメニューを常時利用可能にする */
  body.takka-wide-content .mobile-footer-menu-buttons.mobile-menu-buttons {
    display: flex !important;
    position: fixed !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    width: 100% !important;
    min-height: 50px !important;
    margin: 0 !important;
    z-index: 10020 !important;
    align-items: stretch !important;
    justify-content: space-around !important;
  }

  body.takka-wide-content .mobile-footer-menu-buttons .menu-button {
    flex: 1 1 0 !important;
    width: auto !important;
    max-width: none !important;
  }

  body.takka-wide-content .mobile-footer-menu-buttons .menu-button > a {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    width: 100% !important;
    height: 100% !important;
  }


}

/* スマートフォン横画面: PC用グローバルナビだけを隠し、縦画面と同じ下部モバイルメニューを使う。 */
@media (orientation: landscape) and (max-height: 600px) and (hover: none) and (pointer: coarse) {
  body.takka-wide-content #navi {
    display: none !important;
  }

  body.takka-wide-content .mobile-footer-menu-buttons.mobile-menu-buttons {
    display: flex !important;
    position: fixed !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    width: 100% !important;
    min-height: 50px !important;
    margin: 0 !important;
    z-index: 10020 !important;
    align-items: stretch !important;
    justify-content: space-around !important;
  }

  body.takka-wide-content .mobile-footer-menu-buttons .menu-button {
    flex: 1 1 0 !important;
    width: auto !important;
    max-width: none !important;
  }

  body.takka-wide-content .mobile-footer-menu-buttons .menu-button > a {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    width: 100% !important;
    height: 100% !important;
  }

  body.takka-wide-content {
    padding-bottom: calc(50px + env(safe-area-inset-bottom)) !important;
  }

  body.takka-wide-content iframe.takka-pov-viewer {
    height: calc(100vh - 50px);
    min-height: 280px;
  }
}
