/* blog.css - Notion デザインシステムベース (ダークテーマ適応版) */

/* ========================================
   Notion Design System Adaptation
   - ウォームニュートラルをダークテーマに変換
   - ウィスパーボーダー：1px solid rgba(255,255,255,0.1)
   - マルチレイヤーシャドウ
   - 8px ベース間隔システム
   - ピルバッジ (9999px radius)
   ======================================== */

/* スキップリンク */
.skip-link {
  position: absolute;
  top: -40px;
  left: 0;
  background: #64ffda;
  color: #0a192f;
  padding: 8px 16px;
  z-index: 1001;
  font-weight: 600;
  transition: top 0.2s;
}

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

/* ========================================
   メインレイアウト
   ======================================== */
.blog-main {
  padding: 4rem 0 6rem;
  margin-top: var(--header-height, 80px);
  min-height: calc(100vh - var(--header-height, 80px));
  background: #0a192f;
}

.blog-container,
.content-wrapper {
  display: grid;
  grid-template-columns: 1fr 320px;
  gap: 2.5rem;
  align-items: start;
  max-width: var(--max-width, 1200px);
  margin: 0 auto;
  padding: 0 5%;
}

.main-content {
  min-width: 0;
}

/* ========================================
   ブログ一覧ページ
   ======================================== */
.blog-article {
  min-width: 0;
}

.article-header {
  margin-bottom: 3rem;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid #233554;
}

.article-title {
  font-size: clamp(2rem, 4vw, 3rem);
  font-weight: 800;
  line-height: 1.1;
  letter-spacing: -0.025em;
  margin: 0 0 1rem;
  color: #e6f1ff;
}

.article-meta {
  font-size: 1rem;
  color: #8892b0;
  line-height: 1.6;
  margin: 0;
}

/* ヒーロー画像 (記事詳細ページ) */
.blog-hero-image {
  width: 100%;
  height: auto;
  max-height: 420px;
  object-fit: cover;
  border-radius: 8px;
  margin-bottom: 2rem;
  border: 1px solid #233554;
}

/* ブロググリッド */
.blog-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 1.5rem;
}

/* ブログカード - Notion スタイル */
.blog-card {
  background: #112240;
  border: 1px solid #233554;
  border-radius: 12px;
  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: #64ffda;
}

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

/* カードサムネイル */
.card-thumb {
  position: relative;
  padding-top: 56.25%;
  overflow: hidden;
  background: linear-gradient(135deg, #1a3356 0%, #233554 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-body {
  padding: 1.25rem;
}

.card-body time {
  display: block;
  font-size: 0.875rem;
  color: #8892b0;
  margin-bottom: 0.625rem;
  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: #e6f1ff;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

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

/* ========================================
   記事詳細ページ
   ======================================== */
.article-content {
  color: #8892b0;
  line-height: 1.8;
  font-size: 1rem;
}

.article-content h2 {
  font-size: 1.75rem;
  font-weight: 700;
  color: #e6f1ff;
  margin: 2.5rem 0 1rem;
  padding-left: 1rem;
  border-left: 3px solid #64ffda;
  letter-spacing: -0.015em;
}

.article-content h3 {
  font-size: 1.375rem;
  font-weight: 700;
  color: #e6f1ff;
  margin: 2rem 0 0.875rem;
  letter-spacing: -0.01em;
}

.article-content h4 {
  font-size: 1.125rem;
  font-weight: 600;
  color: #e6f1ff;
  margin: 1.5rem 0 0.625rem;
}

.article-content p {
  margin-bottom: 1.25rem;
  color: #8892b0;
}

.article-content a {
  color: #64ffda;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.article-content a:hover {
  text-decoration: none;
  color: #e6f1ff;
}

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

.article-content li {
  color: #8892b0;
  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 #233554;
}

.article-content blockquote {
  border-left: 3px solid #64ffda;
  margin: 1.5rem 0;
  padding: 0.75rem 0 0.75rem 1.25rem;
  color: #8892b0;
  font-style: italic;
  background: #112240;
  border-radius: 0 8px 8px 0;
}

.article-content strong {
  color: #e6f1ff;
  font-weight: 600;
}

/* ハイライトボックス */
.highlight-box,
.data-reference {
  background: #112240;
  border: 1px solid #233554;
  border-radius: 8px;
  padding: 1.25rem;
  margin: 1.5rem 0;
}

.highlight-box h3,
.data-reference h3 {
  margin-top: 0;
  font-size: 1.125rem;
  font-weight: 700;
  color: #e6f1ff;
}

/* 目次 (TOC) */
.toc-container {
  background: #112240;
  border: 1px solid #233554;
  border-radius: 8px;
  padding: 1.25rem 1.5rem;
  margin: 1.5rem 0;
  font-size: 0.95rem;
}

.toc-container summary {
  cursor: pointer;
  font-size: 1.125rem;
  font-weight: 600;
  margin-bottom: 0.75rem;
  color: #e6f1ff;
  list-style: none;
}

.toc-container summary::-webkit-details-marker {
  display: none;
}

.toc-list {
  margin: 0;
  padding-left: 1.2rem;
}

.toc-list li {
  margin: 0.5rem 0;
  line-height: 1.5;
  color: #8892b0;
}

.toc-list .toc-sub {
  margin-left: 1.2rem;
  font-size: 0.875rem;
  list-style-type: disc;
}

.toc-list a {
  text-decoration: none;
  color: #64ffda;
}

.toc-list a:hover {
  text-decoration: underline;
}

/* 共有リンク */
.share-links {
  margin-top: 2.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid #233554;
}

.share-links-title {
  font-size: 0.95rem;
  font-weight: 600;
  color: #e6f1ff;
  margin-bottom: 1rem;
}

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

.share-buttons a {
  display: inline-block;
  padding: 0.5rem 1rem;
  border: 1px solid #233554;
  border-radius: 4px;
  color: #e6f1ff;
  font-size: 0.875rem;
  font-weight: 500;
  transition: all 0.2s ease;
  background: #112240;
}

.share-buttons a:hover {
  border-color: #64ffda;
  color: #64ffda;
  background: #1a3356;
}

/* ========================================
   サイドバー (両方のクラス名をサポート)
   ======================================== */
.blog-sidebar,
.sidebar {
  position: sticky;
  top: calc(var(--header-height, 80px) + 1.5rem);
  align-self: start;
}

.sidebar-widget,
.sidebar-section {
  background: #112240;
  border: 1px solid #233554;
  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-widget .widget-title,
.sidebar-section h3 {
  font-size: 1rem;
  font-weight: 700;
  margin: 0 0 1rem;
  color: #e6f1ff;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid #233554;
  letter-spacing: -0.01em;
}

.widget-list,
.sidebar-nav {
  list-style: none;
  padding: 0;
  margin: 0;
}

.widget-list li,
.sidebar-nav li {
  margin-bottom: 0.625rem;
}

.widget-list a,
.sidebar-nav a {
  color: #8892b0;
  font-size: 0.9rem;
  text-decoration: none;
  transition: color 0.2s;
  display: block;
  padding: 0.25rem 0;
}

.widget-list a:hover,
.sidebar-nav a:hover {
  color: #64ffda;
}

.widget-content {
  font-size: 0.9rem;
  color: #8892b0;
  line-height: 1.6;
}

.widget-content p {
  margin: 0;
}

/* 広告ウィジェット */
.ad-widget,
.sidebar-ad {
  padding: 0.75rem;
  text-align: center;
}

.ad-widget .amazon-banner,
.ad-widget img,
.sidebar-ad img {
  max-width: 100%;
  border-radius: 4px;
  transition: opacity 0.2s;
}

.ad-widget img:hover,
.sidebar-ad img:hover {
  opacity: 0.9;
}

.ad-widget a,
.sidebar-ad a {
  display: inline-block;
}

/* ピルバッジ */
.pill-badge {
  display: inline-block;
  padding: 0.25rem 0.75rem;
  background: rgba(100, 255, 218, 0.1);
  color: #64ffda;
  border-radius: 9999px;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.025em;
}

/* ========================================
   スクロールトップ
   ======================================== */
.scroll-to-top {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  background: #64ffda;
  color: #0a192f;
  border: none;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  font-size: 1.5rem;
  cursor: pointer;
  z-index: 100;
  display: none;
  font-weight: 700;
  transition: all 0.2s ease;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

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

.scroll-to-top.visible {
  display: block;
}

/* ========================================
   レスポンシブデザイン
   ======================================== */
@media (max-width: 1080px) {
  .blog-container,
  .content-wrapper {
    grid-template-columns: 1fr;
  }

  .blog-sidebar,
  .sidebar {
    position: static;
    order: 2;
  }

  .blog-article,
  .main-content {
    order: 1;
  }
}

@media (max-width: 768px) {
  .blog-main {
    padding: 2rem 0 4rem;
  }

  .blog-container,
  .content-wrapper {
    gap: 1.5rem;
    padding: 0 4%;
  }

  .article-title {
    font-size: 1.75rem;
  }

  .article-meta {
    font-size: 0.9rem;
  }

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

  .ad-widget,
  .sidebar-ad {
    display: block !important;
    margin: 1rem 0;
    padding: 0.5rem;
  }

  .ad-widget img,
  .sidebar-ad img {
    max-width: 100%;
    height: auto;
  }

  .sidebar-widget,
  .sidebar-section {
    padding: 1rem;
    display: block;
    margin-bottom: 1rem;
  }

  .card-body {
    padding: 1rem;
  }

  .card-body h3 {
    font-size: 1rem;
  }

  .article-content h2 {
    font-size: 1.5rem;
  }

  .article-content h3 {
    font-size: 1.25rem;
  }

  .scroll-to-top {
    bottom: 1.5rem;
    right: 1.5rem;
    width: 42px;
    height: 42px;
    font-size: 1.25rem;
  }
}

@media (max-width: 480px) {
  .blog-container,
  .content-wrapper {
    padding: 0 3%;
  }

  .article-header {
    margin-bottom: 2rem;
  }

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

  .card-body time {
    font-size: 0.8rem;
  }

  .card-body h3 {
    font-size: 0.95rem;
  }

  .card-body p {
    font-size: 0.85rem;
  }
}
