/* WOOVE - blog.css */

*, *::before, *::after {
  box-sizing: border-box;
}

/* ===== HERO ===== */
.blog-hero {
  padding: 160px 60px 80px;
  background: var(--bg);
  position: relative; overflow: hidden;
}
.blog-hero::before {
  content: ''; position: absolute; top: 0; right: 0;
  width: 35%; height: 100%;
  background: var(--brand-pale);
  clip-path: polygon(15% 0, 100% 0, 100% 100%, 0% 100%);
  z-index: 0;
}
.blog-hero-inner { position: relative; z-index: 1; max-width: 640px; }
.hero-label {
  font-size: 10px; letter-spacing: 0.45em; text-transform: uppercase;
  color: var(--brand); margin-bottom: 20px;
  display: flex; align-items: center; gap: 14px;
  opacity: 0; animation: fadeUp 0.9s 0.2s forwards;
}
.hero-label::before { content: ''; width: 36px; height: 2px; background: var(--brand); }
.blog-hero-title {
  font-weight: 700; font-size: clamp(32px, 4vw, 52px);
  line-height: 1.35; margin-bottom: 24px; color: var(--ink);
  opacity: 0; animation: fadeUp 0.9s 0.4s forwards;
}
.blog-hero-sub {
  font-size: 14px; line-height: 2.2; color: var(--ink-light);
  opacity: 0; animation: fadeUp 0.9s 0.6s forwards;
}

/* ===== カテゴリフィルター ===== */
.blog-filter {
  background: var(--white);
  border-bottom: 1px solid var(--border);
  position: sticky; top: 0; z-index: 40;
  transition: top 0.4s;
}
.blog-filter-inner {
  display: flex; padding: 0 60px;
  overflow-x: auto; scrollbar-width: none; gap: 4px;
}
.blog-filter-inner::-webkit-scrollbar { display: none; }
.blog-filter-btn {
  font-size: 14px; letter-spacing: 0.12em;
  color: var(--ink-light); background: none; border: none;
  padding: 16px 18px; white-space: nowrap; cursor: pointer;
  border-bottom: 2px solid transparent;
  transition: all 0.25s; font-family: 'Noto Sans JP', sans-serif;
}
.blog-filter-btn:hover { color: var(--brand); }
.blog-filter-btn.active { color: var(--brand); border-bottom-color: var(--brand); font-weight: 500; }

/* ===== 記事一覧 ===== */
.blog-main {
  max-width: 1100px; margin: 0 auto;
  padding: 72px 60px 100px;
}
.blog-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 40px;
}

/* ===== ローディング ===== */
.blog-loading {
  grid-column: 1 / -1;
  text-align: center; padding: 80px 0; color: var(--ink-light);
}
.blog-loading-spinner {
  width: 32px; height: 32px;
  border: 2px solid var(--border);
  border-top-color: var(--brand);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin: 0 auto 16px;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ===== 記事カード ===== */
.blog-card {
  display: block; text-decoration: none; color: inherit;
  border: 1px solid var(--border);
  background: var(--white);
  transition: all 0.3s;
  opacity: 0; transform: translateY(20px);
  animation: fadeUp 0.5s forwards;
}
.blog-card:hover {
  border-color: var(--brand-mid);
  box-shadow: 0 8px 32px rgba(17,168,184,0.1);
  transform: translateY(-4px);
}
.blog-card-thumb {
  aspect-ratio: 16/9; overflow: hidden;
  background: var(--bg-soft);
}
.blog-card-thumb img {
  width: 100%; height: 100%; object-fit: cover;
  transition: transform 0.4s;
}
.blog-card:hover .blog-card-thumb img { transform: scale(1.04); }
.blog-card-thumb-placeholder {
  width: 100%; height: 100%;
  background: var(--brand-pale);
  display: flex; align-items: center; justify-content: center;
}
.blog-card-thumb-placeholder svg { width: 40px; height: 40px; opacity: 0.3; }
.blog-card-body { padding: 24px; }
.blog-card-meta {
  display: flex; align-items: center; gap: 12px;
  margin-bottom: 12px;
}
.blog-card-cat {
  font-size: 10px; letter-spacing: 0.15em;
  color: var(--brand); font-weight: 500;
  background: var(--brand-pale);
  padding: 3px 10px;
}
.blog-card-date {
  font-size: 12px; color: var(--ink-light); letter-spacing: 0.05em;
}
.blog-card-title {
  font-size: 15px; font-weight: 700; line-height: 1.65;
  color: var(--ink); margin-bottom: 10px;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.blog-card-desc {
  font-size: 12px; line-height: 1.9; color: var(--ink-light);
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}

/* ===== ページネーション ===== */
.blog-pagination {
  display: flex; justify-content: center; gap: 8px;
  margin-top: 56px;
}
.blog-page-btn {
  width: 40px; height: 40px;
  border: 1.5px solid var(--border);
  background: var(--white); color: var(--ink-light);
  font-size: 13px; cursor: pointer;
  transition: all 0.2s; font-family: 'Noto Sans JP', sans-serif;
  display: flex; align-items: center; justify-content: center;
}
.blog-page-btn:hover { border-color: var(--brand); color: var(--brand); }
.blog-page-btn.active { background: var(--brand); border-color: var(--brand); color: var(--white); }

/* ===== 記事なし ===== */
.blog-empty {
  grid-column: 1 / -1;
  text-align: center; padding: 80px 0; color: var(--ink-light);
  font-size: 14px;
}

/* ===== 記事詳細 ===== */
.post-main { max-width: 800px; margin: 0 auto; padding: 0px 0px 0px; }
.post-loading { text-align: center; padding: 80px 0; color: var(--ink-light); }
.post-breadcrumb {
  display: flex; align-items: center; gap: 8px;
  font-size: 12px; color: var(--ink-light); margin-bottom: 40px;
}
.post-breadcrumb a { color: var(--ink-light); text-decoration: none; }
.post-breadcrumb a:hover { color: var(--brand); }
.post-breadcrumb span { color: var(--border); }

.post-header { margin-bottom: 48px; }
.post-meta { display: flex; align-items: center; gap: 16px; margin-bottom: 20px; }
.post-cat {
  font-size: 12px; letter-spacing: 0.15em; color: var(--brand);
  background: var(--brand-pale); padding: 4px 14px; font-weight: 500;
}
.post-date { font-size: 12px; color: var(--ink-light); }

.post-title {
  font-size: clamp(22px, 3vw, 36px); font-weight: 700;
  line-height: 1.5; color: var(--ink); margin-bottom: 32px;
}
.post-thumbnail {
  aspect-ratio: 16/9; overflow: hidden; background: var(--bg-soft);
  margin-bottom: 0;
}
.post-thumbnail img { width: 100%; height: 100%; object-fit: cover; }

/* 記事本文スタイル */
.post-body {
  font-size: 15px; line-height: 2.4; color: var(--ink-mid);
  margin-bottom: 56px;
}
.post-body h2 {
  font-size: 22px; font-weight: 700; color: var(--ink);
  margin-top: 56px; margin-bottom: 20px;
  padding-left: 16px;
  border-left: 4px solid var(--brand);
}
.post-body h3 {
  font-size: 18px; font-weight: 700; color: var(--ink);
  margin-top: 40px; margin-bottom: 14px;
}
.post-body p { margin-bottom: 20px; }
.post-body ul, .post-body ol {
  padding-left: 24px; margin-bottom: 20px;
}
.post-body li { margin-bottom: 8px; }
.post-body strong { color: var(--ink); font-weight: 700; }
.post-body a { color: var(--brand); text-decoration: underline; }
.post-body img { max-width: 100%; height: auto; margin: 24px 0; }
.post-body table {
  width: 100%; border-collapse: collapse; margin: 28px 0; font-size: 14px;
}
.post-body th {
  background: var(--brand); color: var(--white);
  padding: 12px 16px; text-align: left; font-weight: 500;
}
.post-body td {
  padding: 12px 16px; border-bottom: 1px solid var(--border); color: var(--ink-mid);
}
.post-body tr:nth-child(even) td { background: var(--bg-soft); }
.post-body blockquote {
  border-left: 4px solid var(--brand-mid);
  padding: 16px 20px; margin: 28px 0;
  background: var(--bg-tint); color: var(--ink-light);
  font-style: normal;
}

.post-footer {
  padding-top: 40px;
  border-top: 1px solid var(--border);
  margin-bottom: 56px;
}
.post-back {
  font-size: 13px; color: var(--brand);
  text-decoration: none; letter-spacing: 0.08em;
  transition: opacity 0.2s;
}
.post-back:hover { opacity: 0.7; }

.post-cta {
  background: var(--bg-tint);
  border: 1.5px solid var(--brand-mid);
  padding: 40px; text-align: center;
}
.post-cta-title {
  font-size: 18px; font-weight: 700; color: var(--ink);
  margin-bottom: 12px;
}
.post-cta p {
  font-size: 13px; color: var(--ink-light);
  line-height: 2; margin-bottom: 24px;
}

/* ===== レスポンシブ ===== */
@media (max-width: 900px) {
  .blog-hero { padding: 120px 24px 56px; }
  .blog-hero::before { display: none; }
  .blog-filter-inner { padding: 0 24px; }
  .blog-main { padding: 48px 24px 72px; }
  .blog-grid { grid-template-columns: 1fr 1fr; gap: 24px; }
  .post-main { padding: 0px 0px 0px; }
}
@media (max-width: 599px) {
  .blog-grid { grid-template-columns: 1fr; }
  .post-title { font-size: 22px; }
}

/* ===== 記事詳細ページ レイアウト ===== */
.post-loading {
  text-align: center; padding: 160px 24px 80px; color: var(--ink-light);
}
.post-page {
  padding-top: 70px;
}
.post-layout {
  display: grid;
  grid-template-columns: 1fr 300px;
  gap: 56px;
  max-width: 1100px;
  margin: 0 auto;
  padding: 0px 60px 100px;
  /* align-items: start; ← この行を削除します */
}

/* ===== メインカラム ===== */
.post-main {
  min-width: 0;
}

.post-header { margin-bottom: 48px; }
.post-meta { display: flex; align-items: center; gap: 16px; margin-bottom: 20px; }
.post-cat {
  font-size: 11px; letter-spacing: 0.15em; color: var(--brand);
  background: var(--brand-pale); padding: 4px 14px; font-weight: 500;
}
.post-date { font-size: 12px; color: var(--ink-light); }
.post-title {
  font-size: clamp(22px, 3vw, 36px); font-weight: 700;
  line-height: 1.5; color: var(--ink); margin-bottom: 32px;
}
.post-thumbnail { aspect-ratio: 16/9; overflow: hidden; background: var(--bg-soft); }
.post-thumbnail img { width: 100%; height: 100%; object-fit: cover; }

/* 記事本文 */
.post-body {
  font-size: 15px; line-height: 2.4; color: var(--ink-mid);
  margin-bottom: 56px;
  word-break: break-word;
}
.post-body table {
  width: 100%; border-collapse: collapse; margin: 28px 0; font-size: 14px;
  display: block; overflow-x: auto; -webkit-overflow-scrolling: touch;
}
  font-size: 22px; font-weight: 700; color: var(--ink);
  margin-top: 56px; margin-bottom: 20px;
  padding-left: 16px; border-left: 4px solid var(--brand);
}
.post-body h3 {
  font-size: 18px; font-weight: 700; color: var(--ink);
  margin-top: 40px; margin-bottom: 14px;
}
.post-body p { margin-bottom: 20px; }
.post-body ul, .post-body ol { padding-left: 24px; margin-bottom: 20px; }
.post-body li { margin-bottom: 8px; }
.post-body strong { color: var(--ink); font-weight: 700; }
.post-body a { color: var(--brand); text-decoration: underline; }
.post-body img { max-width: 100%; height: auto; margin: 24px 0; }
.post-body th { background: var(--brand); color: var(--white); padding: 12px 16px; text-align: left; font-weight: 500; }
.post-body td { padding: 12px 16px; border-bottom: 1px solid var(--border); color: var(--ink-mid); }
.post-body tr:nth-child(even) td { background: var(--bg-soft); }
.post-body blockquote {
  border-left: 4px solid var(--brand-mid); padding: 16px 20px;
  margin: 28px 0; background: var(--bg-tint); color: var(--ink-light);
}

.post-footer { padding-top: 40px; border-top: 1px solid var(--border); margin-bottom: 56px; }
.post-back { font-size: 13px; color: var(--brand); text-decoration: none; letter-spacing: 0.08em; transition: opacity 0.2s; }
.post-back:hover { opacity: 0.7; }

.post-cta {
  background: var(--bg-tint); border: 1.5px solid var(--brand-mid);
  padding: 40px; text-align: center; margin-bottom: 72px;
}
.post-cta-title { font-size: 18px; font-weight: 700; color: var(--ink); margin-bottom: 12px; }
.post-cta p { font-size: 13px; color: var(--ink-light); line-height: 2; margin-bottom: 24px; }

/* ===== 関連記事 ===== */
.related-section { margin-top: 0; }
.related-header { display: flex; align-items: baseline; gap: 14px; margin-bottom: 32px; }
.related-label {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 13px; letter-spacing: 0.2em; color: var(--brand);
}
.related-title { font-size: 20px; font-weight: 700; color: var(--ink); }
.related-grid {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px;
  margin-bottom: 40px;
}
.related-more { text-align: center; }
.related-all-btn {
  display: inline-block; padding: 13px 40px;
  border: 1.5px solid var(--brand); color: var(--brand);
  font-size: 13px; letter-spacing: 0.12em; font-weight: 500;
  text-decoration: none; background: transparent; transition: all 0.25s;
}
.related-all-btn:hover {
  background: var(--brand); color: var(--white);
  transform: translateY(-2px); box-shadow: 0 8px 28px rgba(17,168,184,0.28);
}

/* ===== サイドバー ===== */
.post-sidebar {
  display: flex;
  flex-direction: column;
  gap: 24px;
  /* align-self: start; ← この行を削除します */
}

.post-sidebar-sticky {
  display: flex;
  flex-direction: column;
  gap: 24px;
  flex-grow: 1; /* ← この1行を追加します */
}

.sidebar-widget {
  border: 1px solid var(--border);
  background: var(--white);
  padding: 24px;
}
.sidebar-widget-title {
  font-size: 12px; letter-spacing: 0.25em; text-transform: uppercase;
  color: var(--brand); font-weight: 500; margin-bottom: 16px;
  padding-bottom: 12px; border-bottom: 1px solid var(--border);
}

/* 検索 */
.sidebar-search { display: flex; gap: 0; }
.sidebar-search-input {
  flex: 1; font-size: 13px; padding: 10px 14px;
  border: 1.5px solid var(--border); border-right: none;
  font-family: 'Noto Sans JP', sans-serif; color: var(--ink);
  outline: none; transition: border-color 0.2s;
}
.sidebar-search-input:focus { border-color: var(--brand); }
.sidebar-search-btn {
  padding: 0 14px; background: var(--brand); border: none; cursor: pointer;
  color: var(--white); transition: background 0.2s;
}
.sidebar-search-btn:hover { background: var(--brand-dark); }

/* バナー */
.sidebar-banner { padding: 0; overflow: hidden; }
.sidebar-banner-link { text-decoration: none; display: block; }
.sidebar-banner-inner {
  background: var(--ink); padding: 28px 24px;
  display: flex; flex-direction: column; gap: 10px;
  transition: background 0.25s;
}
.sidebar-banner-link:hover .sidebar-banner-inner { background: var(--brand-dark); }
.sidebar-banner-label {
  font-size: 10px; letter-spacing: 0.3em; text-transform: uppercase;
  color: var(--brand-mid); font-weight: 500;
}
.sidebar-banner-title {
  font-size: 16px; font-weight: 700; color: var(--white); line-height: 1.7;
}
.sidebar-banner-arrow { font-size: 18px; color: var(--brand); }

/* サイドバーCTA */
.sidebar-cta { background: var(--brand); border-color: var(--brand); }
.sidebar-cta .sidebar-widget-title { color: rgba(255,255,255,0.7); border-bottom-color: rgba(255,255,255,0.2); }
.sidebar-cta-label {
  font-size: 10px; letter-spacing: 0.25em; color: rgba(255,255,255,0.7);
  margin-bottom: 8px;
}
.sidebar-cta-title { font-size: 15px; font-weight: 700; color: var(--white); margin-bottom: 10px; }
.sidebar-cta-sub { font-size: 12px; color: rgba(255,255,255,0.8); line-height: 1.8; margin-bottom: 20px; }
.sidebar-cta-btn {
  display: block; text-align: center; padding: 12px;
  background: var(--white); color: var(--brand);
  font-size: 12px; font-weight: 700; text-decoration: none;
  letter-spacing: 0.08em; margin-bottom: 16px;
  transition: all 0.2s;
}
.sidebar-cta-btn:hover { background: var(--brand-pale); }
.sidebar-cta-points {
  list-style: none; padding: 0;
  display: flex; flex-direction: column; gap: 6px;
}
.sidebar-cta-points li {
  font-size: 11px; color: rgba(255,255,255,0.85);
  display: flex; align-items: center; gap: 8px;
}
.sidebar-cta-points li::before {
  content: '✓'; color: rgba(255,255,255,0.6); font-size: 10px;
}

.toc-container {
  position: sticky;
  top: 100px; /* スクロール時に画面上部で止まる位置 */
  background: var(--bg-soft);
  padding: 20px;
  border: 1px solid var(--border);
  margin-top: 30px;
}

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

.toc-item {
  margin-bottom: 10px;
  line-height: 1.4;
}

.toc-item a {
  text-decoration: none;
  color: var(--ink-mid);
  font-size: 13px;
  transition: color 0.2s;
}

.toc-item a:hover {
  color: var(--brand);
}

/* サイドバー目次のウィジェット枠 */
.toc-widget {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  
  /* 以下の3行を追加します */
  position: sticky;
  top: 90px; /* 上部のナビゲーションバーの高さに合わせて数値を調整してください */
  z-index: 10;
}

/* 目次のリンク一覧エリア（常にスクロール可能） */
.sidebar-toc {
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  max-height: 320px;
  padding-right: 4px;
}

/* スクロールバーのカスタマイズ（任意：細くしてデザインに馴染ませる） */
.sidebar-toc::-webkit-scrollbar {
  width: 4px;
}
.sidebar-toc::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 10px;
}

/* リンクの基本スタイル */
.sidebar-toc-link {
  display: block;
  font-size: 13px;
  color: var(--ink-light);
  text-decoration: none;
  line-height: 1.6;
  padding: 8px 0;
  border-bottom: 1px solid var(--bg-soft);
  transition: all 0.2s;
}

/* （ハイライト機能は使用しない） */
.sidebar-toc-link.active {}

/* アンカー移動時に見出しがナビに隠れないようにする設定 */
.post-body h2, .post-body h3 {
  scroll-margin-top: 100px; 
}
.sidebar-toc-link:hover {
  color: #11a8b8;
}

/* h3見出し（子要素）の字下げ */
.sidebar-toc-h3 {
  padding-left: 1em;
  font-size: 13px;
}


/* 現在地ハイライト 
.sidebar-toc-link.active {
  color: #11a8b8;
  font-weight: bold;
  border-left: 2px solid #11a8b8;
  padding-left: 8px;
}

 現在地のハイライトがナビに隠れないためのスクロールマージン（予備設定） 
.post-body h2, .post-body h3 {
  scroll-margin-top: 100px; /* ブラウザ標準のアンカー移動対策 
}/*

/* スマホ表示では追従を解除 */
@media (max-width: 900px) {
  .toc-container {
    position: static;
    margin-top: 40px;
  }
}

/* ===== レスポンシブ ===== */
@media (max-width: 1000px) {
  .post-layout { grid-template-columns: 1fr 260px; gap: 40px; padding: 0px 32px 80px; }
}
@media (max-width: 900px) {
  .post-page { padding-top: 50px; }
  .post-layout {
    grid-template-columns: 1fr;
    padding: 32px 16px 72px;
    box-sizing: border-box;
    width: 100%;
    max-width: 100%;
  }
  .post-sidebar { position: static; gap: 32px; }
  .related-grid { grid-template-columns: 1fr 1fr; }
  .sidebar-toc-widget { display: none !important; }
  .post-cta { padding: 28px 16px; box-sizing: border-box; }
  .post-body img { max-width: 100%; height: auto; display: block; }
}
@media (max-width: 599px) {
  .related-grid { grid-template-columns: 1fr; }
  .post-title { font-size: 20px; }
  .post-layout { padding: 24px 16px 56px; }
  .blog-hero { padding: 100px 16px 48px; }
  .blog-main { padding: 32px 16px 64px; }
  .blog-filter-inner { padding: 0 16px; }
  .post-cta { padding: 24px 16px; }
  .sidebar-widget { padding: 20px 16px; }
}