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

/************************************
** 全体・基本スタイル
************************************/
body {
  font-family: sans-serif !important;
  counter-reset: h2;
}

img {
  border: 2px solid #c0c0c0;
  box-shadow: 0 0 3px #808080;
}

blockquote {
  position: relative;
  margin: 1em 0;
  padding: 1.5em;
  font-family: "Kiwi Maru", "Meiryo", sans-serif;
  font-size: 0.9em;
  line-height: 1.7;
  color: #e0e0e0;
  background-color: #264032;
  border: 8px solid #8b6d51;
  border-radius: 4px;
  box-shadow: 0 0 0 2px #264032, inset 0 0 12px rgba(0, 0, 0, 0.4);
  text-shadow: none;
}

/* blockquote内の強調要素の共通初期化 */
.article blockquote :is(strong, b, em) {
  background: transparent !important;
  font-weight: bold;
}

/* 各強調要素の個別スタイル */
.article blockquote :is(strong, b) {
  color: #e6e696 !important;
  text-shadow: none;
}

.article blockquote em {
  color: #f2c2c9 !important;
  font-style: normal;
}

/* 引用符の装飾 */
blockquote::before {
  content: "“";
  position: absolute;
  top: 5px;
  left: 10px;
  font-size: 2.2em;
  color: rgba(255, 255, 255, 0.1);
}

.ql-img-displayed-equation {
  border: 0;
  box-shadow: none;
}

::selection {
  background: #84c98b;
}

::-moz-selection {
  background: #84c98b;
}

/************************************
** ヘッダー・ナビゲーション
************************************/
.header .header-in {
  min-height: 80px;
  display: flex;
  align-items: center;
  padding: 0 20px;
}

.header-container {
  background-color: #2c3e50;
  color: #fff;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

#header-in a {
  font-size: 1.8em !important;
  color: #fff;
  font-weight: 800 !important;
}

#header-container,
#header-container .navi,
#navi .navi-in > .menu-header .sub-menu,
.sidebar h3,
#footer,
#navi-in {
  background-color: #2c3e50;
}

.menu-header .item-label {
  padding: 10px 16px;
  transition: border-left 0.2s ease, background-color 0.2s ease;
}

.menu-header .item-label:hover {
  border-left: 8px solid #ffd43b;
  color: #000;
  background-color: rgba(255, 255, 255, 0.1) !important;
}

#navi .navi-in a:hover {
  background: #1967d2;
}

/************************************
** フッター
************************************/
.footer {
  padding: 20px;
  color: #ffffff;
  background: linear-gradient(to right, #1a1a1a, #2c3e50);
  text-align: center;
  font-size: 0.95em;
  box-shadow: 0 -2px 6px rgba(0, 0, 0, 0.2);
}

/************************************
** 記事見出し・本文装飾
************************************/
.article :is(h1, h2, h3) {
  font-weight: 800;
}

.article :is(h2, h3) {
  position: relative;
}

.article :is(h2, h3)::before {
  position: absolute;
  top: 0;
  left: 0;
  height: 100%;
  color: #ffffff;
  font-weight: bold;
  display: flex;
  align-items: center;
  justify-content: center;
}

.article h1 {
  font-size: 2.2em;
  color: #ffffff;
  background: #2c3e50;
  padding: 1.2em 1.5em;
  margin: 2em 0 1em;
  border-left: 10px solid #e67e22;
  border-radius: 12px;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.2);
  letter-spacing: 0.8px;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.article h2 {
  counter-reset: h3;
  font-size: 1.8em;
  color: #ffffff;
  background-color: #2c3e50;
  border-left: 8px solid #e67e22;
  padding: 1.2em 1.5em 1.2em 3.5em;
  margin: 2em 0;
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
  letter-spacing: 0.5px;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}

.article h2::before {
  counter-increment: h2;
  content: counter(h2) "";
  width: 3em;
  background-color: #e67e22;
  box-shadow: inset -1px 0 0 rgba(0, 0, 0, 0.2);
}

.article h3 {
  counter-reset: h4;
  font-size: 1.4em;
  color: #2c3e50;
  background: #f8f8f8 repeating-linear-gradient(
    45deg,
    #e0e6ea,
    #e0e6ea 10px,
    #f4f7f9 10px,
    #f4f7f9 20px
  );
  border-left: 5px solid #2c3e50;
  padding: 0.8em 1.2em 0.8em 3.2em;
  margin: 1.5em 0;
  border-radius: 6px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);
  letter-spacing: 0.3px;
  transition: background 0.3s ease, transform 0.2s ease;
}

.article h3::before {
  counter-increment: h3;
  content: counter(h2) "-" counter(h3) "";
  width: 2.8em;
  background-color: #2c3e50;
  box-shadow: inset -1px 0 0 rgba(0, 0, 0, 0.1);
}

.article a {
  font-weight: bold;
  color: #306998;
}

.article strong {
  background: linear-gradient(transparent 80%, #fff070 50%);
  font-weight: bold;
  color: #000;
}

.article em {
  font-style: normal;
  font-weight: bold;
  background: #fff9c4;
}

.article ul {
  list-style-type: disc !important;
}

.article ul ul {
  list-style-type: circle !important;
}

.article ul ul ul {
  list-style-type: square !important;
}

.article ul :is(li, li ul li, li ul li ul li) {
  font-weight: normal;
}

.article pre {
  font-size: 13px !important;
}

/************************************
** サイドバー
************************************/
.sidebar :is(h2, h3) {
  background-color: #2c3e50;
  color: #ffffff;
  font-size: 16px;
  font-weight: 600;
  padding: 10px 12px;
  border-left: 5px solid #e67e22;
  border-radius: 4px;
  margin-bottom: 1em;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
}

.sidebar a {
  font-weight: 600;
  color: #2c3e50;
  text-decoration: none;
  padding: 4px 6px;
  display: inline-block;
  border-radius: 3px;
  transition: background-color 0.2s ease, color 0.2s ease;
}

.sidebar a:hover {
  background-color: #e67e22;
  color: #ffffff;
}

.author-description a {
  text-decoration: underline;
}

/************************************
** テーブル
************************************/
table {
  width: 100%;
  border-collapse: collapse;
  margin: 2em 0;
  font-family: "Segoe UI", "Helvetica Neue", sans-serif;
  border: 2px solid #2c3e50;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

table th {
  background-color: #5a6c7d;
  color: #ffffff;
  font-size: 15px;
  font-weight: 700;
  padding: 1em;
  text-align: left;
  border: 2px solid #2c3e50;
  letter-spacing: 0.4px;
}

table td {
  background-color: #f4f4f4;
  font-size: 14px;
  padding: 0.9em 1em;
  color: #1a1a1a;
  border: 2px solid #ccc;
}

table tr:nth-child(odd) td {
  background-color: #e0e0e0;
}

table tr:last-child td {
  border-bottom: none;
}

/************************************
** 目次（TOC）
************************************/
.toc {
  background: #fdfdfd;
  border: 3px solid #2c3e50 !important;
  padding: 24px 30px;
  display: block;
  border-radius: 12px;
  position: relative;
}

.toc-title {
  font-size: 26px;
  font-weight: 700;
  color: #2c3e50;
  position: relative;
  line-height: 1.0;
  display: flex;
  align-items: center;
}

.toc-title::before {
  content: "\f0ca";
  font-family: FontAwesome;
  font-size: 18px;
  color: #fff;
  background-color: #e67e22;
  border-radius: 50%;
  padding: 12px;
  margin-right: 12px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
}

.toc-content ol {
  padding: 0 0.5em;
  margin: 0;
  counter-reset: section;
}

.toc-content ol li {
  display: flex;
  align-items: center;
  padding: 0.5em 0;
  border-bottom: 1px dashed #ccc;
  font-size: 16px;
  color: #333;
}

.toc-content ol li::before {
  content: counter(section);
  counter-increment: section;
  background-color: #2c3e50;
  color: #fff;
  font-weight: bold;
  width: 1.6em;
  height: 1.6em;
  text-align: center;
  line-height: 1.6em;
  border-radius: 50%;
  font-size: 0.9em;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
  margin-right: 1.2em;
  flex-shrink: 0;
}

.toc-content .toc-list li {
  font-weight: 700;
}

.toc-content .toc-list li li {
  font-weight: normal;
  font-size: 15px;
  padding-left: 2.5em;
}

/************************************
** 展開ボックス
************************************/
.toggle-box {
  margin: 1em 0;
  border: 1px solid #ccc;
  border-radius: 8px;
  padding: 1em;
  background-color: #f9f9f9;
}

.toggle-box input[type="checkbox"] {
  display: none;
}

.toggle-box label {
  display: inline-block;
  cursor: pointer;
  font-weight: bold;
  color: #007acc;
  margin-bottom: 0.5em;
}

.toggle-box .content {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s ease;
}

.toggle-box input[type="checkbox"]:checked ~ .content {
  max-height: 5000px !important;
}

/************************************
** メッセージ・装飾ボックス
************************************/
/* 共通ベーススタイル */
:is(.warning-box, .info-box, .primary-box, .point-box, .success-box, .danger-box, .output-box, .blogcard) {
  position: relative;
  border-radius: 8px;
  font-family: sans-serif;
  line-height: 1.6;
}

:is(.warning-box, .info-box, .blogcard) {
  padding: 36px 20px 20px 20px;
}

:is(.primary-box, .point-box, .success-box, .danger-box, .output-box) {
  padding: 40px 20px 20px 20px;
}

/* 共通ラベルスタイル */
:is(.warning-box, .info-box, .primary-box, .point-box, .success-box, .danger-box, .output-box, .blogcard)::before {
  position: absolute;
  top: 0;
  left: 0;
  color: #ffffff;
  font-weight: bold;
  padding: 6px 12px;
  border-bottom-right-radius: 6px;
  font-size: 14px;
}

:is(.primary-box, .point-box, .success-box, .danger-box, .output-box)::before {
  line-height: 1;
  display: flex;
  align-items: center;
  gap: 6px;
}

/* 個別カラー・コンテンツ定義 */
.warning-box {
  border: 2px solid #f57c00;
  background-color: #fff8e1;
}
.warning-box::before {
  content: "⚠️ 注意";
  background-color: #f57c00;
}

.info-box {
  border: 2px solid #2196f3;
  background-color: #e3f2fd;
}
.info-box::before {
  content: "💡 ヒント";
  background-color: #2196f3;
}

:is(.primary-box, .point-box) {
  border: 2px solid #2e7d32;
  background-color: #e8f5e9;
}
.primary-box::before {
  content: "✍補足";
  background-color: #2e7d32;
}
.point-box::before {
  content: "✍ポイント";
  background-color: #2e7d32;
}

.success-box {
  border: 2px solid #388e3c;
  background-color: #f1f8e9;
}
.success-box::before {
  content: "✍ 発展";
  background-color: #388e3c;
}

.danger-box {
  border: 2px solid #d32f2f;
  background-color: #ffebee;
}
.danger-box::before {
  content: "🚨 警告";
  background-color: #d32f2f;
}

.output-box {
  border: 2px solid #5e2750;
  background-color: #42032e;
  color: #ffffff;
}
.output-box::before {
  content: "🖥️ 実行結果";
  background-color: #444;
}

.blogcard {
  border: 2px solid #2c3e50 !important;
  background-color: #f9f9f9;
}
.blogcard::before {
  content: "👉 解説記事はこちら";
  background-color: #2c3e50;
}

/************************************
** カテゴリラベル
************************************/
.cat-label,
.cat-link,
.entry-categories {
  background-color: #2196f3 !important;
  color: #ffffff !important;
}

.cat-link a {
  color: #ffffff !important;
}

/************************************
** レスポンシブ
************************************/
@media screen and (max-width: 480px) {
  .article img {
    max-width: 100%;
    height: auto;
  }
}