/* ================================================================
   single.css — BitTradeBlog
   記事詳細ページ専用スタイル
================================================================ */

/* ── Article layout (2カラム: 本文 + スティッキーTOC) ── */
.single-layout {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--sp-10);
  align-items: flex-start;
}
/* グリッドセルのブローアウト防止 */
.single-layout > * {
  min-width: 0;
}
@media (min-width: 1024px) {
  .single-layout {
    grid-template-columns: 1fr 260px;
  }
}

/* ── Article header ── */
.article-header { margin-bottom: var(--sp-6); }

.article-cats {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  margin-bottom: var(--sp-4);
  flex-wrap: wrap;
}

.article-title {
  font-family: var(--font-serif);
  font-size: clamp(22px, 4vw, 30px);
  font-weight: 700;
  line-height: var(--leading-snug);
  color: var(--color-text);
  margin-bottom: var(--sp-5);
}

.article-meta {
  display: flex;
  align-items: center;
  gap: var(--sp-4);
  padding-bottom: var(--sp-5);
  border-bottom: 1px solid var(--color-border-light);
  flex-wrap: wrap;
}
.article-meta__item {
  font-size: var(--text-xs);
  color: var(--color-text-muted);
  display: flex;
  align-items: center;
  gap: var(--sp-1);
}

/* ── Thumbnail ── */
.article-thumb {
  display: block;
  width: 100%;
  height: auto;
  object-fit: unset;  /* クロップしない（サーバー側でもクロップ無効） */
  border-radius: 0;
  margin-bottom: var(--sp-8);
}
.article-thumb-placeholder {
  width: 100%;
  aspect-ratio: 16 / 9;
  background: linear-gradient(135deg, var(--blue-800), var(--blue-400));
  border-radius: 0;
  margin-bottom: var(--sp-8);
  display: flex;
  align-items: center;
  justify-content: center;
}

/* ================================================================
   ARTICLE BODY TYPOGRAPHY
================================================================ */
.article-body {
  font-size: var(--text-base);
  line-height: var(--leading-loose);
  color: var(--color-text);
  /* 長いURL・長い単語を折り返す */
  overflow-wrap: break-word;
  word-break: break-word;
  word-wrap: break-word;
  min-width: 0;
}

.article-body p { margin-bottom: 1.6em; overflow-wrap: break-word; word-break: break-word; }

/* リンク・URL も折り返す */
.article-body a {
  overflow-wrap: break-word;
  word-break: break-word;
}

/* Headings */
.article-body h2 {
  font-size: 22px;
  font-weight: 700;
  margin: var(--sp-10) 0 var(--sp-4);
  padding-left: var(--sp-4);
  border-left: 4px solid var(--color-primary);
  line-height: var(--leading-snug);
  scroll-margin-top: calc(var(--header-height) + 24px);
}
.article-body h3 {
  font-size: 17px;
  font-weight: 700;
  color: var(--blue-700);
  margin: var(--sp-8) 0 var(--sp-3);
  scroll-margin-top: calc(var(--header-height) + 24px);
}
.article-body h4 {
  font-size: 15px;
  font-weight: 700;
  margin: var(--sp-6) 0 var(--sp-2);
}

/* Lists */
.article-body ul,
.article-body ol {
  padding-left: 1.6em;
  margin-bottom: 1.4em;
}
.article-body ul { list-style: disc; }
.article-body ol { list-style: decimal; }
.article-body li { margin-bottom: 0.5em; }

/* Blockquote */
.article-body blockquote {
  border-left: 4px solid var(--color-primary);
  padding: var(--sp-3) var(--sp-5);
  margin: var(--sp-6) 0;
  background: var(--color-primary-dim);
  border-radius: 0 var(--r-md) var(--r-md) 0;
  font-style: normal;
  color: var(--blue-700);
}

/* Code */
.article-body code {
  font-family: var(--font-mono);
  font-size: 13px;
  background: var(--gray-100);
  color: var(--blue-600);
  padding: 2px 6px;
  border-radius: var(--r-sm);
}
.article-body pre {
  background: var(--gray-900);
  color: #a8d8ea;
  padding: var(--sp-5);
  border-radius: var(--r-lg);
  overflow-x: auto;
  font-family: var(--font-mono);
  font-size: 13px;
  line-height: 1.7;
  margin-bottom: 1.4em;
}
.article-body pre code {
  background: none;
  color: inherit;
  padding: 0;
  font-size: inherit;
}

/* Tables */
.article-body table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 1.4em;
  font-size: var(--text-sm);
}
.article-body th,
.article-body td {
  border: 1px solid var(--color-border);
  padding: var(--sp-2) var(--sp-3);
  text-align: left;
  line-height: 1.6;
}
.article-body th {
  background: var(--gray-100);
  font-weight: 700;
  color: var(--gray-700);
}
.article-body tr:nth-child(even) td { background: var(--gray-50); }

/* Images */
.article-body img {
  max-width: 100%;
  height: auto;
  border-radius: var(--r-md);
  margin: var(--sp-2) 0;
}
.article-body figure { margin: var(--sp-6) 0; }
.article-body figcaption {
  font-size: var(--text-xs);
  color: var(--color-text-muted);
  text-align: center;
  margin-top: var(--sp-2);
}

/* HR */
.article-body hr {
  border: none;
  border-top: 1px solid var(--color-border);
  margin: var(--sp-8) 0;
}

/* ================================================================
   TABLE OF CONTENTS (スティッキー)
================================================================ */
.article-aside {
  display: flex;
  flex-direction: column;
  gap: var(--sp-5);
}

.toc {
  background: var(--color-surface);
  border: 1px solid var(--color-border-light);
  border-radius: var(--r-lg);
  overflow: hidden;
}
.toc__header {
  background: var(--gray-50);
  border-bottom: 1px solid var(--color-border-light);
  padding: var(--sp-3) var(--sp-4);
}
.toc__title {
  font-size: var(--text-xs);
  font-weight: 700;
  color: var(--color-text-sub);
  display: flex;
  align-items: center;
  gap: var(--sp-2);
}
.toc__title::before {
  content: '';
  width: 3px;
  height: 14px;
  background: var(--color-primary);
  border-radius: var(--r-full);
  display: inline-block;
}
.toc__list {
  padding: var(--sp-2) 0;
  max-height: 60vh;
  overflow-y: auto;
}
.toc__item {
  display: block;
  padding: var(--sp-2) var(--sp-4);
  font-size: var(--text-xs);
  color: var(--color-text-sub);
  text-decoration: none;
  border-left: 2px solid transparent;
  transition: var(--transition-fast);
  line-height: 1.5;
}
.toc__item:hover,
.toc__item.is-active {
  background: var(--color-primary-dim);
  color: var(--color-primary-dark);
  border-left-color: var(--color-primary);
}
.toc__item--h3 { padding-left: var(--sp-8); font-size: 11px; }

/* ================================================================
   AUTHOR BLOCK
================================================================ */
.author-block {
  display: flex;
  gap: var(--sp-4);
  align-items: flex-start;
  background: var(--color-surface);
  border: 1px solid var(--color-border-light);
  border-left: 4px solid var(--color-primary);
  border-radius: var(--r-lg);
  padding: var(--sp-5);
  margin: var(--sp-10) 0 var(--sp-8);
}
.author-block__avatar {
  flex-shrink: 0;
}
.author-block__avatar img {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  object-fit: cover;
  display: block;
}
.author-block__avatar--placeholder {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--blue-600), var(--color-primary));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  font-weight: 700;
  color: #fff;
  flex-shrink: 0;
  letter-spacing: .02em;
}
.author-block__info { flex: 1; }
.author-block__name {
  font-size: var(--text-base);
  font-weight: 700;
  color: var(--color-text);
  margin-bottom: var(--sp-1);
}
.author-block__role {
  font-size: var(--text-xs);
  color: var(--color-primary-dark);
  font-weight: 600;
  margin-bottom: var(--sp-2);
}
.author-block__bio {
  font-size: var(--text-xs);
  color: var(--color-text-sub);
  line-height: var(--leading-normal);
}

/* ================================================================
   RELATED ARTICLES
================================================================ */
.related-section {
  padding: var(--sp-8) 0 var(--sp-10);
  border-top: 1px solid var(--color-border-light);
}
.related-section .section-title { margin-bottom: var(--sp-5); }

/* ================================================================
   SNS SHARE BUTTONS
================================================================ */
.share-buttons {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  padding: var(--sp-6) 0;
  border-top: 1px solid var(--color-border-light);
  border-bottom: 1px solid var(--color-border-light);
  margin: var(--sp-8) 0;
  flex-wrap: wrap;
}
.share-label {
  font-size: var(--text-xs);
  font-weight: 700;
  color: var(--color-text-sub);
}
.share-btn {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-2);
  padding: 7px var(--sp-4);
  border-radius: var(--r-full);
  font-size: var(--text-xs);
  font-weight: 700;
  text-decoration: none;
  transition: var(--transition-fast);
}
.share-btn--x {
  background: #000;
  color: #fff;
}
.share-btn--x:hover { background: #333; color: #fff; }
.share-btn--line {
  background: #06C755;
  color: #fff;
}
.share-btn--line:hover { background: #05a847; color: #fff; }
.share-btn--copy {
  background: var(--gray-100);
  color: var(--color-text-sub);
  border: 1px solid var(--color-border);
}
.share-btn--copy:hover { background: var(--gray-200); }

/* ================================================================
   SIDEBAR WIDGETS（記事ページ）
================================================================ */

/* アプリバナー */
.sb-app-banner {
  display: block;
  border-radius: var(--r-lg);
  overflow: hidden;
  margin-bottom: var(--sp-5);
  box-shadow: var(--shadow-sm);
  transition: var(--transition-fast);
}
.sb-app-banner:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }
.sb-app-banner__img  { width: 100%; height: auto; display: block; }

/* ウィジェット共通 */
.sb-widget {
  background: var(--color-surface);
  border: 1px solid var(--color-border-light);
  border-radius: var(--r-lg);
  overflow: hidden;
  margin-bottom: var(--sp-5);
}
.sb-widget__header {
  background: var(--gray-50);
  border-bottom: 1px solid var(--color-border-light);
  padding: var(--sp-2) var(--sp-4);
}
.sb-widget__title {
  font-size: var(--text-xs);
  font-weight: 700;
  color: var(--color-text-sub);
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  margin: 0;
}
.sb-widget__title::before {
  content: '';
  width: 3px;
  height: 13px;
  background: var(--color-primary);
  border-radius: var(--r-full);
  flex-shrink: 0;
}
.sb-widget__body { padding: var(--sp-3) var(--sp-4); }

/* 人気記事アイテム */
.sb-popular-item {
  display: flex;
  align-items: flex-start;
  gap: var(--sp-3);
  padding: var(--sp-3) 0;
  border-bottom: 1px solid var(--color-border-light);
}
.sb-popular-item:last-child { border-bottom: none; }

.sb-popular-item__rank {
  font-size: 22px;
  font-weight: 900;
  color: var(--color-border);
  min-width: 24px;
  line-height: 1;
  padding-top: 2px;
  flex-shrink: 0;
}
.sb-popular-item__rank.is-top { color: var(--color-primary); }

.sb-popular-item__content {
  flex: 1;
  min-width: 0;
  display: flex;
  gap: var(--sp-2);
  align-items: flex-start;
}
.sb-popular-item__thumb {
  width: 60px;
  height: 45px;
  flex-shrink: 0;
  border-radius: var(--r-sm);
  overflow: hidden;
  display: block;
}
.sb-popular-item__thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.sb-popular-item__title {
  font-size: 12px;
  font-weight: 500;
  color: var(--color-text);
  line-height: 1.55;
  text-decoration: none;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  transition: var(--transition-fast);
}
.sb-popular-item__title:hover { color: var(--color-primary-dark); }

.sb-empty {
  font-size: 12px;
  color: var(--color-text-muted);
  text-align: center;
  padding: var(--sp-4) 0;
}

/* Twitter ウィジェット内の埋め込みサイズ調整 */
.sb-widget--twitter .sb-widget__body {
  padding: 0;
  overflow: hidden;
  border-radius: 0 0 var(--r-lg) var(--r-lg);
}
.sb-widget--twitter .twitter-timeline {
  border-radius: 0 !important;
}

/* 検索フォーム（サイドバー内） */
.sb-widget .search-form {
  display: flex;
  gap: var(--sp-2);
}
.sb-widget .search-field {
  flex: 1;
  padding: 8px var(--sp-3);
  border: 1.5px solid var(--color-border);
  border-radius: var(--r-md);
  font-size: var(--text-xs);
  font-family: var(--font-sans);
  color: var(--color-text);
  background: var(--color-bg);
  outline: none;
  transition: var(--transition-fast);
}
.sb-widget .search-field:focus {
  border-color: var(--color-primary);
  box-shadow: var(--shadow-focus);
}
.sb-widget .search-submit {
  padding: 8px var(--sp-3);
  background: var(--color-primary);
  color: var(--gray-900);
  font-size: var(--text-xs);
  font-weight: 700;
  border-radius: var(--r-md);
  border: none;
  cursor: pointer;
  font-family: var(--font-sans);
  transition: var(--transition-fast);
}
.sb-widget .search-submit:hover { background: var(--blue-400); }

/* ================================================================
   TOC ショートコード（本文インライン表示）
================================================================ */
.toc--inline {
  margin: var(--sp-8) 0;
  max-width: 100%;
}
.single-layout .article-aside #toc {
  display: none;
}
.has-toc-shortcode .article-aside #toc {
  display: none !important;
}

/* ================================================================
   記事ページ背景・全体レイアウト
================================================================ */
body.single,
body.single .site-main,
body.single #primary {
  background: #ffffff;
  /* 横はみ出し防止（長いURL等のセーフガード） */
  overflow-x: hidden;
}

body.single .article-content,
body.single .single-layout {
  background: #ffffff;
}

body.single .article-aside {
  background: transparent;
}
/* ================================================================
   SIDEBAR — タブ（ランキング）
================================================================ */
.sb-widget__header--tabs {
  display: flex;
  flex-direction: column;
  gap: var(--sp-2);
}
.sb-tabs {
  display: flex;
  border: 1px solid var(--color-border-light);
  border-radius: var(--r-sm);
  overflow: hidden;
}
.sb-tab {
  flex: 1;
  padding: 4px 0;
  font-size: 11px;
  font-weight: 700;
  background: transparent;
  color: var(--color-text-muted);
  border: none;
  border-right: 1px solid var(--color-border-light);
  cursor: pointer;
  transition: var(--transition-fast);
  font-family: var(--font-sans);
  line-height: 1;
}
.sb-tab:last-child { border-right: none; }
.sb-tab.is-active  { background: var(--color-primary); color: var(--gray-900); }
.sb-tab:hover:not(.is-active) { background: var(--gray-50); }

.sb-tab-panel             { display: none; }
.sb-tab-panel.is-active   { display: block; }

.sb-widget__body--flush { padding: 0; }

/* フッター「〜一覧はこちら」 */
.sb-widget__footer {
  border-top: 1px solid var(--color-border-light);
  padding: var(--sp-2) var(--sp-4);
  text-align: center;
}
.sb-widget__more {
  font-size: 11px;
  font-weight: 600;
  color: var(--color-primary);
  text-decoration: none;
}
.sb-widget__more:hover { text-decoration: underline; }

/* ウィジェットタイトル絵文字アイコン */
.sb-widget__icon { margin-right: 2px; font-style: normal; }

/* ================================================================
   SIDEBAR — 新着記事
================================================================ */
.sb-recent-item {
  display: flex;
  gap: var(--sp-2);
  padding: var(--sp-3) 0;
  border-bottom: 1px solid var(--color-border-light);
}
.sb-recent-item:last-child { border-bottom: none; }

.sb-recent-item__thumb {
  width: 60px;
  height: 45px;
  flex-shrink: 0;
  border-radius: var(--r-sm);
  overflow: hidden;
  display: block;
}
.sb-recent-item__thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.sb-recent-item__body {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.sb-recent-item__title {
  font-size: 12px;
  font-weight: 500;
  color: var(--color-text);
  line-height: 1.55;
  text-decoration: none;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  transition: var(--transition-fast);
}
.sb-recent-item__title:hover { color: var(--color-primary-dark); }
.sb-recent-item__time {
  font-size: 10px;
  color: var(--color-text-muted);
}

/* ================================================================
   SIDEBAR — チャート
================================================================ */
.sb-widget--chart { overflow: visible; }

.sb-chart-block { padding: var(--sp-3) var(--sp-4); }
.sb-chart-divider {
  border: none;
  border-top: 1px solid var(--color-border-light);
  margin: 0;
}

.sb-chart-header {
  display: flex;
  align-items: flex-start;
  gap: var(--sp-2);
  margin-bottom: var(--sp-2);
}
.sb-chart-header__icon {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
}
.sb-chart-header__info { flex: 1; min-width: 0; }
.sb-chart-header__name {
  display: block;
  font-size: 11px;
  font-weight: 700;
  color: var(--color-text);
  margin-bottom: 2px;
}
.sb-chart-header__price {
  display: flex;
  align-items: baseline;
  gap: var(--sp-2);
}
.sb-chart-price {
  font-size: 17px;
  font-weight: 700;
  color: var(--color-text);
  font-variant-numeric: tabular-nums;
}
.sb-chart-change { font-size: 11px; font-weight: 600; }
.sb-chart-change--up   { color: #e84040; }
.sb-chart-change--down { color: #27ae60; }

.sb-chart-periods {
  display: flex;
  gap: 3px;
  margin-bottom: var(--sp-2);
}
.sb-chart-period {
  flex: 1;
  padding: 3px 0;
  font-size: 10px;
  font-weight: 600;
  background: transparent;
  color: var(--color-text-muted);
  border: 1px solid var(--color-border-light);
  border-radius: var(--r-sm);
  cursor: pointer;
  transition: var(--transition-fast);
  font-family: var(--font-sans);
  white-space: nowrap;
}
.sb-chart-period.is-active {
  background: var(--color-primary);
  color: var(--gray-900);
  border-color: var(--color-primary);
}
.sb-chart-period:hover:not(.is-active) { border-color: var(--color-primary); }

.sb-chart-wrap { width: 100%; margin-bottom: var(--sp-2); }
.sb-chart-canvas { width: 100%; height: auto; display: block; border-radius: var(--r-sm); }

.sb-chart-more {
  display: block;
  text-align: center;
  font-size: 11px;
  font-weight: 600;
  color: var(--color-primary);
  text-decoration: none;
  padding: var(--sp-2) 0;
  border: 1px solid var(--color-border-light);
  border-radius: var(--r-sm);
  transition: var(--transition-fast);
}
.sb-chart-more:hover {
  background: var(--color-primary-dim);
  border-color: var(--color-primary);
}

.sb-chart-all-link {
  display: block;
  text-align: center;
  font-size: 12px;
  font-weight: 600;
  color: var(--color-primary);
  text-decoration: none;
  padding: var(--sp-3);
  border: 1px solid var(--color-border-light);
  border-radius: var(--r-lg);
  margin-bottom: var(--sp-5);
  transition: var(--transition-fast);
}
.sb-chart-all-link:hover {
  border-color: var(--color-primary);
  background: var(--color-primary-dim);
}

/* ================================================================
   固定ページ（page.php）
================================================================ */
.page-single .page-content {
  max-width: 800px;
  margin: 0 auto;
  padding: var(--sp-8) 0 var(--sp-16);
}

.page-content__header {
  margin-bottom: var(--sp-8);
}

.page-content__title {
  font-size: clamp(22px, 3vw, 32px);
  font-weight: 800;
  line-height: var(--leading-snug);
  color: var(--color-text);
}

.page-content__thumb {
  display: block;
  width: 100%;
  height: auto;
  border-radius: var(--r-lg);
  margin-bottom: var(--sp-8);
}

.page-links {
  display: flex;
  gap: var(--sp-2);
  flex-wrap: wrap;
  margin-top: var(--sp-8);
}

.page-links__item {
  display: inline-block;
  padding: var(--sp-2) var(--sp-3);
  border: 1px solid var(--color-border);
  border-radius: var(--r-md);
  font-size: var(--text-sm);
  font-weight: 600;
}

/* ================================================================
   レスポンシブ（記事ページ）
================================================================ */

/* ── モバイル（〜1023px）：サイドバーは記事下に通常表示 ── */

/* ── テーブル：横スクロール ── */
.article-body table {
  display: block;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  white-space: nowrap;
}
.article-body table th,
.article-body table td {
  white-space: normal;
  min-width: 100px;
}

/* ── 埋め込みiframe（YouTube等）：アスペクト比維持 ── */
.article-body iframe {
  max-width: 100%;
}
.article-body .wp-block-embed__wrapper,
.article-body .embed-responsive {
  position: relative;
  width: 100%;
  padding-bottom: 56.25%; /* 16:9 */
  height: 0;
  overflow: hidden;
}
.article-body .wp-block-embed__wrapper iframe,
.article-body .embed-responsive iframe {
  position: absolute;
  top: 0; left: 0;
  width: 100%; height: 100%;
}

/* ── 著者ブロック：縦積み ── */
@media (max-width: 639px) {
  .author-block {
    flex-direction: column;
    align-items: flex-start;
    gap: var(--sp-3);
    padding: var(--sp-4);
  }
}

/* ── シェアボタン：モバイルで均等幅 ── */
@media (max-width: 639px) {
  .share-buttons {
    gap: var(--sp-2);
    padding: var(--sp-4) 0;
  }
  .share-btn {
    flex: 1;
    justify-content: center;
    padding: 8px var(--sp-2);
  }
}

/* ── 記事タイトル：行間を少し詰める ── */
@media (max-width: 639px) {
  .article-title {
    font-size: clamp(20px, 5vw, 26px);
    line-height: 1.45;
  }
}

/* ── 記事本文 h2 のパディング調整 ── */
@media (max-width: 639px) {
  .article-body h2 {
    font-size: 19px;
    padding-left: var(--sp-3);
  }
  .article-body h3 {
    font-size: 16px;
  }
}

/* ── コンテナ左右の余白（single ページ） ── */
@media (max-width: 639px) {
  .single-page .container {
    padding-left: var(--sp-4);
    padding-right: var(--sp-4);
  }
}


/* ================================================================
   Gutenberg ブロック レスポンシブ対応
================================================================ */

/* ── 画像ブロック ── */
.article-body .wp-block-image {
  max-width: 100%;
}
.article-body .wp-block-image img {
  max-width: 100% !important;
  width: auto !important;
  height: auto !important;
}
/* figure に直接 width が付いている場合も上書き */
.article-body figure.wp-block-image,
.article-body figure {
  max-width: 100% !important;
  margin-left: 0;
  margin-right: 0;
}

/* インラインスタイルで固定幅が指定された img を強制レスポンシブ */
.article-body img[style] {
  max-width: 100% !important;
  height: auto !important;
}

/* ── 動画・YouTube等の埋め込みブロック ── */
.article-body .wp-block-embed {
  max-width: 100%;
}
.article-body .wp-block-embed__wrapper {
  position: relative;
  width: 100%;
  padding-bottom: 56.25%; /* 16:9 */
  height: 0;
  overflow: hidden;
}
.article-body .wp-block-embed__wrapper iframe,
.article-body .wp-block-embed__wrapper video {
  position: absolute;
  top: 0; left: 0;
  width: 100% !important;
  height: 100% !important;
}
/* 動画ブロック単体 */
.article-body .wp-block-video video {
  max-width: 100%;
  height: auto;
}

/* ── テーブルブロック ── */
.article-body .wp-block-table {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  display: block;
  max-width: 100%;
}
.article-body .wp-block-table table {
  display: table; /* table の中は table に戻す */
  min-width: max-content;
}

/* ── カラムブロック（wp-block-columns） ── */
@media (max-width: 599px) {
  .article-body .wp-block-columns {
    flex-direction: column !important;
  }
  .article-body .wp-block-column {
    flex-basis: 100% !important;
    min-width: unset !important;
  }
}

/* ── メディアとテキスト（wp-block-media-text） ── */
@media (max-width: 599px) {
  .article-body .wp-block-media-text {
    grid-template-columns: 1fr !important;
  }
  .article-body .wp-block-media-text .wp-block-media-text__media {
    grid-column: 1;
    grid-row: 1;
  }
  .article-body .wp-block-media-text .wp-block-media-text__content {
    grid-column: 1;
    grid-row: 2;
  }
}

/* ── ギャラリーブロック ── */
.article-body .wp-block-gallery {
  max-width: 100%;
}
.article-body .wp-block-gallery img {
  max-width: 100% !important;
  height: auto !important;
}

/* ── ボタンブロック ── */
@media (max-width: 599px) {
  .article-body .wp-block-buttons {
    flex-wrap: wrap;
  }
  .article-body .wp-block-button__link {
    width: 100%;
    text-align: center;
  }
}

/* ── グループ・カバーブロックのオーバーフロー防止 ── */
.article-body .wp-block-group,
.article-body .wp-block-cover {
  max-width: 100%;
  overflow: hidden;
}
