/* =============================================
   統一ブログスタイル Template
   全サイト共通のブログページ用CSS
   ============================================= */

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
    --primary-color: #2563eb;
    --secondary-color: #7c3aed;
    --accent-color: #f59e0b;
    --text-dark: #1f2937;
    --text-light: #6b7280;
    --bg-light: #f9fafb;
    --bg-white: #ffffff;
    --border-color: #e5e7eb;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: 'Hiragino Kaku Gothic ProN', 'Hiragino Sans', 'Meiryo', sans-serif;
  font-size: 16px;
  line-height: 1.7;
  color: var(--text-dark);
  background-color: var(--bg-light);
}

/* ヘッダー */
header {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    color: white;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.header-top {
    max-width: 1200px;
    margin: 0 auto;
    padding: 1rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-size: 1.5rem;
    font-weight: bold;
    text-decoration: none;
    color: white;
}

.logo span {
    color: var(--accent-color);
}

/* ナビゲーション */
nav {
    background-color: rgba(255, 255, 255, 0.1);
    border-top: 1px solid rgba(255, 255, 255, 0.2);
}

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

.nav-menu {
    list-style: none;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.5rem;
}

.nav-menu li a {
    display: block;
    padding: 1rem 1.5rem;
    color: white;
    text-decoration: none;
    transition: background-color 0.3s ease;
    border-radius: 4px;
    font-size: 0.95rem;
}

.nav-menu li a:hover {
    background-color: rgba(255, 255, 255, 0.2);
}

/* ハンバーガーメニュー */
.hamburger {
    display: none;
    flex-direction: column;
    cursor: pointer;
    padding: 0.5rem;
}

.hamburger span {
    width: 25px;
    height: 3px;
    background-color: white;
    margin: 3px 0;
    transition: 0.3s;
    border-radius: 2px;
}


/* =============================================
   2カラムレイアウト (重要！)
   ============================================= */

.blog-container,
.container {
  max-width: 1400px;
  margin: 40px auto 40px;
  padding: 0 2rem;
  display: grid;
  grid-template-columns: 1fr 320px;
  gap: 3rem;
}

/* メインコンテンツ */
.main-content {
  background: var(--bg-white);
  padding: 0; /* パディングを削除 */
  border-radius: 16px;
  box-shadow: 0 4px 6px rgba(0,0,0,0.07);
  min-width: 0;
  overflow: hidden; /* はみ出し防止 */
}

/* サイドバー */
.sidebar {
  position: sticky;
  top: 100px;
  height: fit-content;
  min-width: 0;
}

/* =============================================
   画像スタイル
   ============================================= */

.featured-image {
  width: 100%;
  max-height: 450px;
  object-fit: cover;
  margin-bottom: 2rem;
  display: block;
}

.blog-thumbnail,
.blog-card-image {
  width: 100%;
  height: 200px;
  object-fit: cover;
  border-radius: 8px 8px 0 0;
}

/* =============================================
   テキストスタイル
   ============================================= */

.article-content {
    padding: 0 3rem 3rem 3rem; /* 記事本文のパディング */
}

.article-title {
  font-size: 2.2rem;
  line-height: 1.3;
  margin-bottom: 1rem;
  color: white;
  font-weight: 700;
}

.article-content h2 {
  font-size: 1.75rem;
  margin: 2.5rem 0 1rem;
  color: var(--secondary-color);
  padding-bottom: 0.5rem;
  border-bottom: 3px solid var(--primary-color);
  font-weight: 600;
}

.article-content h3 {
  font-size: 1.4rem;
  margin: 2rem 0 1rem;
  color: var(--text-dark);
  font-weight: 600;
}

.article-content p {
  margin-bottom: 1.5rem;
  color: var(--text-light);
  line-height: 1.9;
  font-size: 1.05em;
}

.article-content ul,
.article-content ol {
  margin: 1.5rem 0 1.5rem 2rem;
  color: var(--text-light);
  line-height: 1.8;
}

.article-content li {
  margin-bottom: 0.8rem;
}

.article-content strong {
  color: var(--primary-color);
  font-weight: 700;
}

.article-content a {
  color: var(--primary-color);
  text-decoration: underline;
  font-weight: 500;
  transition: all 0.3s ease;
}

.article-content a:hover {
  color: var(--accent-color);
}

/* =============================================
   記事メタ情報
   ============================================= */

.article-header {
  background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
  color: white;
  padding: 3rem;
  margin-bottom: 2rem;
}

.article-meta {
  display: flex;
  align-items: center;
  gap: 1rem;
  color: rgba(255, 255, 255, 0.8);
  font-size: 0.95rem;
  flex-wrap: wrap;
}

.article-description {
  font-size: 1.1em;
  color: var(--text-light);
  line-height: 1.7;
  margin-bottom: 1rem;
}

/* =============================================
   サイドバー要素
   ============================================= */

.sidebar-section,
.ad-space {
  background: white;
  padding: 1.5rem;
  border-radius: 12px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.05);
  margin-bottom: 2rem;
}

.ad-space {
  text-align: center;
}

.ad-space img,
.ad-placeholder img {
  max-width: 100%;
  height: auto;
}

/* 目次 */
.toc {
  background: white;
  padding: 1.5rem;
  border-radius: 12px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}

.toc h3 {
  font-size: 1.1rem;
  margin-bottom: 1rem;
  margin-top: 0;
  color: var(--secondary-color);
  padding-bottom: 0.5rem;
  border-bottom: 2px solid var(--primary-color);
}

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

.toc li {
  margin-bottom: 0.6rem;
}

.toc a,
.toc-list a {
  color: var(--text-light);
  font-size: 0.95rem;
  display: block;
  padding: 0.4rem 0.6rem;
  border-radius: 6px;
  transition: all 0.3s ease;
  text-decoration: none;
}

.toc a:hover,
.toc-list a:hover {
  background: var(--bg-light);
  color: var(--primary-color);
  padding-left: 1rem;
}

/* =============================================
   シェアボタン
   ============================================= */

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

.share-btn {
  padding: 0.6rem 1.2rem;
  border-radius: 8px;
  font-weight: 600;
  transition: all 0.3s ease;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: white !important; /* 修正 */
}

.share-btn.twitter {
  background: #1da1f2;
}

.share-btn.twitter:hover {
  background: #0d8bd9;
  transform: translateY(-2px);
}

.share-btn.facebook {
  background: #1877f2;
}

.share-btn.facebook:hover {
  background: #0e66d4;
  transform: translateY(-2px);
}

/* =============================================
   ブログ一覧ページ
   ============================================= */

.blog-header,
.blog-index-header {
  text-align: center;
  padding: 4rem 2rem;
  background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
  color: white;
  border-radius: 8px;
  margin: 2rem auto 3rem;
  max-width: 1400px;
}

.blog-header h1,
.blog-index-header h1 {
  font-size: 2.5rem;
  margin-bottom: 1rem;
  color: white !important; /* 修正 */
  border: none;
  padding: 0;
}

.blog-header p,
.blog-index-header p {
  font-size: 1.2rem;
  opacity: 0.95;
}

.blog-list,
.blog-posts-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 2rem;
  max-width: 1400px;
  margin: 2rem auto;
  padding: 0 2rem;
}

.blog-card {
  background-color: #fff;
  border-radius: 12px;
  box-shadow: 0 4px 6px rgba(0,0,0,0.07);
  overflow: hidden;
  transition: transform 0.3s, box-shadow 0.3s;
  display: flex;
  flex-direction: column;
}

.blog-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 10px 15px rgba(0,0,0,0.1);
}

.blog-card-content {
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  flex-grow: 1;
}

.blog-card-content h2 {
  margin: 0 0 0.5rem 0;
  font-size: 1.4rem;
  border-bottom: none;
  padding-bottom: 0;
}

.blog-card-title {
  text-decoration: none;
  color: var(--text-dark);
  font-size: 1.5em;
  font-weight: 600;
  line-height: 1.4;
  display: block;
  margin-bottom: 15px;
}

.blog-card-date {
  font-size: 0.8rem;
  color: #666;
  margin-bottom: 1rem;
  display: block;
}

.blog-card-excerpt {
  font-size: 0.9rem;
  line-height: 1.6;
  flex-grow: 1;
  margin-bottom: 1rem;
  color: var(--text-light);
}

.read-more-btn {
  display: inline-block;
  margin-top: 1rem;
  text-decoration: none;
  color: var(--primary-color);
  font-weight: bold;
  padding: 10px 24px;
  background-color: var(--accent-color);
  color: white;
  border-radius: 6px;
  transition: all 0.3s ease;
}

.read-more-btn:hover {
  background-color: var(--secondary-color);
  transform: translateX(4px);
}

/* フッター */
footer {
    background-color: var(--text-dark);
    color: white;
    padding: 3rem 2rem 1rem;
    margin-top: 4rem;
}

.footer-content {
    max-width: 1200px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
    margin-bottom: 2rem;
}

.footer-section h3 {
    margin-bottom: 1rem;
    color: var(--accent-color);
}

.footer-section ul {
    list-style: none;
}

.footer-section ul li {
    margin-bottom: 0.5rem;
}

.footer-section a {
    color: #d1d5db;
    text-decoration: none;
    transition: color 0.3s ease;
}

.footer-section a:hover {
    color: var(--accent-color);
}

.footer-bottom {
    text-align: center;
    padding-top: 2rem;
    border-top: 1px solid rgba(255,255,255,0.1);
    color: #9ca3af;
}

/* =============================================
   レスポンシブデザイン
   ============================================= */

@media (max-width: 1024px) {
  .blog-container,
  .container {
    grid-template-columns: 1fr;
    gap: 2rem;
    margin-top: 40px;
  }

  .sidebar {
    position: static;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
  }

  .main-content {
    padding: 0; /* 修正 */
  }
}

@media (max-width: 768px) {
    .hamburger {
        display: flex;
    }

    .nav-menu {
        display: none;
        flex-direction: column;
        width: 100%;
    }

    .nav-menu.active {
        display: flex;
    }

    .nav-menu li {
        width: 100%;
    }

    .nav-menu li a {
        padding: 1rem;
        border-bottom: 1px solid rgba(255,255,255,0.1);
    }

  .blog-container,
  .container {
    margin-top: 20px;
    padding: 0 1rem;
  }

  .article-header {
      padding: 2rem;
  }

  .article-content {
      padding: 0 1.5rem 1.5rem 1.5rem;
  }

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

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

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

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

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

  .blog-header h1,
  .blog-index-header h1 {
    font-size: 2rem;
  }

  .blog-list,
  .blog-posts-grid {
    grid-template-columns: 1fr;
    padding: 0 1rem;
  }

  .share-buttons {
    flex-direction: column;
    align-items: stretch;
  }

  .share-btn {
    width: 100%;
    justify-content: center;
  }
}

@media (max-width: 480px) {

  .article-header {
      padding: 1.5rem;
  }

  .article-content {
      padding: 0 1rem 1rem 1rem;
  }

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

  .blog-header,
  .blog-index-header {
    padding: 2rem 1rem;
  }

  .sidebar-section,
  .ad-space,
  .toc {
    padding: 1rem;
  }
}
