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

/************************************
** 子テーマ用のスタイルを書く
************************************/

/* モバイルフッターのウィジェット見出しを PC サイドバー h3 に揃える（Cocoon 既定の .sidebar h2,.sidebar h3 と同じトークン） */
.footer-widgets-mobile .widget-footer-mobile-title.widget-sidebar-title.widget-title {
  background-color: var(--cocoon-xx-thin-color);
  padding: 12px;
  margin: 16px 0;
  border-radius: var(--cocoon-badge-border-radius);
}

/* 固定ページ: メインタイトルをページ見出しらしく（親テーマの太字＋大きさだけ感を緩和） */
body.page .article .entry-header .entry-title {
  font-weight: 700;
  font-size: clamp(1.45rem, 1.15rem + 1.1vw, 1.95rem);
  line-height: 1.35;
  letter-spacing: 0.03em;
  color: var(--cocoon-text-color);
  margin: 0 0 0.15em;
  padding: 0.15em 0 0.65em;
  border-bottom: 3px solid var(--cocoon-basic-border-color);
}

body.page .article .entry-header {
  margin-bottom: 1.35rem;
  padding-bottom: 0.1rem;
}

.child-aff-entry-card {
  display: block;
}

.child-aff-entry-card.is-disabled {
  cursor: default;
  opacity: 0.85;
}

.child-aff-thumb {
  /* 画像本来の縦横比を活かす（正方形化しない） */
  aspect-ratio: auto;
}

.child-aff-thumb-image {
  width: 100%;
  height: auto;
  display: block; /* 画像下の余白（baseline）を消す */
  object-position: top center; /* カット時は上側を優先表示 */
}

.child-aff-thumb img.no-image {
  width: 100%;
  height: auto;
  display: block;
  object-position: top center;
}

.child-aff-entry-card:hover {
  background: none !important;
  box-shadow: none !important;
  border-color: inherit !important;
}

.child-aff-entry-card {
  transition: none !important;
}

.child-aff-content {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.child-aff-title {
  margin-bottom: 0;
}

.child-aff-meta {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 13px;
  line-height: 1.5;
}

.child-aff-meta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.child-aff-key {
  min-width: 76px;
  color: #666;
  font-weight: 700;
}

.child-aff-val {
  flex: 1;
  min-width: 0;
  word-break: break-word;
}

.child-aff-thumb-link {
  display: block;
}

.child-aff-fields {
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 13px;
  line-height: 1.5;
}

.child-aff-field-row {
  margin: 0;
}

.child-aff-filter-link {
  text-decoration: underline;
}

.child-aff-random-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
}

.child-aff-random-item {
  text-align: center;
}

.child-aff-random-link {
  display: block;
}

.child-aff-random-thumb {
  width: 100%;
  display: block;
  height: auto;
}

.child-aff-random-title-only {
  display: inline-block;
  font-size: 12px;
}

.child-aff-tax-cloud-wrap.tagcloud,
.widget_tag_cloud .tagcloud,
.wp-block-tag-cloud {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  line-height: 1.5;
}

/* 統一ピル: タクソノミー側の枠線(rgba)・文字色 + タグクラウド側の詰めた間隔(margin:2px) + タクソノミー側の内側余白・角丸 */
.child-aff-tax-cloud-wrap.tagcloud a.child-aff-tax-pill,
.widget_tag_cloud .tagcloud a,
.wp-block-tag-cloud a {
  box-sizing: border-box;
  display: inline-block;
  flex: 0 0 auto;
  padding: 4px 10px;
  margin: 2px;
  border: 1px solid rgba(0, 0, 0, 0.15);
  border-radius: 999px;
  background: #fff;
  color: #1967d2;
  text-decoration: none;
  font-weight: 700;
  font-size: 14px;
  line-height: 1.2;
  justify-content: flex-start;
  transition: background-color 0.2s ease;
}

.child-aff-tax-cloud-wrap.tagcloud a.child-aff-tax-pill:hover,
.widget_tag_cloud .tagcloud a:hover,
.wp-block-tag-cloud a:hover {
  background: rgba(0, 0, 0, 0.03);
  color: #1967d2;
}

/* タクソノミークラウド: 人気に依らず一定サイズ */
.child-aff-tax-pill.child-aff-tax-pill--uniform {
  font-size: 14px;
}

.widget_tag_cloud .tagcloud a .tag-caption,
.wp-block-tag-cloud a .tag-caption {
  word-break: break-word;
}

.child-aff-tax-cloud-title {
  font-weight: 700;
  margin-bottom: 4px;
}

.child-aff-featured-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.child-aff-featured-link {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
}

.child-aff-featured-thumb img {
  width: 140px;
  height: auto;
  display: block;
}

.child-aff-featured-title {
  font-weight: 800;
  line-height: 1.3;
}

/* 作品ピックリスト [child_aff_pick_list] */
.child-aff-pick-list__grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

@media screen and (min-width: 835px) {
  .child-aff-pick-list__grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

.child-aff-pick-list__item {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  text-decoration: none;
  color: inherit;
  gap: 6px;
}

.child-aff-pick-list__item:hover {
  opacity: 0.92;
}

.child-aff-pick-list__thumb {
  display: block;
  width: 100%;
  max-width: 100%;
  margin: 0 auto;
}

.child-aff-pick-list__img {
  width: 100%;
  height: auto;
  display: block;
  border-radius: 6px;
}

.child-aff-pick-list__thumb--empty {
  font-size: 12px;
  line-height: 1.35;
  padding: 8px;
  border: 1px solid rgba(0, 0, 0, 0.12);
  border-radius: 6px;
  max-width: 100%;
}

.child-aff-pick-list__actor {
  font-size: 12px;
  font-weight: 700;
  color: #1967d2;
  line-height: 1.25;
}

.child-aff-advanced-search-form {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.child-aff-advanced-row > label {
  display: block;
  font-weight: 700;
  margin-bottom: 6px;
}

.child-aff-advanced-row input[type="text"] {
  width: 100%;
}

.child-aff-advanced-note {
  margin-top: 4px;
  font-size: 12px;
  color: #666;
}

.child-aff-advanced-radio {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.child-aff-advanced-tags {
  max-height: 220px;
  overflow: auto;
}

.child-aff-advanced-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin: 0 8px 8px 0;
  padding: 4px 10px;
  border: 1px solid rgba(0,0,0,0.15);
  border-radius: 999px;
  font-size: 13px;
}

.child-aff-advanced-actions {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin-top: 16px;
  padding-top: 8px;
}

.child-aff-advanced-submit,
.child-aff-advanced-reset {
  min-width: 110px;
  padding: .6em 1.2em;
  line-height: 1.5;
  font-size: 1em;
  border-radius: var(--wp--custom--button--radius, 4px);
  text-align: center;
}

.child-aff-advanced-reset {
  background: #eef3f8;
  color: #2f3b4a;
  border: 1px solid #c9d4e3;
}

.child-aff-advanced-reset:hover {
  background: #e5edf7;
}

.child-aff-hit-count {
  margin: -6px 0 14px;
  font-size: clamp(1.125rem, 1rem + 0.45vw, 1.3125rem);
  font-weight: 700;
  line-height: 1.4;
}

/* 固定ページではメタ情報系を非表示 */
.page .date-tags,
.page .child-aff-advanced-search-title,
.page .entry-footer,
.page #breadcrumb {
  display: none !important;
}

/* 一覧エントリーカード: タイトル行 + 投稿日（右寄せ） */
.child-aff-title-row {
  display: flex;
  flex-wrap: nowrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.5rem 0.75rem;
  width: 100%;
  box-sizing: border-box;
}

.child-aff-title-row .child-aff-title-text {
  flex: 1 1 auto;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.child-aff-posted-on {
  flex: 0 0 auto;
  font-size: 0.78em;
  font-weight: normal;
  line-height: 1.3;
  color: #666;
  white-space: nowrap;
}

.child-aff-posted-on .fa-clock-o {
  margin-right: 0.2em;
  opacity: 0.85;
}

/* タグ一覧・検索: 並び替え */
.child-aff-list-sort-wrap {
  margin: 0;
  padding: 0;
  text-align: right;
  line-height: 1;
}

.child-aff-list-sort-form {
  display: inline-block;
  margin: 0;
  padding: 0;
}

.child-aff-list-sort-select {
  font-size: 0.92rem;
  margin: 0;
  padding: 0.15rem 0.35rem;
  max-width: 100%;
  vertical-align: top;
}

/* TOP・タグ・検索: 一覧直上のページャー（下部と区別しやすくマージン調整） */
.child-aff-pagination-top {
  margin: 0 0 1rem;
}

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

/*834px以下*/
@media screen and (max-width: 834px){
  .child-aff-key {
    min-width: 68px;
  }
}

/*480px以下*/
@media screen and (max-width: 480px){
  /* ランダム出演者グリッド: 3x3 → 2x2（4件のみ表示） */
  .child-aff-random-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .child-aff-random-grid .child-aff-random-item:nth-child(n + 5) {
    display: none;
  }
}

/* スマホ: Cocoon はモバイルフッターメニュー利用時に固定のトップへ戻るを非表示にするため、右下ボタンを復帰 */
@media screen and (max-width: 1023px) {
  .mobile-button-fmb #go-to-top .go-to-top-button,
  .mblt-footer-mobile-buttons #go-to-top .go-to-top-button,
  .mblt-header-and-footer-mobile-buttons #go-to-top .go-to-top-button {
    display: flex !important;
  }

  body:has(.mobile-footer-menu-buttons) #go-to-top.go-to-top {
    bottom: calc(60px + env(safe-area-inset-bottom, 0px));
  }
}
