@charset "UTF-8";

/*!
Theme Name: Cocoon Child
Description: 本番 cocoon-child-master 用の style.css パッチ（Git 同期）。カテゴリ件数の括弧は serusoku 子テーマと同じ。functions.php 等はサーバ既存のまま（rsync はこのフォルダ内のファイルのみ送信）。
Theme URI: https://wp-cocoon.com/
Template: cocoon-master
Version: 1.1.3+site-patch.17
*/

/*
 * コア「カテゴリー」ブロック + Cocoon 側マークアップ:
 * list-item-caption と post-count が隣接し「Kindle159」のように見えるのを防ぐ。
 * （Serusoku 子テーマ style.css と同じルール）
 */
.wp-block-categories .post-count::before {
  content: " (";
}
.wp-block-categories .post-count::after {
  content: ")";
}

.wp-block-archives .post-count::before {
  content: " (";
}
.wp-block-archives .post-count::after {
  content: ")";
}

/* Serusoku 子テーマと同じ: フロント タブ 横並び＋順序（新着 → Kindle → DMM → 楽天kobo） */
.index-tab-wrap .index-tab-buttons {
  display: flex !important;
  flex-direction: row !important;
  flex-wrap: nowrap !important;
  align-items: stretch;
}
.index-tab-wrap .index-tab-buttons label.index-tab-button {
  flex: 1 1 0;
  min-width: 0;
  width: auto !important;
  max-width: none !important;
  box-sizing: border-box;
}
.index-tab-wrap label.index-tab-button[for="index-tab-1"] {
  order: 1;
}
.index-tab-wrap label.index-tab-button[for="index-tab-3"] {
  order: 2;
}
.index-tab-wrap label.index-tab-button[for="index-tab-2"] {
  order: 3;
}
.index-tab-wrap label.index-tab-button[for="index-tab-4"] {
  order: 4;
}
@media screen and (max-width: 480px) {
  .index-tab-wrap .index-tab-buttons {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    flex-wrap: nowrap !important;
  }
  .index-tab-wrap .index-tab-buttons label.index-tab-button {
    flex: 1 0 auto;
    min-width: 4.25rem;
  }
}

/* Serusoku と同じ: サイドバー カテゴリ表示順（cat-item-{term_id}） */
:is(.sidebar, .sidebar-scroll) .wp-block-categories-list.wp-block-categories {
  display: flex;
  flex-direction: column;
}
:is(.sidebar, .sidebar-scroll) .wp-block-categories-list.wp-block-categories > li.cat-item {
  order: 50;
}
:is(.sidebar, .sidebar-scroll) .wp-block-categories-list.wp-block-categories > li.cat-item-2 {
  order: 1;
}
:is(.sidebar, .sidebar-scroll) .wp-block-categories-list.wp-block-categories > li.cat-item-20 {
  order: 2;
}
:is(.sidebar, .sidebar-scroll) .wp-block-categories-list.wp-block-categories > li.cat-item-22 {
  order: 3;
}
:is(.sidebar, .sidebar-scroll) .wp-block-categories-list.wp-block-categories > li.cat-item-3 {
  order: 4;
}
:is(.sidebar, .sidebar-scroll) .wp-block-categories-list.wp-block-categories > li.cat-item-12 {
  order: 5;
}
:is(.sidebar, .sidebar-scroll) .wp-block-categories-list.wp-block-categories > li.cat-item-13 {
  order: 6;
}
:is(.sidebar, .sidebar-scroll) .wp-block-categories-list.wp-block-categories > li.cat-item-14 {
  order: 7;
}
:is(.sidebar, .sidebar-scroll) .wp-block-categories-list.wp-block-categories > li.cat-item-4 {
  order: 8;
}
:is(.sidebar, .sidebar-scroll) .wp-block-categories-list.wp-block-categories > li.cat-item-21 {
  order: 9;
}
:is(.sidebar, .sidebar-scroll) .wp-block-categories-list.wp-block-categories > li.cat-item-18 {
  order: 10;
}
:is(.sidebar, .sidebar-scroll) .wp-block-categories-list.wp-block-categories > li.cat-item-1 {
  order: 100;
}

/* Serusoku 子テーマと同じ: 2 行＋省略。li で高さを締めて 3 行目のゴーストを隠す */
.sidebar .wp-block-latest-posts li,
.sidebar-scroll .wp-block-latest-posts li {
  margin-bottom: 1em;
  overflow: hidden;
  max-height: calc(1.55em * 2);
  line-height: 1.55;
}

.sidebar .wp-block-latest-posts .wp-block-latest-posts__post-title,
.sidebar .wp-block-latest-posts li > a,
.sidebar-scroll .wp-block-latest-posts .wp-block-latest-posts__post-title,
.sidebar-scroll .wp-block-latest-posts li > a {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: normal;
  word-break: break-word;
  overflow-wrap: anywhere;
  line-height: 1.55;
  max-width: 100%;
  margin: 0;
  padding: 0;
}

/* Serusoku 子テーマと同じ: 一覧カードの複数カテゴリチップ + 記事のカテゴリ・タグリンクのチップ風 */
.entry-card-wrap .entry-card-meta .entry-card-categorys,
.entry-card-wrap .e-card-meta .e-card-categorys {
  display: flex !important;
  flex-wrap: wrap;
  gap: 4px 6px;
  justify-content: flex-end;
  align-items: center;
  align-self: center;
  max-width: 100%;
}

.entry-card-wrap .entry-card-categorys .entry-category,
.entry-card-wrap .e-card-categorys .entry-category {
  display: inline-block;
  font-size: 0.7rem;
  line-height: 1.2;
  padding: 2px 6px;
  border-radius: 2px;
  order: 50;
}

.entry-card-wrap .entry-card-categorys .entry-category.cat-label-2,
.entry-card-wrap .e-card-categorys .entry-category.cat-label-2 {
  order: 1;
}
.entry-card-wrap .entry-card-categorys .entry-category.cat-label-20,
.entry-card-wrap .e-card-categorys .entry-category.cat-label-20 {
  order: 2;
}
.entry-card-wrap .entry-card-categorys .entry-category.cat-label-22,
.entry-card-wrap .e-card-categorys .entry-category.cat-label-22 {
  order: 3;
}
.entry-card-wrap .entry-card-categorys .entry-category.cat-label-3,
.entry-card-wrap .e-card-categorys .entry-category.cat-label-3 {
  order: 4;
}
.entry-card-wrap .entry-card-categorys .entry-category.cat-label-12,
.entry-card-wrap .e-card-categorys .entry-category.cat-label-12 {
  order: 5;
}
.entry-card-wrap .entry-card-categorys .entry-category.cat-label-13,
.entry-card-wrap .e-card-categorys .entry-category.cat-label-13 {
  order: 6;
}
.entry-card-wrap .entry-card-categorys .entry-category.cat-label-14,
.entry-card-wrap .e-card-categorys .entry-category.cat-label-14 {
  order: 7;
}
.entry-card-wrap .entry-card-categorys .entry-category.cat-label-4,
.entry-card-wrap .e-card-categorys .entry-category.cat-label-4 {
  order: 8;
}
.entry-card-wrap .entry-card-categorys .entry-category.cat-label-21,
.entry-card-wrap .e-card-categorys .entry-category.cat-label-21 {
  order: 9;
}
.entry-card-wrap .entry-card-categorys .entry-category.cat-label-18,
.entry-card-wrap .e-card-categorys .entry-category.cat-label-18 {
  order: 10;
}
.entry-card-wrap .entry-card-categorys .entry-category.cat-label-1,
.entry-card-wrap .e-card-categorys .entry-category.cat-label-1 {
  order: 100;
}

.article .entry-categories-tags {
  margin-bottom: 0.75rem;
}

.article .entry-categories-tags .entry-categories,
.article .entry-categories-tags .entry-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 8px;
  align-items: center;
}

.article .entry-categories-tags .entry-categories a,
.article .entry-categories-tags .entry-tags a {
  display: inline-block;
  font-size: 0.8rem;
  line-height: 1.3;
  padding: 3px 8px;
  border-radius: 3px;
  text-decoration: none;
  background: rgba(0, 0, 0, 0.06);
  color: inherit;
}

.article .entry-categories-tags .entry-categories a {
  order: 50;
}

.article .entry-categories-tags .entry-categories a.cat-link-2 {
  order: 1;
}
.article .entry-categories-tags .entry-categories a.cat-link-20 {
  order: 2;
}
.article .entry-categories-tags .entry-categories a.cat-link-22 {
  order: 3;
}
.article .entry-categories-tags .entry-categories a.cat-link-3 {
  order: 4;
}
.article .entry-categories-tags .entry-categories a.cat-link-12 {
  order: 5;
}
.article .entry-categories-tags .entry-categories a.cat-link-13 {
  order: 6;
}
.article .entry-categories-tags .entry-categories a.cat-link-14 {
  order: 7;
}
.article .entry-categories-tags .entry-categories a.cat-link-4 {
  order: 8;
}
.article .entry-categories-tags .entry-categories a.cat-link-21 {
  order: 9;
}
.article .entry-categories-tags .entry-categories a.cat-link-18 {
  order: 10;
}
.article .entry-categories-tags .entry-categories a.cat-link-1 {
  order: 100;
}

.article .entry-categories-tags .entry-categories a:hover,
.article .entry-categories-tags .entry-tags a:hover {
  opacity: 0.85;
  text-decoration: underline;
}

.article-header .eye-catch-wrap + .entry-categories-tags {
  margin-top: 0.6rem;
  margin-bottom: 0.35rem;
}
