/* post.css - 投稿詳細ページ（統一デザイン版） */

:root {
  --ny-accent: #4C9D81;
  --text: #473c34;
  --muted: #8e8a86;
  --badge-color: #fb8498;
  --button-color: #70B3B1;
  --link-color: #FFC509;
}

body.single-post {
  background: #F9F8F5;
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

.site-main.post-single {
  padding: 2rem 0;
}

/* ============================================
   ページタイトル
   ============================================ */

.page-title {
  font-size: 2.2rem;
  color: var(--ny-accent);
  margin: 2rem 1rem 0;
  font-weight: 600;
}

/* ============================================
   メイン画像セクション
   ============================================ */

.section-hero {
  background: transparent;
  padding: 0 0 3rem 0;
}

.hero-image-wrapper {
  position: relative;
  width: 90%;
  margin: 0 auto 3rem;
}

.hero-image-card {
  position: relative;
  width: 100%;
  background: transparent;
}

.hero-image-card img {
  width: 100%;
  border-radius: 20px;
  border-bottom-right-radius: 0;
  object-fit: cover;
  display: block;
}

.hero-image-card::after {
  content: "";
  position: absolute;
  bottom: -20px;
  right: -20px;
  width: 100px;
  height: 100px;
  background: transparent;
  border-top-left-radius: 50%;
  z-index: 1;
}

/* 画像がない場合のプレースホルダー */
.hero-image-card .no-image {
  width: 100%;
  min-height: 400px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #e8e8e8;
  color: var(--muted);
  font-size: 1.2rem;
  border-radius: 20px;
  border-bottom-right-radius: 0;
}

/* メタ情報 */
.post-meta {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  list-style: none;
  padding: 1rem 0 0 0;
  margin: 0;
  gap: 1rem;
}

.post-meta-left {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  align-items: center;
}

.post-date {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.85rem;
  color: var(--muted);
  font-weight: 600;
}

.post-date i {
  font-size: 0.85rem;
}

.post-category {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.85rem;
  color: var(--text);
  text-decoration: none;
  padding: 0.4rem 0.75rem;
  border-radius: 6px;
  background: #f5f5f5;
  transition: all 0.3s ease;
  cursor: pointer;
}

.post-category:hover {
  color: var(--ny-accent);
  background: #e8f5f0;
  transform: translateY(-1px);
  box-shadow: 0 2px 4px rgba(76, 157, 129, 0.15);
}

.post-category i {
  color: var(--button-color);
  font-size: 0.9rem;
  transition: transform 0.3s ease;
}

.post-category:hover i {
  transform: scale(1.1);
}

/* タグ */
.post-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  justify-content: flex-end;
}

.post-tag {
  display: inline-block;
  background: var(--link-color);
  color: #fff;
  padding: 0.375rem 0.75rem;
  border-radius: 16px;
  font-size: 0.7rem;
  font-weight: 600;
  white-space: nowrap;
  text-decoration: none;
  transition: all 0.3s ease;
  cursor: pointer;
  position: relative;
  overflow: hidden;
}

.post-tag::before {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.3);
  transform: translate(-50%, -50%);
  transition: width 0.4s ease, height 0.4s ease;
}

.post-tag:hover::before {
  width: 100px;
  height: 100px;
}

.post-tag:hover {
  background: #e6b308;
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(255, 197, 9, 0.4);
}

/* メイン情報 */
.hero-info {
  text-align: left;
  margin-top: 1.5rem;
  background: transparent;
  padding: 0;
  width: 90%;
  margin-left: auto;
  margin-right: auto;
}

.hero-title {
  font-size: 1.8rem;
  color: var(--ny-accent);
  margin: 1rem 0 1.5rem;
  font-weight: 600;
  line-height: 1.4;
}

/* ============================================
   本文コンテンツ
   ============================================ */

.section-content {
  background: #fff;
  padding: 2rem;
  border-radius: 8px;
  margin-bottom: 3rem;
}

.post-content {
  color: var(--text);
  line-height: 1.8;
  font-size: 1rem;
}

.post-content p {
  margin-bottom: 1.6em;
}

.post-content h2 {
  margin-top: 2.4em;
  margin-bottom: 1em;
  font-size: 1.6rem;
  color: var(--ny-accent);
  font-weight: 600;
}

.post-content h3 {
  margin-top: 2em;
  margin-bottom: 0.8em;
  font-size: 1.3rem;
  color: var(--button-color);
  font-weight: 600;
}

.post-content img {
  max-width: 100%;
  height: auto;
  border-radius: 8px;
  margin: 1.5rem 0;
  display: block;
}

.post-content a {
  color: var(--ny-accent);
  text-decoration: none;
  transition: 0.3s;
}

.post-content a:hover {
  text-decoration: underline;
}

.post-content ul,
.post-content ol {
  margin: 1rem 0 1rem 2rem;
}

.post-content li {
  margin: 0.5rem 0;
}

/* ============================================
   関連投稿セクション
   ============================================ */

.section-related {
  background: #fff;
  padding: 2rem;
  border-radius: 8px;
  margin-bottom: 3rem;
}

.section-related h2 {
  font-size: 1.05rem;
  color: var(--ny-accent);
  margin-bottom: 1.5rem;
  font-weight: 600;
}

.related-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 2rem;
}

@media (max-width: 900px) {
  .related-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 1.5rem;
  }
}

@media (max-width: 480px) {
  .related-grid {
    grid-template-columns: 1fr;
    gap: 1rem;
  }
}

/* 関連投稿カードリンク */
.related-card-link {
  text-decoration: none;
  color: inherit;
  display: block;
}

/* カード内部 */
.related-card-inner {
  position: relative;
  width: 100%;
  height: 13rem;
  background: #fff;
  border-radius: 1.25rem;
  border-bottom-right-radius: 0;
  overflow: hidden;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

/* 画像 */
.related-card {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.related-card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.3s ease;
}

.related-card-link:hover .related-card img {
  transform: scale(1.05);
}

/* 画像がない場合 */
.related-card .no-image {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #e8e8e8;
  color: var(--muted);
  font-size: 0.9rem;
}

/* 装飾 */
.related-card-inner::before {
  content: "";
  position: absolute;
  bottom: -0.375rem;
  right: -0.375rem;
  width: 3.4rem;
  height: 3.4rem;
  background: #fff;
  border-top-left-radius: 50%;
  z-index: 1;
}

.related-card-inner::after {
  content: "";
  position: absolute;
  bottom: -0.375rem;
  right: -0.375rem;
  width: 3.4rem;
  height: 3.4rem;
  background: transparent;
  border-top-left-radius: 50%;
  box-shadow: inset 0.313rem 0.313rem 0 0.313rem #fff;
  z-index: 2;
}

/* ボタン */
.related-button {
  position: absolute;
  bottom: 0.4rem;
  right: 0.4rem;
  width: 2rem;
  height: 2rem;
  background: var(--button-color);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 3;
  box-shadow: 0 3px 10px rgba(112, 179, 177, 0.3);
  transition: all 0.3s ease;
}

.related-button:hover {
  transform: scale(1.1);
  box-shadow: 0 4px 14px rgba(112, 179, 177, 0.4);
}

.related-button svg {
  width: 1.2rem;
  height: 1.2rem;
  color: #fff;
  transition: transform 0.3s ease;
}

.related-card-link:hover .related-button svg {
  transform: translateX(2px);
}

.related-title {
  margin-top: 0.625rem;
  color: var(--text);
  font-size: 0.85rem;
  text-align: center;
  font-weight: 500;
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

/* ============================================
   CTAセクション
   ============================================ */

.section-cta {
  background: linear-gradient(135deg, #4C9D81 0%, #3a7d66 100%);
  padding: 3rem 2rem;
  border-radius: 8px;
  text-align: center;
  margin-bottom: 3rem;
}

.section-cta h2 {
  font-size: 1.5rem;
  color: #fff;
  margin-bottom: 1rem;
  font-weight: 600;
}

.section-cta p {
  color: rgba(255, 255, 255, 0.9);
  font-size: 1rem;
  margin-bottom: 2rem;
}

.cta-buttons {
  display: flex;
  justify-content: center;
  gap: 1rem;
  flex-wrap: wrap;
}

.btn {
  display: inline-block;
  padding: 0.8rem 2rem;
  background: rgba(255, 255, 255, 0.25);
  color: #fff;
  border: 2px solid #fff;
  border-radius: 8px;
  text-decoration: none;
  font-weight: 600;
  transition: all 0.3s ease;
}

.btn:hover {
  background: rgba(255, 255, 255, 0.35);
  transform: translateY(-2px);
}

/* ============================================
   レスポンシブ
   ============================================ */

@media (max-width: 768px) {
  main.site-main {
    padding: 1.5rem 1rem;
  }

  .page-title {
    font-size: 1.8rem;
  }

  .hero-image-wrapper {
    width: 100%;
  }

  .hero-info {
    width: 100%;
  }

  .hero-title {
    font-size: 1.5rem;
  }

  .section-content,
  .section-related,
  .section-cta {
    padding: 1.5rem 1rem;
    margin-bottom: 2rem;
    border-radius: 4px;
  }
}

@media (max-width: 480px) {
  main.site-main {
    padding: 1rem 0.75rem;
  }

  .page-title {
    font-size: 1.5rem;
    margin: 1rem 0.75rem 0;
  }

  .hero-title {
    font-size: 1.3rem;
  }

  .post-meta {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.75rem;
  }

  .post-meta-left {
    width: 100%;
  }

  .post-tags {
    width: 100%;
    justify-content: flex-start;
  }

  .section-content,
  .section-related,
  .section-cta {
    padding: 1rem 0.75rem;
  }

  .section-cta h2 {
    font-size: 1.3rem;
  }

  .section-cta p {
    font-size: 0.9rem;
  }

  .cta-buttons {
    flex-direction: column;
  }

  .btn {
    width: 100%;
  }
}