/* ======================
   🎯 トップロゴ 調整（統合・簡潔版）
   ====================== */
.top-logo {
  width: 100%;
  height: auto;
  display: block;
  margin: 0 auto;
  object-fit: contain;
}

.logo-frame {
  width: 500px;
  padding: 8px;
  text-align: center;
  margin: 0 auto;
}

.top-hero img.top-logo {
  display: block !important;
  margin: 0 auto !important;
  max-width: 460px !important;
  height: auto !important;
}

/*キャッチコピーを中央寄せ */
.catch-copy {
  text-align: center;
  font-size: 1.5em; /* サイズ調整 */
  font-weight: 600; /* 太字など */
  margin: 1.5em auto;
  max-width: 90%;   /* はみ出し防止 */
}

/* 中央寄せが必要なときだけ明示的に使用 */
.center-title {
  text-align: center;
  margin: 1em 0;
}

/* h1, h2 の中央寄せは解除してデフォルトに戻す */
.entry-content h1,
.entry-content h2 {
  text-align: inherit;
}

/* ボタンを中央揃え */
.dictionary-buttons {
  display: flex;
  justify-content: center;
  gap: 1em; /* ボタン同士の間隔 */
  margin: 1.5em auto;
}

.dictionary-btn {
  text-decoration: none;
  padding: 0.6em 1.2em;
  border-radius: 8px;
  background-color: #f5f5f5;
  border: 1px solid #ccc;
  font-weight: bold;
  transition: background-color 0.3s ease;
}

.dictionary-btn:hover {
  background-color: #e0e0e0;
}

/* キャッチコピーの中央寄せ */
.top-hero .catch-copy {
  text-align: center !important;
  font-size: 1.2em;
  margin-top: 1rem;
}

/*
body::before {
  content: "🌱 CSSは読み込まれています";
  position: fixed;
  top: 0;
  left: 0;
  background: yellow;
  padding: 4px 8px;
  font-weight: bold;
  z-index: 9999;
}
*/

/* 📚 一覧タイトル中央寄せ */
.center-title,
.center-title h2 {
  text-align: center;
  margin: 1em auto;
}

/* サイドバー落下防止：ロゴのサイズを制限 */
.top-logo {
  max-width: 240px; /* 必要に応じて微調整（例: 200〜300）*/
  height: auto;
  display: block;
  margin: 0 auto;
  box-sizing: border-box;
}

/* 全体レイアウト修正（必要な場合） */
#content {
  display: flex;
  flex-wrap: wrap;
}
#primary {
  flex: 1 1 70%;
}
#secondary {
  flex: 1 1 30%;
}

/* 「紅茶のことば一覧」ブロックを中央寄せ */
.wp-block-buttons-is-layout-flex {
  justify-content: center;
}

/* セクション全体の中央寄せと幅調整 */
.front-content .max-w-xl {
  margin-left: auto !important;
  margin-right: auto !important;
  text-align: center !important;
}

/* 見出しの中央寄せ */
.front-content h3 {
  text-align: center !important;
}

/* サイドバー落下防止対策 */
.content-area.with-sidebar {
  display: flex;
  flex-wrap: wrap;
}

#primary.site-main {
  flex: 1 1 65%;
  min-width: 300px;
}

#secondary.site-sidebar {
  flex: 1 1 30%;
  min-width: 250px;
}

/* --- サイドバー落下防止・2カラム固定化 --- */
.content-area.with-sidebar {
  display: flex;
  flex-wrap: nowrap; /* wrapしないことで横並びを維持 */
  align-items: flex-start;
}

#primary.site-main {
  flex: 0 1 auto;
  width: 70%;
  min-width: 300px;
}

#secondary.site-sidebar {
  flex: 0 1 auto;
  width: 30%;
  min-width: 200px;
}

/* --- コンテンツ幅の拡張（必要に応じて調整） --- */
.content-area.with-sidebar {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1rem;
}

/* 🖼 ロゴ画像（比率を保ちつつ調整） */
.top-logo {
  width: 100%;
  height: auto;
  display: block;
  object-fit: contain;
}

/* =============================
   🎯 タグ統計ページ（page-id-4648）調整用CSS
   ============================= */

/* 🎯 ページ識別用表示（確認後削除可） */
body.page-id-4648::before {
  content: "🎯 tag CSS OK";
  position: fixed;
  top: 0.5em;
  left: 0.5em;
  background-color: yellow;
  color: black;
  padding: 2px 6px;
  font-size: 12px;
  z-index: 9999;
}

/* 🎯 統計セクション全体をflexで横並びに */
.page-id-4648 .tag-stats-content {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 2em;
  margin-bottom: 3em;
}

/* 🎯 タグ使用数チャート（Chart.js部分） */
.page-id-4648 .tag-usage-chart-container {
  flex: 1 1 100%;
  max-width: 100%;
  margin-bottom: 2em;
}

/* 🎯 タグクラウド（WordCloud.js部分） */
.page-id-4648 .tag-wordcloud-container {
  flex: 2 1 600px;
  max-width: 800px;
  min-width: 300px;
  margin: 0 auto;
}

/* 🎯 Canvas 自体の幅調整 */
.page-id-4648 #tagwordCloud {
  width: 100% !important;
  height: auto !important;
  display: block;
}

/* 🎯 サイドバー */
.page-id-4648 .site-sidebar {
  flex: 1 1 240px;
  min-width: 240px;
}

/* 🎯 タグ一覧リスト（ul）横並び調整） */
.page-id-4648 .tag-list-container ul.word-cloud {
  display: flex;
  flex-wrap: wrap;
  gap: 1.2em;
  padding-left: 1em;
}

body.page-id-4648 canvas#tagwordCloud {
  display: block;
  margin: 0 auto;
  max-width: 100%;
}

/* タグクラウド用 canvas の中央寄せ */
body.page-id-4648 #tagwordCloud {
  display: block;
  margin-left: auto;
  margin-right: auto;
  max-width: 100%;
  height: auto;
}

/* 親コンテナにも制限をかけると効果的 */
body.page-id-4648 .tag-wordcloud-container {
  text-align: center;
  width: 100%;
  max-width: 800px;
  margin: 0 auto;
}

body.page-id-4648 #tagwordCloud {
}

body.page-id-4648 #tagwordCloud {
  display: block !important;
  margin: 0 auto !important;
  width: 100% !important;
  height: auto !important;
  max-width: 800px !important;
}

body.page-id-4648 .tag-wordcloud-container {
  text-align: center !important;
  max-width: 100% !important;
  margin: 2em auto !important;
}

/* canvasの外側ラッパーを整える（page-id限定）*/
body.page-id-4648 .tag-wordcloud-container {
  max-width: 100%;
  margin: 2em auto;
  text-align: center;
  padding: 1rem;
 /*  border: 2px dashed red; /* テスト確認用 */
 /*background-color: #fdfbe7; */
}

body.page-id-4648 canvas#tagwordCloud {
  width: 100% !important;
  height: auto !important;
  display: block;
  margin: 0 auto;
}
/* CSSでcanvasを幅制限 */
#tagwordCloud {
  width: 100%;
  max-width: 100%;
  height: auto;
  display: block;
  margin: 0 auto;
}
/*  */
/* タグクラウド canvas のレイアウト補正 */
#tagWordCloud {
  display: block;
  max-width: 100%;
  height: auto;
  margin: 0 auto;
}

.tag-wordcloud-container {
  max-width: 100%;
  padding: 1em;
  box-sizing: border-box;
  margin: 2em auto;
  text-align: center;

}

.tag-wordcloud-container h2 {
  text-align: left;
}

.tag-wordcloud-container {
  max-width: 880px;
  margin: 2em auto;
}

/* ことば辞典サイドバーの位置 */
.content-area {
  display: flex;
  gap: 20px;
  align-items: flex-start;
}

.site-main {
  flex: 1 1 70%;
  min-width: 0;
}

.site-sidebar {
  flex: 0 0 28%;
  min-width: 250px;
}

/*サイドバー対策*/
body.single-tea_term .content-area.with-sidebar {
  display: flex;
  flex-wrap: nowrap;
  align-items: flex-start;
  gap: 20px;
}

body.single-tea_term #primary.site-main {
  flex: 1 1 70%;
  min-width: 300px;
}

body.single-tea_term #secondary.site-sidebar,
body.single-tea_term .site-sidebar {
  flex: 0 0 30%;
  min-width: 250px;
}

.content-wrapper {
  display: flex;
  flex-wrap: nowrap;
  gap: 2rem;
  align-items: flex-start;
}

.main-content {
  flex: 3;
  min-width: 0;
}

.sidebar {
  flex: 1;
}

/*ことば辞典アーカイブCard形式*/
.card {
  border: 1px solid #ddd;
  border-radius: 12px;
  padding: 1rem;
  margin-bottom: 1.5rem;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  background: #fff;
}

.card:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 16px rgba(0,0,0,0.1);
}

.card-link {
  text-decoration: none;
  color: inherit;
  display: block;
}