/* Heroセクション */
.hero {
  padding: 3rem 2rem;
  min-height: 35vh;
  /* 背景色フォールバック（画像読み込み前の表示） */
  background-color: #e3f2fd;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

/* Hero背景画像（LCP要素の最適化） */
.hero-bg-image {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  z-index: 0;
}

/* 背景画像のオーバーレイ（テキストの可読性向上） */
.hero::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(255, 255, 255, 0.7);
  z-index: 1;
}

.hero-content {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: flex-start;
  gap: 3rem;
  max-width: 100%;
  width: 100%;
  padding-top: 1.5rem;
}

.hero-text {
  flex: 1;
  text-align: center;
  margin-top: 4rem;
}

.hero-text h1,
.hero-text p {
  font-size: 3rem;
  color: var(--text-primary);
  margin: 0;
  font-weight: 500;
}

.hero-video {
  flex: 0 0 auto;
  position: relative;
  padding-bottom: 18%; /* アスペクト比調整 */
  height: 0;
  overflow: hidden;
  width: 500px;
  max-width: 100%;
  margin-top: 1rem;
  margin-left: auto;
}

/* YouTubeサムネイルと再生ボタン */
.youtube-thumbnail {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  cursor: pointer;
  background-color: #000;
  border-radius: 8px;
  overflow: hidden;
}

.youtube-thumbnail img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.youtube-play-button {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 68px;
  height: 48px;
  transition: transform 0.2s;
  pointer-events: none;
}

.youtube-thumbnail:hover .youtube-play-button {
  transform: translate(-50%, -50%) scale(1.1);
}

.youtube-iframe-container {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
}

.hero-video iframe {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

/* セクション */
.section {
  padding: 4rem 2rem;
  scroll-margin-top: 70px; /* ヘッダーの高さ分オフセット */
}

/* セクション背景色の交互切り替え */
.section:nth-child(odd) {
  background-color: var(--bg-primary);
}

.section:nth-child(even) {
  background-color: var(--bg-secondary);
}

.section-title {
  font-size: 2rem;
  margin-bottom: 2rem;
  color: var(--text-primary);
  text-align: center;
  font-weight: bold;
}

/* セクション内コンテンツの最大幅 */
.section-content {
  max-width: 1200px;
  margin: 0 auto;
  width: 100%;
}

/* LateralQ-AI とは？セクション */
.about-content {
  margin-top: 1rem;
}

.about-description {
  font-size: 1.1rem;
  line-height: 1.8;
  color: var(--text-primary);
  margin-bottom: 3rem;
  text-align: center;
  max-width: 900px;
  margin-left: auto;
  margin-right: auto;
}

.about-features {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 2rem;
  margin-top: 2rem;
}

.about-feature-item {
  padding: 2rem;
  background-color: var(--bg-primary);
  border-radius: 12px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.08);
  transition: transform 0.2s, box-shadow 0.2s;
}

/* グレー背景のセクション内のカード */
.section:nth-child(even) .about-feature-item {
  background-color: var(--bg-primary);
}

/* 白背景のセクション内のカード */
.section:nth-child(odd) .about-feature-item {
  background-color: var(--bg-secondary);
}

.about-feature-item:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 20px rgba(0,0,0,0.12);
}

.about-feature-title {
  font-size: 1.3rem;
  font-weight: bold;
  color: var(--text-primary);
  margin-bottom: 1rem;
  text-align: center;
}

.about-feature-desc {
  font-size: 1rem;
  line-height: 1.7;
  color: var(--text-secondary);
  text-align: center;
}

/* 開発背景アコーディオン */
.development-background-item {
  margin-top: 3rem;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  overflow: hidden;
  background-color: var(--bg-primary);
}

/* グレー背景のセクション内の開発背景アイテムは白背景 */
.section:nth-child(even) .development-background-item {
  background-color: var(--bg-primary);
}

.development-background-question {
  padding: 1.25rem;
  background-color: var(--bg-secondary);
  font-size: 1.5rem;
  font-weight: bold;
  color: var(--text-primary);
  cursor: pointer;
  user-select: none;
  display: flex;
  justify-content: space-between;
  align-items: center;
  transition: background-color 0.25s;
  text-align: center;
}

.development-background-question:hover {
  background-color: #e8e8e8;
}

.development-background-question::after {
  content: '+';
  font-size: 1.5rem;
  font-weight: normal;
  color: var(--text-secondary);
}

.development-background-item.active .development-background-question::after {
  content: '−';
}

.development-background-answer {
  padding: 0 0.75rem;
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s ease-out, padding 0.3s ease-out;
}

.development-background-item.active .development-background-answer {
  max-height: 2000px;
  padding: 1rem 0.75rem;
}

.development-background-description {
  font-size: 1.1rem;
  line-height: 1.8;
  color: var(--text-primary);
  margin-bottom: 1.5rem;
  text-align: left;
  max-width: 100%;
  margin-left: 0;
  margin-right: 0;
}


.development-background-description:last-child {
  margin-bottom: 0;
}

.development-background-points {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 2rem;
  margin-top: 2rem;
}

.development-background-point {
  padding: 2rem;
  background-color: var(--bg-primary);
  border-radius: 12px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.08);
  transition: transform 0.2s, box-shadow 0.2s;
}

/* グレー背景のセクション内のカード */
.section:nth-child(even) .development-background-point {
  background-color: var(--bg-primary);
}

/* 白背景のセクション内のカード */
.section:nth-child(odd) .development-background-point {
  background-color: var(--bg-secondary);
}

.development-background-point:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 20px rgba(0,0,0,0.12);
}

.development-background-point-title {
  font-size: 1.3rem;
  font-weight: bold;
  color: var(--text-primary);
  margin-bottom: 1rem;
  text-align: center;
}

.development-background-point-desc {
  font-size: 1rem;
  line-height: 1.7;
  color: var(--text-secondary);
  text-align: center;
}

/* プレイ方法セクション */
.how-to-play {
  padding: 0;
}

.how-to-play ol {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
}

.how-to-play li {
  background-color: var(--bg-primary);
  border-radius: 12px;
  padding: 2rem 1.5rem;
  box-shadow: 0 4px 12px rgba(0,0,0,0.08);
  transition: transform 0.2s, box-shadow 0.2s;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.how-to-play li:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 20px rgba(0,0,0,0.12);
}

.how-to-play-icon {
  width: 60px;
  height: 60px;
  background: linear-gradient(135deg, var(--bg-header-blue), #1565c0);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 1rem;
  box-shadow: 0 4px 8px rgba(0,0,0,0.15);
  color: var(--text-inverse);
}

.how-to-play-icon svg {
  width: 32px;
  height: 32px;
  stroke-width: 2;
}

.how-to-play-text {
  font-size: 1.05rem;
  color: var(--text-primary);
  line-height: 1.6;
  font-weight: 500;
}

.how-to-play-number {
  font-weight: bold;
  color: var(--bg-header-blue);
  margin-right: 0.5rem;
}

/* グレー背景のセクション内のカード */
.section:nth-child(even) .how-to-play li {
  background-color: var(--bg-primary);
}

/* 白背景のセクション内のカード */
.section:nth-child(odd) .how-to-play li {
  background-color: var(--bg-secondary);
}

/* 利用シーンセクション */
.use-case-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 1.5rem;
  margin-top: 0;
}

.use-case-item {
  padding: 1.5rem;
  background-color: var(--bg-primary);
  border-radius: 8px;
  border: 1px solid var(--border-color);
  box-shadow: 0 2px 4px rgba(0,0,0,0.05);
  transition: box-shadow 0.25s;
}

/* グレー背景のセクション内のカードは白背景 */
.section:nth-child(even) .use-case-item {
  background-color: var(--bg-primary);
}

/* 白背景のセクション内のカードはグレー背景 */
.section:nth-child(odd) .use-case-item {
  background-color: var(--bg-secondary);
}

.use-case-item:hover {
  box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}

.use-case-title {
  font-weight: bold;
  color: var(--text-primary);
  margin-bottom: 0.5rem;
  font-size: 1.1rem;
}

.use-case-desc {
  font-size: 0.95rem;
  color: var(--text-secondary);
  line-height: 1.6;
}

/* サンプルシナリオセクション */
.sample-scenarios-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 2rem;
  margin-top: 2rem;
}

.sample-scenario-item {
  padding: 2rem;
  background-color: var(--bg-primary);
  border-radius: 12px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.08);
  transition: transform 0.2s, box-shadow 0.2s;
}

/* グレー背景のセクション内のサンプルシナリオアイテムは白背景 */
.section:nth-child(even) .sample-scenario-item {
  background-color: var(--bg-primary);
}

/* 白背景のセクション内のサンプルシナリオアイテムはグレー背景 */
.section:nth-child(odd) .sample-scenario-item {
  background-color: var(--bg-secondary);
}

.sample-scenario-item:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 20px rgba(0,0,0,0.12);
}

.sample-scenario-header {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 1rem;
  flex-wrap: wrap;
}

.sample-scenario-category {
  padding: 0.25rem 0.75rem;
  border-radius: 12px;
  font-size: 0.85rem;
  font-weight: bold;
  display: inline-block;
}

.sample-scenario-category-daily {
  background-color: #e3f2fd;
  color: #1976d2;
}

.sample-scenario-category-it {
  background-color: #fff3e0;
  color: #f57c00;
}

.sample-scenario-category-mystery {
  background-color: #f3e5f5;
  color: #7b1fa2;
}

.sample-scenario-difficulty {
  padding: 0.25rem 0.75rem;
  border-radius: 12px;
  font-size: 0.85rem;
  font-weight: bold;
  display: inline-block;
}

.sample-scenario-difficulty-easy {
  background-color: #e8f5e9;
  color: #388e3c;
}

.sample-scenario-difficulty-medium {
  background-color: #fff9c4;
  color: #f57f17;
}

.sample-scenario-difficulty-hard {
  background-color: #ffebee;
  color: #c62828;
}

.sample-scenario-title {
  font-size: 1.3rem;
  font-weight: bold;
  color: var(--text-primary);
  margin-bottom: 1rem;
}

.sample-scenario-problem {
  font-size: 1rem;
  color: var(--text-primary);
  line-height: 1.7;
  margin-bottom: 1rem;
  padding: 1rem;
  background-color: var(--bg-secondary);
  border-left: 4px solid var(--bg-header-blue);
  border-radius: 4px;
}

.section:nth-child(even) .sample-scenario-problem {
  background-color: #f0f0f0;
}

.section:nth-child(odd) .sample-scenario-problem {
  background-color: #fafafa;
}

.sample-scenario-description {
  font-size: 0.95rem;
  color: var(--text-secondary);
  line-height: 1.6;
}

.sample-scenarios-note {
  margin-top: 2rem;
  padding: 1rem;
  background-color: var(--bg-secondary);
  border-radius: 8px;
  font-size: 0.95rem;
  color: var(--text-secondary);
  text-align: center;
  line-height: 1.7;
}

.section:nth-child(even) .sample-scenarios-note {
  background-color: #f0f0f0;
}

.section:nth-child(odd) .sample-scenarios-note {
  background-color: #fafafa;
}

/* プレイ画像セクション */
.play-images-title {
  font-size: 1.5rem;
  margin-top: 3rem;
  margin-bottom: 1.5rem;
  color: var(--text-primary);
  text-align: center;
  font-weight: bold;
}

.play-images-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 2rem;
  margin-top: 3rem;
}

.play-image-wrapper {
  display: flex;
  flex-direction: column;
}

.play-image-item {
  width: 100%;
  aspect-ratio: 16 / 9;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 4px 12px rgba(0,0,0,0.08);
  transition: transform 0.2s, box-shadow 0.2s;
  background-color: var(--bg-primary);
}

.play-image-item:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 20px rgba(0,0,0,0.12);
}

.play-image-item img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
}

.play-image-clickable {
  cursor: pointer;
}

/* 画像拡大表示モーダル */
.image-modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 1000;
}

.image-modal.active {
  display: flex;
  align-items: center;
  justify-content: center;
}

.image-modal-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.9);
  cursor: pointer;
}

.image-modal-content {
  position: relative;
  max-width: 90%;
  max-height: 90%;
  z-index: 1001;
  display: flex;
  align-items: center;
  justify-content: center;
}

.image-modal-img {
  max-width: 100%;
  max-height: 90vh;
  object-fit: contain;
  border-radius: 8px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
}

.image-modal-close {
  position: absolute;
  top: -40px;
  right: 0;
  background: none;
  border: none;
  color: var(--text-inverse);
  font-size: 3rem;
  cursor: pointer;
  line-height: 1;
  padding: 0;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity 0.2s;
}

.image-modal-close:hover {
  opacity: 0.7;
}

.play-image-caption {
  margin-top: 1rem;
  text-align: center;
  font-size: 1.1rem;
  font-weight: 500;
  color: var(--text-primary);
}

/* グレー背景のセクション内の画像アイテム */
.section:nth-child(even) .play-image-item {
  background-color: var(--bg-primary);
}

/* 白背景のセクション内の画像アイテム */
.section:nth-child(odd) .play-image-item {
  background-color: var(--bg-secondary);
}

/* よくある質問セクション */
.faq-list {
  margin: 0;
  width: 100%;
}

.faq-item {
  margin-bottom: 1rem;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  overflow: hidden;
  background-color: var(--bg-primary);
}

/* グレー背景のセクション内のFAQアイテムは白背景 */
.section:nth-child(even) .faq-item {
  background-color: var(--bg-primary);
}

.faq-question {
  padding: 1.25rem;
  background-color: var(--bg-secondary);
  font-weight: bold;
  color: var(--text-primary);
  cursor: pointer;
  user-select: none;
  display: flex;
  justify-content: space-between;
  align-items: center;
  transition: background-color 0.25s;
}

.faq-question:hover {
  background-color: #e8e8e8;
}

.faq-question::after {
  content: '+';
  font-size: 1.5rem;
  font-weight: normal;
  color: var(--text-secondary);
}

.faq-item.active .faq-question::after {
  content: '−';
}

.faq-answer {
  padding: 0 1.25rem;
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s ease-out, padding 0.3s ease-out;
  color: var(--text-secondary);
  line-height: 1.8;
}

.faq-item.active .faq-answer {
  max-height: 500px;
  padding: 1.25rem;
}

/* レスポンシブ */
@media (max-width: 768px) {
  .hero {
    margin-top: 140px; /* モバイルヘッダーの高さ分（余裕を持たせる） */
    padding: 1.5rem 0.5rem; /* 上下左右パディング */
    min-height: auto;
    overflow: visible; /* 見切れ防止 */
  }
  
  .hero-content {
    flex-direction: column;
    gap: 1.5rem; /* 要素間の余白を削減 */
    padding: 0; /* パディングをリセット */
    width: 100%;
  }
  
  .hero-text {
    text-align: center;
    margin-top: 0; /* 上部マージンを削除 */
    width: 100%;
  }
  
  .hero-text h1,
  .hero-text p {
    font-size: 1.5rem;
  }
  
  .hero-video {
    max-width: 100%;
    width: 100%;
    padding-bottom: 56.25%; /* 16:9のアスペクト比 */
    margin: 0 auto; /* 中央揃え */
    margin-top: 0.5rem; /* 上部に少し余白 */
  }
  
  /* モバイル版: hero背景画像の調整 */
  .hero-bg-image {
    object-fit: cover;
    object-position: center;
  }
  
  /* モバイル版: YouTube再生ボタンのサイズ調整 */
  .youtube-play-button {
    width: 48px;
    height: 34px;
  }
  
  .youtube-play-button svg {
    width: 100%;
    height: 100%;
  }
  
  .use-case-grid {
    grid-template-columns: 1fr;
  }
  
  .sample-scenarios-grid {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }
  
  .sample-scenario-item {
    padding: 1.5rem;
  }
  
  .sample-scenario-title {
    font-size: 1.1rem;
  }
  
  .sample-scenario-problem {
    font-size: 0.95rem;
    padding: 0.75rem;
  }
  
  .sample-scenario-description {
    font-size: 0.9rem;
  }
  
  .sample-scenarios-note {
    font-size: 0.9rem;
    padding: 0.75rem;
  }
  
  .how-to-play ol {
    grid-template-columns: 1fr;
  }
  
  /* how-to-play-numberのコントラスト比改善: より濃い青色に変更 */
  .how-to-play-number {
    color: #0d47a1; /* #1976d2 → #0d47a1（より濃い青） */
  }
  
  .about-features {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }
  
  .about-description {
    font-size: 1rem;
    padding: 0 1rem;
  }
  
  .development-background-points {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }
  
  .development-background-item {
    margin-top: 2rem;
  }
  
  .development-background-question {
    font-size: 1.3rem;
    padding: 1rem;
  }
  
  .development-background-description {
    font-size: 1rem;
    padding: 0;
    margin-bottom: 1rem;
  }
  
  .development-background-description:last-child {
    margin-bottom: 0;
  }
  
  .development-background-item.active .development-background-answer {
    padding: 1rem 0.75rem;
  }
  
  .play-images-title {
    font-size: 1.3rem;
    margin-top: 2rem;
    margin-bottom: 1rem;
  }
  
  .play-images-grid {
    grid-template-columns: 1fr;
    gap: 1.5rem;
    margin-top: 2rem;
  }
  
  /* モバイル版: 画像モーダルの調整 */
  .image-modal-content {
    max-width: 95%;
    max-height: 95%;
  }
  
  .image-modal-img {
    max-height: 85vh;
  }
  
  .image-modal-close {
    top: -35px;
    font-size: 2.5rem;
    width: 35px;
    height: 35px;
  }
}
