/* ブログページ専用スタイルシート */

/* ヒーロー画像 */
.hero {
  position: relative;
  overflow: hidden;
}

.hero-background {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  position: absolute;
  top: 0;
  left: 0;
}

.hero-content {
  position: relative;
  z-index: 1;
}

/* 2カラムレイアウト */
.page-wrapper {
  display: grid;
  grid-template-columns: 1fr 300px;
  gap: 3rem;
  max-width: 1200px;
  margin: 0 auto;
  padding: 2rem 20px;
}

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

.sidebar {
  position: sticky;
  top: 90px;
  align-self: start;
  max-height: calc(100vh - 110px);
  overflow-y: auto;
}

/* 記事メタ情報 */
.post-meta {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 2rem;
  padding-bottom: 1rem;
  border-bottom: 2px solid rgba(102, 126, 234, 0.2);
}

.post-meta time {
  color: #667eea;
  font-weight: 600;
  font-size: 0.95rem;
}

.post-meta .author {
  color: #764ba2;
  font-weight: 500;
}

/* 記事コンテンツ */
.article-content {
  background: rgba(255, 255, 255, 0.95);
  padding: 3rem;
  border-radius: 15px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.1);
  line-height: 1.8;
  color: #2c3e50;
}

.article-content h1 {
  font-size: 2.5rem;
  font-weight: 700;
  color: #2c3e50;
  margin-bottom: 1.5rem;
  line-height: 1.3;
  background: linear-gradient(135deg, #667eea, #764ba2);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.article-content h2 {
  font-size: 1.8rem;
  font-weight: 600;
  color: #667eea;
  margin: 2.5rem 0 1rem;
  padding-bottom: 0.5rem;
  border-bottom: 3px solid rgba(102, 126, 234, 0.3);
  scroll-margin-top: 90px;
}

.article-content h3 {
  font-size: 1.4rem;
  font-weight: 600;
  color: #764ba2;
  margin: 2rem 0 1rem;
  padding-left: 1rem;
  border-left: 4px solid #764ba2;
  scroll-margin-top: 90px;
}

.article-content p {
  margin-bottom: 1.5rem;
  font-size: 1.05rem;
  color: #444;
}

.article-content ul,
.article-content ol {
  margin: 1.5rem 0 1.5rem 2rem;
  color: #444;
}

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

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

.article-content em {
  color: #764ba2;
  font-style: italic;
}

.article-content a {
  color: #667eea;
  text-decoration: none;
  border-bottom: 1px solid rgba(102, 126, 234, 0.3);
  transition: all 0.3s ease;
}

.article-content a:hover {
  color: #764ba2;
  border-bottom-color: #764ba2;
}

.article-content img {
  max-width: 100%;
  height: auto;
  border-radius: 10px;
  margin: 2rem 0;
  box-shadow: 0 5px 20px rgba(0, 0, 0, 0.1);
}

.article-content blockquote {
  background: rgba(102, 126, 234, 0.05);
  border-left: 5px solid #667eea;
  padding: 1.5rem;
  margin: 2rem 0;
  border-radius: 5px;
  color: #555;
  font-style: italic;
}

.article-content code {
  background: #f4f4f4;
  padding: 0.2rem 0.5rem;
  border-radius: 3px;
  font-family: 'Courier New', monospace;
  font-size: 0.9em;
  color: #e83e8c;
}

.article-content pre {
  background: #2d2d2d;
  color: #f8f8f2;
  padding: 1.5rem;
  border-radius: 8px;
  overflow-x: auto;
  margin: 2rem 0;
}

.article-content pre code {
  background: none;
  color: inherit;
  padding: 0;
}

/* サイドバー要素 */
.sidebar > * {
  margin-bottom: 2rem;
}

/* 目次 */
.toc {
  background: rgba(255, 255, 255, 0.95);
  padding: 1.5rem;
  border-radius: 12px;
  box-shadow: 0 5px 20px rgba(0, 0, 0, 0.08);
  border: 1px solid rgba(102, 126, 234, 0.2);
}

.toc h3 {
  font-size: 1.2rem;
  font-weight: 600;
  color: #667eea;
  margin-bottom: 1rem;
  padding-bottom: 0.5rem;
  border-bottom: 2px solid rgba(102, 126, 234, 0.2);
}

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

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

.toc a {
  color: #2c3e50;
  text-decoration: none;
  font-size: 0.95rem;
  display: block;
  padding: 0.5rem;
  border-radius: 5px;
  transition: all 0.3s ease;
  border-left: 3px solid transparent;
}

.toc a:hover {
  background: rgba(102, 126, 234, 0.1);
  border-left-color: #667eea;
  padding-left: 1rem;
}

/* 広告スペース */
.ad-space {
  background: linear-gradient(135deg, rgba(102, 126, 234, 0.1), rgba(118, 75, 162, 0.1));
  padding: 2rem;
  border-radius: 12px;
  text-align: center;
  border: 2px dashed rgba(102, 126, 234, 0.3);
  min-height: 250px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.ad-space p {
  color: #667eea;
  font-weight: 600;
  margin: 0;
}

/* 関連記事 */
.related-articles {
  background: rgba(255, 255, 255, 0.95);
  padding: 1.5rem;
  border-radius: 12px;
  box-shadow: 0 5px 20px rgba(0, 0, 0, 0.08);
  border: 1px solid rgba(118, 75, 162, 0.2);
}

.related-articles h3 {
  font-size: 1.2rem;
  font-weight: 600;
  color: #764ba2;
  margin-bottom: 1rem;
  padding-bottom: 0.5rem;
  border-bottom: 2px solid rgba(118, 75, 162, 0.2);
}

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

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

.related-articles a {
  color: #2c3e50;
  text-decoration: none;
  font-size: 0.95rem;
  display: block;
  padding: 0.5rem;
  border-radius: 5px;
  transition: all 0.3s ease;
  border-left: 3px solid transparent;
}

.related-articles a:hover {
  background: rgba(118, 75, 162, 0.1);
  border-left-color: #764ba2;
  padding-left: 1rem;
}

/* ブログ一覧ページ */
.blog-header {
  text-align: center;
  margin-bottom: 4rem;
  padding: 3rem 0;
}

.blog-header h1 {
  font-size: 3rem;
  font-weight: 700;
  color: white;
  text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
  margin-bottom: 1rem;
}

.blog-header p {
  font-size: 1.2rem;
  color: rgba(255, 255, 255, 0.9);
}

/* ブログ記事一覧 */
.blog-list {
  display: grid;
  gap: 2rem;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
}

.blog-card {
  display: grid;
  grid-template-columns: 350px 1fr;
  gap: 2rem;
  background: rgba(255, 255, 255, 0.95);
  border-radius: 15px;
  overflow: hidden;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
  transition: all 0.3s ease;
}

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

.blog-card a {
  text-decoration: none;
}

.blog-thumbnail {
  width: 350px;
  height: 250px;
  object-fit: cover;
  transition: transform 0.3s ease;
}

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

.blog-content {
  padding: 2rem 2rem 2rem 0;
  display: flex;
  flex-direction: column;
}

.blog-content h2 {
  font-size: 1.6rem;
  font-weight: 600;
  margin-bottom: 0.8rem;
  color: #2c3e50;
  line-height: 1.4;
}

.blog-content h2 a {
  color: #667eea;
  transition: color 0.3s ease;
}

.blog-content h2 a:hover {
  color: #764ba2;
}

.blog-content time {
  display: block;
  color: #667eea;
  font-weight: 600;
  font-size: 0.9rem;
  margin-bottom: 1rem;
}

.article-summary {
  color: #666;
  line-height: 1.7;
  margin-bottom: 1.5rem;
  flex-grow: 1;
}

.read-more {
  display: inline-block;
  color: white;
  background: linear-gradient(135deg, #667eea, #764ba2);
  padding: 0.6rem 1.5rem;
  border-radius: 25px;
  font-weight: 600;
  font-size: 0.95rem;
  transition: all 0.3s ease;
  align-self: flex-start;
}

.read-more:hover {
  transform: translateX(5px);
  box-shadow: 0 5px 15px rgba(102, 126, 234, 0.4);
}

/* レスポンシブ対応 */
@media (max-width: 1024px) {
  .page-wrapper {
    grid-template-columns: 1fr;
    gap: 2rem;
  }

  .sidebar {
    position: static;
    max-height: none;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
  }

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

  .blog-thumbnail {
    width: 100%;
    height: 300px;
  }

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

@media (max-width: 768px) {
  .article-content {
    padding: 2rem 1.5rem;
  }

  .article-content h1 {
    font-size: 2rem;
  }

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

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

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

  .blog-header p {
    font-size: 1rem;
  }

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

  .toc,
  .ad-space,
  .related-articles {
    padding: 1.2rem;
  }
}

@media (max-width: 480px) {
  .page-wrapper {
    padding: 1rem 10px;
  }

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

  .article-content h1 {
    font-size: 1.6rem;
  }

  .blog-content h2 {
    font-size: 1.3rem;
  }
}
