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

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

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

/*834px以下*/
@media screen and (max-width: 834px){
  /*必要ならばここにコードを書く*/
}

/*480px以下*/
@media screen and (max-width: 480px){
  /*必要ならばここにコードを書く*/
}


/* AI化工のお部屋 - Global design v1.0 */

:root {
  --kako-navy: #17384d;
  --kako-navy-deep: #0d2938;
  --kako-teal: #198b84;
  --kako-teal-dark: #116f6c;
  --kako-blue: #3979ad;
  --kako-orange: #d9893f;
  --kako-ink: #263746;
  --kako-muted: #647789;
  --kako-line: #d5e4e7;
  --kako-soft: #edf4f5;
  --kako-white: #ffffff;
  --kako-shadow: 0 12px 32px rgba(23, 56, 77, 0.09);
}

html {
  scroll-behavior: smooth;
  max-width: 100%;
  overflow-x: hidden;
}

body {
  max-width: 100%;
  overflow-x: hidden;
  background-color: var(--kako-soft);
  background-image:
    radial-gradient(circle at 8% 8%, rgba(57, 121, 173, 0.12), transparent 28rem),
    radial-gradient(circle at 94% 24%, rgba(25, 139, 132, 0.11), transparent 25rem),
    linear-gradient(rgba(23, 56, 77, 0.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(23, 56, 77, 0.025) 1px, transparent 1px);
  background-size: auto, auto, 38px 38px, 38px 38px;
  background-attachment: fixed;
  color: var(--kako-ink);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Hiragino Kaku Gothic ProN", "Yu Gothic", Meiryo, sans-serif;
  line-height: 1.9;
  letter-spacing: 0.015em;
}

a {
  color: var(--kako-teal-dark);
  text-decoration-color: rgba(15, 111, 115, 0.35);
  text-underline-offset: 0.18em;
  transition: color 0.2s ease, opacity 0.2s ease;
}

a:hover {
  color: var(--kako-orange);
}

/* Header */
#header {
  position: relative;
  overflow: hidden;
  background:
    radial-gradient(circle at 10% 25%, rgba(57, 121, 173, 0.16), transparent 28%),
    radial-gradient(circle at 90% 20%, rgba(25, 139, 132, 0.15), transparent 26%),
    linear-gradient(135deg, #ffffff 0%, #f5fbfb 55%, #f4f8fc 100%);
  border-top: 4px solid var(--kako-teal);
  border-bottom: 1px solid var(--kako-line);
  box-shadow: 0 7px 24px rgba(23, 56, 77, 0.065);
}

#header::after {
  position: absolute;
  z-index: 0;
  top: 0;
  right: 0;
  width: 38%;
  height: 100%;
  background-image: radial-gradient(circle, rgba(25, 139, 132, 0.18) 1.2px, transparent 1.3px);
  background-size: 22px 22px;
  content: "";
  opacity: 0.58;
  pointer-events: none;
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 70%);
  mask-image: linear-gradient(90deg, transparent, #000 70%);
}

#header-in {
  position: relative;
  z-index: 1;
  padding: 28px 24px 25px;
}

/* Main navigation */
#navi {
  background: rgba(255, 255, 255, 0.9);
  border-bottom: 1px solid rgba(213, 228, 231, 0.95);
  box-shadow: 0 5px 18px rgba(23, 56, 77, 0.045);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
}

#navi .navi-in > ul > li > a {
  color: #344f62;
  transition: color 0.2s ease, background-color 0.2s ease;
}

#navi .navi-in > ul > li > a:hover {
  color: var(--kako-teal-dark);
  background: linear-gradient(180deg, rgba(25, 139, 132, 0.08), rgba(57, 121, 173, 0.045));
}

.logo-header {
  margin: 3px 0 0;
}

.site-name-text {
  color: var(--kako-navy);
  font-size: clamp(1.9rem, 3vw, 2.45rem);
  font-weight: 800;
  letter-spacing: 0.055em;
}

.tagline {
  color: var(--kako-muted);
  font-size: 0.82rem;
  letter-spacing: 0.06em;
  margin-bottom: 4px;
}

/* Overall layout */
#content-in {
  max-width: 1180px;
  gap: 28px;
  padding: 34px 16px 54px;
  box-sizing: border-box;
}

.main {
  width: calc(100% - 328px);
  box-sizing: border-box;
  margin: 0;
  padding: 38px 42px;
  background: var(--kako-white);
  border: 1px solid rgba(220, 230, 236, 0.95);
  border-radius: 18px;
  box-shadow: var(--kako-shadow);
}

.sidebar {
  width: 300px;
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

.breadcrumb {
  color: var(--kako-muted);
  font-size: 0.78rem;
  margin-bottom: 18px;
}

/* Home and archive cards */
.home .main,
.archive .main,
.search .main {
  padding: 24px;
}

.entry-card-wrap {
  position: relative;
  display: block;
  margin-bottom: 22px;
  padding: 0 !important;
  overflow: hidden;
  background: #ffffff;
  border: 1px solid var(--kako-line) !important;
  border-radius: 15px;
  box-shadow: 0 7px 22px rgba(23, 50, 77, 0.055);
  transition: transform 0.22s ease, box-shadow 0.22s ease, border-color 0.22s ease;
}

.entry-card-wrap::before {
  position: absolute;
  z-index: 2;
  top: 0;
  right: 0;
  left: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--kako-blue), var(--kako-teal), rgba(217, 137, 63, 0.72));
  content: "";
  opacity: 0.72;
  pointer-events: none;
}

.entry-card-wrap:hover {
  transform: translateY(-3px);
  border-color: rgba(22, 138, 141, 0.45) !important;
  box-shadow: 0 14px 30px rgba(23, 50, 77, 0.11);
}

.entry-card {
  display: grid;
  grid-template-columns: minmax(230px, 34%) 1fr;
  min-height: 190px;
}

.entry-card-thumb {
  float: none !important;
  width: 100% !important;
  height: 100%;
  margin: 0 !important;
  overflow: hidden;
  background: linear-gradient(135deg, #edf4f7, #f9fbfc);
}

.entry-card-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.35s ease;
}

.entry-card-wrap:hover .entry-card-thumb img {
  transform: scale(1.025);
}

.entry-card-content {
  margin-left: 0 !important;
  padding: 22px 24px 20px;
}

.entry-card-title {
  color: var(--kako-navy);
  font-size: 1.18rem;
  font-weight: 750;
  line-height: 1.55;
  margin-bottom: 10px;
}

.entry-card-snippet {
  color: #536778;
  font-size: 0.9rem;
  line-height: 1.75;
}

.e-card-info {
  color: #7b8b98;
  font-size: 0.76rem;
}

.cat-label {
  top: 10px;
  left: 10px;
  padding: 4px 10px;
  background: rgba(23, 50, 77, 0.92) !important;
  border: 0;
  border-radius: 999px;
  box-shadow: 0 3px 10px rgba(16, 38, 58, 0.14);
  font-size: 0.68rem;
  letter-spacing: 0.04em;
}

/* Article typography */
.entry-title {
  color: var(--kako-navy-deep);
  font-size: clamp(1.75rem, 3vw, 2.25rem);
  font-weight: 800;
  line-height: 1.45;
  letter-spacing: 0.02em;
  margin-bottom: 22px;
}

.entry-content {
  color: var(--kako-ink);
  font-size: 1rem;
  line-height: 2;
}

.entry-content p {
  margin: 1.15em 0;
}

.entry-content h2 {
  position: relative;
  margin: 3.2em 0 1.25em;
  padding: 0.78em 1em 0.78em 1.15em;
  color: var(--kako-navy);
  background: linear-gradient(90deg, rgba(47, 111, 187, 0.095), rgba(22, 138, 141, 0.045));
  border: 0;
  border-left: 6px solid var(--kako-teal);
  border-radius: 8px;
  font-size: 1.48rem;
  font-weight: 800;
  line-height: 1.5;
}

.entry-content h3 {
  position: relative;
  margin: 2.25em 0 1em;
  padding: 0.25em 0 0.48em 0.9em;
  color: var(--kako-navy);
  border: 0;
  border-bottom: 2px solid var(--kako-line);
  font-size: 1.2rem;
  line-height: 1.55;
}

.entry-content h3::before {
  position: absolute;
  top: 0.35em;
  bottom: 0.55em;
  left: 0;
  width: 4px;
  background: var(--kako-blue);
  border-radius: 4px;
  content: "";
}

.entry-content strong {
  color: #183b59;
  font-weight: 750;
}

.entry-content ul,
.entry-content ol {
  margin: 1.2em 0;
  padding: 1.1em 1.4em 1.1em 2.3em;
  background: #f8fafb;
  border: 1px solid #e4ebef;
  border-radius: 10px;
}

.entry-content li + li {
  margin-top: 0.4em;
}

.eye-catch-wrap {
  overflow: hidden;
  margin: 8px 0 28px;
  border-radius: 14px;
  box-shadow: 0 10px 26px rgba(23, 50, 77, 0.11);
}

/* Kakomaru and learning boxes */
.kakomaru-introduction {
  position: relative;
  margin: 6px 0 30px;
  padding: 22px 24px 18px;
  overflow: hidden;
  background: linear-gradient(135deg, #eef8f8 0%, #f5f9fd 100%);
  border: 1px solid #cae2e4;
  border-left: 5px solid var(--kako-teal);
  border-radius: 12px;
  box-shadow: 0 8px 20px rgba(22, 138, 141, 0.07);
}

.kakomaru-introduction::after {
  position: absolute;
  right: -28px;
  bottom: -44px;
  width: 125px;
  height: 125px;
  background: radial-gradient(circle, rgba(47, 111, 187, 0.12), transparent 68%);
  content: "";
}

.kakomaru-introduction p {
  position: relative;
  z-index: 1;
  margin: 0 0 0.65em;
}

.kakomaru-introduction small {
  color: var(--kako-muted);
  font-size: 0.78rem;
}

.information-box,
.point-box,
.alert-box {
  margin: 1.7em 0;
  padding: 1.2em 1.35em;
  border-radius: 11px;
  box-shadow: none;
}

.information-box {
  background: #f2f7fc;
  border: 1px solid #ccdeef;
}

.point-box {
  background: #eef9f6;
  border: 1px solid #c8e6df;
}

.alert-box {
  background: #fff7ef;
  border: 1px solid #f1d4b7;
}

.information-box ul,
.point-box ul,
.alert-box ul {
  background: transparent;
  border: 0;
  padding-top: 0.2em;
  padding-bottom: 0.2em;
}

/* Tables and equations */
.entry-content .wp-block-table {
  max-width: 100%;
  overflow-x: auto;
}

.entry-content table {
  width: 100%;
  margin: 1.7em 0;
  overflow: hidden;
  border: 1px solid #d6e1e7;
  border-collapse: separate;
  border-spacing: 0;
  border-radius: 10px;
  font-size: 0.92rem;
}

.entry-content th {
  padding: 0.85em 0.9em;
  color: #ffffff;
  background: var(--kako-navy);
  border-color: #2a4963;
  font-weight: 700;
  text-align: left;
}

.entry-content td {
  padding: 0.8em 0.9em;
  background: #ffffff;
  border-color: #e0e8ed;
}

.entry-content tbody tr:nth-child(even) td {
  background: #f7fafb;
}

mjx-container[display="true"] {
  max-width: 100%;
  margin: 1.35em 0 !important;
  padding: 0.9em 1em;
  overflow-x: auto;
  overflow-y: hidden;
  background: #f8fafc;
  border: 1px solid #e1e9ee;
  border-radius: 9px;
}

details {
  margin: 1.6em 0;
  overflow: hidden;
  background: #ffffff;
  border: 1px solid var(--kako-line);
  border-radius: 10px;
}

summary {
  padding: 0.95em 1.15em;
  color: var(--kako-navy);
  background: #f1f6f8;
  cursor: pointer;
  font-weight: 700;
}

details[open] > *:not(summary) {
  margin-right: 1.2em;
  margin-left: 1.2em;
}

/* Share buttons and metadata */
.sns-share-buttons a,
.sns-follow-buttons a {
  border-radius: 8px;
  box-shadow: none;
  transition: transform 0.2s ease, opacity 0.2s ease;
}

.sns-share-buttons a:hover,
.sns-follow-buttons a:hover {
  transform: translateY(-2px);
  opacity: 0.9;
}

.date-tags,
.post-date,
.post-update {
  color: #718392;
  font-size: 0.78rem;
}

/* Sidebar */
.sidebar .widget {
  margin-bottom: 22px;
  padding: 20px;
  background: linear-gradient(180deg, #ffffff 0%, #fbfdfd 100%);
  border: 1px solid var(--kako-line);
  border-radius: 14px;
  box-shadow: 0 9px 25px rgba(23, 56, 77, 0.075);
}

.sidebar h2,
.sidebar .widget-title,
.sidebar .wp-block-heading {
  margin: 0 0 15px;
  padding: 0 0 9px;
  color: var(--kako-navy);
  background: transparent;
  border: 0;
  border-bottom: 2px solid #d9e7ea;
  font-size: 1rem;
  font-weight: 800;
  letter-spacing: 0.03em;
}

.sidebar h2::before,
.sidebar .widget-title::before,
.sidebar .wp-block-heading::before {
  display: inline-block;
  width: 5px;
  height: 1.05em;
  margin-right: 9px;
  vertical-align: -0.12em;
  background: linear-gradient(180deg, var(--kako-blue), var(--kako-teal));
  border-radius: 999px;
  content: "";
}

.sidebar ul {
  margin: 0;
  padding: 0;
}

.sidebar li {
  padding: 0.65em 0;
  border-bottom: 1px solid #edf1f3;
  line-height: 1.6;
}

.sidebar li:last-child {
  border-bottom: 0;
}

.sidebar a {
  color: #42586a;
  font-size: 0.9rem;
}

/* ホームのサイドバーは「検索 → カテゴリー」を最初に表示 */
.home .sidebar {
  display: flex;
  flex-direction: column;
}

/* テーマが用意するサイドバー直下のウィジェットを並べ替え */
.home .sidebar > .widget-sidebar.widget_search {
  order: 1;
}

.home .sidebar > .sidebar-scroll {
  order: 2;
  display: flex;
  flex-direction: column;
}

.home .sidebar > .widget-sidebar:not(.widget_search) {
  order: 3;
}

/* アーカイブとカテゴリーが同じスクロール領域にあるため、カテゴリーを先に表示 */
.home .sidebar > .sidebar-scroll > .widget-sidebar-scroll:has(.wp-block-categories-list) {
  order: 1;
}

.home .sidebar > .sidebar-scroll > .widget-sidebar-scroll:has(.wp-block-archives-list) {
  order: 2;
}

.wp-block-search__input,
.search-edit {
  min-height: 44px;
  padding: 0 12px;
  border: 1px solid #ccd8df !important;
  border-radius: 8px !important;
  outline: none;
}

.wp-block-search__input:focus,
.search-edit:focus {
  border-color: var(--kako-teal) !important;
  box-shadow: 0 0 0 3px rgba(22, 138, 141, 0.12);
}

.wp-block-search__button,
.search-submit {
  color: #ffffff !important;
  background: linear-gradient(135deg, var(--kako-navy), var(--kako-teal-dark)) !important;
  border: 0 !important;
  border-radius: 8px !important;
}

/* Pagination */
.pagination a,
.pagination .current {
  border: 1px solid var(--kako-line);
  border-radius: 8px;
}

.pagination .current {
  color: #ffffff;
  background: var(--kako-teal);
}

/* Footer */
#footer {
  color: rgba(255, 255, 255, 0.78);
  background:
    radial-gradient(circle at 82% 20%, rgba(25, 139, 132, 0.24), transparent 28%),
    linear-gradient(135deg, var(--kako-navy-deep), #123d4a);
  border-top: 4px solid var(--kako-teal);
}

#footer a,
#footer .site-name-text {
  color: #ffffff;
}

.footer-bottom {
  padding-top: 26px;
  padding-bottom: 26px;
}

/* Responsive */
@media screen and (max-width: 1023px) {
  #content-in {
    display: block;
    padding: 24px 14px 44px;
  }

  .main,
  .sidebar {
    width: 100%;
    margin: 0;
  }

  .sidebar {
    margin-top: 24px;
  }
}

@media screen and (max-width: 834px) {
  body {
    font-size: 16.5px;
    line-height: 1.85;
  }

  #header-in {
    padding: 21px 16px 19px;
  }

  .tagline {
    font-size: 0.72rem;
    line-height: 1.55;
  }

  .site-name-text {
    font-size: 1.75rem;
  }

  .main,
  .home .main,
  .archive .main,
  .search .main {
    padding: 24px 18px;
    border-radius: 13px;
  }

  .entry-card {
    display: block;
    min-height: 0;
  }

  .entry-card-thumb {
    height: auto;
    aspect-ratio: 16 / 9;
  }

  .entry-card-content {
    padding: 17px 18px 18px;
  }

  .entry-card-title {
    font-size: 1.08rem;
  }

  .entry-card-snippet {
    font-size: 0.86rem;
  }

  .entry-title {
    font-size: 1.55rem;
    line-height: 1.5;
  }

  .entry-content {
    font-size: 0.98rem;
    line-height: 1.9;
  }

  .entry-content h2 {
    margin-top: 2.65em;
    padding: 0.72em 0.85em;
    font-size: 1.25rem;
  }

  .entry-content h3 {
    font-size: 1.1rem;
  }

  .kakomaru-introduction {
    padding: 18px 18px 15px;
  }

  .entry-content table {
    font-size: 0.82rem;
  }

  .entry-content th,
  .entry-content td {
    min-width: 7em;
    padding: 0.7em;
  }

  .sns-share-buttons {
    gap: 0;
  }
}

/* WordPressの初期ウィジェット見出しをサイト表記に統一 */
.widget_archive .widget-title,
.widget_categories .widget-title,
.sidebar h2.wp-block-heading:has(+ .wp-block-archives-list),
.sidebar h2.wp-block-heading:has(+ .wp-block-categories-list) {
  font-size: 0;
}

.widget_archive .widget-title::after,
.widget_categories .widget-title::after,
.sidebar h2.wp-block-heading:has(+ .wp-block-archives-list)::after,
.sidebar h2.wp-block-heading:has(+ .wp-block-categories-list)::after {
  font-size: 1rem;
  letter-spacing: 0.04em;
}

.widget_archive .widget-title::after,
.sidebar h2.wp-block-heading:has(+ .wp-block-archives-list)::after {
  content: "月別アーカイブ";
}

.widget_categories .widget-title::after,
.sidebar h2.wp-block-heading:has(+ .wp-block-categories-list)::after {
  content: "カテゴリー";
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
  }
}
