@charset "UTF-8";

/*!
Theme Name: Cocoon Child for ai.ushiblo
Description: ai.ushiblo.com 用の Cocoon 子テーマ。正方形・円・三角を組み合わせた、藍×からしの幾何学系デザイン
Theme URI: https://ai.ushiblo.com/
Author: uc4696
Template:   cocoon-master
Version:    1.0.0
*/

/* スキンは使わない（Cocoon の素の見た目の上に、これだけで組む）。
   図形はロゴ（images/logo.svg）と同じ4つ：正方形・円・三角・四分円。角丸は使わず、線と面で組む。
   正本は ai-ushiblo-autoblog リポジトリの wp/theme/cocoon-child-ai/。 */

:root {
  --ai-main:   #3b4c86; /* 藍 */
  --ai-dark:   #2a3765; /* 濃い藍（ロゴの面・フッター） */
  --ai-accent: #f2b632; /* からし（差し色） */
  --ai-accent-pale: #fdf3d9;
  --ai-bg:     #eef1f8; /* 淡い藍（ロゴの右下のタイル） */
  --ai-line:   #d3d9ea;
  --ai-text:   #1f2742;
  --ai-sub:    #5f6884;
  --ai-page:   #f4f5f9;
  --ai-font-head: 'Zen Kaku Gothic New', 'Hiragino Kaku Gothic ProN', 'Hiragino Sans', Meiryo, sans-serif;
}

/* 全体
==============================================================================*/

body {
  background-color: var(--ai-page);
  color: var(--ai-text);
}
a {
  color: #2f5fb3;
}
.main,
.sidebar {
  border: none;
  border-radius: 0;
}

/* ヘッダー
==============================================================================*/

/* マーク（正方形）とサイト名を横に並べる。サイト名は functions.php の ai_header_logo_with_name
   Cocoon依存: .logo-header .site-name-text-link（ロゴのリンク）、.header-in（中央寄せ） */
.header {
  background-color: #fff;
}
.header-in {
  min-height: 0;
  padding: 28px 16px 22px;
}
.logo-header {
  padding: 0;
}
.logo-header .site-name-text-link {
  display: inline-flex;
  align-items: center;
  gap: 16px;
  text-decoration: none;
}
.logo-header .site-logo-image {
  width: 72px;
  height: 72px;
}
/* Cocoon がロゴの中の span を display: block などにするので、ロゴのリンクから指定して勝たせる */
.logo-header .site-name-text-link .ai-site-name {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  color: var(--ai-dark);
  font-family: var(--ai-font-head);
  line-height: 1.35;
  text-align: left;
}
.logo-header .ai-site-name .ai-site-name-main {
  display: block;
  font-size: 26px;
  font-weight: 700;
  letter-spacing: .02em;
}
.logo-header .ai-site-name .ai-site-name-sub {
  display: block;
  margin-top: 6px;
  padding: 2px 10px;
  background-color: var(--ai-dark);
  color: #fff;
  font-size: 13px;
  font-weight: 500;
  letter-spacing: .14em;
}
.ai-site-name-sub::before {
  display: inline-block;
  width: .6em;
  height: .6em;
  margin-right: .6em;
  background-color: var(--ai-accent);
  vertical-align: .05em;
  content: "";
}
@media (max-width: 834px) {
  .header-in { padding: 16px 12px 14px; }
  .logo-header .site-name-text-link { gap: 10px; }
  .logo-header .site-logo-image { width: 48px; height: 48px; }
  .logo-header .ai-site-name .ai-site-name-main { font-size: 17px; }
  .logo-header .ai-site-name .ai-site-name-sub { margin-top: 4px; font-size: 11px; }
}

/* ヘッダーの下の帯 : ロゴと同じ図形を横に繰り返す（images/band.svg） */
.header-container {
  box-shadow: none;
}
.header-container::after {
  display: block;
  height: 12px;
  background: url(images/band.svg) 0 0 / 96px 12px repeat-x;
  content: "";
}

/* グローバルメニュー : Cocoon がキーカラー（濃い藍）で塗る帯。hover と今いるページは下にからしの線
   Cocoon依存: #navi の背景はテーマの設定 site_key_color、.navi-in a .item-description は項目の「説明」 */
.navi-in a {
  color: #fff;
  font-family: var(--ai-font-head);
  font-size: 14px;
  font-weight: 500;
}
.navi-in a:hover {
  background-color: rgba(255, 255, 255, .08);
  box-shadow: inset 0 -3px 0 var(--ai-accent);
}
.navi-in > ul > li.current-menu-item > a {
  box-shadow: inset 0 -3px 0 var(--ai-accent);
}
.navi-in .item-description {
  color: #aeb6cc;
}

/* パンくず */
.breadcrumb {
  color: var(--ai-sub);
}

/* 記事
==============================================================================*/

.article h1,
.entry-title {
  color: var(--ai-text);
  font-family: var(--ai-font-head);
  font-weight: 700;
  line-height: 1.5;
}

.article h2 {
  margin-top: 6rem;
  margin-bottom: 1.5rem;
}
.article h3 {
  margin-top: 4.5rem;
  margin-bottom: 1.25rem;
}
.article h4,
.article h5,
.article h6 {
  margin-top: 3rem;
  margin-bottom: 1rem;
}
.article h2 + h3,
.article h2 + h4,
.article h3 + h4 {
  margin-top: 1.5rem;
}

@media (max-width: 480px) {
  .article .entry-title {
    margin: .5em 0 1em;
    padding: 0;
    font-size: 20px;
  }
}

.article .entry-content {
  font-size: 16px;
}
.article p {
  margin-bottom: 2em;
}

/* 見出しは3段とも左に図形を置く。h2＝正方形、h3＝円、h4＝三角 */
.article .entry-content h2,
.article .entry-content h3,
.article .entry-content h4 {
  position: relative;
  border: none;
  border-radius: 0;
  font-family: var(--ai-font-head);
  font-weight: 700;
  line-height: 1.5;
}

/* H2 : 濃い藍の面。左端にからしの正方形 */
.article .entry-content h2 {
  padding: 14px 18px 14px 50px;
  background: var(--ai-dark);
  color: #fff;
  font-size: 23px;
}
.article .entry-content h2::before {
  position: absolute;
  top: 50%;
  left: 18px;
  width: 16px;
  height: 16px;
  margin-top: -8px;
  background: var(--ai-accent);
  content: "";
}

/* H3 : 下に藍の線。左にからしの円 */
.article .entry-content h3 {
  padding: 4px 4px 10px 30px;
  background: none;
  box-shadow: inset 0 -2px 0 var(--ai-line);
  color: var(--ai-text);
  font-size: 20px;
}
.article .entry-content h3::before {
  position: absolute;
  top: .55em;
  left: 4px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--ai-accent);
  content: "";
}
.article .entry-content h3::after {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 4em;
  height: 2px;
  background: var(--ai-dark);
  content: "";
}

/* H4 : 左に藍の三角 */
.article .entry-content h4 {
  padding: 2px 0 2px 26px;
  background: none;
  color: var(--ai-text);
  font-size: 18px;
}
.article .entry-content h4::before {
  position: absolute;
  top: .5em;
  left: 2px;
  width: 0;
  height: 0;
  border-right: 7px solid transparent;
  border-bottom: 13px solid var(--ai-main);
  border-left: 7px solid transparent;
  content: "";
}

@media (max-width: 768px) {
  .article .entry-content { font-size: 15px; }
  .article h2 { margin-top: 4.5rem; }
  .article h3 { margin-top: 3.5rem; }
  .article .entry-content h2 { padding: 12px 14px 12px 40px; font-size: 19px; }
  .article .entry-content h2::before { left: 14px; width: 12px; height: 12px; margin-top: -6px; }
  .article .entry-content h3 { font-size: 17px; }
  .article .entry-content h4 { font-size: 16px; }
}

/* 箇条書き : 点を小さな正方形に */
.article .entry-content ul:not([class*="is-style"]) > li::marker {
  color: var(--ai-main);
  content: "■  ";
  font-size: .7em;
}

/* 画像 : 記事の図は白地なので、細い線で囲む */
.article .entry-content .wp-block-image img {
  border: 1px solid var(--ai-line);
  border-radius: 0;
  box-shadow: none;
}
.article .entry-content .wp-block-image figcaption {
  color: var(--ai-sub);
  font-size: 13px;
}
.eye-catch img {
  border-radius: 0;
}

/* 引用 : 知恵袋の質問の言い換えなどに使う。左にからしの太線 */
.article .entry-content blockquote {
  padding: 16px 20px;
  border: none;
  border-left: 6px solid var(--ai-accent);
  border-radius: 0;
  background-color: var(--ai-accent-pale);
}
.article .entry-content blockquote::before,
.article .entry-content blockquote::after {
  content: none;
}

/* 強調 : からしの下線マーカー */
.article .entry-content strong {
  background: linear-gradient(transparent 62%, var(--ai-accent-pale) 62%);
}

/* コード */
.article .entry-content .wp-block-code {
  border: none;
  border-left: 4px solid var(--ai-main);
  border-radius: 0;
  background-color: var(--ai-bg);
  font-size: 14px;
  line-height: 1.6;
}

/* 表 */
.article .entry-content .wp-block-table table {
  border: none;
  font-size: 14px;
  line-height: 1.6;
}
.article .entry-content .wp-block-table th,
.article .entry-content .wp-block-table td {
  padding: .6em .8em;
  border: none;
  border-bottom: 1px solid var(--ai-line);
  font-size: inherit;
}
.article .entry-content .wp-block-table th {
  background-color: var(--ai-dark);
  color: #fff;
  font-weight: 700;
}
.article .entry-content .wp-block-table tbody tr:nth-child(even) td {
  background-color: #f8f9fc;
}
.article .entry-content .scrollable-table td {
  min-width: 4em;
  white-space: normal;
}

/* 目次 : 上に藍の太線 */
.toc {
  border: none;
  border-top: 4px solid var(--ai-dark);
  border-radius: 0;
  background-color: #f8f9fc;
}
.toc-title {
  color: var(--ai-text);
  font-family: var(--ai-font-head);
  font-weight: 700;
}
.toc-content {
  border-top: 1px solid var(--ai-line);
}

/* 記事の末尾の「AI が書いた」旨（src/Pipeline.php が本文の最後に入れる小さな段落） */
.article .entry-content > p.has-small-font-size:last-child {
  padding: 12px 16px 12px 40px;
  background: var(--ai-bg) url(images/logo.svg) 12px 14px / 16px 16px no-repeat;
  color: #4a5370;
  font-size: 13px;
}

/* カテゴリー・タグ */
.cat-link {
  border-radius: 0;
  background-color: var(--ai-dark);
}
.cat-link:hover {
  background-color: var(--ai-main);
  color: #fff;
}
.tag-link {
  border-color: var(--ai-main);
  border-radius: 0;
  color: var(--ai-main);
}
.tag-link:hover {
  background-color: var(--ai-bg);
  color: var(--ai-main);
}

/* 前後の記事・関連記事 */
.pager-post-navi a {
  border-color: var(--ai-line);
}
.related-entry-card-title {
  color: var(--ai-text);
}

/* 一覧・カード
==============================================================================*/

/* カード : 白い面に細い線。hover で下にからしの線
   Cocoon依存: .entry-card-wrap（.a-wrap）、.cat-label（サムネの左上のカテゴリー名） */
.list .a-wrap,
.related-entry-card-wrap {
  border: 1px solid var(--ai-line);
  border-radius: 0;
  background-color: #fff;
  transition: box-shadow .2s ease;
}
.list .a-wrap:hover,
.related-entry-card-wrap:hover {
  background-color: #fff;
  box-shadow: inset 0 -4px 0 var(--ai-accent);
}
.a-wrap:hover {
  background-color: var(--ai-bg);
}
.list .entry-card-title {
  color: var(--ai-text);
  font-family: var(--ai-font-head);
  font-weight: 700;
  line-height: 1.5;
}
.list .entry-card-snippet {
  color: var(--ai-sub);
  line-height: 1.6;
}
.cat-label {
  top: 0;
  left: 0;
  padding: 2px 8px;
  border: none;
  background-color: var(--ai-dark);
  color: #fff;
}
.card-thumb img {
  border-radius: 0;
}

/* 一覧の見出し（トップの「新着記事」・関連記事など） : 左に3つの図形（■●▲）
   Cocoon依存: .list-title（トップのカテゴリーごとの一覧）・.related-entry-heading・.archive-title */
.list-title,
.related-entry-heading,
.comment-title,
.archive-title {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 1.25em;
  padding: 0 0 8px;
  border: none;
  border-bottom: 2px solid var(--ai-dark);
  background: none;
  color: var(--ai-text);
  font-family: var(--ai-font-head);
  font-size: 20px;
  font-weight: 700;
  text-align: left;
}
.list-title::before,
.related-entry-heading::before,
.comment-title::before,
.archive-title::before {
  flex: none;
  width: 44px;
  height: 12px;
  background:
    linear-gradient(var(--ai-dark), var(--ai-dark)) 0 0 / 12px 12px no-repeat,
    radial-gradient(circle at 6px 6px, var(--ai-accent) 5.5px, transparent 6px) 16px 0 / 12px 12px no-repeat,
    conic-gradient(from 150deg at 50% 0, var(--ai-main) 60deg, transparent 0) 32px 0 / 12px 12px no-repeat;
  content: "";
}
.list-title-in {
  padding: 0;
  border: none;
}

/* ページ送り・「もっと見る」 */
.page-numbers,
.pagination-next-link,
.pager-links a span,
.list-more-button {
  border-radius: 0;
}
a.page-numbers,
.pagination-next-link,
.pager-links a span {
  border: none;
  background-color: var(--ai-dark);
  color: #fff;
}
a.page-numbers:hover,
.pagination-next-link:hover,
.pager-links a:hover span {
  background-color: var(--ai-main);
  color: #fff;
}
.page-numbers.current {
  background-color: var(--ai-accent);
  color: var(--ai-dark);
}
.list-more-button {
  border: 2px solid var(--ai-dark);
  color: var(--ai-dark);
  font-weight: 700;
}
.list-more-button:hover {
  background-color: var(--ai-dark);
  color: #fff;
}

/* サイドバー
==============================================================================*/

.sidebar {
  background-color: transparent;
}
.sidebar .widget {
  margin-bottom: 28px;
  padding: 16px;
  background-color: #fff;
}
.sidebar h2,
.sidebar h3 {
  position: relative;
  margin: 0 0 1em;
  padding: 0 0 0 20px;
  border: none;
  background: none;
  color: var(--ai-text);
  font-family: var(--ai-font-head);
  font-size: 16px;
  font-weight: 700;
}
.sidebar h2::before,
.sidebar h3::before {
  position: absolute;
  top: .3em;
  left: 0;
  width: 12px;
  height: 12px;
  background-color: var(--ai-accent);
  content: "";
}
.widget-entry-card {
  font-size: 14px;
  line-height: 1.5;
}
.widget-entry-cards .a-wrap {
  border-bottom: 1px solid var(--ai-bg);
}
.widget_categories ul li a:hover,
.widget_archive ul li a:hover,
.widget_nav_menu ul li a:hover {
  background-color: var(--ai-bg);
}
.search-box .search-edit {
  border: 2px solid var(--ai-line);
  border-radius: 0;
}
.search-box .search-edit:focus {
  border-color: var(--ai-main);
}

/* 「このサイトについて」の箱（wp/setup/site.php で入れるウィジェット） */
.ai-about-box {
  font-size: 14px;
  line-height: 1.75;
}
.ai-about-box p {
  margin: 0 0 .7em;
}
.ai-about-box p:last-child {
  margin-bottom: 0;
}
.ai-about-box a {
  font-weight: 700;
}

/* 広告
==============================================================================*/

/* 広告の枠 : 線で囲んだ「置き場所」。広告は AdSense のユニット3つ（wp/setup/site.php の広告ウィジェット）で、自動広告は使わない。
   広告そのもの（ins）の大きさ・位置には手を入れない（AdSense のポリシーで、切り取り・重ね・隠し表示はできない）
   Cocoon依存: tmp/ad.php の .ad-area > .ad-label + .ad-wrap。記事中は最初の h2 の前のウィジェット（.widget_common_ad）と [ad]（.ad-box） */
.ad-area {
  margin: 3rem 0;
  padding: .5rem 12px 12px;
  border: 1px solid var(--ai-line);
  border-radius: 0;
  background-color: #f8f9fc;
}
.ad-area .ad-label {
  margin-bottom: .5rem;
  color: #7c86a3;
  font-size: 11px;
  line-height: 1.4;
  letter-spacing: .15em;
}
/* トップの一覧の広告は、本文幅いっぱいにせずレクタングル（最大336px）に */
.widget-index-middle .ad-area,
.widget-index-bottom .ad-area {
  max-width: 360px;
  margin-right: auto;
  margin-left: auto;
}
.sidebar .ad-area {
  margin: 0;
  border: none;
  background: none;
}
.article .entry-content .widget_common_ad + h2,
.article .entry-content .ad-box + h2 {
  margin-top: 3rem;
}
/* 広告が来なかった枠は、ラベルだけの空箱にせず枠ごと消す */
.ad-area:has(ins.adsbygoogle[data-ad-status="unfilled"]),
.sidebar .widget:has(ins.adsbygoogle[data-ad-status="unfilled"]) {
  display: none;
}

/* フッター
==============================================================================*/

.footer {
  background-color: var(--ai-dark);
}
.footer::before {
  display: block;
  height: 12px;
  background: url(images/band.svg) 0 0 / 96px 12px repeat-x;
  content: "";
}
#footer,
#footer a,
.navi-footer-in a {
  color: #e7eaf3;
}
.navi-footer-in a:hover {
  background-color: rgba(255, 255, 255, .08);
  color: #fff !important;
}
.navi-footer-in > .menu-footer li {
  border-left-color: rgba(231, 234, 243, .25);
}
#footer .copyright {
  color: #aeb6cc;
}
#footer .footer-widgets {
  border-bottom: 1px solid rgba(231, 234, 243, .2);
}
#footer .footer-title {
  border: none;
  background: none;
  color: #fff;
}

/* スマホ
==============================================================================*/

.mobile-menu-buttons {
  background-color: var(--ai-dark);
}
.mobile-menu-buttons .menu-caption,
.mobile-menu-buttons .menu-icon {
  color: #fff;
}
.mobile-menu-buttons .menu-button:hover {
  background-color: var(--ai-main);
}
.navi-menu-content {
  background-color: var(--ai-dark);
}
.navi-menu-content .menu-drawer a {
  border-bottom: 1px solid rgba(255, 255, 255, .15);
  color: #fff;
}
.navi-menu-content .menu-drawer a:hover {
  background-color: var(--ai-main);
}
.go-to-top-button {
  border-radius: 0;
  background-color: var(--ai-dark);
  color: var(--ai-accent);
}
.go-to-top-button:hover {
  background-color: var(--ai-main);
}
