/* ========================================
   WordPress / Gutenberg
   ブロックエディタ完結を目指す設定
======================================== */


/* ----------------------------------------
   全ブロック共通余白
---------------------------------------- */
main .wp-block {
  margin-top: 0;
  margin-bottom: 32px;
}


/* ----------------------------------------
   幅管理

   通常 / wide / full
---------------------------------------- */
.alignwide {
  width: min(100% - 40px, 1400px);
  margin-inline: auto;
}

.alignfull {
  width: 100vw;
  margin-left: calc(50% - 50vw);
}


/* ----------------------------------------
   group block
---------------------------------------- */
.wp-block-group {
  padding: 20px;
  border-radius: 20px;
}

.has-background.wp-block-group {
  padding: 40px;
}


/* ----------------------------------------
   columns
---------------------------------------- */
.wp-block-columns {
  gap: 32px;
  align-items: stretch;
}

.wp-block-column {
  min-width: 0;
}


/* ----------------------------------------
   heading装飾
---------------------------------------- */
h2.wp-block-heading {
  color: var(--color_brand);
  padding-bottom: 12px;
  position: relative;
}

h2.wp-block-heading::after {
  content: "";
  display: block;
  width: 64px;
  height: 3px;
  margin-top: 10px;
  background: var(--color_brand);
}

h3.wp-block-heading {
  padding-left: 14px;
  border-left: 4px solid var(--color_brand);
}


/* ----------------------------------------
   quote
---------------------------------------- */
.wp-block-quote {
  padding: 24px 32px;
  background: var(--color_bg_gray);
  border-left: 4px solid var(--color_brand);
  border-radius: 0 var(--radius) var(--radius) 0;
}


/* ----------------------------------------
   cover
   ファーストビュー向き
---------------------------------------- */
.wp-block-cover {
  min-height: 420px;
  border-radius: 24px;
  overflow: hidden;
}


/* ----------------------------------------
   media text
---------------------------------------- */
.wp-block-media-text {
  gap: 40px;
  align-items: center;
}


/* ----------------------------------------
   widget
---------------------------------------- */
.widget {
  margin-bottom: 32px;
}

/* 最近の投稿・カテゴリ・アーカイブ */
.widget_recent_entries ul,
.widget_categories ul,
.widget_archive ul,
.widget_pages ul,
.wp-block-categories,
.wp-block-archives,
.wp-block-latest-posts {
  list-style: none;
  padding: 0;
  margin: 0;
}

.widget_categories a,
.widget_archive a,
.widget_pages a {
  display: block;
  padding: 2px 0;
}


/* 検索 */
.search-form,
.wp-block-search {
  display: flex;
  gap: 8px;
}


/* pagination（一覧用。投稿ナビは .post-navigation で上書き） */
.navigation.pagination .nav-links,
.navigation.pagination {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin-top: 48px;
}

.page-numbers {
  min-width: 42px;
  height: 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--color_border_light);
  border-radius: 8px;
  color: var(--color_text);
}

.page-numbers.current {
  background: var(--color_brand);
  border-color: var(--color_brand);
  color: #fff;
}

/* ========================================
   Sidebar / Entry
======================================== */

.sidebar {
  width: 100%;
}

/* 投稿本文（single.php用） */
.entry-content {
  width: 100%;
  min-width: 0;
}

.entry-content > *:last-child {
  margin-bottom: 0;
}

/* 投稿ヘッダー */
.entry-header {
  margin-bottom: 40px;
}

/* 投稿タイトル：本文トンマナに合わせテキスト色（リンク色と区別） */
.entry-title {
  font-size: clamp(1.375rem, 2.8vw, 1.875rem);
  font-weight: 700;
  line-height: 1.5;
  color: var(--color_text);
  margin: 0 0 12px;
}

.entry-meta {
  font-size: var(--fz_sm);
  color: var(--color_text_light);
  margin: 0;
}

/* アイキャッチ */
.entry-thumbnail {
  margin-bottom: 32px;
}

.entry-thumbnail img {
  width: 100%;
  height: auto;
  border-radius: 4px;
}

/* 投稿ナビ：左右に「前／次の記事へ」 */
.post-navigation {
  margin-top: 64px;
  padding-top: 32px;
  border-top: 1px solid var(--color_border_light);
}

.post-navigation .screen-reader-text {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.post-navigation .nav-links {
  display: flex;
  justify-content: space-between;
  align-items: stretch;
  gap: 16px;
  margin-top: 0;
}

.post-navigation .nav-previous,
.post-navigation .nav-next {
  flex: 1 1 0;
  min-width: 0;
}

.post-navigation .nav-next {
  text-align: right;
}

.post-navigation .nav-previous a,
.post-navigation .nav-next a {
  display: inline-flex;
  align-items: center;
  gap: 0.5em;
  max-width: 100%;
  padding: 0.85em 1.35em;
  border: 1px solid var(--color_border_light);
  border-radius: 999px;
  background: #fff;
  color: var(--color_text);
  font-size: var(--fz_sm);
  font-weight: 700;
  line-height: 1.4;
  text-decoration: none;
  transition: border-color var(--transition_base), color var(--transition_base), background-color var(--transition_base);
}

.post-navigation .nav-previous a:hover,
.post-navigation .nav-next a:hover {
  border-color: var(--color_brand);
  color: var(--color_brand);
  background: var(--color_surface_muted);
}

.post-navigation .nav-previous a i,
.post-navigation .nav-next a i {
  flex-shrink: 0;
}

/* サイドバー見出し：Gutenberg装飾を打ち消し、一覧・詳細で同一意匠に */
.sidebar .widget-title,
.sidebar .widget h2,
.sidebar .widget h3,
.sidebar .wp-block-heading,
.sidebar h2.wp-block-heading,
.sidebar h3.wp-block-heading {
  margin: 0 0 16px;
  padding: 0 0 12px;
  color: var(--color_text);
  font-size: 1rem;
  font-weight: 700;
  line-height: 1.4;
  border: 0;
  border-bottom: 2px solid var(--color_brand);
  position: static;
}

.sidebar h2.wp-block-heading::after,
.sidebar .wp-block-heading::after {
  content: none;
  display: none;
}

.sidebar .wp-block-group {
  padding: 0;
  border-radius: 0;
}

.sidebar .widget,
.sidebar .wp-block-group {
  margin-bottom: 40px;
}

.widget a,
.sidebar a {
  color: var(--color_text);
}

.widget a:hover,
.sidebar a:hover {
  color: var(--color_brand);
}

.widget_recent_entries li,
.widget_categories li,
.widget_archive li,
.wp-block-latest-posts li,
.wp-block-categories li,
.wp-block-archives li {
  padding: 10px 0;
  border-bottom: 1px solid var(--color_border_light);
  color: var(--color_text);
  list-style: none;
}

.widget_recent_entries li:last-child,
.widget_categories li:last-child,
.widget_archive li:last-child,
.wp-block-latest-posts li:last-child,
.wp-block-categories li:last-child,
.wp-block-archives li:last-child {
  border-bottom: 0;
}

/* 一覧カラム内のお知らせリストは幅いっぱい */
.layout_sidebar .res_news_list {
  max-width: none;
  margin: 0;
}

.layout_sidebar .res_news_list + .pagenavi_inner {
  margin-top: 40px;
}

/* archive */
.archive-header {
  margin-bottom: 48px;
}

/* card内タイトル */
.card h2 {
  font-size: 1.2rem;
  margin-top: 16px;
  margin-bottom: 12px;
}

.card h2 a {
  color: var(--color_text);
}

.card h2 a:hover {
  color: var(--color_brand);
}

@media (max-width: 767px) {
  .post-navigation .nav-links {
    flex-direction: column;
  }

  .post-navigation .nav-previous a,
  .post-navigation .nav-next a {
    width: 100%;
    justify-content: center;
  }

  .post-navigation .nav-next {
    text-align: left;
  }
}