/* =========================================================
   Clean Navigator - Phase1 (Cocoon)
   white + light blue + card UI
   ========================================================= */

/* ---------- 1) Design Tokens ---------- */
:root {
  --cn-blue-dark: #0B3A6E;   /* 見出し/CTA/強調 */
  --cn-blue-main: #1F6FEB;   /* 主要ボタン */
  --cn-blue-pale: #EAF4FF;   /* 薄い青背景 */
  --cn-blue-section: #F5FAFF;/* セクション薄青 */
  --cn-border: #D7E6FF;      /* 境界線 */
  --cn-text: #0F172A;        /* 本文 */
  --cn-white: #FFFFFF;

  --cn-radius-md: 12px;
  --cn-radius-lg: 16px;
  --cn-shadow: 0 2px 10px rgba(15, 23, 42, 0.04);

  --cn-space-1: 8px;
  --cn-space-2: 12px;
  --cn-space-3: 16px;
  --cn-space-4: 24px;
  --cn-space-5: 32px;
}

/* ---------- 2) Base ---------- */
html, body {
  background: var(--cn-blue-pale);
  color: var(--cn-text);
}

body {
  line-height: 1.75;
  letter-spacing: 0.01em;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

a {
  color: var(--cn-blue-main);
  text-decoration-thickness: 1px;
  text-underline-offset: 2px;
}
a:hover {
  color: var(--cn-blue-dark);
}

/* ---------- 3) Layout + Card unify ---------- */
/* Cocoonメインエリアの白カード化 */
#main,
.main,
.content,
.content-in,
#main .main,
#main .entry,
#main .article {
  background: var(--cn-white);
  border: 1px solid var(--cn-border);
  border-radius: var(--cn-radius-lg);
  box-shadow: var(--cn-shadow);
}

/* 内側余白調整（過剰上書き防止で主要コンテナ中心） */
.main .entry-content,
.article .entry-content,
.content-in {
  padding: clamp(16px, 2.5vw, 32px);
}

/* セクションの視認性 */
.entry-content > section,
.entry-content > .wp-block-group {
  background: var(--cn-blue-section);
  border: 1px solid var(--cn-border);
  border-radius: var(--cn-radius-md);
  padding: clamp(14px, 2vw, 24px);
  margin: 0 0 var(--cn-space-4);
}

/* ---------- 4) Heading style ---------- */
.entry-content h2,
.article h2,
h2 {
  color: var(--cn-blue-dark);
  font-size: clamp(1.3rem, 2.2vw, 1.7rem);
  line-height: 1.4;
  border-left: 6px solid var(--cn-blue-main);
  padding: 0.25em 0 0.25em 0.7em;
  margin: 1.8em 0 0.9em;
  background: linear-gradient(to right, #f7fbff 0%, #ffffff 100%);
  border-radius: 6px;
}

.entry-content h3,
.article h3,
h3 {
  color: var(--cn-blue-dark);
  font-size: clamp(1.1rem, 1.8vw, 1.3rem);
  line-height: 1.5;
  margin: 1.5em 0 0.7em;
  padding-bottom: 0.35em;
  border-bottom: 2px solid var(--cn-border);
}

.entry-content h4,
.article h4,
h4 {
  color: var(--cn-blue-dark);
  font-size: clamp(1rem, 1.4vw, 1.1rem);
  margin: 1.2em 0 0.5em;
}

/* ---------- 5) Sidebar card unify ---------- */
#sidebar,
.sidebar {
  gap: var(--cn-space-3);
}

#sidebar .widget,
.sidebar .widget {
  background: var(--cn-white);
  border: 1px solid var(--cn-border);
  border-radius: var(--cn-radius-md);
  box-shadow: var(--cn-shadow);
  padding: var(--cn-space-3);
  margin-bottom: var(--cn-space-3);
}

#sidebar .widget-title,
.sidebar .widget-title {
  color: var(--cn-blue-dark);
  font-size: 1rem;
  line-height: 1.4;
  margin-bottom: var(--cn-space-2);
  padding-left: 0.6em;
  border-left: 4px solid var(--cn-blue-main);
}

/* ---------- 6) Button system ---------- */
/* 主ボタン */
button,
input[type="submit"],
input[type="button"],
.wp-block-button__link,
.btn,
a.btn,
.pagination-next-link {
  background: var(--cn-blue-main);
  color: #fff;
  border: 1px solid var(--cn-blue-main);
  border-radius: 10px;
  padding: 0.7em 1.05em;
  font-weight: 700;
  line-height: 1.3;
  text-decoration: none;
  transition: background-color .2s ease, border-color .2s ease, transform .12s ease;
  min-height: 44px;
}

button:hover,
input[type="submit"]:hover,
input[type="button"]:hover,
.wp-block-button__link:hover,
.btn:hover,
a.btn:hover,
.pagination-next-link:hover {
  background: var(--cn-blue-dark);
  border-color: var(--cn-blue-dark);
  color: #fff;
  transform: translateY(-1px);
}

/* 副ボタン（Cocoon側にoutline系がある場合を吸収） */
.btn-outline,
a.btn-outline,
.is-style-outline .wp-block-button__link,
input[type="reset"] {
  background: #fff !important;
  color: var(--cn-blue-main) !important;
  border: 1px solid var(--cn-blue-main) !important;
}

/* ---------- 7) Form/readability ---------- */
input[type="text"],
input[type="search"],
input[type="email"],
textarea,
select {
  border: 1px solid var(--cn-border);
  border-radius: 10px;
  background: #fff;
  color: var(--cn-text);
}

input:focus,
textarea:focus,
select:focus {
  outline: 2px solid rgba(31, 111, 235, 0.25);
  border-color: var(--cn-blue-main);
  box-shadow: 0 0 0 2px rgba(31, 111, 235, 0.12);
}

/* ---------- 8) Mobile ---------- */
@media (max-width: 768px) {
  #main,
  .main,
  .content,
  .content-in,
  #main .entry,
  #main .article {
    border-radius: 12px;
  }

  .main .entry-content,
  .article .entry-content,
  .content-in {
    padding: 14px;
  }

  #sidebar .widget,
  .sidebar .widget {
    padding: 12px;
  }

  button,
  input[type="submit"],
  input[type="button"],
  .wp-block-button__link,
  .btn,
  a.btn,
  .pagination-next-link {
    width: 100%;
    justify-content: center;
  }
}

/* =========================================================
   Clean Navigator - Phase2 (Top page only)
   scope: body.home / body.front-page
   Optional block classes:
   - top-hero: ヒーロー領域
   - top-stepmap: ステップマップ領域
   - top-feature-nav: 導線ナビ領域
   - top-toc: 案内/目次領域
   ========================================================= */

/* ---------- Top layout breathing room ---------- */
body.home #main,
body.front-page #main {
  padding-top: clamp(12px, 2vw, 24px);
}

body.home .content-in,
body.front-page .content-in {
  gap: clamp(16px, 2.8vw, 32px);
}

body.home .entry-content > * + *,
body.front-page .entry-content > * + * {
  margin-top: clamp(14px, 2vw, 24px);
}

/* ---------- A) Hero ---------- */
/* 推奨: ヒーローに top-hero を付与 */
body.home .top-hero,
body.front-page .top-hero {
  background: var(--cn-blue-section);
  border: 1px solid var(--cn-border);
  border-radius: var(--cn-radius-lg);
  padding: clamp(16px, 3vw, 32px);
}

body.home .top-hero :is(h1, h2, h3),
body.front-page .top-hero :is(h1, h2, h3) {
  color: var(--cn-blue-dark);
  line-height: 1.35;
}

body.home .top-hero :is(p, li),
body.front-page .top-hero :is(p, li) {
  color: var(--cn-text);
  line-height: 1.85;
  font-size: clamp(0.98rem, 1.2vw, 1.08rem);
}

body.home .top-hero img,
body.front-page .top-hero img {
  display: block;
  width: 100%;
  max-width: 1100px;
  margin-inline: auto;
  border-radius: var(--cn-radius-lg);
  box-shadow: 0 6px 18px rgba(15, 23, 42, 0.06);
}

/* クラス未設定時のフォールバック（トップ最上部の画像/カバー） */
body.home .entry-content > .wp-block-image:first-child img,
body.front-page .entry-content > .wp-block-image:first-child img,
body.home .entry-content > .wp-block-cover:first-child,
body.front-page .entry-content > .wp-block-cover:first-child {
  border-radius: var(--cn-radius-lg);
  box-shadow: 0 6px 18px rgba(15, 23, 42, 0.06);
  overflow: hidden;
}

/* ---------- B) Step map ---------- */
/* 推奨: ステップマップを包むグループに top-stepmap を付与 */
body.home .top-stepmap,
body.front-page .top-stepmap {
  background: var(--cn-blue-section);
  border: 1px solid var(--cn-border);
  border-radius: var(--cn-radius-lg);
  padding: clamp(16px, 2.8vw, 28px);
}

body.home .top-stepmap img,
body.front-page .top-stepmap img {
  display: block;
  width: min(100%, 760px);
  margin-inline: auto;
  border-radius: 14px;
  border: 1px solid var(--cn-border);
  background: #fff;
  box-shadow: 0 6px 18px rgba(15, 23, 42, 0.05);
}

/* クラス未設定時: step系画像名/altを緩く吸収 */
body.home .entry-content img[src*="step"],
body.front-page .entry-content img[src*="step"],
body.home .entry-content img[alt*="step" i],
body.front-page .entry-content img[alt*="step" i] {
  display: block;
  width: min(100%, 760px);
  margin-inline: auto;
  border-radius: 14px;
}

/* ---------- C) Entry cards ---------- */
/* Cocoon標準カードをトップのみで統一 */
body.home :is(.a-wrap, .entry-card-wrap, .widget-entry-card-link, .related-entry-card-wrap),
body.front-page :is(.a-wrap, .entry-card-wrap, .widget-entry-card-link, .related-entry-card-wrap) {
  background: #fff;
  border: 1px solid var(--cn-border);
  border-radius: 14px;
  box-shadow: 0 4px 14px rgba(15, 23, 42, 0.05);
  transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}

body.home :is(.a-wrap, .entry-card-wrap, .widget-entry-card-link):hover,
body.front-page :is(.a-wrap, .entry-card-wrap, .widget-entry-card-link):hover {
  transform: translateY(-2px);
  border-color: #c7ddff;
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.08);
}

body.home :is(.a-wrap img, .entry-card-thumb img, .widget-entry-card-thumb img),
body.front-page :is(.a-wrap img, .entry-card-thumb img, .widget-entry-card-thumb img) {
  border-radius: 12px;
}

body.home :is(.entry-card-title, .card-title, .widget-entry-card-title),
body.front-page :is(.entry-card-title, .card-title, .widget-entry-card-title) {
  color: var(--cn-blue-dark);
  line-height: 1.55;
  letter-spacing: 0.01em;
}

/* ---------- D) Sidebar ---------- */
body.home #sidebar .widget,
body.front-page #sidebar .widget {
  background: #fff;
  border: 1px solid var(--cn-border);
  border-radius: 14px;
  box-shadow: 0 4px 14px rgba(15, 23, 42, 0.05);
  padding: clamp(12px, 1.8vw, 18px);
}

body.home #sidebar .widget-title,
body.front-page #sidebar .widget-title {
  color: var(--cn-blue-dark);
  border-left: 4px solid var(--cn-blue-main);
  padding-left: 0.6em;
  line-height: 1.45;
  margin-bottom: 10px;
}

body.home #sidebar .widget :is(li, p),
body.front-page #sidebar .widget :is(li, p) {
  line-height: 1.75;
}

body.home #sidebar .widget a,
body.front-page #sidebar .widget a {
  color: var(--cn-text);
}

body.home #sidebar .widget a:hover,
body.front-page #sidebar .widget a:hover {
  color: var(--cn-blue-main);
}

/* Sidebar card readability: thumbnail 40% + title 2 lines */
#sidebar :is(.widget-entry-card-link, .new-entry-card-link, .popular-entry-card-link, .a-wrap),
.sidebar :is(.widget-entry-card-link, .new-entry-card-link, .popular-entry-card-link, .a-wrap) {
  display: grid !important;
  grid-template-columns: 42% minmax(0, 1fr) !important;
  align-items: center;
  gap: 10px;
  padding: 8px;
  min-height: 86px;
}

#sidebar :is(.widget-entry-card-thumb, .new-entry-card-thumb, .popular-entry-card-thumb, .card-thumb),
.sidebar :is(.widget-entry-card-thumb, .new-entry-card-thumb, .popular-entry-card-thumb, .card-thumb) {
  width: 100%;
  margin: 0;
}

#sidebar :is(.widget-entry-card-thumb img, .new-entry-card-thumb img, .popular-entry-card-thumb img, .card-thumb img),
.sidebar :is(.widget-entry-card-thumb img, .new-entry-card-thumb img, .popular-entry-card-thumb img, .card-thumb img) {
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  border-radius: 10px;
}

#sidebar :is(.widget-entry-card-content, .new-entry-card-content, .popular-entry-card-content, .card-content),
.sidebar :is(.widget-entry-card-content, .new-entry-card-content, .popular-entry-card-content, .card-content) {
  min-width: 0;
}

#sidebar :is(.widget-entry-card-title, .new-entry-card-title, .popular-entry-card-title, .card-title),
.sidebar :is(.widget-entry-card-title, .new-entry-card-title, .popular-entry-card-title, .card-title) {
  margin: 0;
  font-size: 14px;
  line-height: 1.45;
  font-weight: 600;
  color: #1e2b43;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-overflow: ellipsis;
  word-break: normal;
  overflow-wrap: anywhere;
}

/* ---------- Optional nav/toc block ---------- */
/* 推奨: 導線ブロックに top-feature-nav / top-toc を付与 */
body.home .top-feature-nav,
body.front-page .top-feature-nav,
body.home .top-toc,
body.front-page .top-toc {
  background: #fff;
  border: 1px solid var(--cn-border);
  border-radius: 14px;
  padding: clamp(14px, 2.2vw, 22px);
  box-shadow: 0 4px 14px rgba(15, 23, 42, 0.05);
}

/* ---------- Mobile safety ---------- */
@media (max-width: 768px) {
  body.home .top-hero,
  body.front-page .top-hero,
  body.home .top-stepmap,
  body.front-page .top-stepmap,
  body.home .top-feature-nav,
  body.front-page .top-feature-nav,
  body.home .top-toc,
  body.front-page .top-toc {
    padding: 14px;
    border-radius: 12px;
  }

  body.home .entry-content img,
  body.front-page .entry-content img {
    max-width: 100%;
    height: auto;
  }

  /* バナー/カラムの崩れ防止 */
  body.home .entry-content .wp-block-columns,
  body.front-page .entry-content .wp-block-columns {
    gap: 12px;
  }
}

/* =========================================================
   Top page polish (professional + friendly)
   1) 余白階層
   2) 二重カード軽減
   3) 色トーン整理
   4) タイポ改善
   ========================================================= */

/* ---------- 1) Spacing hierarchy ---------- */
body.home .entry-content,
body.front-page .entry-content {
  padding-top: clamp(18px, 3vw, 34px);
}

body.home .entry-content > :is(.wp-block-image, .wp-block-cover, .wp-block-group, .wp-block-columns),
body.front-page .entry-content > :is(.wp-block-image, .wp-block-cover, .wp-block-group, .wp-block-columns) {
  margin-block: clamp(18px, 3vw, 36px);
}

/* ---------- 2) Reduce nested frame look ---------- */
body.home.no-sidebar #main,
body.front-page.no-sidebar #main {
  max-width: min(920px, 94vw);
  margin-inline: auto;
  border-radius: 16px;
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.06);
}

body.home :is(.content, .content-in, #main .main, #main .entry, #main .article),
body.front-page :is(.content, .content-in, #main .main, #main .entry, #main .article) {
  border: 0;
  box-shadow: none;
  border-radius: 0;
  background: transparent;
}

/* ---------- 3) Tone control (less noisy) ---------- */
body.home :is(.sns-share, .sns-share-buttons, .share-buttons, .sns-buttons),
body.front-page :is(.sns-share, .sns-share-buttons, .share-buttons, .sns-buttons) {
  background: var(--cn-blue-section);
  border: 1px solid var(--cn-border);
  border-radius: 12px;
  padding: 10px;
}

body.home :is(.sns-share a, .sns-share-buttons a, .share-button, .sns-btn),
body.front-page :is(.sns-share a, .sns-share-buttons a, .share-button, .sns-btn) {
  border-radius: 10px;
  box-shadow: none;
  transform: none;
  filter: saturate(0.9) contrast(0.98);
}

body.home :is(#toc, .toc),
body.front-page :is(#toc, .toc) {
  background: #fff;
  border: 1px solid var(--cn-border);
  border-radius: 14px;
  box-shadow: 0 6px 18px rgba(15, 23, 42, 0.05);
  padding: clamp(14px, 2vw, 20px);
  max-width: 560px;
  margin: clamp(20px, 3vw, 34px) auto;
}

body.home :is(#toc, .toc) :is(li, a),
body.front-page :is(#toc, .toc) :is(li, a) {
  line-height: 1.7;
}

/* ---------- 4) Typography ---------- */
body.home .entry-content :is(p, li),
body.front-page .entry-content :is(p, li) {
  color: #1e2b43;
  line-height: 1.9;
  font-size: clamp(0.98rem, 1.15vw, 1.06rem);
}

body.home .entry-content h2,
body.front-page .entry-content h2 {
  margin-top: clamp(26px, 4vw, 44px);
  margin-bottom: clamp(14px, 2vw, 20px);
}

body.home .entry-content h3,
body.front-page .entry-content h3 {
  margin-top: clamp(18px, 2.8vw, 30px);
  margin-bottom: 12px;
}

/* Top image links (navigation-like banners) */
body.home .entry-content a img,
body.front-page .entry-content a img {
  border-radius: 12px;
}

/* Step map visual spacing */
body.home :is(.top-stepmap img, .entry-content img[src*="step"], .entry-content img[alt*="step" i]),
body.front-page :is(.top-stepmap img, .entry-content img[src*="step"], .entry-content img[alt*="step" i]) {
  margin-block: clamp(16px, 2.6vw, 28px);
}

@media (max-width: 768px) {
  body.home #main,
  body.front-page #main {
    max-width: 96vw;
    border-radius: 12px;
  }

  body.home :is(#toc, .toc),
  body.front-page :is(#toc, .toc) {
    max-width: 100%;
    margin-inline: 0;
  }
}

/* =========================================================
   Hotfix: sidebar drop + top recommended cards sizing
   ========================================================= */

/* 1) Sidebar should stay beside main content on desktop */
@media (min-width: 1024px) {
  body.home :is(#content, #content-in, .content, .content-in),
  body.front-page :is(#content, #content-in, .content, .content-in) {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 300px;
    align-items: flex-start;
    gap: clamp(20px, 2.4vw, 32px);
  }

  body.home #main,
  body.front-page #main {
    min-width: 0;
    width: 100%;
    max-width: none;
    margin: 0;
  }

  body.home #sidebar,
  body.front-page #sidebar {
    width: 100%;
    max-width: none;
    margin-top: 0;
  }
}

/* 2) Top recommended cards: less tall + cleaner spacing */
body.home :is(#recommended, .recommended, .navi-entry-cards, .recommended-cards),
body.front-page :is(#recommended, .recommended, .navi-entry-cards, .recommended-cards) {
  margin: clamp(14px, 2vw, 24px) auto clamp(22px, 3vw, 34px);
}

/* おすすめカード帯の背景色を上品に調整 */
body.home :is(#recommended, .recommended, .navi-entry-cards-wrap, .navi-entry-cards-container),
body.front-page :is(#recommended, .recommended, .navi-entry-cards-wrap, .navi-entry-cards-container) {
  background: linear-gradient(180deg, #f8fcff 0%, #f2f8ff 100%) !important;
  border-top: 1px solid var(--cn-border);
  border-bottom: 1px solid var(--cn-border);
  padding-block: clamp(12px, 2vw, 22px);
}

body.home :is(#recommended, .recommended, .navi-entry-cards, .recommended-cards) :is(ul, ol),
body.front-page :is(#recommended, .recommended, .navi-entry-cards, .recommended-cards) :is(ul, ol) {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  padding: 0;
  margin: 0;
  list-style: none;
}

body.home :is(#recommended, .recommended, .navi-entry-cards, .recommended-cards) :is(li, .menu-item, .recommended-item),
body.front-page :is(#recommended, .recommended, .navi-entry-cards, .recommended-cards) :is(li, .menu-item, .recommended-item) {
  margin: 0;
}

body.home :is(#recommended, .recommended, .navi-entry-cards, .recommended-cards) :is(a, .menu-link),
body.front-page :is(#recommended, .recommended, .navi-entry-cards, .recommended-cards) :is(a, .menu-link) {
  display: block;
  border-radius: 14px;
  overflow: hidden;
  border: 1px solid var(--cn-border);
  box-shadow: 0 4px 12px rgba(15, 23, 42, 0.05);
}

body.home :is(#recommended, .recommended, .navi-entry-cards, .recommended-cards) img,
body.front-page :is(#recommended, .recommended, .navi-entry-cards, .recommended-cards) img {
  width: 100%;
  height: auto;
  aspect-ratio: auto;
  object-fit: contain;
  display: block;
}

@media (max-width: 1023px) {
  body.home :is(#recommended, .recommended, .navi-entry-cards, .recommended-cards) :is(ul, ol),
  body.front-page :is(#recommended, .recommended, .navi-entry-cards, .recommended-cards) :is(ul, ol) {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 640px) {
  body.home :is(#recommended, .recommended, .navi-entry-cards, .recommended-cards) :is(ul, ol),
  body.front-page :is(#recommended, .recommended, .navi-entry-cards, .recommended-cards) :is(ul, ol) {
    grid-template-columns: 1fr;
  }
}

/* =========================================================
/* =========================================================
   Next step: share placement + header redesign (clean)
   ========================================================= */

/* Top page: keep only bottom share */
body.home .article .sns-share,
body.front-page .article .sns-share {
  display: none;
}

body.home .article .sns-share:last-of-type,
body.front-page .article .sns-share:last-of-type {
  display: block;
}

/* Global content centering */
:is(#content, #content-in, .content, .content-in) {
  max-width: min(1240px, 96vw);
  margin-inline: auto;
}

@media (min-width: 1024px) {
  #content.content.cf {
    max-width: min(1240px, 96vw);
    margin-inline: auto;
    display: grid;
    grid-template-columns: minmax(0, 1fr) 360px;
    column-gap: clamp(22px, 2.8vw, 38px);
    align-items: start;
  }

  #content #main.main {
    min-width: 0;
    width: 100%;
    max-width: none;
  }

  #content #sidebar.sidebar {
    width: 100%;
    max-width: none;
  }
}

/* Header base */
#header-container,
#header {
  background: #fff;
  border-bottom: 1px solid var(--cn-border);
}

#header-container {
  box-shadow: 0 4px 14px rgba(15, 23, 42, 0.04);
}

#header-container-in.header-container-in {
  max-width: min(1240px, 96vw);
  margin-inline: auto;
  padding-inline: clamp(12px, 2.2vw, 22px);
}

/* Header final layout: logo left, tagline right of logo, search far right */
#header.header.cf {
  display: flex !important;
  align-items: center !important;
  min-height: clamp(72px, 7vw, 92px);
  width: 100% !important;
  gap: 12px !important;
}

#header #header-in.header-in {
  flex: 0 0 auto !important;
  display: flex !important;
  flex-direction: row !important;
  align-items: center !important;
  justify-content: flex-start !important;
  flex-wrap: nowrap !important;
  min-width: 0 !important;
  margin: 0 !important;
  max-width: fit-content !important;
  text-align: left !important;
  overflow: visible;
}

#header #header-in .logo,
#header #header-in .logo.logo-header.logo-image {
  order: 1 !important;
  flex: 0 0 auto !important;
  margin: 0 !important;
}

#header .logo-header .site-logo-image,
#header .logo .site-logo-image,
#header .logo-image .site-logo-image,
#header .logo-header .header-site-logo-image {
  width: auto;
  height: clamp(56px, 5.8vw, 88px);
  max-width: min(540px, 86vw);
  object-fit: contain;
}

/* Use native tagline, remove pseudo tagline and decorative lines */
body.cn-has-tagline #header .logo::after {
  content: none !important;
  display: none !important;
}

#header #header-in .tagline {
  order: 2 !important;
  display: inline-block !important;
  float: none !important;
  clear: none !important;
  position: static !important;
  flex: 0 1 auto !important;
  width: auto !important;
  max-width: none !important;
  min-width: 0 !important;
  margin: 0 0 0 8px !important;
  color: #58708f !important;
  font-size: clamp(0.82rem, 0.95vw, 0.95rem) !important;
  line-height: 1.3 !important;
  white-space: nowrap !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
  border: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
}

#header #header-in .tagline::before,
#header #header-in .tagline::after,
#header .site-description::before,
#header .site-description::after,
#header .header-caption::before,
#header .header-caption::after,
#header hr {
  content: none !important;
  display: none !important;
  border: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
}

#header .site-description,
#header .header-caption {
  display: none !important;
}

/* Search button and panel */
#header .cn-header-tools {
  margin: 0 0 0 auto !important;
  justify-self: auto !important;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  position: relative !important;
}

#header .cn-search-toggle {
  width: 46px;
  height: 46px;
  border-radius: 999px;
  border: 1px solid var(--cn-border);
  background: #fff;
  color: var(--cn-blue-dark);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(15, 23, 42, 0.05);
  transition: transform .16s ease, box-shadow .16s ease, border-color .16s ease;
}

#header .cn-search-toggle:hover {
  transform: translateY(-1px);
  border-color: #b7d0ff;
  box-shadow: 0 8px 20px rgba(15, 23, 42, 0.08);
}

#header .cn-search-toggle:focus-visible {
  outline: 2px solid rgba(31, 111, 235, 0.28);
  outline-offset: 2px;
}

#header .cn-search-toggle svg {
  width: 20px;
  height: 20px;
  fill: currentColor;
}

#header .cn-header-search-panel {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  width: min(420px, 90vw);
  background: #fff;
  border: 1px solid var(--cn-border);
  border-radius: 16px;
  box-shadow: 0 14px 32px rgba(15, 23, 42, 0.12);
  padding: 10px;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: translateY(-6px);
  transition: opacity .16s ease, transform .16s ease, visibility .16s ease;
  z-index: 40;
}

#header.cn-search-open .cn-header-search-panel {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transform: translateY(0);
}

#header .cn-header-search-panel form {
  display: flex;
  align-items: center;
  gap: 8px;
}

#header .cn-header-search-panel input[type="search"] {
  flex: 1;
  min-height: 44px;
  border-radius: 12px;
  border: 1px solid var(--cn-border);
  background: #fff;
  padding: 0 12px;
  margin: 0;
}

#header .cn-header-search-panel button[type="submit"] {
  width: 44px;
  height: 44px;
  min-height: 44px;
  border-radius: 12px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

#header .cn-header-search-panel button[type="submit"] svg {
  width: 18px;
  height: 18px;
  fill: currentColor;
}

/* Hide sidebar search widget */
#sidebar .search-box,
#sidebar .search-edit,
#sidebar .widget_search {
  display: none;
}

/* Recommended band exact classes */
body.home .recommended.cf.rcs-image-only,
body.front-page .recommended.cf.rcs-image-only {
  background: #f3f8ff;
  border-top: 1px solid var(--cn-border);
  border-bottom: 1px solid var(--cn-border);
  margin: 0;
  padding: clamp(12px, 2vw, 24px) 0;
}

body.home .recommended.cf .recommended-in.cf,
body.front-page .recommended.cf .recommended-in.cf {
  max-width: min(1240px, 96vw);
  margin-inline: auto;
  padding-inline: clamp(10px, 2vw, 18px);
}

body.home .recommended .navi-entry-cards.widget-entry-cards,
body.front-page .recommended .navi-entry-cards.widget-entry-cards {
  gap: 12px;
}

body.home .recommended .navi-entry-cards .a-wrap,
body.front-page .recommended .navi-entry-cards .a-wrap {
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid var(--cn-border);
  box-shadow: 0 6px 16px rgba(15, 23, 42, 0.05);
}

@media (max-width: 767px) {
  #header-container-in.header-container-in {
    padding-inline: 10px;
  }

  #header .logo-header .site-logo-image,
  #header .logo .site-logo-image,
  #header .logo-image .site-logo-image,
  #header .logo-header .header-site-logo-image {
    height: 42px;
    max-width: 240px;
  }

  #header #header-in .tagline {
    display: none !important;
  }

  #header .cn-search-toggle {
    width: 42px;
    height: 42px;
  }

  #header .cn-header-search-panel {
    width: min(360px, calc(100vw - 20px));
    right: 0;
  }

  body.home .recommended.cf .recommended-in.cf,
  body.front-page .recommended.cf .recommended-in.cf {
    padding-inline: 8px;
  }
}
