* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family:
    "Helvetica Neue", Arial, "Hiragino Kaku Gothic ProN", "Hiragino Sans",
    Meiryo, sans-serif;
  line-height: 1.6;
  color: #333;
}

a {
  color: #0056b3;
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

.wrapper {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 1rem;
}

header {
  background: #f8f9fa;
  padding: 1.5rem 0;
  border-bottom: 1px solid #e9ecef;
  margin-bottom: 2rem;
}

header h1 {
  margin: 0;
  font-size: 1.5rem;
}

/* 2カラムレイアウト */
.container {
  display: flex;
  gap: 2rem;
}

main {
  flex: 3;
} /* メインコンテンツ 75%程度 */
aside {
  flex: 1;
} /* サイドバー 25%程度 */

.sidebar-widget {
  background: #f8f9fa;
  padding: 1.5rem;
  border-radius: 4px;
  margin-bottom: 2rem;
}

.sidebar-widget h3 {
  margin-top: 0;
  font-size: 1.1rem;
  border-bottom: 2px solid #e9ecef;
  padding-bottom: 0.5rem;
  margin-bottom: 1rem;
  color: #333;
}

.sidebar-widget ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

.sidebar-widget li {
  border-bottom: 1px solid #e9ecef;
}

.sidebar-widget li:last-child {
  border-bottom: none;
}

.sidebar-widget li a {
  display: block;
  padding: 0.6rem 0;
  color: #555;
  transition: all 0.2s ease;
}

.sidebar-widget li a:hover {
  color: #0056b3;
  text-decoration: none;
}

footer {
  margin-top: 3rem;
  padding: 2rem 0;
  background: #333;
  color: #fff;
  text-align: center;
}

/* スマホ対応 */
@media (max-width: 768px) {
  .container {
    flex-direction: column;
  }

  /* テーブルを横スクロール可能にする */
  table {
    display: block;
    overflow-x: auto;
    white-space: nowrap;
    -webkit-overflow-scrolling: touch;
  }
}

/* --- テーブルスタイル --- */
table {
  width: 100%;
  border-collapse: collapse;
  margin: 2.5rem 0;
  font-size: 0.95em;
  border-radius: 8px;
  overflow: hidden; /* 角丸を有効にするため */
}

table th,
table td {
  padding: 14px 16px;
  text-align: center;
  vertical-align: middle; /* 画像とテキストの垂直方向を中央揃え */
}

table thead th {
  background-color: #343a40;
  color: #ffffff;
  font-weight: 600;
}

table tbody tr {
  border-bottom: 1px solid #e9ecef;
}

table tbody tr:nth-of-type(even) {
  background-color: #f8f9fa; /* 縞模様 */
}

table tbody tr:hover {
  background-color: #e9ecef; /* ホバー時の背景色 */
}

table img {
  max-width: 80px;
  height: auto;
  display: block;
  margin: 0 auto;
}

.red-button {
  display: inline-block;
  background-color: #e60033; /* 目立つ赤色 */
  color: #ffffff; /* 文字色は白 */
  text-decoration: none; /* 下線を消す */
  padding: 10px 20px; /* 上下左右の余白 */
  border-radius: 5px; /* 角を丸くする */
  font-weight: bold; /* 太字 */
  text-align: center;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2); /* 軽い影をつける */
  transition: opacity 0.3s ease;
}

.red-button:hover {
  opacity: 0.8; /* ホバー時に少し透明にして反応を示す */
  color: #ffffff;
}

.green-button {
  display: inline-block;
  background-color: #00b300; /* 目立つ緑色 */
  color: #ffffff; /* 文字色は白 */
  text-decoration: none; /* 下線を消す */
  padding: 10px 20px; /* 上下左右の余白 */
  border-radius: 5px; /* 角を丸くする */
  font-weight: bold; /* 太字 */
  text-align: center;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2); /* 軽い影をつける */
  transition: opacity 0.3s ease;
}

.green-button:hover {
  opacity: 0.8; /* ホバー時に少し透明にして反応を示す */
  color: #ffffff;
}

.strong-red {
  color: #e60033;
  font-weight: bold;
}

/* ストアリンク共通のボタンスタイル */
.store-btn {
  display: inline-block;
  color: #ffffff !important; /* 文字色を白に固定 */
  text-decoration: none; /* 下線を消す */
  padding: 8px 12px; /* 余白 */
  border-radius: 4px; /* 角丸 */
  font-size: 14px;
  font-weight: bold;
  text-align: center;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2); /* 軽い影 */
  transition: opacity 0.2s ease;
  min-width: 100px; /* 幅をある程度揃える */
  word-break: keep-all;
  overflow-wrap: break-word;
}

.store-btn:hover {
  opacity: 0.8; /* ホバー時の透明度 */
  color: #ffffff !important;
}

/* Amazon Kindle (オレンジ) */
.kindle-btn {
  background-color: #ff9900;
}

/* BOOK☆WALKER (ダークグレー/黒) */
.bw-btn {
  background-color: #333333;
}

/* 楽天ブックス (赤) */
.rakuten-btn {
  background-color: #bf0000;
}

/* --- 吹き出し（チャット）スタイル --- */
.speech-bubble {
  display: flex;
  align-items: flex-start;
  gap: 15px;
  margin-bottom: 20px;
}

.speech-bubble.right {
  flex-direction: row-reverse;
}

.speech-icon {
  width: 60px;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.speech-icon img {
  width: 50px;
  height: 50px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid #eee;
  margin-bottom: 5px;
  background-color: #ddd; /* 画像がない場合の背景色 */
}

.speech-name {
  font-size: 10px;
  color: #777;
  text-align: center;
  line-height: 1.2;
}

.speech-content {
  position: relative;
  background: #f1f1f1;
  padding: 15px;
  border-radius: 10px;
  font-size: 15px;
  color: #333;
  line-height: 1.6;
  max-width: 80%;
}

/* 右側（自分）の色変更 */
.speech-bubble.right .speech-content {
  background: #dcf8c6;
}

/* --- シェアボタン --- */
.share-area {
  margin: 40px 0;
  padding: 20px;
  background: #f9f9f9;
  border-radius: 8px;
  text-align: center;
}

.share-area h3 {
  margin-top: 0;
  font-size: 1.1rem;
  margin-bottom: 15px;
}

.share-buttons {
  display: flex;
  justify-content: center;
  gap: 10px;
  flex-wrap: wrap;
}

.share-btn {
  display: inline-block;
  padding: 10px 16px;
  color: #fff !important;
  border-radius: 4px;
  font-size: 14px;
  font-weight: bold;
  transition: opacity 0.2s;
}

.share-btn:hover {
  opacity: 0.8;
  text-decoration: none;
}
.sb-x {
  background-color: #000;
}
.sb-fb {
  background-color: #1877f2;
}
.sb-line {
  background-color: #06c755;
}
.sb-hatebu {
  background-color: #00a4de;
}

/* --- ページネーション（前後記事） --- */
.post-pagination {
  display: flex;
  justify-content: space-between;
  gap: 15px;
  margin-top: 30px;
}
.post-pagination a {
  flex: 1;
  padding: 15px;
  background: #fff;
  border: 1px solid #ddd;
  border-radius: 5px;
  display: flex;
  flex-direction: column;
  color: #333;
  transition: background 0.2s;
}
.post-pagination a:hover {
  background: #f5f5f5;
  text-decoration: none;
}
.pagination-label {
  font-size: 12px;
  color: #888;
  margin-bottom: 5px;
}
.pagination-title {
  font-weight: bold;
  font-size: 14px;
}
.post-pagination .prev {
  text-align: left;
}
.post-pagination .next {
  text-align: right;
}
@media (max-width: 600px) {
  .post-pagination {
    flex-direction: column;
  }
}

/* --- 目次 (TOC) --- */
.post-toc {
  background: #f8f9fa;
  border: 1px solid #e9ecef;
  border-radius: 4px;
  padding: 1.5rem;
  margin: 2rem 0;
}

.post-toc h2 {
  margin-top: 0;
  font-size: 1.25rem;
  border-bottom: 2px solid #e9ecef;
  padding-bottom: 0.5rem;
  margin-bottom: 1rem;
}

.post-toc ul {
  list-style-type: none;
  padding-left: 0;
}

.post-toc ul ul {
  padding-left: 1.5rem;
  margin-top: 0.5rem;
}

.post-toc li {
  margin-bottom: 0.5rem;
}

.post-toc a {
  color: #495057;
  text-decoration: none;
}

.post-toc a:hover {
  color: #0056b3;
  text-decoration: underline;
}

.blog-card {
  display: block;
  text-decoration: none;
  color: inherit;
  border: 1px solid #ddd;
  border-radius: 8px;
  margin: 1.5rem 0;
  background-color: #fff;
  transition:
    box-shadow 0.2s,
    transform 0.2s;
  overflow: hidden;
}
.blog-card:hover {
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
  background-color: #fcfcfc;
  transform: translateY(-2px);
}
.blog-card-body {
  display: flex;
  padding: 5px 15px 15px;
  gap: 15px;
  align-items: start;
}
.blog-card-thumbnail {
  flex: 0 0 80px;
  width: 80px;
}
.blog-card-thumbnail img {
  width: 100%;
  height: auto;
  border-radius: 4px;
  display: block;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}
.blog-card-content {
  flex: 1;
  min-width: 0;
}
.blog-card-title {
  font-weight: bold;
  font-size: 1.1rem;
  padding: 15px 15px 5px;
  line-height: 1.4;
  color: #333;
}
.blog-card-summary {
  font-size: 0.9rem;
  color: #666;
  margin-bottom: 0.5rem;
  line-height: 1.5;
  display: -webkit-box;
  line-clamp: 2;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.blog-card-meta {
  font-size: 0.8rem;
  color: #999;
}
@media (max-width: 480px) {
  .blog-card-thumbnail {
    flex: 0 0 60px;
    width: 60px;
  }
  .blog-card-title {
    font-size: 1rem;
  }
}

.post-summary-card {
  display: block;
  text-decoration: none;
  color: inherit;
  border: 1px solid #ddd;
  border-radius: 8px;
  margin-bottom: 1.5rem;
  padding: 15px;
  background-color: #fff;
  transition: box-shadow 0.2s;
}
.post-summary-card:hover {
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
}
.card-header {
  margin-bottom: 10px;
}
.card-header h2 {
  margin: 0 0 5px 0;
  font-size: 1.4rem;
}
.card-header .meta {
  font-size: 0.85rem;
  color: #666;
}
.card-body {
  display: flex;
  gap: 15px;
}
.card-thumbnail {
  flex: 0 0 120px;
}
.card-thumbnail img {
  width: 100%;
  height: auto;
  border-radius: 4px;
  display: block;
}
.card-content {
  flex: 1;
  min-width: 0;
}
.summary {
  font-size: 0.95rem;
  line-height: 1.6;
}
/* Pagination */
.pagination {
  display: flex;
  justify-content: center;
  list-style: none;
  padding: 0;
  margin: 2rem 0;
  gap: 5px;
}
.pagination .page-item .page-link {
  display: block;
  padding: 8px 12px;
  border: 1px solid #ddd;
  border-radius: 4px;
  text-decoration: none;
  color: #333;
  background-color: #fff;
}
.pagination .page-item.active .page-link {
  background-color: #eee;
  font-weight: bold;
}
.pagination .page-item.disabled .page-link {
  color: #ccc;
  pointer-events: none;
}

.pr-label {
  display: inline-block;
  color: #333;
  font-size: 12px;
  padding: 4px 8px;
  border-radius: 4px;
}
