/* blog.css - Notion Design System for micro-communities */

/* ========================================
   Notion Design System
   - フォント：Inter, Noto Sans JP, system-ui
   - ライトテーマ
   - 2カラム（メイン + 300pxサイドバー）
   - モバイル1カラム（768px以下）
   ======================================== */

/* フォント指定 */
.blog-layout,
.blog-main,
.blog-sidebar,
.article-header {
  font-family: 'Inter', 'Noto Sans JP', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

/* ========================================
   ページヘッダー
   ======================================== */
.article-header {
  background: linear-gradient(135deg, var(--primary-color, #2D3E50) 0%, #3d5266 100%);
  color: #fff;
  padding: 3rem 0;
  margin-bottom: 2rem;
}

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

.article-title {
  font-size: clamp(1.75rem, 4vw, 2.5rem);
  font-weight: 800;
  line-height: 1.2;
  letter-spacing: -0.02em;
  margin: 0 0 0.75rem;
}

.article-meta {
  font-size: 1rem;
  opacity: 0.9;
  line-height: 1.6;
}

/* ========================================
   メインレイアウト
   ======================================== */
.blog-layout {
  display: flex;
  gap: 2.5rem;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 2rem 4rem;
  align-items: start;
}

.blog-main {
  flex: 1;
  min-width: 0;
}

.blog-sidebar {
  width: 300px;
  flex-shrink: 0;
  position: sticky;
  top: calc(var(--header-height, 80px) + 1.5rem);
  align-self: start;
}

/* ========================================
   ブログカード（一覧ページ）
   ======================================== */
.blog-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1.5rem;
}

.blog-card {
  background: #FFFFFF;
  border: 1px solid rgba(0, 0, 0, 0.08);
  border-radius: 8px;
  overflow: hidden;
  transition: all 0.2s ease;
  box-shadow:
    rgba(0, 0, 0, 0.04) 0px 4px 18px,
    rgba(0, 0, 0, 0.027) 0px 2.025px 7.84688px,
    rgba(0, 0, 0, 0.02) 0px 0.8px 2.925px,
    rgba(0, 0, 0, 0.01) 0px 0.175px 1.04062px;
}

.blog-card:hover {
  transform: translateY(-2px);
  box-shadow:
    rgba(0, 0, 0, 0.08) 0px 8px 24px,
    rgba(0, 0, 0, 0.054) 0px 4.05px 15.69376px,
    rgba(0, 0, 0, 0.04) 0px 1.6px 5.85px,
    rgba(0, 0, 0, 0.02) 0px 0.35px 2.08125px;
  border-color: rgba(0, 0, 0, 0.12);
}

.blog-card a {
  color: inherit;
  text-decoration: none;
  display: block;
}

.card-thumb {
  position: relative;
  padding-top: 56.25%;
  overflow: hidden;
  background: linear-gradient(135deg, #e8ecf1 0%, #d5dde5 100%);
}

.card-thumb img {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s ease;
}

.blog-card:hover .card-thumb img {
  transform: scale(1.05);
}

.card-category {
  position: absolute;
  top: 0.75rem;
  left: 0.75rem;
  display: inline-block;
  padding: 0.25rem 0.75rem;
  background: var(--secondary-color, #E67E22);
  color: #fff;
  border-radius: 9999px;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.025em;
}

.card-body {
  padding: 1.25rem;
}

.card-meta {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 0.625rem;
  font-size: 0.875rem;
  color: #666;
  font-weight: 500;
}

.card-body h3 {
  font-size: 1.125rem;
  font-weight: 700;
  line-height: 1.4;
  letter-spacing: -0.01em;
  margin: 0 0 0.75rem;
  color: var(--text-dark, #1A1A1A);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.card-body p {
  font-size: 0.9rem;
  color: #666;
  line-height: 1.6;
  margin: 0;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* ========================================
   記事詳細ページ
   ======================================== */
.article-post {
  background: #FFFFFF;
  border: 1px solid rgba(0, 0, 0, 0.08);
  border-radius: 8px;
  padding: 2rem;
  box-shadow:
    rgba(0, 0, 0, 0.04) 0px 4px 18px,
    rgba(0, 0, 0, 0.027) 0px 2.025px 7.84688px,
    rgba(0, 0, 0, 0.02) 0px 0.8px 2.925px,
    rgba(0, 0, 0, 0.01) 0px 0.175px 1.04062px;
}

.article-hero {
  margin: -2rem -2rem 2rem;
  border-radius: 8px 8px 0 0;
  overflow: hidden;
}

.article-featured-image {
  width: 100%;
  height: auto;
  max-height: 400px;
  object-fit: cover;
  display: block;
}

.image-caption {
  padding: 0.75rem 2rem;
  font-size: 0.875rem;
  color: #888;
  text-align: center;
  background: #f8f9fa;
}

.article-content {
  color: var(--text-color, #333);
  line-height: 1.8;
  font-size: 1rem;
}

.article-content h2 {
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--text-dark, #1A1A1A);
  margin: 2.5rem 0 1rem;
  padding-left: 1rem;
  border-left: 3px solid var(--secondary-color, #E67E22);
  letter-spacing: -0.015em;
}

.article-content h3 {
  font-size: 1.375rem;
  font-weight: 700;
  color: var(--text-dark, #1A1A1A);
  margin: 2rem 0 0.875rem;
  letter-spacing: -0.01em;
}

.article-content h4 {
  font-size: 1.125rem;
  font-weight: 600;
  color: var(--text-dark, #1A1A1A);
  margin: 1.5rem 0 0.625rem;
}

.article-content p {
  margin-bottom: 1.25rem;
}

.article-content a {
  color: var(--secondary-color, #E67E22);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.article-content a:hover {
  text-decoration: none;
  opacity: 0.8;
}

.article-content ul,
.article-content ol {
  margin: 1.25rem 0 1.25rem 1.5rem;
  padding: 0;
}

.article-content li {
  margin-bottom: 0.625rem;
  line-height: 1.7;
}

.article-content img {
  max-width: 100%;
  height: auto;
  border-radius: 8px;
  margin: 1.5rem 0;
  border: 1px solid rgba(0, 0, 0, 0.08);
}

.article-content blockquote {
  border-left: 3px solid var(--secondary-color, #E67E22);
  margin: 1.5rem 0;
  padding: 0.75rem 0 0.75rem 1.25rem;
  color: #555;
  font-style: italic;
  background: #f8f9fa;
  border-radius: 0 8px 8px 0;
}

.article-content strong {
  color: var(--text-dark, #1A1A1A);
  font-weight: 600;
}

/* ========================================
   サイドバー
   ======================================== */
.sidebar-block {
  background: #FFFFFF;
  border: 1px solid rgba(0, 0, 0, 0.08);
  border-radius: 8px;
  padding: 1.25rem;
  margin-bottom: 1.25rem;
  box-shadow:
    rgba(0, 0, 0, 0.04) 0px 4px 18px,
    rgba(0, 0, 0, 0.027) 0px 2.025px 7.84688px,
    rgba(0, 0, 0, 0.02) 0px 0.8px 2.925px,
    rgba(0, 0, 0, 0.01) 0px 0.175px 1.04062px;
}

.sidebar-block h2 {
  font-size: 1rem;
  font-weight: 700;
  margin: 0 0 1rem;
  color: var(--text-dark, #1A1A1A);
  padding-bottom: 0.75rem;
  border-bottom: 1px solid rgba(0, 0, 0, 0.08);
  letter-spacing: -0.01em;
}

/* 広告プレースホルダー */
.sidebar-ad.amazon-ad {
  background: linear-gradient(135deg, #f8f9fa 0%, #e8ecf1 100%);
  border: 2px dashed rgba(0, 0, 0, 0.15);
  border-radius: 8px;
  padding: 2rem 1rem;
  text-align: center;
  color: #888;
  font-size: 0.875rem;
  font-weight: 500;
  margin-bottom: 1.25rem;
}

/* 検索フォーム */
.search-form {
  display: flex;
  gap: 0.5rem;
}

.search-input {
  flex: 1;
  padding: 0.5rem 0.75rem;
  border: 1px solid rgba(0, 0, 0, 0.12);
  border-radius: 6px;
  font-size: 0.9rem;
  background: #f8f9fa;
  color: var(--text-color, #333);
}

.search-button {
  padding: 0.5rem 0.75rem;
  background: var(--primary-color, #2D3E50);
  color: #fff;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity 0.2s;
}

.search-button:hover {
  opacity: 0.85;
}

/* カテゴリーリスト */
.category-list,
.popular-list,
.widget-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.category-list li,
.popular-list li,
.widget-list li {
  margin-bottom: 0.625rem;
}

.category-list a,
.popular-list a,
.widget-list a {
  color: #666;
  font-size: 0.9rem;
  text-decoration: none;
  transition: color 0.2s;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.25rem 0;
}

.category-list a:hover,
.popular-list a:hover,
.widget-list a:hover {
  color: var(--secondary-color, #E67E22);
}

.category-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}

.popular-rank {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  background: var(--primary-color, #2D3E50);
  color: #fff;
  border-radius: 4px;
  font-size: 0.75rem;
  font-weight: 700;
  flex-shrink: 0;
}

.popular-title {
  line-height: 1.4;
}

/* sitenavi バナー */
.sitenavi-block a {
  display: block;
  margin-bottom: 0.75rem;
}

.sitenavi-block img {
  max-width: 100%;
  height: auto;
  border-radius: 4px;
  display: block;
}

/* バナーブロック */
.banner-block .banner-link {
  display: block;
  padding: 1rem;
  background: linear-gradient(135deg, var(--primary-color, #2D3E50) 0%, #3d5266 100%);
  border-radius: 8px;
  color: #fff;
  text-decoration: none;
  text-align: center;
}

.banner-text {
  margin: 0.5rem 0 0;
  font-size: 0.9rem;
  line-height: 1.5;
}

.pill-badge {
  display: inline-block;
  padding: 0.25rem 0.75rem;
  background: rgba(255, 255, 255, 0.2);
  color: #fff;
  border-radius: 9999px;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.025em;
}

/* ========================================
   共有リンク
   ======================================== */
.share-links {
  margin-top: 2.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid rgba(0, 0, 0, 0.08);
}

.share-links-title {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-dark, #1A1A1A);
  margin-bottom: 1rem;
}

.share-buttons {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.share-buttons a {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.5rem 1rem;
  border: 1px solid rgba(0, 0, 0, 0.12);
  border-radius: 6px;
  color: var(--text-dark, #1A1A1A);
  font-size: 0.875rem;
  font-weight: 500;
  transition: all 0.2s ease;
  background: #f8f9fa;
  text-decoration: none;
}

.share-buttons a:hover {
  border-color: var(--secondary-color, #E67E22);
  color: var(--secondary-color, #E67E22);
  background: #fff;
}

/* ========================================
   目次（TOC）
   ======================================== */
.toc-block .toc-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.toc-block .toc-list li {
  margin: 0.5rem 0;
  line-height: 1.5;
}

.toc-block .toc-list a {
  text-decoration: none;
  color: #666;
  transition: color 0.2s;
}

.toc-block .toc-list a:hover {
  color: var(--secondary-color, #E67E22);
  text-decoration: underline;
}

/* ========================================
   空状態
   ======================================== */
.empty-state {
  text-align: center;
  padding: 4rem 2rem;
  color: #888;
}

/* ========================================
   スクロールトップ
   ======================================== */
.scroll-to-top {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  background: var(--secondary-color, #E67E22);
  color: #fff;
  border: none;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  font-size: 1.25rem;
  cursor: pointer;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 999;
}

.scroll-to-top.visible {
  opacity: 1;
  visibility: visible;
}

.scroll-to-top:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(0,0,0,0.2);
}

/* ========================================
   スキップリンク
   ======================================== */
.skip-link {
  position: absolute;
  top: -40px;
  left: 0;
  background: var(--secondary-color, #E67E22);
  color: #fff;
  padding: 8px 16px;
  z-index: 1001;
  font-weight: 600;
  transition: top 0.2s;
  text-decoration: none;
}

.skip-link:focus {
  top: 0;
}

/* ========================================
   レスポンシブ（768px以下で1カラム）
   ======================================== */
@media (max-width: 768px) {
  .blog-layout {
    flex-direction: column;
    gap: 2rem;
    padding: 0 1rem 3rem;
  }

  .blog-sidebar {
    width: 100%;
    position: static;
  }

  .blog-grid {
    grid-template-columns: 1fr;
  }

  .article-post {
    padding: 1.5rem;
  }

  .article-hero {
    margin: -1.5rem -1.5rem 1.5rem;
  }

  .article-featured-image {
    max-height: 250px;
  }

  .share-buttons {
    justify-content: center;
  }
}
