/* ==========================================================
   CANOPUS theme - main.css
   補助用スタイル（レイアウト調整・コンポーネントなど）
   ※ベースのリセット＆タイポは style.css 側にあります
   ========================================================== */

/* --------------------------------------
   アクセシビリティ：スクリーンリーダーテキスト
   -------------------------------------- */

.screen-reader-text {
  border: 0;
  clip: rect(1px, 1px, 1px, 1px);
  clip-path: inset(50%);
  height: 1px;
  margin: -1px;
  overflow: hidden;
  padding: 0;
  position: absolute;
  width: 1px;
  word-wrap: normal !important;
}

.screen-reader-text:focus {
  background-color: #f1f1f1;
  clip: auto !important;
  clip-path: none;
  color: #21759b;
  display: block;
  font-size: 0.875rem;
  height: auto;
  left: 0.5rem;
  line-height: normal;
  padding: 0.75rem 1rem;
  text-decoration: none;
  top: 0.5rem;
  width: auto;
  z-index: 100000;
}

/* --------------------------------------
   全体レイアウト微調整
   -------------------------------------- */

.cp-page {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.cp-site-main {
  flex: 1 0 auto;
  padding-top: 2rem;
  padding-bottom: 2rem;
}

/* 記事間の余白など */
.cp-entry {
  border-bottom: 1px solid #eee;
  padding-bottom: 1.75rem;
  margin-bottom: 1.75rem;
}

.cp-entry:last-of-type {
  border-bottom: none;
}

/* アーカイブ・検索ヘッダー */
.cp-archive-header {
  margin-bottom: 1.5rem;
}

.cp-archive-description {
  margin-top: 0.5rem;
  font-size: 0.9375rem;
  color: #666;
}

/* --------------------------------------
   グローバルナビ（PC: 普通の階層ドロップダウン / SP: ドロワー）
   -------------------------------------- */

.cp-site-nav-wrapper {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  margin-left: auto;
}

/* PC用ナビ */
.cp-site-navigation--desktop {
  display: block;
}

.cp-global-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0 1.5rem;
  list-style: none;
  margin: 0;
  padding: 0;
}

.cp-global-nav > li {
  position: relative;
}

.cp-global-nav > li > a {
  font-size: 0.9375rem;
  padding: 0.4rem 0;
  display: inline-block;
  border-bottom: 2px solid transparent;
  text-decoration: none;
}

.cp-global-nav > li > a:hover,
.cp-global-nav > li > a:focus,
.cp-global-nav > li.current-menu-item > a,
.cp-global-nav > li.current-menu-ancestor > a {
  border-bottom-color: #0066cc;
}

/* ▼ サブメニュー（普通のドロップダウン） */
.cp-global-nav .sub-menu {
  list-style: none;
  margin: 0;
  padding: 0.4rem 0;
  position: absolute;
  top: 100%;
  left: 0;
  min-width: 180px;
  background-color: #ffffff;
  border: 1px solid #eee;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.06);
  display: none;
  z-index: 50;
}

.cp-global-nav li.menu-item-has-children:hover > .sub-menu,
.cp-global-nav li.menu-item-has-children:focus-within > .sub-menu {
  display: block;
}

.cp-global-nav .sub-menu li a {
  display: block;
  padding: 0.35rem 0.9rem;
  font-size: 0.875rem;
  text-decoration: none;
}

.cp-global-nav .sub-menu li a:hover,
.cp-global-nav .sub-menu li a:focus {
  background-color: #f7f7f7;
}

/* 第3階層以降はとりあえず右側に出す */
.cp-global-nav .sub-menu .sub-menu {
  top: 0;
  left: 100%;
}

/* モバイルナビ：PCでは隠す */
.cp-site-navigation--mobile {
  display: none;
}

.cp-mobile-nav {
  list-style: none;
  padding: 0;
  margin: 0;
}

/* ハンバーガーボタン（中央できれいな X になる版） */
.cp-nav-toggle {
  display: none; /* PCでは非表示。SPブレイクポイントで display:block にする */
  position: relative;
  width: 32px;
  height: 28px;
  border: none;
  background: none;
  padding: 0;
  cursor: pointer;
}

/* 3本線：絶対配置で高さを決める */
.cp-nav-toggle__bar {
  position: absolute;
  left: 4px;
  right: 4px;
  height: 2px;
  background-color: #222;
  border-radius: 1px;
  transition: transform 0.2s ease, opacity 0.2s ease, top 0.2s ease;
}

.cp-nav-toggle__bar:nth-child(1) {
  top: 6px;
}

.cp-nav-toggle__bar:nth-child(2) {
  top: 13px;
}

.cp-nav-toggle__bar:nth-child(3) {
  top: 20px;
}

/* MENUラベルはボタンの真下・中央 */
.cp-nav-toggle__label {
  position: absolute;
  left: 50%;
  bottom: -11px;
  transform: translateX(-50%);
  font-size: 0.6rem;
  letter-spacing: 0.08em;
}

/* 開いたときのアニメーション（上下の線を中央に寄せてから回転） */
.cp-nav-toggle[aria-expanded="true"] .cp-nav-toggle__bar:nth-child(1) {
  top: 13px;
  transform: rotate(45deg);
}

.cp-nav-toggle[aria-expanded="true"] .cp-nav-toggle__bar:nth-child(2) {
  opacity: 0;
}

.cp-nav-toggle[aria-expanded="true"] .cp-nav-toggle__bar:nth-child(3) {
  top: 13px;
  transform: rotate(-45deg);
}

/* ブレイクポイント：1024px以下をスマホ・タブレット扱い */
@media (max-width: 1024px) {
  /* PCナビは非表示 */
  .cp-site-navigation--desktop {
    display: none;
  }

  /* ハンバーガー表示（縦並び） */
  .cp-nav-toggle {
    display: flex;
  }

  /* モバイルナビ：ドロワー */
  .cp-site-header {
    position: relative;
  }

  .cp-site-navigation--mobile {
    display: block;
    position: absolute;
    left: 0;
    right: 0;
    top: 100%;
    background-color: #ffffff;
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.15);
    transform-origin: top;
    transform: scaleY(0.8);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.18s ease, transform 0.18s ease, visibility 0.18s ease;
    z-index: 40;
  }

  .cp-site-navigation--mobile.is-open {
    opacity: 1;
    visibility: visible;
    transform: scaleY(1);
  }

  .cp-mobile-nav {
    padding: 0.75rem 1rem 1rem;
  }

  .cp-mobile-nav > li {
    border-bottom: 1px solid #eee;
  }

  .cp-mobile-nav > li:last-child {
    border-bottom: none;
  }

  .cp-mobile-nav > li > a {
    display: block;
    padding: 0.5rem 0;
    font-size: 0.9375rem;
    text-decoration: none;
  }

  /* 第2階層以降はインデントで表現 */
  .cp-mobile-nav .sub-menu {
    list-style: none;
    padding-left: 1rem;
    margin: 0 0 0.5rem;
  }

  .cp-mobile-nav .sub-menu a {
    font-size: 0.875rem;
  }
}


/* --------------------------------------
   投稿・ページ共通
   -------------------------------------- */

.cp-entry--single .cp-entry-content,
.cp-entry--page .cp-entry-content {
  font-size: 1rem;
}

.cp-entry--single .cp-entry-content p,
.cp-entry--page .cp-entry-content p {
  margin-bottom: 1.25rem;
}

.cp-entry-thumb {
  margin-bottom: 1rem;
}

/* タグエリア */
.cp-tags {
  margin-top: 1.25rem;
  font-size: 0.875rem;
}

.cp-tags a {
  display: inline-block;
  margin-right: 0.5rem;
  margin-bottom: 0.25rem;
  padding: 0.25rem 0.6rem;
  border-radius: 999px;
  border: 1px solid #ddd;
  text-decoration: none;
  font-size: 0.8125rem;
  color: #555;
}

.cp-tags a:hover,
.cp-tags a:focus {
  border-color: #0066cc;
  color: #0066cc;
}

/* --------------------------------------
   ページネーション・前後ナビ
   -------------------------------------- */

/* the_posts_pagination() 出力 */
.navigation.pagination {
  margin-top: 2rem;
  display: flex;
  justify-content: center;
}

.page-numbers {
  display: inline-block;
  margin: 0 0.25rem;
  padding: 0.35rem 0.75rem;
  border-radius: 999px;
  border: 1px solid #ddd;
  font-size: 0.875rem;
  text-decoration: none;
}

.page-numbers.current {
  background-color: #0066cc;
  border-color: #0066cc;
  color: #fff;
}

.page-numbers:hover,
.page-numbers:focus {
  border-color: #0066cc;
}

.cp-post-nav {
  margin-top: 2rem;
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  font-size: 0.875rem;
}

.cp-post-nav-prev a,
.cp-post-nav-next a {
  text-decoration: none;
}

.cp-post-nav-prev a:hover,
.cp-post-nav-next a:hover,
.cp-post-nav-prev a:focus,
.cp-post-nav-next a:focus {
  text-decoration: underline;
}

/* --------------------------------------
   ウィジェット・サイドバー
   -------------------------------------- */

.cp-layout__sidebar {
  font-size: 0.9375rem;
}

.cp-widget {
  margin-bottom: 1.5rem;
}

.cp-widget-title {
  font-size: 1rem;
  margin: 0 0 0.75rem;
  padding-bottom: 0.25rem;
  border-bottom: 1px solid #eee;
}

.cp-widget ul {
  list-style: none;
  margin: 0;
  padding: 0;
}

.cp-widget ul li {
  margin-bottom: 0.5rem;
}

/* デフォルトサイドバー案内 */
.cp-widget--default p {
  font-size: 0.875rem;
  color: #777;
}

/* --------------------------------------
   検索フォーム
   -------------------------------------- */

.cp-search-form {
  display: flex;
  gap: 0.5rem;
  margin-top: 0.75rem;
  max-width: 360px;
}

.cp-search-field {
  flex: 1 1 auto;
  padding: 0.4rem 0.6rem;
  border-radius: 4px;
  border: 1px solid #ccc;
  font-size: 0.9rem;
}

.cp-search-submit {
  padding: 0.4rem 0.9rem;
  border-radius: 4px;
  border: 1px solid #0066cc;
  background-color: #0066cc;
  color: #fff;
  font-size: 0.875rem;
  cursor: pointer;
}

.cp-search-submit:hover,
.cp-search-submit:focus {
  background-color: #004d99;
  border-color: #004d99;
}

/* スマホでは検索フォームを縦並びに */
@media (max-width: 480px) {
  .cp-search-form {
    flex-direction: column;
    max-width: 100%;
  }

  .cp-search-submit {
    width: 100%;
    text-align: center;
  }
}

/* --------------------------------------
   フロントページ：最新記事セクション
   -------------------------------------- */

.cp-front-latest {
  margin-top: 2.5rem;
}

.cp-front-latest__header {
  margin-bottom: 1rem;
}

.cp-front-latest__title {
  font-size: 1.25rem;
  margin: 0 0 0.25rem;
}

/* --------------------------------------
   404ページ
   -------------------------------------- */

.cp-entry--404 .cp-entry-content p {
  margin-bottom: 1rem;
  color: #555;
}

/* --------------------------------------
   フッター
   -------------------------------------- */

.cp-footer-inner {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  align-items: center;
}

.cp-footer-nav {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 1.25rem;
}

.cp-footer-nav a {
  font-size: 0.875rem;
  text-decoration: none;
}

.cp-footer-nav a:hover,
.cp-footer-nav a:focus {
  text-decoration: underline;
}

@media (min-width: 769px) {
  .cp-footer-inner {
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
  }
}

/* -------------------------------------------------------------
   パンくずバー（ヘッダー直下・1行表示強制）
------------------------------------------------------------- */

.cp-breadcrumb-bar {
	width: 100%;
	background: #f7f7f7;
	border-bottom: 1px solid #e3e3e3;
	padding: 4px 0;
}

.cp-breadcrumb-bar .cp-container {
	display: flex;
	align-items: center;      /* 縦方向センター */
	min-height: 32px;         /* 好みで調整 */
}

/* nav 自体を1行ボックスにする */
.cp-breadcrumb {
	display: block;
	max-width: 100%;
	white-space: nowrap !important;       /* 折り返し禁止 */
	overflow: hidden !important;
	text-overflow: ellipsis !important;   /* はみ出したら … に */
	margin: 0;
	padding: 0;
}

/* ul/li の余白を全部リセットして、横並びにする */
.cp-breadcrumb ul {
	display: inline-flex !important;      /* 横並びを強制 */
	flex-wrap: nowrap !important;         /* 折り返し禁止 */
	align-items: center;
	gap: 6px;
	margin: 0;
	padding: 0;
	list-style: none;
}

.cp-breadcrumb li {
	display: inline-flex;
	align-items: center;
	white-space: nowrap !important;
	margin: 0;
	padding: 0;
}

/* 区切りの > */
.cp-breadcrumb li::after {
	content: ">";
	margin-left: 6px;
	color: #888;
}

.cp-breadcrumb li:last-child::after {
	content: "";
}

/* リンクのスタイル（お好みで） */
.cp-breadcrumb a {
	color: inherit;
	text-decoration: none;
}

.cp-breadcrumb a:hover {
	text-decoration: underline;
}

/* -------------------------------------------------------------
   フルワイドブロック（alignfull）を画面いっぱいに広げる
------------------------------------------------------------- */

/* ブラウザ標準の body の余白を消しておく（上下左右ぴったりにするための保険） */
body {
  margin: 0;
}

/* 記事本文内で alignfull を選択したブロックは、ラッパーの幅制限から抜けて
   画面の幅（viewport幅）いっぱいまで広げる */
.cp-layout__main .cp-entry-content > .alignfull,
.cp-layout__main .cp-entry-content .wp-block-cover.alignfull,
.cp-layout__main .cp-entry-content .wp-block-image.alignfull,
.cp-layout__main .cp-entry-content .wp-block-group.alignfull,
.cp-layout__main .cp-entry-content .wp-block-columns.alignfull {
  width: 100vw;
  max-width: 100vw;
  margin-left: calc(50% - 50vw);
  margin-right: calc(50% - 50vw);
}

/* alignfull ブロックに対して、cp-entry-content 側の左右の余白の影響をなくす */
.cp-layout__main .cp-entry-content > .alignfull {
  padding-left: 0;
  padding-right: 0;
}

/* =========================================
   CANOPUS フルワイドセクション完全フル幅化
   （背景だけでなく文字も左右いっぱいに）
   ========================================= */

/* 外側セクションを画面幅いっぱいに */
.cp-block-fullwide.wp-block-canopus-fullwide-section {
  width: 100vw;
  max-width: 100vw;
  margin-left: calc(50% - 50vw);
  margin-right: calc(50% - 50vw);
}

/* 内側ラッパーの幅制限・左右パディングを解除 */
.cp-block-fullwide__inner.cp-block-inner-full {
  max-width: none !important;
  margin-left: 0 !important;
  margin-right: 0 !important;
  padding-left: 0 !important;
  padding-right: 0 !important;
}

/* 内側の直下テキスト・ブロックも左右いっぱいに */
.cp-block-fullwide__inner.cp-block-inner-full > * {
  max-width: none !important;
  margin-left: 0;
  margin-right: 0;
}

