/*
Theme Name: MoneyDive
Theme URI: https://moneydive.local
Author: MoneyDive Team
Author URI: https://moneydive.local
Description: 投資ブログ「MoneyDive」のカスタムテーマ。NISA、投資信託、米国株、マーケット情報、節約・家計管理に関する情報を発信します。
Version: 1.0.0
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: moneydive
Tags: blog, investment, finance, responsive, custom-menu
*/

/* Reset and Base Styles */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Hiragino Sans",
    "Hiragino Kaku Gothic ProN", "Noto Sans JP", YuGothic, "Yu Gothic Medium",
    Meiryo, sans-serif;
  font-size: 17px;
  line-height: 1.9;
  color: #08131a;
  background-color: #ffffff;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

a {
  color: #08131a;
  text-decoration: none;
  transition: all 0.2s ease;
}

a:hover {
  color: #149274;
  text-decoration: none;
}

/* Container */
.container {
  max-width: 1000px;
  margin: 0 auto;
  padding: 0 24px;
}

/* Header */
.site-header {
  background-color: #fff;
  padding: 24px 0 0;
  position: sticky;
  top: 0;
  z-index: 100;
}

.site-branding {
  max-width: 1000px;
  margin: 0 auto;
  padding: 0 24px;
}

.site-title {
  font-size: 1.5rem;
  font-weight: 700;
  color: #08131a;
  margin-bottom: 4px;
  letter-spacing: -0.02em;
}

.site-title a {
  color: #08131a;
  display: flex;
  align-items: center;
}

.site-title a:hover {
  color: #149274;
}

.site-logo {
  height: 60px;
  width: auto;
  display: block;
}

.site-description {
  font-size: 0.875rem;
  color: #6b7280;
  font-weight: 400;
}

/* Navigation */
.main-navigation {
  background-color: #fff;
  border-bottom: 1px solid #f0f0f0;
  padding: 0;
  margin-top: 0;
}

.main-navigation .container {
  max-width: 1000px;
  position: relative;
}

.main-navigation ul {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 12px 32px;
  padding: 12px 0;
}

.main-navigation a {
  color: #6b7280;
  font-weight: 500;
  font-size: 0.9375rem;
  padding: 8px 0;
}

.main-navigation a:hover {
  color: #149274;
  text-decoration: none;
}

/* Menu Toggle Button */
.menu-toggle {
  display: none;
  background-color: transparent;
  border: none;
  color: #6b7280;
  cursor: pointer;
  padding: 8px;
  font-size: 1.25rem;
  transition: color 0.2s ease;
}

.menu-toggle:hover {
  color: #149274;
}

/* Main Content */
.site-content {
  display: grid;
  grid-template-columns: 1fr 280px;
  gap: 48px;
  margin: 48px auto;
  padding: 0 24px;
  max-width: 1000px;
}

/* サイドバーがない場合（index, archiveなど） */
.site-content:not(:has(.sidebar)) {
  grid-template-columns: 1fr;
  max-width: 800px;
}

.content-area {
  background-color: transparent;
  padding: 0;
}

/* Sidebar Toggle Button */
.sidebar-toggle {
  display: none;
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 999;
  background-color: #149274;
  color: #fff;
  border: none;
  border-radius: 50%;
  width: 56px;
  height: 56px;
  box-shadow: 0 4px 12px rgba(20, 146, 116, 0.4);
  cursor: pointer;
  transition: all 0.3s ease;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
}

.sidebar-toggle i {
  font-size: 1.25rem;
}

.sidebar-toggle span {
  font-size: 0.625rem;
  font-weight: 600;
}

.sidebar-toggle:hover {
  background-color: #0d7c5f;
  transform: scale(1.05);
}

.sidebar-toggle:active {
  transform: scale(0.95);
}

/* Sidebar */
.sidebar {
  background-color: transparent;
  padding: 0;
  height: fit-content;
}

/* 目次専用スタイル */
.toc-sidebar {
  position: sticky;
  top: 200px;
  max-height: calc(100vh - 200px);
  overflow-y: auto;
}

.toc-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.toc-item {
  margin-bottom: 8px;
}

.toc-item.toc-h3 {
  padding-left: 16px;
  font-size: 0.875rem;
}

.toc-link {
  color: #4b5563;
  font-size: 0.9375rem;
  display: block;
  padding: 6px 0;
  transition: color 0.2s ease;
  line-height: 1.5;
}

.toc-link:hover {
  color: #149274;
}

.widget {
  margin-bottom: 40px;
  padding: 24px;
  background-color: #f9fafb;
  border-radius: 8px;
}

.widget-title {
  font-size: 1rem;
  font-weight: 700;
  color: #08131a;
  margin-bottom: 16px;
  letter-spacing: -0.01em;
}

.widget ul {
  list-style: none;
}

.widget ul li {
  margin-bottom: 12px;
}

.widget ul li a {
  color: #4b5563;
  font-size: 0.9375rem;
  display: flex;
  align-items: center;
  gap: 8px;
}

.widget ul li a i {
  color: #149274;
  font-size: 0.75rem;
  transition: transform 0.2s ease;
}

.widget ul li a:hover {
  color: #149274;
}

.widget ul li a:hover i {
  transform: translateX(3px);
}

/* Articles */
.article-list {
  display: grid;
  gap: 48px;
}

.article-card {
  border-bottom: 1px solid #f0f0f0;
  padding-bottom: 48px;
}

.article-card:last-child {
  border-bottom: none;
}

.article-header {
  margin-bottom: 16px;
}

.article-title {
  font-size: 1.625rem;
  line-height: 1.4;
  font-weight: 700;
  margin-bottom: 12px;
  letter-spacing: -0.02em;
  color: #08131a;
}

.article-title a {
  color: #08131a;
}

.article-title a:hover {
  color: #149274;
}

.article-meta {
  font-size: 0.875rem;
  color: #6b7280;
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 12px;
}

.article-category {
  display: inline-block;
  background-color: transparent;
  color: #149274;
  padding: 4px 12px;
  border: 1px solid #149274;
  border-radius: 16px;
  font-size: 0.8125rem;
  font-weight: 500;
  margin: 0 0 12px 0;
  line-height: 1.2;
}

.article-thumbnail {
  margin-bottom: 20px;
  border-radius: 8px;
  overflow: hidden;
}

.article-thumbnail img {
  width: 100%;
  height: auto;
  display: block;
  transition: transform 0.3s ease;
}

.article-thumbnail:hover img {
  transform: scale(1.02);
}

.article-excerpt {
  color: #4b5563;
  margin-bottom: 20px;
  font-size: 1rem;
  line-height: 1.75;
}

.read-more {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background-color: transparent;
  color: #149274;
  padding: 0;
  border-radius: 0;
  font-weight: 600;
  font-size: 0.9375rem;
  border-bottom: 2px solid #149274;
  padding-bottom: 2px;
}

.read-more i {
  font-size: 0.8125rem;
  transition: transform 0.2s ease;
}

.read-more:hover {
  background-color: transparent;
  text-decoration: none;
  color: #0d7c5f;
  border-bottom-color: #0d7c5f;
}

.read-more:hover i {
  transform: translateX(3px);
}

/* Author Section */
.author-section {
  background-color: #f9fafb;
  padding: 64px 0;
  margin-top: 80px;
  border-top: 1px solid #f0f0f0;
}

.author-card {
  display: flex;
  gap: 32px;
  align-items: center;
  max-width: 800px;
  margin: 0 auto;
  background-color: #fff;
  padding: 40px;
  border-radius: 12px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

.author-avatar {
  width: 120px;
  height: 120px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
}

.author-avatar-placeholder {
  width: 120px;
  height: 120px;
  border-radius: 50%;
  background-color: #e5e7eb;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.author-avatar-placeholder i {
  font-size: 3rem;
  color: #9ca3af;
}

.author-info {
  flex: 1;
}

.author-name {
  font-size: 1.5rem;
  font-weight: 700;
  color: #08131a;
  margin-bottom: 16px;
  letter-spacing: -0.02em;
}

.author-bio {
  font-size: 1rem;
  line-height: 1.8;
  color: #4b5563;
  margin: 0;
}

/* Ranking Section */
.ranking-section {
  background-color: #fff;
  padding: 64px 0;
  border-top: 1px solid #f0f0f0;
}

.ranking-section-title {
  font-size: 1.875rem;
  font-weight: 700;
  color: #08131a;
  text-align: center;
  margin-bottom: 48px;
  letter-spacing: -0.02em;
}

.ranking-list {
  display: flex;
  flex-direction: column;
  gap: 24px;
  max-width: 900px;
  margin: 0 auto;
}

.ranking-item {
  display: flex;
  gap: 24px;
  align-items: flex-start;
  background-color: #fff;
  border: 2px solid #e5e7eb;
  border-radius: 12px;
  padding: 32px;
  transition: all 0.3s ease;
  position: relative;
}

.ranking-item:hover {
  border-color: #149274;
  box-shadow: 0 4px 12px rgba(20, 146, 116, 0.1);
  transform: translateY(-2px);
}

.ranking-item:first-child {
  border-color: #fbbf24;
  background: linear-gradient(135deg, #fffbeb 0%, #ffffff 100%);
}

.ranking-item:first-child:hover {
  border-color: #f59e0b;
  box-shadow: 0 4px 12px rgba(251, 191, 36, 0.2);
}

.ranking-item:nth-child(2) {
  border-color: #d1d5db;
  background: linear-gradient(135deg, #f9fafb 0%, #ffffff 100%);
}

.ranking-item:nth-child(2):hover {
  border-color: #9ca3af;
  box-shadow: 0 4px 12px rgba(209, 213, 219, 0.2);
}

.ranking-item:nth-child(3) {
  border-color: #d97706;
  background: linear-gradient(135deg, #fef3c7 0%, #ffffff 100%);
}

.ranking-item:nth-child(3):hover {
  border-color: #b45309;
  box-shadow: 0 4px 12px rgba(217, 119, 6, 0.2);
}

.ranking-badge {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-width: 80px;
  height: 80px;
  background-color: #149274;
  border-radius: 50%;
  flex-shrink: 0;
  box-shadow: 0 2px 8px rgba(20, 146, 116, 0.3);
}

.ranking-item:first-child .ranking-badge {
  background: linear-gradient(135deg, #fbbf24 0%, #f59e0b 100%);
}

.ranking-item:nth-child(2) .ranking-badge {
  background: linear-gradient(135deg, #9ca3af 0%, #6b7280 100%);
}

.ranking-item:nth-child(3) .ranking-badge {
  background: linear-gradient(135deg, #d97706 0%, #b45309 100%);
}

.ranking-number {
  font-size: 2rem;
  font-weight: 700;
  color: #fff;
  line-height: 1;
  margin-bottom: 2px;
}

.ranking-label {
  font-size: 0.875rem;
  font-weight: 600;
  color: #fff;
  line-height: 1;
}

.ranking-image {
  width: 300px;
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: #fff;
  border-radius: 8px;
  flex-shrink: 0;
  overflow: hidden;
}

.ranking-image img {
  width: 100%;
  object-fit: contain;
}

.ranking-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.ranking-name {
  font-size: 1.375rem;
  font-weight: 700;
  color: #08131a;
  margin: 0;
  letter-spacing: -0.01em;
}

.ranking-points {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.ranking-points li {
  font-size: 0.9375rem;
  line-height: 1.6;
  color: #4b5563;
  padding-left: 24px;
  position: relative;
}

.ranking-points li::before {
  content: "✓";
  position: absolute;
  left: 0;
  color: #149274;
  font-weight: 700;
  font-size: 1.125rem;
}

.ranking-button {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background-color: #149274;
  color: #fff;
  padding: 12px 24px;
  border-radius: 8px;
  font-weight: 600;
  font-size: 0.9375rem;
  transition: all 0.2s ease;
  text-decoration: none;
  align-self: flex-start;
  margin-top: 8px;
}

.ranking-button:hover {
  background-color: #0d7c5f;
  transform: translateX(4px);
  color: #fff;
}

.ranking-button i {
  font-size: 0.875rem;
  transition: transform 0.2s ease;
}

.ranking-button:hover i {
  transform: translateX(4px);
}

/* Footer */
.site-footer {
  background-color: #f9fafb;
  color: #4b5563;
  padding: 48px 0 32px;
  text-align: center;
  margin-top: 80px;
  border-top: 1px solid #f0f0f0;
}

.social-links {
  display: flex;
  justify-content: center;
  gap: 20px;
  margin-bottom: 32px;
}

.social-links a {
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background-color: #fff;
  color: #6b7280;
  font-size: 1.125rem;
  transition: all 0.2s ease;
  border: 1px solid #e5e7eb;
}

.social-links a:hover {
  background-color: #149274;
  color: #fff;
  border-color: #149274;
  transform: translateY(-2px);
}

.footer-navigation ul {
  list-style: none;
  display: flex;
  justify-content: center;
  gap: 24px;
  margin-bottom: 24px;
  flex-wrap: wrap;
}

.footer-navigation a {
  color: #6b7280;
  font-size: 0.875rem;
}

.footer-navigation a:hover {
  color: #149274;
}

.copyright {
  font-size: 0.8125rem;
  color: #9ca3af;
}

/* Single Post & Page Styles */
.page-title,
h1.article-title {
  font-size: 2rem;
  line-height: 1.3;
  font-weight: 700;
  margin-bottom: 24px;
  letter-spacing: -0.03em;
}

.article-content,
.page-content {
  font-size: 1.0625rem;
  line-height: 1.9;
  color: #1f2937;
}

.article-content h2,
.page-content h2 {
  font-size: 1.625rem;
  font-weight: 700;
  margin-top: 48px;
  margin-bottom: 24px;
  letter-spacing: -0.02em;
  color: #08131a;
}

.article-content h3,
.page-content h3 {
  font-size: 1.375rem;
  font-weight: 700;
  margin-top: 40px;
  margin-bottom: 20px;
  letter-spacing: -0.01em;
  color: #08131a;
}

.article-content p,
.page-content p {
  margin-bottom: 24px;
}

.article-content ul,
.page-content ul,
.content-area ul {
  margin-bottom: 24px;
  padding-left: 20px;
  margin-left: 0;
}

.article-content ol,
.page-content ol,
.content-area ol {
  margin-bottom: 24px;
  padding-left: 20px;
  margin-left: 0;
}

.article-content li,
.page-content li {
  margin-bottom: 8px;
}

.article-content a,
.page-content a {
  color: #149274;
  text-decoration: underline;
}

.article-content a:hover,
.page-content a:hover {
  color: #0d7c5f;
}

/* Breadcrumb */
.breadcrumb {
  margin-bottom: 24px;
  padding: 12px 0;
}

.breadcrumb-list {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  list-style: none;
  padding: 0;
  margin: 0;
  gap: 8px;
  font-size: 0.875rem;
}

.breadcrumb-item {
  display: flex;
  align-items: center;
  color: #6b7280;
}

.breadcrumb-item:not(:last-child)::after {
  content: "›";
  margin-left: 8px;
  color: #9ca3af;
  font-weight: 600;
}

.breadcrumb-item a {
  color: #6b7280;
  text-decoration: none;
  transition: color 0.2s ease;
}

.breadcrumb-item a:hover {
  color: #149274;
}

.breadcrumb-item a i {
  margin-right: 4px;
  font-size: 0.8125rem;
}

.breadcrumb-item.active {
  color: #08131a;
  font-weight: 500;
}

/* Archive Header */
.archive-header {
  margin-bottom: 48px;
  padding-bottom: 24px;
  border-bottom: 1px solid #f0f0f0;
}

.archive-title {
  font-size: 2rem;
  font-weight: 700;
  color: #08131a;
  margin-bottom: 12px;
  letter-spacing: -0.02em;
}

.archive-description {
  font-size: 1rem;
  color: #6b7280;
  line-height: 1.75;
}

/* Pagination */
.pagination {
  margin-top: 64px;
  display: flex;
  justify-content: center;
  gap: 12px;
}

.pagination a,
.pagination span {
  padding: 8px 16px;
  border: 1px solid #e5e7eb;
  border-radius: 6px;
  color: #4b5563;
  font-size: 0.9375rem;
}

.pagination a:hover {
  background-color: #f9fafb;
  color: #149274;
  border-color: #149274;
}

.pagination .current {
  background-color: #149274;
  color: #fff;
  border-color: #149274;
}

/* CTA Section */
.cta-section {
  background-color: #f0fdf4;
  padding: 32px;
  margin-top: 48px;
  border-radius: 12px;
  border: 1px solid #d1fae5;
}

.cta-section h3 {
  font-size: 1.25rem;
  font-weight: 700;
  color: #08131a;
  margin-bottom: 16px;
  margin-top: 0;
}

.cta-section ul {
  margin-bottom: 0;
  padding-left: 20px;
}

.cta-section li {
  margin-bottom: 12px;
}

.cta-section a {
  color: #149274;
  font-weight: 600;
  text-decoration: none;
}

.cta-section a:hover {
  color: #0d7c5f;
  text-decoration: underline;
}

/* Post Navigation */
.post-navigation {
  margin-top: 64px;
  padding-top: 32px;
  border-top: 1px solid #f0f0f0;
  display: flex;
  justify-content: space-between;
  gap: 24px;
}

.nav-previous a,
.nav-next a {
  color: #149274;
  font-weight: 600;
  font-size: 0.9375rem;
}

.nav-previous a:hover,
.nav-next a:hover {
  color: #0d7c5f;
}

/* Responsive */
@media (max-width: 768px) {
  body {
    font-size: 16px;
  }

  .site-content {
    grid-template-columns: 1fr;
    gap: 40px;
    margin: 32px auto;
  }

  /* ヘッダーをコンパクトに */
  .site-header {
    padding: 16px 0;
  }

  .site-branding {
    display: flex;
    justify-content: space-between;
    align-items: center;
  }

  .site-title {
    font-size: 1.25rem;
    margin-bottom: 0;
  }

  .site-logo {
    height: 50px;
  }

  .site-description {
    display: none;
  }

  /* メニュートグルボタンを表示 */
  .menu-toggle {
    display: block;
  }

  /* ナビゲーションを非表示・トグル対応 */
  .main-navigation {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    border-bottom: none;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
  }

  .main-navigation.is-open {
    max-height: 500px;
    border-bottom: 1px solid #f0f0f0;
  }

  .main-navigation ul {
    flex-direction: column;
    gap: 0;
    padding: 0;
  }

  .main-navigation li {
    border-bottom: 1px solid #f0f0f0;
  }

  .main-navigation li:last-child {
    border-bottom: none;
  }

  .main-navigation a {
    display: block;
    padding: 16px 24px;
    font-size: 1rem;
  }

  /* モバイルメニュー内のSNSリンク */
  .mobile-social-links {
    display: flex;
    justify-content: center;
    gap: 16px;
    padding: 24px;
    border-top: 1px solid #f0f0f0;
    background-color: #f9fafb;
  }

  .mobile-social-links a {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background-color: #fff;
    color: #6b7280;
    font-size: 1rem;
    transition: all 0.2s ease;
    border: 1px solid #e5e7eb;
    padding: 0;
  }

  .mobile-social-links a:hover {
    background-color: #149274;
    color: #fff;
    border-color: #149274;
  }

  .article-title {
    font-size: 1.375rem;
  }

  h1.article-title,
  .page-title {
    font-size: 1.75rem;
  }

  .article-content h2,
  .page-content h2 {
    font-size: 1.375rem;
  }

  .article-content h3,
  .page-content h3 {
    font-size: 1.125rem;
  }

  /* サイドバートグルを表示（記事ページのみ） */
  .sidebar-toggle {
    display: none;
  }

  body.single .sidebar-toggle {
    display: flex;
  }

  /* サイドバーをモバイルで非表示・スライドイン */
  .sidebar {
    position: fixed;
    top: 0;
    right: -100%;
    width: 85%;
    max-width: 320px;
    height: 100vh;
    background-color: #fff;
    box-shadow: -4px 0 12px rgba(0, 0, 0, 0.1);
    padding: 80px 24px 24px;
    overflow-y: auto;
    transition: right 0.3s ease;
    z-index: 998;
  }

  .sidebar.is-open {
    right: 0;
  }

  /* 目次サイドバーのモバイルスタイル */
  .toc-sidebar {
    position: fixed;
    top: 0;
    max-height: 100vh;
  }

  /* オーバーレイ */
  .sidebar.is-open::before {
    content: "";
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: -1;
  }

  .widget {
    padding: 20px;
    background-color: #f9fafb;
  }

  .widget:first-child {
    margin-top: 0;
  }

  /* Author Section */
  .author-section {
    padding: 48px 0;
    margin-top: 48px;
  }

  .author-card {
    flex-direction: column;
    text-align: center;
    padding: 32px 24px;
    gap: 24px;
  }

  .author-avatar,
  .author-avatar-placeholder {
    width: 100px;
    height: 100px;
  }

  .author-avatar-placeholder i {
    font-size: 2.5rem;
  }

  .author-name {
    font-size: 1.25rem;
    margin-bottom: 12px;
  }

  .author-bio {
    font-size: 0.9375rem;
  }

  /* Ranking Section */
  .ranking-section {
    padding: 48px 0;
  }

  .ranking-section-title {
    font-size: 1.5rem;
    margin-bottom: 32px;
  }

  .ranking-list {
    gap: 20px;
  }

  .ranking-item {
    flex-direction: column;
    padding: 24px 20px;
    gap: 20px;
    align-items: center;
    text-align: center;
  }

  .ranking-badge {
    min-width: 70px;
    height: 70px;
  }

  .ranking-number {
    font-size: 1.75rem;
  }

  .ranking-label {
    font-size: 0.8125rem;
  }

  .ranking-image {
    width: 100%;
    max-width: 200px;
  }

  .ranking-content {
    align-items: center;
  }

  .ranking-name {
    font-size: 1.125rem;
  }

  .ranking-points li {
    font-size: 0.875rem;
    padding-left: 20px;
  }

  .ranking-points li::before {
    font-size: 1rem;
  }

  .ranking-button {
    width: 100%;
    justify-content: center;
    padding: 12px 20px;
  }

  .ranking-button:hover {
    transform: none;
  }

  .ranking-button:hover i {
    transform: translateX(4px);
  }

  /* Breadcrumb */
  .breadcrumb {
    margin-bottom: 20px;
    padding: 8px 0;
  }

  .breadcrumb-list {
    font-size: 0.8125rem;
    gap: 6px;
  }

  .breadcrumb-item:not(:last-child)::after {
    margin-left: 6px;
  }

  .breadcrumb-item a i {
    font-size: 0.75rem;
  }
}

/* Affiliate Banner Styles */
.affiliate-banner img {
  display: block;
  margin: 0 auto;
}

/* Related Posts (note-style) */
.related-posts {
  margin: 60px 0 40px;
  padding: 0;
  width: 100%;
  max-width: 100%;
  overflow: hidden;
}

.related-posts-title {
  font-size: 1.25rem;
  font-weight: 600;
  color: #08131a;
  margin: 0 0 20px;
  padding: 0;
  border: none;
}

.related-posts-list {
  display: flex;
  flex-direction: column;
  gap: 16px;
  width: 100%;
  max-width: 100%;
}

.related-post-card {
  display: flex;
  gap: 16px;
  padding: 16px;
  width: 100%;
  max-width: 100%;
  background-color: #ffffff;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  text-decoration: none;
  color: #08131a;
  transition: all 0.2s ease;
  overflow: hidden;
  box-sizing: border-box;
}

.related-post-card:hover {
  background-color: #f9fafb;
  border-color: #d1d5db;
  transform: translateY(-2px);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.related-post-image {
  width: 120px;
  min-width: 120px;
  max-width: 120px;
  height: 80px;
  object-fit: cover;
  border-radius: 4px;
  flex-shrink: 0;
}

.related-post-content {
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex: 1;
  min-width: 0;
  overflow: hidden;
}

.related-post-title {
  font-size: 1rem;
  font-weight: 600;
  color: #08131a;
  line-height: 1.5;
  margin: 0;
  padding: 0;
  border: none;
  word-break: break-word;
  overflow-wrap: break-word;
}

.related-post-excerpt {
  font-size: 0.875rem;
  color: #6b7280;
  line-height: 1.6;
  margin: 0;
  overflow: hidden;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  word-break: break-word;
  overflow-wrap: break-word;
}

/* Responsive */
@media (max-width: 768px) {
  .related-posts {
    margin: 40px 0 30px;
  }

  .related-posts-title {
    font-size: 1.125rem;
  }

  .related-post-card {
    padding: 12px;
    gap: 12px;
  }

  .related-post-image {
    width: 100px;
    min-width: 100px;
    max-width: 100px;
    height: 67px;
  }

  .related-post-title {
    font-size: 0.9375rem;
  }

  .related-post-excerpt {
    font-size: 0.8125rem;
  }
}

@media (max-width: 480px) {
  .related-post-card {
    flex-direction: column;
  }

  .related-post-image {
    width: 100%;
    min-width: 100%;
    max-width: 100%;
    height: 160px;
  }
}

/* ================================================
   テーブルスタイル（ハイブリッド方式）
   ================================================ */

/* 基本スタイル */
.article-content table {
  width: 100%;
  border-collapse: collapse;
  margin: 32px 0;
  background-color: #fff;
  font-size: 0.9375rem;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
  border-radius: 8px;
  overflow: hidden;
}

.article-content table th,
.article-content table td {
  padding: 14px 16px;
  text-align: left;
  border: 1px solid #e5e7eb;
}

.article-content table th {
  background-color: #f9fafb;
  font-weight: 600;
  color: #374151;
  border-bottom: 2px solid #d1d5db;
}

.article-content table tbody tr:hover {
  background-color: #f9fafb;
}

.article-content table tbody tr:nth-child(even) {
  background-color: #fafafa;
}

/* テーブルラッパー（JavaScriptで自動追加） */
.table-wrapper {
  width: 100%;
  margin: 32px 0;
  position: relative;
}

/* スマホでの横スクロール対応 */
@media (max-width: 768px) {
  .table-wrapper {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    margin: 24px 0;
    padding: 0;
    position: relative;
    width: calc(100vw - 60px);
    border-radius: 8px;
    display: block;
  }

  .article-content table {
    margin: 0;
    box-shadow: none;
    font-size: 0.875rem;
    min-width: 600px; /* テーブルの最小幅を確保 */
    display: table; /* テーブルとして表示 */
  }

  .article-content table th,
  .article-content table td {
    padding: 10px 12px;
    white-space: nowrap; /* 改行を防ぐ */
  }

  /* 最後の列に余白を追加（グラデーション影の分） */
  .article-content table th:last-child,
  .article-content table td:last-child {
    padding-right: 48px;
  }
}

@media (max-width: 480px) {
  .table-wrapper {
    margin: 20px 0;
  }

  .article-content table {
    font-size: 0.8125rem;
    min-width: 500px;
  }

  .article-content table th,
  .article-content table td {
    padding: 8px 10px;
  }

  .article-content table th:last-child,
  .article-content table td:last-child {
    padding-right: 48px;
  }
}
