/* =============================
   Blog Single Post Design
   ブログ記事詳細ページのモダンなデザイン
================================ */

/* subctsのpaddingを削除（ブログ記事詳細ページのみ） */
body.single-post .subcts {
  padding: 0;
}

/* 2カラムレイアウトコンテナ */
.blog-single-container {
  display: flex;
  gap: 32px;
  max-width: 1400px;
  margin: 0 auto;
  padding: 40px 24px;
}

/* メインコンテンツエリア */
.blog-single-main {
  flex: 1;
  min-width: 0;
  background: #fff;
  border-radius: 16px;
  padding: 40px 32px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
}

/* アイキャッチ画像 */
.blog-single-thumbnail {
  margin: 0 0 32px;
  border-radius: 12px;
  overflow: hidden;
  max-height: 420px;
  position: relative;
}

.blog-single-featured-image {
  width: 100%;
  height: auto;
  max-height: 420px;
  display: block;
  object-fit: cover;
  object-position: top center;
  border-radius: 12px;
}

/* 記事タイトル */
.blog-single-title {
  font-size: 32px;
  font-weight: 700;
  color: #1f2937;
  line-height: 1.4;
  margin: 0 0 24px;
}

/* メタ情報エリア */
.blog-single-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  padding-bottom: 24px;
  margin-bottom: 32px;
  border-bottom: 2px solid #f0f0f0;
  flex-wrap: wrap;
}

.blog-single-meta-left {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  align-items: center;
  flex: 1;
}

/* 投稿日 */
.post-date {
  display: flex;
  align-items: center;
  gap: 8px;
  color: #6b7280;
  font-size: 14px;
  font-weight: 500;
}

.post-date svg {
  color: #667eea;
}

/* シェアボタン */
.blog-single-share {
  display: flex;
  gap: 8px;
  align-items: center;
}

.share-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  transition: all 0.3s ease;
  text-decoration: none;
}

.share-facebook {
  background-color: #1877f2;
  color: #ffffff;
}

.share-facebook:hover {
  background-color: #155db2;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(24, 119, 242, 0.3);
}

.share-instagram {
  background: linear-gradient(45deg, #f09433 0%, #e6683c 25%, #dc2743 50%, #cc2366 75%, #bc1888 100%);
  color: #ffffff;
}

.share-instagram:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(188, 24, 136, 0.3);
}

.share-button svg {
  width: 20px;
  height: 20px;
}

/* カテゴリバッジ - /blogページと完全に同じスタイル (blog-modern.css) */
.blog-single-main .post-categories {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0;
}

.blog-single-main .post-categories .category-badge {
  display: inline-flex !important;
  align-items: center !important;
  gap: 6px !important;
  padding: 4px 10px !important;
  border-radius: 999px !important;
  background: #b71f39 !important;
  color: #fff !important;
  font-weight: 700 !important;
  letter-spacing: .02em !important;
  font-size: 12px !important;
  text-decoration: none !important;
  border: none !important;
  box-shadow: none !important;
  transition: background .2s !important;
}

.blog-single-main .post-categories .category-badge:hover {
  background: #CE2746 !important;
  color: #fff !important;
  transform: none !important;
  box-shadow: none !important;
}

/* 記事本文 */
.blog-single-content {
  color: #4b5563;
  font-size: 16px;
  line-height: 1.8;
  margin-bottom: 40px;
}

.blog-single-content h1 {
  font-size: 28px !important;
  font-weight: 700 !important;
  color: #1f2937 !important;
  margin: 48px 0 24px !important;
  padding-bottom: 0 !important;
  text-align: left !important;
  border: none !important;
  background: none !important;
}

.blog-single-content h1::before,
.blog-single-content h1::after {
  display: none !important;
}

.blog-single-content h2 {
  font-size: 24px;
  font-weight: 700;
  color: #1f2937;
  margin: 40px 0 20px;
  padding-bottom: 12px;
  padding-left: 16px;
  text-align: left; /* グローバルのtext-align: centerをリセット */
  border-left: 6px solid #007bba;
  border-bottom: 2px solid #007bba;
}

/* グローバルのh2::beforeで追加されるロゴアイコンを削除 */
.blog-single-content h2::before {
  display: none !important;
}

/* =============================
   目次ボックスのモダンデザイン
================================ */
.blog-single-content .ultp-block-toc {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(102, 126, 234, 0.06);
  margin: 32px 0;
}

/* 目次ヘッダー */
.blog-single-content .ultp-toc-header {
  background: rgba(255, 255, 255, 0.95) !important;
  backdrop-filter: blur(10px);
  padding: 20px 24px !important;
  border: none !important;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.blog-single-content .ultp-toc-heading {
  color: #667eea !important;
  font-size: 20px !important;
  font-weight: 700 !important;
  margin: 0;
}

/* 開閉トグル */
.blog-single-content .ultp-collapsible-toggle {
  margin-left: auto !important;
}

.blog-single-content .ultp-collapsible-text {
  color: #667eea !important;
  font-size: 14px !important;
  font-weight: 600 !important;
  padding: 6px 16px;
  background: #f0f4ff;
  border-radius: 20px;
  transition: all 0.3s ease;
  text-decoration: none !important;
}

.blog-single-content .ultp-collapsible-text:hover {
  background: #667eea;
  color: #fff !important;
  transform: translateY(-1px);
}

.blog-single-content .ultp-collapsible-toggle a svg {
  fill: #667eea !important;
}

/* 目次本体 */
.blog-single-content .ultp-block-toc-body {
  background: #fff !important;
  padding: 24px 28px !important;
}

/* 目次リスト */
.blog-single-content .ultp-toc-lists {
  list-style: none !important;
  padding: 0 !important;
  margin: 0 !important;
}

.blog-single-content .ultp-toc-lists li {
  margin: 0 0 12px 0 !important;
  padding-left: 0 !important;
}

.blog-single-content .ultp-toc-lists li:last-child {
  margin-bottom: 0 !important;
}

/* ネストされたリスト */
.blog-single-content .ultp-toc-lists ul {
  margin-top: 8px !important;
  padding-left: 24px !important;
}

.blog-single-content .ultp-toc-lists ul li {
  margin: 8px 0 !important;
}

/* 目次リンク */
.blog-single-content .ultp-toc-lists a {
  color: #374151 !important;
  font-size: 15px !important;
  font-weight: 500 !important;
  text-decoration: none !important;
  display: inline-flex;
  align-items: center;
  transition: all 0.3s ease;
  line-height: 1.6;
  padding: 4px 0;
}

.blog-single-content .ultp-toc-lists a:hover {
  color: #667eea !important;
  padding-left: 8px;
}

/* トップに戻るボタン */
.blog-single-content .ultp-toc-backtotop {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%) !important;
  border-radius: 12px !important;
  padding: 14px 16px !important;
  box-shadow: 0 4px 16px rgba(102, 126, 234, 0.3);
  transition: all 0.3s ease;
}

.blog-single-content .ultp-toc-backtotop:hover {
  background: linear-gradient(135deg, #764ba2 0%, #667eea 100%) !important;
  transform: translateY(-4px);
  box-shadow: 0 8px 24px rgba(102, 126, 234, 0.4);
}

.blog-single-content .ultp-toc-backtotop svg {
  fill: #fff !important;
}

.blog-single-content h3,
.blog-single-content h3.wp-block-heading {
  font-size: 20px !important;
  font-weight: 700 !important;
  color: #1f2937 !important;
  margin: 32px 0 16px !important;
  text-align: left !important;
  padding-bottom: 0 !important;
  padding-left: 24px !important;
  border: none !important;
  background: none !important;
  position: relative !important;
}

.blog-single-content h3::before,
.blog-single-content h3.wp-block-heading::before {
  content: "■" !important;
  color: #007bba !important;
  position: absolute !important;
  left: 0 !important;
  top: 50% !important;
  transform: translateY(-50%) !important;
  font-size: 16px !important;
  display: inline-block !important;
}

.blog-single-content h3::after,
.blog-single-content h3.wp-block-heading::after {
  display: none !important;
  content: none !important;
}

.blog-single-content p {
  margin-bottom: 20px;
}

.blog-single-content img {
  max-width: 100%;
  height: auto;
  border-radius: 12px;
  margin: 24px 0;
}

.blog-single-content ul,
.blog-single-content ol {
  margin: 20px 0;
  padding-left: 24px;
}

.blog-single-content ul,
.blog-single-content ul.wp-block-list {
  list-style-type: disc !important;
  list-style: disc !important;
}

.blog-single-content ol,
.blog-single-content ol.wp-block-list {
  list-style-type: decimal !important;
  list-style: decimal !important;
}

.blog-single-content li {
  margin-bottom: 8px;
  list-style-type: inherit !important;
}

.blog-single-content a {
  color: #667eea;
  text-decoration: underline;
  transition: color 0.2s ease;
}

.blog-single-content a:hover {
  color: #764ba2;
}

.blog-single-content code {
  background: #f3f4f6;
  padding: 2px 6px;
  border-radius: 4px;
  font-family: 'Courier New', monospace;
  font-size: 14px;
}

.blog-single-content pre {
  background: #1f2937;
  color: #f3f4f6;
  padding: 20px;
  border-radius: 8px;
  overflow-x: auto;
  margin: 24px 0;
}

.blog-single-content pre code {
  background: none;
  color: inherit;
  padding: 0;
}

/* タグエリア */
.blog-single-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  padding-top: 32px;
  border-top: 2px solid #f0f0f0;
}

.tags-label {
  font-weight: 700;
  color: #6b7280;
  font-size: 14px;
}

.tag-badge {
  display: inline-block;
  padding: 6px 14px;
  border-radius: 20px;
  background: #f3f4f6;
  color: #4b5563;
  font-size: 13px;
  font-weight: 500;
  text-decoration: none;
  transition: all 0.2s ease;
}

.tag-badge:hover {
  background: #667eea;
  color: #ffffff;
  transform: translateY(-2px);
}

/* サイドバー */
.blog-single-sidebar {
  flex: 0 0 320px;
  position: sticky;
  top: 20px;
  max-height: calc(100vh - 40px);
  overflow-y: auto;
  align-self: flex-start;
}

/* サイドバーウィジェット */
.sidebar-widget {
  background: #fff;
  border-radius: 16px;
  padding: 24px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
  margin-bottom: 24px;
}

.sidebar-widget-title {
  font-size: 18px;
  font-weight: 700;
  color: #1f2937;
  margin: 0 0 20px;
  padding-bottom: 12px;
  border-bottom: 2px solid #667eea;
}

.sidebar-widget-title::before,
.sidebar-widget-title::after {
  display: none !important;
}

/* 新着記事リスト */
.sidebar-recent-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.sidebar-recent-item {
  display: flex;
  gap: 12px;
  padding: 12px;
  border-radius: 8px;
  transition: all 0.3s ease;
  margin-bottom: 12px;
}

.sidebar-recent-item:hover {
  background: #f8f9ff;
  transform: translateX(4px);
}

.sidebar-recent-item:last-child {
  margin-bottom: 0;
}

.sidebar-recent-thumb-link {
  flex: 0 0 80px;
  display: block;
}

.sidebar-recent-thumb {
  width: 80px;
  height: 80px;
  object-fit: cover;
  border-radius: 8px;
  display: block;
}

.sidebar-recent-info {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
}

.sidebar-recent-title {
  font-size: 14px;
  font-weight: 600;
  color: #1f2937;
  text-decoration: none;
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  transition: color 0.2s ease;
}

.sidebar-recent-title:hover {
  color: #667eea;
}

.sidebar-recent-date {
  font-size: 12px;
  color: #9ca3af;
  font-weight: 500;
}

/* スクロールバーのスタイリング */
.blog-single-sidebar::-webkit-scrollbar {
  width: 6px;
}

.blog-single-sidebar::-webkit-scrollbar-track {
  background: #f3f4f6;
  border-radius: 3px;
}

.blog-single-sidebar::-webkit-scrollbar-thumb {
  background: #d1d5db;
  border-radius: 3px;
}

.blog-single-sidebar::-webkit-scrollbar-thumb:hover {
  background: #9ca3af;
}

/* レスポンシブデザイン */
@media (max-width: 1024px) {
  .blog-single-container {
    flex-direction: column;
    padding: 24px 16px;
  }

  .blog-single-main {
    padding: 32px 24px;
  }

  .blog-single-sidebar {
    position: static;
    flex: 0 0 auto;
    max-height: none;
    width: 100%;
  }

  .blog-single-title {
    font-size: 28px;
  }
}

@media (max-width: 768px) {
  .blog-single-main {
    padding: 24px 20px;
  }

  .blog-single-title {
    font-size: 24px;
  }

  .blog-single-content {
    font-size: 15px;
  }

  .blog-single-content h2 {
    font-size: 20px;
  }

  .blog-single-content h3 {
    font-size: 18px;
  }

  .sidebar-recent-thumb-link {
    flex: 0 0 60px;
  }

  .sidebar-recent-thumb {
    width: 60px;
    height: 60px;
  }
}

/* =============================
   Table Styles
   テーブルスタイル
================================ */

.blog-single-content table {
  width: 100%;
  border-collapse: collapse;
  margin: 24px 0;
}

.blog-single-content .wp-block-table thead,
.blog-single-content table thead {
  border-bottom: 1px solid #d1d5db !important;
}

.blog-single-content .wp-block-table tbody,
.blog-single-content table tbody {
  border: 1px solid #000000 !important;
}

.blog-single-content table thead th {
  background: #f0f0f0;
  color: #1f2937;
  font-weight: 700;
  padding: 12px 16px;
  text-align: left;
  border-bottom: none !important;
}

.blog-single-content table tbody td,
.blog-single-content table tbody th,
.blog-single-content .wp-block-table tbody td,
.blog-single-content .wp-block-table tbody th,
.blog-single-content figure.wp-block-table tbody td,
.blog-single-content figure.wp-block-table tbody th,
.blog-single-content td,
.blog-single-content th {
  padding: 12px 16px;
  border-bottom: 1px solid #d1d5db !important;
}

.blog-single-content table tbody tr:last-child td,
.blog-single-content table tbody tr:last-child th,
.blog-single-content .wp-block-table tbody tr:last-child td,
.blog-single-content .wp-block-table tbody tr:last-child th,
.blog-single-content figure.wp-block-table tbody tr:last-child td,
.blog-single-content figure.wp-block-table tbody tr:last-child th,
.blog-single-content tbody tr:last-child td,
.blog-single-content tbody tr:last-child th {
  border-bottom: none !important;
}
