/* HEROエリア */
.hero {
  height: 100vh;
  background: url("../images/yakei.webp");
  background-size: cover;
  background-position: center;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  color: white;
}

.hero-content h1 {
  font-size: 3.5rem;
  margin-bottom: 1rem;
  font-weight: 700;
  text-shadow: 2px 2px 8px rgba(0, 0, 0, 0.7);
}

.hero-content p {
  font-size: 1.2rem;
  margin-bottom: 2rem;
  opacity: 0.9;
}

.btn {
  display: inline-block;
  padding: 1rem 2rem;
  background-color: var(--accent-color);
  color: white;
  text-decoration: none;
  border-radius: 8px;
  font-weight: 600;
  transition: all 0.3s ease;
}

.btn:hover {
  background-color: var(--hover-color);
  transform: translateY(-2px);
}

.section {
  padding: 4rem 0;
}

.section:nth-child(even) {
  background-color: var(--card-bg);
}
/* カードイメージ縦3対4 */

/* 見出しスタイル */
.heading-large {
  font-size: 2.5rem;
  margin-bottom: 2rem;
  text-align: center;
  position: relative;
  color: var(--accent-color);
}

.heading-large::after {
  content: "";
  position: absolute;
  bottom: -10px;
  left: 50%;
  transform: translateX(-50%);
  width: 80px;
  height: 4px;
  background: linear-gradient(90deg, var(--accent-color), var(--hover-color));
  border-radius: 2px;
}

.heading-medium {
  font-size: 2rem;
  margin-bottom: 1.5rem;
  color: var(--text-color);
  border-left: 5px solid var(--accent-color);
  padding-left: 1rem;
}

.heading-small {
  font-size: 1.5rem;
  margin-bottom: 1rem;
  color: var(--text-color);
  position: relative;
  padding-bottom: 0.5rem;
}

/* --- 提案3：スラッシュ・アクセント・スタイル --- */
.heading-small.heading-accent-bar {
  padding-left: 1.2rem; /* スラッシュのためのスペース */
  padding-bottom: 0; /* 下線が不要なためリセット */
  position: relative;
}

/* ::before を新たに追加し、左側のスラッシュを作成 */
.heading-small.heading-accent-bar::before {
  content: "";
  position: absolute;
  top: 50%;
  left: 0;
  width: 6px;
  height: 1.2em; /* テキストの高さに合わせる */
  transform: translateY(-50%) skewX(-15deg); /* 中央揃えにして傾ける */
  background: linear-gradient(135deg, var(--accent-color), var(--hover-color));
  border-radius: 2px;
}

/* 元の下線は不要なので無効化 */
.heading-small.heading-accent-bar {
  border-bottom: #667eea solid 1px;
}

/* グリッドレイアウト */
.grid-1 {
  display: grid;
  grid-template-columns: 1fr;
  gap: 2rem;
}
.grid-2 {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 2rem;
}
.grid-3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 2rem;
}
.grid-4 {
  display: grid;
  grid-template-columns: repeat(
    auto-fit,
    minmax(280px, 1fr)
  ); /* 画面幅に応じて列数を自動調整 */
  gap: 2rem;
}
/* カスタムグリッド（左1：右2、左2：右1） */
.grid-custom {
  display: grid;
  grid-template-columns: 1fr 2fr; /* デフォルトは 左1 : 右2 */
  gap: var(--grid-gap, 2rem);
}
/* 反転レイアウト (左2 : 右1) */
.grid-custom.grid-reverse {
  grid-template-columns: 2fr 1fr; /* 左2 : 右1 に変更 */
}

/* 右側の上下2段の要素にgapを設定 */
.grid-custom .col-2 {
  display: grid;
  gap: var(--grid-gap, 2rem);
}

/* Aside */
.sidebar {
  background: var(--card-bg);
  padding: 2rem;
  border-radius: 12px;
  border: 1px solid var(--border-color);
}

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

/* スマートフォン */
@media (max-width: 768px) {
  .grid-custom,
  .grid-custom.grid-reverse {
    grid-template-columns: 1fr; /* スマートフォン：1列 */
  }
}

/* --- card --- */
/* --- 特徴（右側1段、画像左、テキスト右） --- */
/* 修正: 画像を大きく表示できるよう、縦積みのレイアウトに変更 */
.feature-item-large {
  display: flex;
  flex-direction: column; /* 縦並びに変更 */
  align-items: center; /* 中央揃え */
  gap: 2rem;
  background-color: var(--card-bg);
  padding: 2rem;
  border-radius: 12px;
  border: 1px solid var(--border-color);
  transition: all 0.3s ease;
}

.feature-item-large:hover {
  transform: translateY(-5px);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.1);
  border-color: var(--accent-color);
}

.feature-item-large__image {
  width: 100%;
  max-width: 800px;
  height: auto; /* 高さを自動調整 */
  object-fit: cover;
  border-radius: 8px;
}

.feature-item-large__text {
  width: 100%; /* 横幅いっぱいに広げる */
}

.feature-item-large__text .heading-small {
  text-align: left;
  margin-bottom: 0.5rem;
}
.feature-item-large__text .heading-small::after {
  left: 0;
  transform: translateX(0);
  width: 50px;
}

/* --- 特徴リスト（画像左、テキスト右） --- */
.feature-item {
  display: flex;
  align-items: flex-start; /* 上揃えにする場合 */
  gap: 1.5rem;
  background-color: var(--card-bg);
  padding: 1.5rem;
  border-radius: 12px;
  border: 1px solid var(--border-color);
  transition: all 0.3s ease;
  height: 100%; /* .col-2内で高さを揃えるため */
}

.feature-item:hover {
  transform: translateY(-5px);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.1);
  border-color: var(--accent-color);
}

.feature-item__image {
  flex: 0 0 150px; /* 画像の幅を固定 */
  width: 150px;
  height: 150px;
  object-fit: cover;
  border-radius: 8px;
}

.feature-item__text {
  flex: 1;
}

.feature-item__text .heading-small {
  text-align: left;
  margin-bottom: 0.5rem;
}
.feature-item__text .heading-small::after {
  left: 0;
  transform: translateX(0);
  width: 50px;
}

.feature-item__text h3 {
  font-size: 1.1rem;
  color: var(--text-color-secondary);
  margin-bottom: 0.75rem;
  font-weight: 500;
}

/* スマートフォン用のレスポンシブ対応 */
@media (max-width: 768px) {
  #blog-list {
    grid-template-columns: 1fr;
  }
}

/* レスポンシブ対応 */
@media (max-width: 768px) {
  .nav-menu {
    display: none;
  }

  .hamburger {
    display: flex;
  }

  .theme-toggle {
    /* ロゴとテーマボタンの間を最大化して右に寄せます */
    margin-left: auto;
    /* アイコンだけにするため、テキストを非表示にします */
    font-size: 0;
    /* 正円のボタンにします */
    padding: 0;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    position: relative;
    flex-shrink: 0; /* ボタンが縮まないようにします */
  }

  .theme-toggle::before {
    /* アイコンをボタンの中央に配置します */
    content: "🌙"; /* デフォルトは月のアイコン */
    font-size: 1.2rem;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
  }

  /* ダークモードの時だけ、アイコンを太陽に切り替えます */
  [data-theme="dark"] .theme-toggle::before {
    content: "☀️";
  }

  .hero-content h1 {
    font-size: 2.5rem;
  }

  .hero-content p {
    font-size: 1rem;
  }

  .grid-2,
  .grid-3 {
    /* .grid-4 は auto-fit で自動調整されるため、ここからは除外します */
    grid-template-columns: 1fr;
  }

  .heading-large {
    font-size: 2rem;
  }

  .heading-medium {
    font-size: 1.5rem;
  }

  .container {
    padding: 0 15px;
  }

  .section {
    padding: 2rem 0;
  }

  .feature-item {
    flex-direction: column; /* 縦並びにする */
    align-items: center; /* 中央揃えにする */
    text-align: center;
  }
  .feature-item__image {
    flex-basis: auto; /* flex-basisをリセット */
    width: 100%;
    height: auto;
    max-width: 250px; /* 最大幅を指定 */
  }
}

.card {
  background: var(--card-bg);
  border-radius: 12px;
  padding: 2rem;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
  transition: all 0.3s ease;
  border: 1px solid var(--border-color);
}

.card:hover {
  transform: translateY(-10px) scale(1.03);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.2);
  border-color: var(--accent-color);
}

.card-image {
  width: 100%;
  height: 200px;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  border-radius: 8px;
  margin-bottom: 1.5rem;
  box-shadow: 2px 2px 8px rgba(0, 0, 0, 0.15);
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 1.2rem;
  font-weight: 600;
  transition: transform 0.3s ease;
}

@media (max-width: 480px) {
  .mobile-menu {
    width: 100vw;
    right: -100vw;
  }

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

/* スマートフォン用のレスポンシブ対応 */
@media (max-width: 768px) {
  .feature-item-large {
    flex-direction: column;
    align-items: center;
    text-align: center;
  }
  .feature-item-large__image {
    width: 100%;
    max-width: 300px;
  }

  /* image-generation-guide.html の画像比較セクション用 */
  .image-comparison-grid {
    justify-items: center; /* グリッドアイテムを中央揃え */
  }

  .image-comparison-grid figure {
    width: 100%;
    max-width: 400px; /* タブレット表示で少し大きく見せる */
  }
}
.grid-4 .card:hover .card-image {
  transform: scale(1.05);
}

/* --- 4段組レイアウトの特別スタイル --- */

/* 4段組のカードの画像スタイルを円形に変更 */
.grid-4 .card .card-image {
  width: 50%; /* コンテンツ（カード）の50%の幅 */
  height: 0;
  padding-bottom: 50%; /* 高さを幅と同じにして正円を維持 */
  border-radius: 50%; /* 円形にする */
  margin: 0 auto 1.5rem auto; /* 中央配置と、下のテキストとの余白 */
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1); /* 薄っすらとシャドウ */
  background-size: cover;
  background-position: center;
  transform: none; /* ホバー時の拡大アニメーションを無効化 */
}
