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

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

:root {
  --primary-color: #2563eb;
  --secondary-color: #1e3a8a;
  --accent-color: #3b82f6;
  --text-primary: #1a1a1a;
  --text-secondary: #4a5568;
  --bg-light: #f8fafc;
  --bg-white: #ffffff;
  --shadow-sm: 0 2px 4px rgba(0,0,0,0.06);
  --shadow-md: 0 4px 6px rgba(0,0,0,0.07);
  --shadow-lg: 0 10px 15px rgba(0,0,0,0.1);
  --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Hiragino Sans", "Noto Sans JP", sans-serif;
  font-size: 16px;
  line-height: 1.8;
  color: var(--text-primary);
  background-color: var(--bg-light);
  padding-top: 0;
}

/* =============================================
   ヘッダー・ナビゲーション・フッタースタイル
   （blog.cssに必須！親サイトと共通のスタイル）
   ============================================= */

/* Header */
header {
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(10px);
  padding: 16px 0;
  border-bottom: 1px solid rgba(226, 232, 240, 0.8);
  position: sticky;
  top: 0;
  z-index: 1000;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
}

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

.logo a {
  font-size: 28px;
  font-weight: 700;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

nav ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  gap: 32px;
}

nav a {
  font-weight: 500;
  color: #4a5568;
  padding: 8px 16px;
  border-radius: 8px;
  transition: all 0.3s ease;
}

nav a:hover,
nav a.active {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  transform: translateY(-2px);
}

/* Footer */
footer {
  background: linear-gradient(135deg, #2d3748 0%, #4a5568 100%);
  color: white;
  text-align: center;
  padding: 40px 0;
  position: relative;
  overflow: hidden;
}

footer::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><defs><pattern id="footerGrain" width="50" height="50" patternUnits="userSpaceOnUse"><circle cx="10" cy="10" r="0.5" fill="white" opacity="0.1"/><circle cx="40" cy="40" r="0.5" fill="white" opacity="0.1"/><circle cx="25" cy="5" r="0.3" fill="white" opacity="0.1"/><circle cx="5" cy="35" r="0.3" fill="white" opacity="0.1"/></pattern></defs><rect width="100" height="100" fill="url(%23footerGrain)"/></svg>');
}

footer p {
  margin: 0;
  font-size: 16px;
  position: relative;
  z-index: 1;
  opacity: 0.9;
}

.footer-links {
  display: flex;
  justify-content: center;
  gap: 24px;
  flex-wrap: wrap;
  margin-bottom: 20px;
  position: relative;
  z-index: 1;
}

.footer-links a {
  color: white;
  font-size: 15px;
  opacity: 0.9;
  transition: opacity 0.3s ease;
}

.footer-links a:hover {
  opacity: 1;
}

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

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

/* メインコンテンツ */
.main-content {
  background: var(--bg-white);
  padding: 3rem;
  border-radius: 16px;
  box-shadow: var(--shadow-lg);
  min-width: 0;
}

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

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

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

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

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

.main-content h1,
.article-title {
  font-size: 2.2rem;
  line-height: 1.3;
  margin-bottom: 1rem;
  color: var(--text-primary);
  font-weight: 700;
}

.main-content h2,
.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(--accent-color);
  font-weight: 600;
}

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

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

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

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

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

.main-content a,
.article-content a {
  color: var(--primary-color);
  text-decoration: underline;
  font-weight: 500;
  transition: var(--transition);
}

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

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

.post-meta,
.article-meta {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 2rem;
  padding-bottom: 1rem;
  border-bottom: 2px solid var(--bg-light);
  color: var(--text-secondary);
  font-size: 0.95rem;
  flex-wrap: wrap;
}

.article-header {
  margin-bottom: 30px;
  border-bottom: 3px solid var(--accent-color);
  padding-bottom: 20px;
}

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

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

.sidebar-section,
.ad-space {
  background: white;
  padding: 1.5rem;
  border-radius: 12px;
  box-shadow: var(--shadow-md);
  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: var(--shadow-md);
}

.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(--accent-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-secondary);
  font-size: 0.95rem;
  display: block;
  padding: 0.4rem 0.6rem;
  border-radius: 6px;
  transition: var(--transition);
  text-decoration: none;
}

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

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

.share-links,
.social-share {
  margin-top: 3rem;
  padding-top: 2rem;
  border-top: 2px solid var(--bg-light);
  display: flex;
  gap: 1rem;
  align-items: center;
  flex-wrap: wrap;
}

.social-share {
  background-color: var(--bg-light);
  padding: 25px;
  border-radius: 8px;
  justify-content: center;
}

.share-links p,
.social-share h3 {
  font-weight: 600;
  margin: 0;
  color: var(--text-primary);
}

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

.share-twitter,
.share-facebook,
.share-btn {
  padding: 0.6rem 1.2rem;
  border-radius: 8px;
  font-weight: 600;
  transition: var(--transition);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: white;
}

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

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

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

.share-facebook:hover,
.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(--secondary-color) 0%, var(--accent-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;
  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: var(--shadow-md);
  overflow: hidden;
  transition: transform 0.3s, box-shadow 0.3s;
  display: flex;
  flex-direction: column;
}

.blog-card:hover {
  transform: translateY(-5px);
  box-shadow: var(--shadow-lg);
}

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

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

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

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

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

.read-more,
.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: var(--transition);
}

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

/* =============================================
   広告バナー
   ============================================= */

.ad-banner,
.content-ad-banner {
  text-align: center;
  margin: 2rem 0;
  padding: 1rem;
  background: var(--bg-light);
  border-radius: 8px;
}

.ad-banner img,
.content-ad-banner img {
  max-width: 100%;
  height: auto;
}

/* =============================================
   強調ボックス
   ============================================= */

.highlight-box {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  padding: 25px;
  border-radius: 8px;
  margin: 30px 0;
  box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
}

.highlight-box h3 {
  color: white;
  margin-top: 0;
  margin-bottom: 15px;
  border: none;
  padding: 0;
}

.highlight-box p {
  margin-bottom: 10px;
  color: white;
}

.data-reference {
  background-color: var(--bg-light);
  padding: 1.5rem;
  border-left: 4px solid var(--accent-color);
  margin: 2rem 0;
  border-radius: 4px;
}

/* CTA Box */
.cta-box {
  background: linear-gradient(135deg, var(--accent-color) 0%, var(--secondary-color) 100%);
  color: white;
  padding: 2rem;
  border-radius: 12px;
  margin: 3rem 0;
  box-shadow: var(--shadow-lg);
}

.cta-box h3 {
  color: white;
  margin-top: 0;
  margin-bottom: 1rem;
  font-size: 1.5rem;
  border: none;
  padding: 0;
}

.cta-box p {
  color: white;
  margin-bottom: 1rem;
  opacity: 0.95;
}

.cta-box ul {
  list-style: none;
  margin: 1rem 0;
  padding: 0;
}

.cta-box li {
  margin-bottom: 0.8rem;
  padding-left: 0;
}

.cta-box a {
  color: white;
  text-decoration: underline;
  font-weight: 600;
  transition: var(--transition);
}

.cta-box a:hover {
  opacity: 0.8;
}

/* Related Posts */
.related-posts {
  background: white;
  padding: 1.5rem;
  border-radius: 12px;
  box-shadow: var(--shadow-md);
  margin-bottom: 2rem;
}

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

.related-posts ul {
  list-style: none;
  margin: 0;
  padding: 0;
}

.related-posts li {
  margin-bottom: 0.8rem;
}

.related-posts a {
  color: var(--text-secondary);
  font-size: 0.95rem;
  display: block;
  padding: 0.6rem;
  border-radius: 6px;
  transition: var(--transition);
  text-decoration: none;
  line-height: 1.5;
}

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

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

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

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

  .main-content {
    padding: 2rem;
  }
}

@media (max-width: 768px) {
  header .container {
    flex-direction: column;
    gap: 16px;
  }

  nav ul {
    flex-wrap: wrap;
    justify-content: center;
    gap: 16px;
  }

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

  .main-content {
    padding: 1.5rem;
  }

  .main-content h1,
  .article-title {
    font-size: 1.75rem;
  }

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

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

  .blog-hero-image,
  .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) {
  .logo a {
    font-size: 20px;
    writing-mode: horizontal-tb;
    text-orientation: mixed;
  }

  nav ul {
    flex-direction: row;
    flex-wrap: wrap;
    gap: 12px;
    writing-mode: horizontal-tb;
  }

  nav a {
    writing-mode: horizontal-tb;
    text-orientation: mixed;
    font-size: 14px;
    padding: 6px 12px;
  }

  .main-content {
    padding: 1rem;
  }

  .main-content h1,
  .article-title {
    font-size: 1.5rem;
  }

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

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