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

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

/* Post 493: 見出し自体に章番号があるため、Cocoon目次側の自動番号は非表示 */
body.postid-493 #toc.tnt-number .toc-list,
body.postid-493 #toc.tnt-number .toc-list ol {
  list-style: none !important;
}

/* ========================================
   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: #087786 !important;
    box-shadow: 0 1px 6px rgba(0, 0, 0, .08);
  }

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

  #navi-in,
  #navi .menu-header {
    background-color: #087786 !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: #0f6e7a !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);
  }
}


/* ========================================
   ワイドコンテンツ: full-bleed領域
======================================== */
/*
 * wide-content自体はCocoon通常記事の余白を維持する。
 * 画面幅を必要とするメインUIだけ、このクラスで記事余白を脱出する。
 * 既存の薬比較表は同じgeometryを維持する。
 */
.pmc-v37-shell {
  width: calc(100vw - 20px) !important;
  max-width: none !important;
  margin-left: calc(50% - 50vw + 10px) !important;
}

/* 通常本文のpaddingだけを相殺し、#main/#content-inの外へは出さない。 */
body.takka-wide-content .takka-full-bleed {
  width: calc(100% + clamp(20px, 3.2vw, 56px) + clamp(20px, 3.2vw, 56px)) !important;
  max-width: none !important;
  margin-left: calc(-1 * clamp(20px, 3.2vw, 56px)) !important;
  margin-right: calc(-1 * clamp(20px, 3.2vw, 56px)) !important;
}

@media screen and (max-width: 600px) {
  body.takka-wide-content .takka-full-bleed {
    width: calc(100% + 32px) !important;
    margin-left: -16px !important;
    margin-right: -16px !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: #087786 !important;
    background: #e6f3f5 !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;
}


/* ========================================
   Canvas: flat shell + page-owned design
   ======================================== */
html body.takka-wide-content {
  --takka-canvas-gutter: clamp(18px, 3vw, 44px);
  --takka-canvas-reading: 1080px;
  background-image: none !important;
  background-color: var(--takka-canvas-page-bg, var(--takka-bg, #f4f5f7)) !important;
  background-attachment: scroll !important;
}

html body.takka-wide-content.custom-background #container,
html body.takka-wide-content #container,
html body.takka-wide-content #content,
html body.takka-wide-content #content-in,
html body.takka-wide-content #main,
html body.takka-wide-content main.main,
html body.takka-wide-content .takka-canvas-article,
html body.takka-wide-content article.article.takka-canvas-article,
html body.takka-wide-content .entry-content.takka-canvas-body {
  width: 100% !important;
  max-width: none !important;
  min-width: 0 !important;
  margin: 0 !important;
  padding: 0 !important;
  border: 0 !important;
  border-radius: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
  box-sizing: border-box !important;
}

html body.takka-wide-content #header-container,
html body.takka-wide-content #header-container-in,
html body.takka-wide-content #navi {
  margin-bottom: 0 !important;
}

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

html body.takka-wide-content .footer {
  margin-top: 0 !important;
}

/* Semantic page title. Individual pages may override with --takka-canvas-title-size. */
html body.takka-wide-content .takka-canvas-title-shell {
  width: 100% !important;
  max-width: calc(var(--takka-canvas-reading) + 88px) !important;
  margin: 0 auto !important;
  padding: clamp(20px, 2.5vw, 32px) var(--takka-canvas-gutter) clamp(14px, 1.8vw, 22px) !important;
  border: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
  box-sizing: border-box !important;
}

html body.takka-wide-content .takka-canvas-title {
  margin: 0 !important;
  padding: 0 !important;
  border: 0 !important;
  border-radius: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
  color: var(--takka-canvas-title-color, inherit) !important;
  font-size: var(--takka-canvas-title-size, clamp(1.7rem, 2.2vw, 2.4rem)) !important;
  font-weight: var(--takka-canvas-title-weight, 700) !important;
  line-height: 1.2 !important;
  letter-spacing: 0 !important;
}

/* Canvas pages never use Cocoon's automatic table of contents. */
html body.takka-wide-content .takka-canvas-body #toc,
html body.takka-wide-content .takka-canvas-body .toc,
html body.takka-wide-content .takka-canvas-body .toc-content,
html body.takka-wide-content .takka-canvas-body .toc-widget-box {
  display: none !important;
}

/* Normal prose gets a readable measure. App/viewer divs remain unrestricted. */
html body.takka-wide-content .takka-canvas-body > p,
html body.takka-wide-content .takka-canvas-body > ul,
html body.takka-wide-content .takka-canvas-body > ol,
html body.takka-wide-content .takka-canvas-body > blockquote,
html body.takka-wide-content .takka-canvas-body > pre,
html body.takka-wide-content .takka-canvas-body > h2,
html body.takka-wide-content .takka-canvas-body > h3,
html body.takka-wide-content .takka-canvas-body > h4,
html body.takka-wide-content .takka-canvas-body > h5,
html body.takka-wide-content .takka-canvas-body > h6 {
  width: 100% !important;
  max-width: calc(var(--takka-canvas-reading) + 88px) !important;
  margin-left: auto !important;
  margin-right: auto !important;
  padding-left: var(--takka-canvas-gutter) !important;
  padding-right: var(--takka-canvas-gutter) !important;
  box-sizing: border-box !important;
}

html body.takka-wide-content .takka-canvas-body > p {
  margin-top: 0 !important;
  margin-bottom: 1.15em !important;
  line-height: 1.8 !important;
}

html body.takka-wide-content .takka-canvas-body > ul,
html body.takka-wide-content .takka-canvas-body > ol {
  margin-top: 0 !important;
  margin-bottom: 1.5em !important;
  padding-left: calc(var(--takka-canvas-gutter) + 1.5em) !important;
  padding-right: var(--takka-canvas-gutter) !important;
  line-height: 1.75 !important;
}

/* Remove Cocoon/dark-theme article heading decoration. */
html body.takka-wide-content .takka-canvas-body > h2.wp-block-heading,
html body.takka-wide-content .takka-canvas-body > h2,
html body.takka-wide-content .takka-canvas-body > h3.wp-block-heading,
html body.takka-wide-content .takka-canvas-body > h3,
html body.takka-wide-content .takka-canvas-body > h4,
html body.takka-wide-content .takka-canvas-body > h5,
html body.takka-wide-content .takka-canvas-body > h6 {
  border: 0 !important;
  border-left: 0 !important;
  border-bottom: 0 !important;
  border-radius: 0 !important;
  background: transparent !important;
  background-image: none !important;
  box-shadow: none !important;
  padding-left: var(--takka-canvas-gutter) !important;
  padding-right: var(--takka-canvas-gutter) !important;
  color: inherit !important;
}

html body.takka-wide-content .takka-canvas-body > h2.wp-block-heading,
html body.takka-wide-content .takka-canvas-body > h2 {
  margin-top: 2.2em !important;
  margin-bottom: .75em !important;
  font-size: clamp(1.35rem, 1.8vw, 1.7rem) !important;
  line-height: 1.35 !important;
}

html body.takka-wide-content .takka-canvas-body > h3.wp-block-heading,
html body.takka-wide-content .takka-canvas-body > h3 {
  margin-top: 1.8em !important;
  margin-bottom: .65em !important;
  font-size: clamp(1.15rem, 1.45vw, 1.4rem) !important;
  line-height: 1.4 !important;
}

/* Explicit helpers for page-owned layouts. */
html body.takka-wide-content .takka-reading-width {
  width: 100% !important;
  max-width: calc(var(--takka-canvas-reading) + 88px) !important;
  margin-left: auto !important;
  margin-right: auto !important;
  padding-left: var(--takka-canvas-gutter) !important;
  padding-right: var(--takka-canvas-gutter) !important;
  box-sizing: border-box !important;
}

html body.takka-wide-content .takka-wide-interactive,
html body.takka-wide-content .takka-wide-viewer,
html body.takka-wide-content iframe.takka-wide-interactive,
html body.takka-wide-content iframe.takka-pov-viewer {
  display: block;
  width: 100%;
  max-width: none;
  min-width: 0;
  box-sizing: border-box;
}

html body.takka-wide-content iframe.takka-pov-viewer {
  height: min(75vh, 760px);
  border: 0;
}

/* Advertising remains a shared Canvas function. */
html body.takka-wide-content .takka-canvas-body > .takka-manual-ad,
html body.takka-wide-content .takka-canvas-ad-slot {
  display: block;
  clear: both;
  width: 100% !important;
  max-width: calc(var(--takka-canvas-reading) + 88px) !important;
  margin: 36px auto !important;
  padding: 8px var(--takka-canvas-gutter) !important;
  box-sizing: border-box !important;
}

html body.takka-wide-content .takka-manual-ad .ad-area,
html body.takka-wide-content .takka-canvas-ad-slot .ad-area {
  margin-left: auto !important;
  margin-right: auto !important;
}

/* Cross Rhythm: wide game surface, readable prose. */
html body.postid-996.takka-wide-content .takka-cross-rhythm-player:not(.is-maximized) {
  width: calc(100% - 24px) !important;
  max-width: none !important;
  margin: 8px 12px 30px !important;
  border-radius: 0 !important;
}

/* Narrow screens keep the Canvas shell flat and the mobile controls available. */
@media screen and (max-width: 834px) {
  html body.takka-wide-content iframe.takka-pov-viewer {
    height: 55vh;
    min-height: 320px;
  }

  html 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;
  }

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

  html 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;
  }
}

@media screen and (max-width: 600px) {
  html body.takka-wide-content {
    --takka-canvas-gutter: 14px;
  }

  html body.takka-wide-content .takka-canvas-title-shell {
    padding-top: 18px !important;
    padding-bottom: 12px !important;
  }

  html body.takka-wide-content .takka-canvas-title {
    font-size: clamp(1.5rem, 7vw, 1.9rem) !important;
  }

  html body.takka-wide-content .takka-canvas-body > h2.wp-block-heading,
  html body.takka-wide-content .takka-canvas-body > h2 {
    font-size: 1.35rem !important;
  }

  html body.postid-996.takka-wide-content .takka-cross-rhythm-player:not(.is-maximized) {
    width: calc(100% - 12px) !important;
    margin-left: 6px !important;
    margin-right: 6px !important;
  }
}

/* ========================================
   Canvas page-specific presentation
   ======================================== */

/* POV-Ray viewer: the viewer is the product; prose becomes a compact guide. */
html body.postid-695.takka-wide-content,
html body.postid-943.takka-wide-content {
  --takka-canvas-reading: 1040px;
  --takka-canvas-title-size: clamp(1.65rem, 2vw, 2.2rem);
}

html body.postid-695 .takka-canvas-body > p:first-of-type,
html body.postid-943 .takka-canvas-body > p:first-of-type {
  font-size: 1.05em;
  line-height: 1.75 !important;
}

html body.postid-695 .takka-canvas-body > small,
html body.postid-943 .takka-canvas-body > small {
  display: block;
  width: 100%;
  max-width: calc(var(--takka-canvas-reading) + 88px);
  margin: -0.25em auto 1.4em;
  padding-left: var(--takka-canvas-gutter);
  padding-right: var(--takka-canvas-gutter);
  box-sizing: border-box;
  color: var(--takka-muted, #9fb3b6);
  line-height: 1.6;
}

html body.postid-695 .takka-wide-interactive,
html body.postid-943 .takka-wide-interactive {
  width: 100% !important;
  max-width: none !important;
  margin: 10px 0 34px !important;
}

html body.postid-695 .takka-canvas-body > h2,
html body.postid-943 .takka-canvas-body > h2 {
  padding-top: 20px !important;
  border-top: 1px solid var(--takka-line, #29464a) !important;
}

html body.postid-695 .takka-canvas-body > ul,
html body.postid-943 .takka-canvas-body > ul {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  list-style: none !important;
  padding-left: var(--takka-canvas-gutter) !important;
  padding-right: var(--takka-canvas-gutter) !important;
}

html body.postid-695 .takka-canvas-body > ul > li,
html body.postid-943 .takka-canvas-body > ul > li {
  margin: 0 !important;
  padding: 14px 16px;
  border: 1px solid var(--takka-line, #29464a);
  border-radius: 8px;
  background: var(--takka-surface, #0e191c);
  line-height: 1.65;
}

/* Drum Layout: full-width 3D workspace with numbered explanation sections below. */
html body.postid-906.takka-wide-content,
html body.postid-934.takka-wide-content {
  --takka-canvas-reading: 1080px;
  --takka-canvas-title-size: clamp(1.65rem, 2vw, 2.2rem);
}

html body.postid-906 .takka-canvas-body,
html body.postid-934 .takka-canvas-body {
  counter-reset: takka-drum-layout-section;
}

html body.postid-906 .takka-canvas-body > p:first-of-type,
html body.postid-934 .takka-canvas-body > p:first-of-type {
  font-size: 1.04em;
  margin-bottom: 1.4em !important;
}

html body.postid-906 .takka-drum3d-language-switch,
html body.postid-934 .takka-drum3d-language-switch {
  width: 100%;
  max-width: calc(var(--takka-canvas-reading) + 88px);
  margin-left: auto !important;
  margin-right: auto !important;
  padding-left: var(--takka-canvas-gutter);
  padding-right: var(--takka-canvas-gutter);
  box-sizing: border-box;
}

html body.postid-906 .takka-drum3d-shell,
html body.postid-934 .takka-drum3d-shell {
  margin-top: 8px !important;
  margin-bottom: 34px !important;
}

html body.postid-906 .takka-canvas-body > h2,
html body.postid-934 .takka-canvas-body > h2 {
  counter-increment: takka-drum-layout-section;
  display: grid;
  grid-template-columns: 2.4em minmax(0, 1fr);
  align-items: baseline;
  column-gap: 10px;
  margin-top: 2.4em !important;
}

html body.postid-906 .takka-canvas-body > h2::before,
html body.postid-934 .takka-canvas-body > h2::before {
  content: "0" counter(takka-drum-layout-section);
  color: var(--takka-accent-bright, #17989b);
  font-size: .72em;
  font-variant-numeric: tabular-nums;
  letter-spacing: .08em;
}

/* Cross Rhythm: the game stays wide; features and download read like product UI. */
html body.postid-996.takka-wide-content {
  --takka-canvas-reading: 1040px;
  --takka-canvas-title-size: clamp(1.65rem, 2vw, 2.2rem);
}

html body.postid-996 .takka-canvas-body > p:first-of-type {
  font-size: 1.05em;
  margin-bottom: 1.25em !important;
}

html body.postid-996 .takka-cross-rhythm-player:not(.is-maximized) {
  margin-top: 6px !important;
  margin-bottom: 28px !important;
}

html body.postid-996 .takka-canvas-body > h2 {
  padding-top: 18px !important;
  border-top: 1px solid var(--takka-line, #29464a) !important;
}

html body.postid-996 .takka-canvas-body > h2:first-of-type + ul {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px 18px;
  list-style: none !important;
  padding-left: var(--takka-canvas-gutter) !important;
  padding-right: var(--takka-canvas-gutter) !important;
}

html body.postid-996 .takka-canvas-body > h2:first-of-type + ul > li {
  position: relative;
  margin: 0 !important;
  padding: 11px 12px 11px 28px;
  border-bottom: 1px solid var(--takka-line, #29464a);
}

html body.postid-996 .takka-canvas-body > h2:first-of-type + ul > li::before {
  content: "•";
  position: absolute;
  left: 10px;
  color: var(--takka-accent-bright, #17989b);
}

html body.postid-996 .takka-canvas-body > h2:nth-of-type(2) + p > a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 10px 18px;
  border: 1px solid var(--takka-accent-bright, #17989b);
  border-radius: 6px;
  background: var(--takka-accent, #0f6f73);
  color: #fff !important;
  font-weight: 700;
  text-decoration: none !important;
}

/* WP Agent Bridge already owns its inner visual system. Give that system Canvas gutters. */
html body.postid-719.takka-wide-content,
html body.postid-969.takka-wide-content {
  --takka-canvas-reading: 1120px;
  --takka-canvas-title-size: clamp(1.65rem, 2vw, 2.2rem);
}

html body.postid-719 .wpab-wrap,
html body.postid-969 .wpab-wrap {
  width: 100% !important;
  max-width: 1188px !important;
  margin-left: auto !important;
  margin-right: auto !important;
  padding-left: var(--takka-canvas-gutter) !important;
  padding-right: var(--takka-canvas-gutter) !important;
  box-sizing: border-box !important;
}

@media screen and (max-width: 720px) {
  html body.postid-695 .takka-canvas-body > ul,
  html body.postid-943 .takka-canvas-body > ul,
  html body.postid-996 .takka-canvas-body > h2:first-of-type + ul {
    grid-template-columns: 1fr;
  }

  html body.postid-695 .takka-canvas-body > ul > li,
  html body.postid-943 .takka-canvas-body > ul > li {
    padding: 12px 13px;
  }
}

/* Final Canvas prose gutter enforcement.
 * Do not depend on the auxiliary .takka-canvas-body class: every Canvas page
 * still renders its prose inside .entry-content. Interactive div/iframe blocks
 * remain full width because only direct text-level children are targeted. */
html body.takka-wide-content {
  --takka-canvas-gutter: clamp(24px, 4vw, 56px);
}

html body.takka-wide-content .entry-content > p,
html body.takka-wide-content .entry-content > blockquote,
html body.takka-wide-content .entry-content > pre,
html body.takka-wide-content .entry-content > h2,
html body.takka-wide-content .entry-content > h3,
html body.takka-wide-content .entry-content > h4,
html body.takka-wide-content .entry-content > h5,
html body.takka-wide-content .entry-content > h6 {
  width: 100% !important;
  max-width: calc(var(--takka-canvas-reading) + 112px) !important;
  margin-left: auto !important;
  margin-right: auto !important;
  padding-left: var(--takka-canvas-gutter) !important;
  padding-right: var(--takka-canvas-gutter) !important;
  box-sizing: border-box !important;
}

html body.takka-wide-content .entry-content > ul,
html body.takka-wide-content .entry-content > ol {
  width: 100% !important;
  max-width: calc(var(--takka-canvas-reading) + 112px) !important;
  margin-left: auto !important;
  margin-right: auto !important;
  padding-left: calc(var(--takka-canvas-gutter) + 1.5em) !important;
  padding-right: var(--takka-canvas-gutter) !important;
  box-sizing: border-box !important;
}

html body.takka-wide-content .entry-content > h2,
html body.takka-wide-content .entry-content > h3,
html body.takka-wide-content .entry-content > h4,
html body.takka-wide-content .entry-content > h5,
html body.takka-wide-content .entry-content > h6 {
  background: transparent !important;
  background-image: none !important;
  border: 0 !important;
  border-radius: 0 !important;
  box-shadow: none !important;
}

html body.takka-wide-content .takka-canvas-title-shell {
  width: 100% !important;
  max-width: calc(var(--takka-canvas-reading) + 112px) !important;
  padding-left: var(--takka-canvas-gutter) !important;
  padding-right: var(--takka-canvas-gutter) !important;
}

@media screen and (max-width: 600px) {
  html body.takka-wide-content {
    --takka-canvas-gutter: 16px;
  }
}

/* Canvas prose gutter: put the gutter on the content container itself.
 * Full-width apps explicitly break out of it. This remains effective even when
 * WordPress or another filter wraps prose in extra elements. */
html body.takka-wide-content .entry-content.takka-canvas-body {
  padding-left: var(--takka-canvas-gutter) !important;
  padding-right: var(--takka-canvas-gutter) !important;
  box-sizing: border-box !important;
  overflow: visible !important;
}

/* Text-level children no longer carry their own horizontal gutter; the parent does. */
html body.takka-wide-content .entry-content.takka-canvas-body > p,
html body.takka-wide-content .entry-content.takka-canvas-body > blockquote,
html body.takka-wide-content .entry-content.takka-canvas-body > pre,
html body.takka-wide-content .entry-content.takka-canvas-body > h2,
html body.takka-wide-content .entry-content.takka-canvas-body > h3,
html body.takka-wide-content .entry-content.takka-canvas-body > h4,
html body.takka-wide-content .entry-content.takka-canvas-body > h5,
html body.takka-wide-content .entry-content.takka-canvas-body > h6 {
  max-width: var(--takka-canvas-reading) !important;
  padding-left: 0 !important;
  padding-right: 0 !important;
}

html body.takka-wide-content .entry-content.takka-canvas-body > ul,
html body.takka-wide-content .entry-content.takka-canvas-body > ol {
  max-width: var(--takka-canvas-reading) !important;
  padding-right: 0 !important;
}

/* Full-width product/application surfaces escape only the prose gutter. */
html body.takka-wide-content .entry-content.takka-canvas-body > .takka-wide-interactive,
html body.takka-wide-content .entry-content.takka-canvas-body > .takka-full-bleed,
html body.takka-wide-content .entry-content.takka-canvas-body > .takka-drum3d-shell,
html body.takka-wide-content .entry-content.takka-canvas-body > .takka-cross-rhythm-player:not(.is-maximized),
html body.takka-wide-content .entry-content.takka-canvas-body > .pmc-json-app {
  width: calc(100% + (var(--takka-canvas-gutter) * 2)) !important;
  max-width: none !important;
  margin-left: calc(0px - var(--takka-canvas-gutter)) !important;
  margin-right: calc(0px - var(--takka-canvas-gutter)) !important;
  box-sizing: border-box !important;
}

/* Existing page-owned wrappers use the Canvas gutter supplied by the parent. */
html body.postid-719.takka-wide-content .wpab-wrap,
html body.postid-969.takka-wide-content .wpab-wrap,
html body.postid-906.takka-wide-content .takka-drum3d-language-switch,
html body.postid-934.takka-wide-content .takka-drum3d-language-switch,
html body.postid-695.takka-wide-content .takka-canvas-body > small,
html body.postid-943.takka-wide-content .takka-canvas-body > small {
  padding-left: 0 !important;
  padding-right: 0 !important;
}

/* Grid-style lists already supply their own internal item spacing. */
html body.postid-695.takka-wide-content .takka-canvas-body > ul,
html body.postid-943.takka-wide-content .takka-canvas-body > ul,
html body.postid-996.takka-wide-content .takka-canvas-body > h2:first-of-type + ul {
  padding-left: 0 !important;
  padding-right: 0 !important;
}

/* Site-wide fallback upper ad. */
.entry-content .takka-global-upper-ad {
  display: block;
  clear: both;
  width: 100%;
  max-width: 100%;
  margin: 34px auto 40px;
  padding: 10px 0;
  box-sizing: border-box;
}

.entry-content .takka-global-upper-ad .ad-area {
  margin-left: auto;
  margin-right: auto;
}

/* Canvas social/profile footer uses the same components as normal posts. */
html body.takka-wide-content .takka-canvas-social-footer {
  width: 100%;
  max-width: calc(var(--takka-canvas-reading) + (var(--takka-canvas-gutter) * 2));
  margin: 36px auto 0;
  padding: 0 var(--takka-canvas-gutter);
  box-sizing: border-box;
}

html body.takka-wide-content .takka-canvas-social-footer .widget-single-content-bottom,
html body.takka-wide-content .takka-canvas-social-footer .sns-share,
html body.takka-wide-content .takka-canvas-social-footer .sns-follow {
  width: 100%;
  max-width: none;
  box-sizing: border-box;
}

html body.takka-wide-content .takka-canvas-social-footer .widget-single-content-bottom {
  margin-bottom: 30px;
}

html body.takka-wide-content .takka-canvas-social-footer .sns-share,
html body.takka-wide-content .takka-canvas-social-footer .sns-follow {
  margin-left: 0 !important;
  margin-right: 0 !important;
}

@media screen and (max-width: 600px) {
  html body.takka-wide-content .takka-canvas-social-footer {
    margin-top: 28px;
  }
}

/* Canvas article interaction footer: rating, related posts and comments. */
html body.takka-wide-content .takka-article-rating {
  width: 100%;
  max-width: var(--takka-canvas-reading);
  margin-left: auto !important;
  margin-right: auto !important;
  box-sizing: border-box;
}

html body.takka-wide-content .takka-canvas-under-entry {
  width: 100%;
  max-width: calc(var(--takka-canvas-reading) + (var(--takka-canvas-gutter) * 2));
  margin: 44px auto 0;
  padding: 0 var(--takka-canvas-gutter) 52px;
  box-sizing: border-box;
}

html body.takka-wide-content .takka-canvas-under-entry .related-entries,
html body.takka-wide-content .takka-canvas-under-entry .comment-area {
  width: 100%;
  max-width: none;
  margin-left: 0 !important;
  margin-right: 0 !important;
}

html body.takka-wide-content .takka-canvas-under-entry .related-entry-heading,
html body.takka-wide-content .takka-canvas-under-entry .comment-title {
  margin-top: 0;
}

@media screen and (max-width: 600px) {
  html body.takka-wide-content .takka-canvas-under-entry {
    margin-top: 32px;
    padding-bottom: 36px;
  }
}

/* Smartphone landscape uses the same fixed mobile controls. */
@media (orientation: landscape) and (max-height: 600px) and (hover: none) and (pointer: coarse) {
  html body.takka-wide-content #navi {
    display: none !important;
  }

  html 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;
  }

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

  html 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;
  }

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

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