/* =========================================================
   SINGLE POST / 記事ページ専用スタイル（RCP2026）
========================================================= */

/* ===== レイアウト全体 ===== */
.post-body {
  display: flex;
  flex-wrap: nowrap;
  gap: 2rem;
  align-items: flex-start;
}

.post-main {
  flex: 1 1 66%;
  background-color: var(--color-white);
  padding: 2rem;
  border-radius: 8px;
}

.post-sidebar {
  flex: 0 0 30%;
}

@media (max-width: 1024px) {
  .post-body {
    flex-direction: column;
  }

  .post-sidebar {
    width: 100%;
    margin-top: 2rem;
  }
}

/* ===== パンくず ===== */
.breadcrumb {
  font-size: 14px;
  margin-bottom: 1.5rem;
  color: var(--color-text-muted);
}

.breadcrumb a {
  color: var(--color-primary);
  text-decoration: none;
}

.breadcrumb a:hover {
  text-decoration: underline;
}

/* ===== タイトル・メタ情報 ===== */
.post-title {
  font-size: 2rem;
  font-weight: 700;
  margin-bottom: 1rem;
  line-height: 1.4;
}

.post-meta {
  font-size: 0.875rem;
  color: var(--color-text-light);
  margin-bottom: 2rem;
}

.post-meta .post-category {
  display: inline-block;
  background-color: var(--color-primary);
  color: var(--color-white);
  font-size: 0.8rem;
  padding: 0.25rem 0.75rem;
  margin-right: 0.5rem;
  border-radius: 9999px;
  text-decoration: none;
}

.post-meta .post-category:hover {
  background-color: var(--color-primary-hover);
}

/* ===== アイキャッチ（16:9固定） ===== */
.post-thumbnail {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  margin-bottom: 2rem;
  overflow: hidden;
  border-radius: 10px;
}

.post-thumbnail img {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 10px;
  transition: transform 0.4s ease;
}

.post-thumbnail:hover img {
  transform: scale(1.03);
}

/* ===== 本文エリア ===== */
.post-content {
  font-size: 1rem;
  color: var(--color-text);
  line-height: 1.8;
}

.post-content p {
  margin-bottom: 1.5rem;
}

.post-content ul,
.post-content ol {
  padding-left: 1.5rem;
  margin-bottom: 1.5rem;
}

.post-content a {
  color: var(--color-primary);
  text-decoration: underline;
  transition: 0.3s;
}

.post-content a:hover {
  text-decoration: none;
  color: var(--color-primary-hover);
}

/* ===== 見出し（強調） ===== */
.post-content h2 {
  font-size: 1.6rem;
  margin-top: 3rem;
  margin-bottom: 1.5rem;
  font-weight: 800;
  border-left: 6px solid var(--color-primary);
  padding-left: 0.75rem;
  color: var(--color-primary);
}

.post-content h3 {
  font-size: 1.3rem;
  margin-top: 2rem;
  margin-bottom: 1rem;
  font-weight: 700;
  position: relative;
  padding-left: 1.25rem;
  color: var(--color-primary);
}

.post-content h3::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.6em;
  width: 8px;
  height: 8px;
  background-color: var(--color-primary);
  border-radius: 50%;
}

/* ===== サイドバー追従 ===== */
.post-sticky {
  position: sticky;
  top: 120px;
  display: flex;
  flex-direction: column;
  gap: 2rem;
  z-index: 10;
  transition: transform 0.3s ease-out;
}

@media (prefers-reduced-motion: no-preference) {
  .post-sticky {
    animation: floatFollow 1.5s ease-out;
  }

  @keyframes floatFollow {
    0% {
      transform: translateY(20px);
      opacity: 0;
    }
    100% {
      transform: translateY(0);
      opacity: 1;
    }
  }
}

/* ===== サイドバーBOX ===== */
.post-sidebar-box {
  background-color: var(--color-bg-alt);
  padding: 1.5rem;
  border-radius: 1rem;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.05);
  text-align: center;
}

.post-sidebar-title {
  font-size: 1rem;
  font-weight: bold;
  margin-bottom: 1rem;
}

.post-sidebar-button {
  display: inline-block;
  padding: 0.75rem 1.5rem;
  background-color: var(--color-primary);
  color: var(--color-white);
  text-decoration: none;
  border-radius: 9999px;
  font-weight: bold;
  transition: background-color 0.3s;
}

.post-sidebar-button:hover {
  background-color: var(--color-primary-hover);
}

/* ===== レスポンシブ対応 ===== */
@media (max-width: 768px) {
  .post-title {
    font-size: 1.6rem;
  }

  .post-content h2 {
    font-size: 1.3rem;
  }

  .post-content h3 {
    font-size: 1.1rem;
  }

  .post-sticky {
    position: relative;
    top: auto;
    animation: none;
  }

  .post-sidebar-box {
    margin-top: 2rem;
  }
}

/* ===== サイドバー追従修正 ===== */
.post-sidebar {
  position: relative;
  overflow: visible; /* ← これが重要 */
}

.post-sticky {
  position: -webkit-sticky;
  position: sticky;
  top: 120px;
  align-self: flex-start; /* ← Flex内のstickyを安定化 */
}