/*
Theme Name: Cosmo Machine Blog (Cocoon Child)
Description: コスモマシン ブログ用 Cocoon 子テーマ
Theme URI: https://blog.cosmomachine.com/
Author: OBITASTAR
Template:   cocoon-master
Version:    4.1.0
*/

/* ==========================================================================
   Design Tokens
   ========================================================================== */
:root {
  --bg:         #f7f8fa;
  --white:      #fff;
  --surface:    #f0f2f5;
  --line:       #e0e3e8;
  --text:       #1d1d1f;
  --text-sub:   #494d55;
  --text-muted: #8a8f98;
  --brand:      #19448e;
  --brand-dark: #0f2f6b;
  --brand-pale: #edf1f9;
  --accent:     #06C755;
  --accent-hover:#05b34a;
  --link:       #19448e;

  --ff: "Noto Sans JP", "Hiragino Kaku Gothic ProN", sans-serif;
  --fs-xs:   .6875rem;
  --fs-sm:   .8125rem;
  --fs-base: .9375rem;
  --fs-md:   1rem;
  --fs-lg:   1.125rem;
  --fs-xl:   1.25rem;
  --fs-2xl:  clamp(1.3rem, 2.5vw, 1.65rem);
  --fs-3xl:  clamp(1.45rem, 3vw, 1.9rem);
  --lh:      1.8;

  --r:       6px;
  --r-lg:    10px;
  --shadow-sm:  0 1px 2px rgba(0,0,0,.05);
  --shadow:     0 1px 4px rgba(0,0,0,.07);
  --shadow-md:  0 4px 16px rgba(0,0,0,.09);
  --dur:     .2s;
  --ease:    ease;
  --content-w: 1200px;
}

/* ==========================================================================
   Base
   ========================================================================== */
body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--ff);
  font-size: var(--fs-base);
  line-height: var(--lh);
  -webkit-font-smoothing: antialiased;
  font-feature-settings: "palt";
}
a {
  color: var(--link);
  text-decoration: none;
  transition: color var(--dur) var(--ease);
}
a:hover { color: var(--brand-dark); }

/* ==========================================================================
   Cocoon 標準ヘッダー・ナビを非表示（カスタムヘッダーに置換）
   ※ .header-container のみ対象。フッターには影響させない
   ========================================================================== */
.header-container.fixed-header,
.header-container:not(#footer) {
  display: none !important;
}
#header {
  display: none !important;
}
.navi:not(#navi-footer):not(.navi-footer) {
  display: none !important;
}

/* Cocoon標準フッター内の余分な部分を非表示 */
#footer .footer-bottom {
  display: none;
}

/* ==========================================================================
   Custom Header Banner（1行）
   ========================================================================== */
.cm-header {
  background: var(--white);
  border-bottom: 1px solid var(--line);
  box-shadow: var(--shadow-sm);
  position: sticky;
  top: 0;
  z-index: 1000;
}
.cm-header__inner {
  max-width: var(--content-w);
  margin: 0 auto;
  padding: 0 1.25rem;
  display: flex;
  align-items: center;
  height: 64px;
  gap: 1.5rem;
}

/* --- Brand（ロゴ + タグライン） --- */
.cm-header__brand {
  display: flex;
  align-items: center;
  gap: .75rem;
  flex-shrink: 0;
}
.cm-header__logo img {
  height: 28px;
  width: auto;
  display: block;
}
.cm-header__tagline {
  font-size: var(--fs-xs);
  color: var(--text-muted);
  white-space: nowrap;
  border-left: 1px solid var(--line);
  padding-left: .75rem;
}

/* --- Navigation --- */
.cm-header__nav {
  display: flex;
  align-items: center;
  gap: .15rem;
  margin-left: auto;
}
.cm-header__nav a {
  color: var(--text-sub);
  font-size: var(--fs-sm);
  font-weight: 500;
  padding: .4rem .65rem;
  border-radius: var(--r);
  transition: color var(--dur) var(--ease), background var(--dur) var(--ease);
  white-space: nowrap;
}
.cm-header__nav a:hover {
  color: var(--brand);
  background: var(--brand-pale);
}

/* --- CTA（電話 + LINE） --- */
.cm-header__cta {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-shrink: 0;
}
.cm-header__tel {
  text-align: right;
  line-height: 1.3;
}
.cm-header__tel-num {
  display: block;
  font-size: var(--fs-sm);
  font-weight: 700;
  letter-spacing: .02em;
}
.cm-header__tel-num a {
  color: var(--text) !important;
}
.cm-header__tel-num a:hover {
  color: var(--brand) !important;
}
.cm-header__line {
  display: inline-flex;
  align-items: center;
  gap: .35rem;
  background: var(--accent);
  color: #fff !important;
  font-weight: 700;
  font-size: var(--fs-sm);
  padding: .5rem 1rem;
  border-radius: 100px;
  white-space: nowrap;
  transition: background var(--dur) var(--ease);
}
.cm-header__line:hover {
  background: var(--accent-hover);
  color: #fff !important;
}

/* --- Hamburger（モバイル用） --- */
.cm-header__hamburger {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 36px;
  height: 36px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 6px;
  margin-left: auto;
}
.cm-header__hamburger span {
  display: block;
  width: 100%;
  height: 2px;
  background: var(--text);
  border-radius: 2px;
  transition: transform var(--dur) var(--ease), opacity var(--dur) var(--ease);
}
.cm-header__hamburger.is-open span:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}
.cm-header__hamburger.is-open span:nth-child(2) {
  opacity: 0;
}
.cm-header__hamburger.is-open span:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

/* --- Mobile Menu --- */
.cm-mobile-menu {
  display: none;
  background: var(--white);
  border-bottom: 1px solid var(--line);
  box-shadow: var(--shadow);
  overflow: hidden;
  max-height: 0;
  transition: max-height .3s var(--ease);
}
.cm-mobile-menu.is-open {
  max-height: 500px;
}
.cm-mobile-menu nav {
  display: flex;
  flex-direction: column;
  padding: .5rem 0;
}
.cm-mobile-menu nav a {
  padding: .75rem 1.5rem;
  color: var(--text-sub);
  font-size: var(--fs-base);
  font-weight: 500;
  border-bottom: 1px solid var(--surface);
}
.cm-mobile-menu nav a:hover {
  background: var(--brand-pale);
  color: var(--brand);
}
.cm-mobile-menu__cta {
  display: flex;
  gap: .5rem;
  padding: .75rem 1.5rem 1rem;
}
.cm-mobile-menu__cta a {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: .35rem;
  padding: .65rem;
  font-weight: 700;
  font-size: var(--fs-sm);
  border-radius: var(--r);
  color: #fff !important;
}
.cm-mobile-menu__tel { background: var(--brand); }
.cm-mobile-menu__line { background: var(--accent); }

/* ==========================================================================
   Content Wrapper（2カラム）
   ========================================================================== */
.wrap {
  max-width: var(--content-w);
}
.content-in {
  padding-top: 1.75rem;
  display: flex;
  gap: 1.75rem;
  align-items: flex-start;
}
#main {
  flex: 1;
  min-width: 0;
  background: var(--white);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow);
  padding: 2rem;
}
#sidebar {
  width: 300px;
  flex-shrink: 0;
  background: var(--white);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow);
  padding: 1.5rem;
  position: sticky;
  top: 80px;
}

/* ==========================================================================
   Entry Cards（一覧）
   ========================================================================== */
.a-wrap {
  border-radius: var(--r);
  border: 1px solid var(--line);
  overflow: hidden;
  background: var(--white);
  box-shadow: var(--shadow-sm);
  transition: transform var(--dur) var(--ease), box-shadow var(--dur) var(--ease);
}
.a-wrap:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
  color: var(--text);
}
.entry-card {
  border: none;
  background: transparent;
}
.entry-card-thumb,
.widget-entry-card-thumb {
  overflow: hidden;
}
.entry-card-thumb img,
.widget-entry-card-thumb img {
  aspect-ratio: 16 / 10;
  object-fit: cover;
  width: 100%;
  display: block;
  transition: transform .4s var(--ease);
}
.a-wrap:hover .entry-card-thumb img {
  transform: scale(1.03);
}
.entry-card-content {
  padding: .75rem 1rem 1rem;
}
.cat-label {
  display: inline-block;
  background: var(--brand-pale);
  color: var(--brand);
  font-size: var(--fs-xs);
  font-weight: 600;
  padding: .15rem .6rem;
  border-radius: 100px;
}
.entry-card-title,
.card-title {
  font-weight: 700;
  color: var(--text);
  font-size: var(--fs-md);
  line-height: 1.45;
  margin-top: .35rem;
  transition: color var(--dur) var(--ease);
}
.a-wrap:hover .entry-card-title,
.a-wrap:hover .card-title {
  color: var(--brand);
}
.entry-card-snippet {
  color: var(--text-muted);
  font-size: var(--fs-sm);
  margin-top: .3rem;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.entry-date,
.post-date {
  color: var(--text-muted);
  font-size: var(--fs-xs);
}

/* ==========================================================================
   Article Page（記事詳細）
   ========================================================================== */
.article h1.entry-title {
  font-size: var(--fs-3xl);
  font-weight: 900;
  line-height: 1.35;
  margin-bottom: .75rem;
}
.eye-catch img {
  border-radius: var(--r);
}
.entry-content {
  font-size: var(--fs-md);
  line-height: var(--lh);
}
.entry-content p {
  margin-bottom: 1.6em;
}
.entry-content h2 {
  font-size: var(--fs-2xl);
  font-weight: 900;
  margin: 3rem 0 1rem;
  padding: .55rem 0 .55rem .85rem;
  border-left: 4px solid var(--brand);
  background: var(--brand-pale);
  border-radius: 0 var(--r) var(--r) 0;
  line-height: 1.35;
}
.entry-content h3 {
  font-size: var(--fs-xl);
  font-weight: 700;
  margin: 2.5rem 0 .75rem;
  padding-bottom: .4rem;
  border-bottom: 2px solid var(--line);
  line-height: 1.4;
}
.entry-content h4 {
  font-weight: 700;
  margin: 2rem 0 .5rem;
  color: var(--text-sub);
}
.entry-content blockquote {
  border-left: 3px solid var(--brand);
  background: var(--surface);
  padding: 1rem 1.25rem;
  margin: 1.5rem 0;
  border-radius: 0 var(--r) var(--r) 0;
  color: var(--text-sub);
}
.entry-content a { color: var(--link); }
.entry-content a:hover { text-decoration: underline; }
.entry-content img { border-radius: var(--r); }
.entry-content figcaption {
  font-size: var(--fs-xs);
  color: var(--text-muted);
  margin-top: .3rem;
}
.entry-content table {
  width: 100%;
  border-collapse: collapse;
  margin: 1.5rem 0;
  font-size: var(--fs-base);
}
.entry-content th {
  background: var(--brand-pale);
  font-weight: 700;
  text-align: left;
  color: var(--brand-dark);
}
.entry-content th,
.entry-content td {
  padding: .55rem .75rem;
  border: 1px solid var(--line);
}
.entry-content tr:nth-child(even) td {
  background: var(--surface);
}
.entry-content ul,
.entry-content ol {
  padding-left: 1.5rem;
  margin-bottom: 1.5rem;
}
.entry-content li { margin-bottom: .4rem; }
.entry-content code {
  background: var(--surface);
  padding: .1em .35em;
  border-radius: 3px;
  font-size: .875em;
}
.entry-content pre {
  background: var(--surface);
  padding: 1rem;
  border-radius: var(--r);
  overflow-x: auto;
  margin: 1.5rem 0;
}

/* ==========================================================================
   TOC
   ========================================================================== */
.toc {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r);
  padding: 1.25rem 1.5rem;
}
.toc-title { font-weight: 700; color: var(--text); }
.toc a { color: var(--text-sub); }
.toc a:hover { color: var(--brand); }

/* ==========================================================================
   Sidebar
   ========================================================================== */
.sidebar { font-size: var(--fs-base); }
.sidebar .widget-title {
  font-weight: 700;
  font-size: var(--fs-base);
  color: var(--text);
  padding: .4rem 0 .4rem .7rem;
  border-left: 3px solid var(--brand);
  margin-bottom: .75rem;
}
.sidebar .widget-entry-card-link {
  border-radius: var(--r);
  transition: background var(--dur) var(--ease);
}
.sidebar .widget-entry-card-link:hover {
  background: var(--surface);
}
.widget-entry-card-title { font-size: var(--fs-sm); }

/* ==========================================================================
   Related / Pagination
   ========================================================================== */
.related-entry-card-wrap {
  border-radius: var(--r);
  overflow: hidden;
  border: 1px solid var(--line);
  box-shadow: var(--shadow-sm);
  transition: transform var(--dur) var(--ease), box-shadow var(--dur) var(--ease);
}
.related-entry-card-wrap:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}
.pagination .page-numbers {
  border: 1px solid var(--line);
  border-radius: var(--r);
  color: var(--text-sub);
  padding: .4rem .75rem;
  font-size: var(--fs-sm);
  transition: all var(--dur) var(--ease);
}
.pagination .page-numbers:hover {
  background: var(--brand-pale);
  color: var(--brand);
  border-color: var(--brand);
}
.pagination .page-numbers.current {
  background: var(--brand);
  color: #fff;
  border-color: var(--brand);
}

/* ==========================================================================
   Breadcrumb
   ========================================================================== */
.breadcrumb {
  font-size: var(--fs-xs);
  color: var(--text-muted);
}
.breadcrumb a { color: var(--text-sub); }
.breadcrumb a:hover { color: var(--brand); }

/* ==========================================================================
   Footer
   ========================================================================== */
/* Cocoon標準フッター */
#footer,
#footer .footer-in,
#footer .wrap {
  background: #fff !important;
}
.cm-footer {
  background: #fff !important;
  color: var(--text-sub);
  border: none;
}
#footer {
  border-top: 1px solid var(--line) !important;
  padding: 0 !important;
}
#footer a { color: var(--text-sub); }
#footer a:hover { color: var(--brand); }
#footer .footer-bottom {
  display: none !important;
}

/* Custom footer（3カラム） */
.cm-footer {
  max-width: var(--content-w);
  margin: 0 auto;
  padding: 3rem 1.25rem 1.5rem;
}
.cm-footer__inner {
  display: flex;
  align-items: flex-start;
  gap: 2.5rem;
  flex-wrap: wrap;
}

/* 左カラム：会社情報 */
.cm-footer__col--brand {
  flex: 1 1 320px;
  min-width: 280px;
}
.cm-footer__logo img {
  height: 26px;
  width: auto;
}
.cm-footer__tagline {
  font-size: var(--fs-xs);
  color: var(--text-muted);
  margin-top: .4rem;
}
.cm-footer__address {
  margin-top: 1rem;
  font-size: var(--fs-sm);
  line-height: 1.8;
  color: var(--text-sub);
}
.cm-footer__address a {
  color: var(--text-sub) !important;
}
.cm-footer__address a:hover {
  color: var(--brand) !important;
}
.cm-footer__tel-group {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0 .75rem;
}
.cm-footer__tel-label {
  font-size: var(--fs-xs);
  color: var(--text-muted);
  margin-right: .25rem;
}
.cm-footer__sns {
  margin-top: 1rem;
}
.cm-footer__sns-line {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--surface);
  color: var(--accent) !important;
  transition: background var(--dur) var(--ease), color var(--dur) var(--ease);
}
.cm-footer__sns-line:hover {
  background: var(--accent);
  color: #fff !important;
}

/* 中央・右カラム：リンクリスト共通 */
.cm-footer__col--info,
.cm-footer__col--blog {
  flex: 0 1 180px;
  min-width: 150px;
}
.cm-footer__col-title {
  font-weight: 700;
  font-size: var(--fs-sm);
  color: var(--text);
  margin-bottom: .75rem;
  padding-bottom: .5rem;
  border-bottom: 2px solid var(--brand);
}
.cm-footer__col ul {
  list-style: none;
  margin: 0;
  padding: 0;
}
.cm-footer__col li {
  margin-bottom: .35rem;
}
.cm-footer__col li a {
  color: var(--text-sub) !important;
  font-size: var(--fs-sm);
  transition: color var(--dur) var(--ease);
}
.cm-footer__col li a:hover {
  color: var(--brand) !important;
}

/* コピーライト */
.cm-footer__copy {
  text-align: center;
  font-size: var(--fs-xs);
  color: var(--text-muted);
  margin-top: 2.5rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--line);
}

/* ==========================================================================
   Mobile Floating CTA
   ========================================================================== */
.cm-floatcta { display: none; }
@media (max-width: 767px) {
  .cm-floatcta {
    display: flex;
    position: fixed;
    left: 0; right: 0; bottom: 0;
    z-index: 1100;
    box-shadow: 0 -2px 12px rgba(0,0,0,.12);
  }
  .cm-floatcta a {
    flex: 1;
    text-align: center;
    padding: .7rem;
    font-weight: 700;
    font-size: var(--fs-sm);
    color: #fff !important;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: .35rem;
    min-height: 48px;
  }
  .cm-floatcta__tel { background: var(--brand); }
  .cm-floatcta__line { background: var(--accent); }
  body { padding-bottom: 52px; }
}

/* ==========================================================================
   Focus
   ========================================================================== */
:focus-visible {
  outline: 2px solid var(--brand);
  outline-offset: 2px;
}

/* ==========================================================================
   Responsive
   ========================================================================== */

/* Tablet: ナビ・電話を隠す、ハンバーガー表示 */
@media (max-width: 1023px) {
  .cm-header__nav,
  .cm-header__cta {
    display: none;
  }
  .cm-header__hamburger {
    display: flex;
  }
  .cm-mobile-menu {
    display: block;
  }
}

/* Tablet: 1カラム化 */
@media (max-width: 834px) {
  .content-in {
    flex-direction: column;
  }
  #sidebar {
    width: 100%;
    position: static;
  }
}

/* SP */
@media (max-width: 767px) {
  .cm-header__inner {
    height: 56px;
    padding: 0 1rem;
  }
  .cm-header__logo img {
    height: 22px;
  }
  .cm-header__tagline {
    display: none;
  }
  #main {
    padding: 1.25rem;
    border-radius: var(--r);
  }
  #sidebar {
    padding: 1.25rem;
    border-radius: var(--r);
  }
  .content-in {
    padding-top: 1rem;
  }
}
@media (max-width: 480px) {
  .entry-content h2 { font-size: 1.15rem; }
  .article h1.entry-title { font-size: 1.3rem; }
  .cm-footer__inner {
    flex-direction: column;
    gap: 1.5rem;
  }
  .cm-footer__col--info,
  .cm-footer__col--blog {
    flex-basis: 100%;
  }
}
