/* 全体リセット */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
  }
  
  body {
    font-family: "Hiragino Mincho ProN", "Yu Mincho", serif;
    line-height: 1.8;
    background: #f9f9e1;
    color: #333;
    text-align: center;
  }
  /* ヘッダー */
header {
  background: #f9f9e1;
  padding: 40px 80px; /* ← 上下余白を広げる */
  position: relative;
  z-index: auto;
}

.header-container {
  display: flex;
  justify-content: space-between; /* 左右に配置 */
  align-items: center;            /* 高さを中央に揃える */
}

/* 左：サイトタイトル */
.site-title {
  font-size: 2.2rem;
  font-weight: bold;
  color: #1c60ad;      /* 紺色 */
  margin: 0;
  text-align: left;
}

/* 中央：ページタイトル */
.page-title {
  font-size: 1.9rem;
  font-weight: bold;
  text-align: center;
  flex: 1;             /* ← 中央に広がる */
  color: #1c60ad;
}

/* 右：ナビゲーション */
.header-nav {
  display: flex;
  gap: 25px;
  justify-content: flex-end; /* ← 右寄せ */
  align-items: center;
}

.header-nav a {
  display: flex;
  flex-direction: column; /* アイコンの下に文字 */
  align-items: center;
  text-decoration: none;
  color: #333;
  font-size: 0.8rem;
}

.header-nav a img {
  width: 40px;  /* アイコンサイズ：画像に近い大きさ */
  height: auto;
  margin-bottom: 5px;
}

.header-nav a span {
  font-size: 0.8rem;
}

/* スマホ用：右からスライドイン */
@media (max-width: 768px) {
  .header-nav {
    position: fixed;
    top: 0;
    right: -70%;
    width: 70%;
    height: 100%;
    background: #fffde8;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 25px;
    padding: 40px 20px;
    box-shadow: -3px 0 8px rgba(0,0,0,0.2);
    transition: right 0.3s ease;
    z-index: 1000;
  }
  .header-nav.active {
    right: 0;
  }
}
  
  /* メインビジュアル */
  .main-visual img {
    width: 100%;
    height: auto;
    display: block;
  }
  /* main-visual全体に高さを与える */
.main-visual {
  width: 100%;
  height: auto;
}

/* 競合しないように変更 */
.main-visual > img {
  /* ← 単独のimg用（古い一枚画像用） */
  width: 100%;
  height: auto;
  display: block;
}
.main-visual {
  position: relative; /* 相対配置で基準にする */
}

.character {
  position: absolute;
  top: 50%;
  left: 0;
  width: 120px !important; /* ← 強制的に小さくする */
  height: auto !important;
  cursor: grab;
  z-index: 10;
  user-select: none;
}

  
  /* キャッチコピー */
  .catch {
    padding: 150px 0;
    font-size: 2rem;
    color: #444;
  }
  
  .catch p {
    margin: 60px 20;
  }
  .catch span {
    display: block;              /* ← 各行をブロックに */
    opacity: 0;
    transform: translateY(20px);
    animation: fadeUp 1.5s ease forwards;
  }
  
  .catch span:nth-of-type(1) {
    animation-delay: 0s;
    padding-left: 1em;           /* ← 左余白（全角2文字分） */
  }
  .catch span:nth-of-type(2) {
    animation-delay: 1s;
    padding-left: 3em;           /* ← さらに右に寄せる */
  }
  .catch span:nth-of-type(3) {
    animation-delay: 2s;
    padding-left: 7em;          /* ← 一番右に寄せる */
  }

  
  @keyframes fadeUp {
    to {
      opacity: 1;
      transform: translateY(0);
    }
  }
  
  .pickup {
    margin-top: 150px;
    font-weight: bold;
    letter-spacing: 2px;
  }
  
  /* 本の一覧 */
  .books {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    padding: 20px;
    max-width: 1200px;
    margin: 0 auto;
  }
  
  .book {
    text-align: center;
  }
  
  .book img {
    width: 100%;
    aspect-ratio: 3 / 4;   /* 縦長（3:4） */
    object-fit: cover;     /* トリミングして均一に */
    border-radius: 8px;
    box-shadow: 0 3px 6px rgba(0,0,0,0.2);
  }
  
  .book p {
    margin-top: 10px;
    font-size: 1.5rem;
  }
  
  
  /* 紹介文 */
  .intro {
    background: #fffde8;
    padding: 100px 40px;
    margin: 50px 0;
    font-size: 1.2rem;
    line-height: 2;
  }
  
  /* フッター */
  footer {
    background: #f8e96f;
    padding: 150px;
    font-size: 1.5rem;
  }
  
  footer nav a {
    text-decoration: none;
    color: #333;
    margin: 0 5px;
  }
  
  /* レスポンシブ対応 */
  @media (max-width: 768px) {
    .site-title {
      font-size: 1.2rem;
    }
  
    /* ハンバーガー表示 */
    .menu-toggle {
      display: flex;
    }
  }
  
  @media (max-width: 480px) {
    body {
      font-size: 14px;
    }
  
    .books {
      grid-template-columns: 1fr 1fr;
    }
  
    .book p {
      font-size: 0.8rem;
    }
  }
 
  
  .page-subtitle {
    font-size: 1rem;
    margin-bottom: 30px;
    color: #666;
  }
  
  /* 商品一覧 */
  .product-list {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 20px;
    max-width: 1000px;
    margin: 0 auto;
    padding: 20px;
  }
  
  .product {
    background: #fff;
    border-radius: 10px;
    padding: 15px;
    box-shadow: 0 3px 8px rgba(0,0,0,0.15);
    text-align: center;
  }
  
  .product img {
    width: 100%;
    border-radius: 8px;
  }
  
  .product h3 {
    font-size: 1rem;
    margin: 10px 0;
  }
  
  .product .desc {
    font-size: 0.85rem;
    color: #555;
    margin-bottom: 8px;
  }
  
  .product .price {
    font-weight: bold;
    color: #333;
    margin-bottom: 10px;
  }
  
  .buy-btn {
    background: #f8e96f;
    border: none;
    padding: 8px 15px;
    border-radius: 6px;
    font-size: 0.9rem;
    cursor: pointer;
    transition: background 0.3s;
  }
  
  .buy-btn:hover {
    background: #f6d93a;
  }
  /* 本の詳細ページ */

  .book-detail {
    display: flex;
    flex-wrap: wrap;
    max-width: 900px;
    margin: 40px auto;
    padding: 20px;
    gap: 40px;              /* ← 画像とテキストの余白を広めに */
    text-align: left;
    align-items: center;    /* ← 画像の中央高さにテキストを揃える */
  }
  
  .book-image img {
    max-width: 300px;
    border-radius: 8px;
    box-shadow: 0 3px 8px rgba(0,0,0,0.2);
  }
  
  .book-info {
  flex: 1;
  font-size: 1rem;
  line-height: 2;         /* ← 行間を広げる */
  padding-left: 100px;     /* ← 文字を少し右に寄せる */
}
  
.book-info h2 {
  margin-bottom: 15px;
  font-size: 1.6rem;
  color: #333;
}

.book-info p {
  margin-bottom: 35px;    /* ← 各行に余白 */
}

.book-info label {
  display: block;         /* ← 数量を独立した行にする */
  margin: 15px 0;
}
  
  .book-info .price {
    font-weight: bold;
    margin: 10px 0;
  }
  
  .book-info input {
    width: 60px;
    margin-left: 5px;
    padding: 5px;
  }  
  
  .buy-btn {
    display: block;         /* ← ボタンも独立した行に */
    margin-top: 10px;
    background: #f8e96f;
    border: none;
    padding: 10px 20px;
    border-radius: 6px;
    font-size: 1rem;
    cursor: pointer;
  }
  
  .buy-btn:hover {
    background: #f6d93a;
  }

  /* shop.html の商品一覧用 */
.shop-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr); /* 3列 */
  gap: 40px;
  padding: 20px;
}

.shop-grid .item {
  display: flex;
  flex-direction: column;
  justify-content: space-between; /* 画像とテキストを上下で分布 */
  background: transparent;
  padding: 10px;
  border-radius: 8px;
  transition: transform 0.2s;
}

.shop-grid .item dt {
  font-size: 1rem;   /* タイトルを大きく */
  font-weight: bold;
  margin: 10px 0 5px;
}

.shop-grid .item dd {
  font-size: 0.9rem;
  line-height: 1.6;
  margin-bottom: 12px; /* 説明文下に余白 */
  flex-grow: 1; /* 説明文の高さを揃える */
}

.shop-grid .item dl {
  flex: 1; /* 余白を調整して高さを均等化 */
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  min-height: 120px; /* タイトル+説明の最低高さを指定 */
}

.shop-grid .item p {
  font-size: 1.1rem;   /* 価格を大きく */
  font-weight: bold;
  margin-top: auto; /* 下に固定配置 */
}

.shop-grid .item:hover {
  transform: scale(1.05);
}
.shop-grid img {
  width: 100%;
  aspect-ratio: 3 / 4; /* 縦長（3:4）に統一 */
  object-fit: cover;   /* はみ出した部分はトリミング */
  border-radius: 8px;
}


/* ハンバーガーメニュー（モーダル風スライドイン） */
.menu {
  position: fixed;
  top: 0;
  right: -250px; /* 初期は隠す */
  width: 250px;
  height: 100%;
  background: #fef9c3;
  display: flex;
  flex-direction: column;
  padding: 60px 20px;
  transition: right 0.3s ease;
  z-index: 1000;
}

.menu a {
  margin: 15px 0;
  text-decoration: none;
  font-size: 18px;
  color: #333;
}

.menu.active {
  right: 0; /* 表示状態 */
}

.hamburger {
  font-size: 24px;
  cursor: pointer;
  position: absolute;
  right: 20px;
  top: 20px;
}
.menu-toggle {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  width: 30px;
  height: 22px;
  background: none;
  border: none;
  cursor: pointer;

  position: absolute;  
  right: 20px;
  top: 50%;
  transform: translateY(-50%);  /* ← ヘッダー中央に揃える */
}
.menu-toggle span {
  display: block;
  height: 3px;
  background: #333;
  border-radius: 2px;
}

/* 作者紹介ページ */
.author-intro {
  max-width: 1000px;
  margin: 60px auto;
  padding: 20px;
  text-align: left; /* ← 中央揃え解除 */
}

.author-container {
  display: flex;
  align-items: flex-start;  /* 上揃え */
  gap: 40px;                /* 画像とテキストの余白 */
}

.author-photo img {
  max-width: 280px;        /* 写真サイズを統一 */
  border-radius: 8px;
  box-shadow: 0 3px 8px rgba(0,0,0,0.2);
}

.author-text {
  flex: 1;
  line-height: 2;          /* 行間を広げる */
}

.author-text h2 {
  font-size: 1.3rem;         /* 名前を大きめに */
  margin-bottom: 20px;
  color: #002147;          /* 紺色 */
}

.author-text .profile {
  font-size: 1.1rem;
  margin-bottom: 20px;
}

.author-text .description {
  font-size: 1rem;
  color: #444;
  line-height: 1.8;
}

/* スマホ時は縦並び */
@media (max-width: 768px) {
  .author-container {
    flex-direction: column;
    align-items: center;
    text-align: center;
  }
  .author-photo img {
    max-width: 80%;
  }
  .author-text {
    text-align: left;
  }
}

/* スライドショー全体 */
.slideshow {
  position: relative;
  width: 100%;
  height: 500px; /* ← 高さを決める（必要に応じ調整） */
  overflow: hidden;
}

/* 画像共通 */
.slideshow img {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  transition: opacity 1s ease-in-out;
}

/* 表示中の画像 */
.slideshow img.active {
  opacity: 1;
  z-index: 1;
}
/* スマホ時のキャッチコピー調整 */
@media (max-width: 768px) {
  .catch {
    font-size: 1.5rem; /* 少し小さめ */
    padding: 80px 20px;
  }
  .catch span {
    padding-left: 0 !important; /* 余白リセット */
    text-align: center; /* 中央揃え */
    display: block;
  }
  .pickup {
    margin-top: 40px;
    font-size: 1.2rem;
  }
}
/* フッター（スマホ時） */
@media (max-width: 768px) {
  footer {
    padding: 40px 20px;
    font-size: 1rem;
  }
  footer nav {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 15px;
  }
  footer nav a {
    margin: 0; /* 横余白削除 */
  }
}

.sub-nav {
  display: flex;
  justify-content: center;
  gap: 30px;
  margin-top: 15px;
}
.sub-nav a {
  text-decoration: none;
  color: #333;
  font-size: 1rem;
}

/* スマホ時は縦並び */
@media (max-width: 768px) {
  .sub-nav {
    flex-direction: column;
    gap: 15px;
  }
}
@media (max-width: 768px) {
  .header-nav {
    display: none; /* ← スマホ時はナビを非表示 */
  }
  .header-nav.active {
    display: flex; /* ← ハンバーガーを押したら表示 */
  }
}
/* スマホ時は2列 */
@media (max-width: 768px) {
  .shop-grid {
    grid-template-columns: 1fr 1fr;
    gap: 20px; /* ← 余白を少し小さく */
  }
}
/* PC（769px以上）のときはハンバーガーを消す */
@media (min-width: 769px) {
  .menu-toggle {
    display: none;
  }
}
header {
  background: #f9f9e1;
  padding: 40px 20px; /* ← 左右の余白を 80px → 20px に減らす */
  position: relative;
  z-index: 1000;
}
/* デフォルトでは非表示（PCでは出さない） */
.mobile-links {
  display: none;
}

/* スマホ用レイアウト調整（max-width:768px は既存と合わせてます） */
@media (max-width: 768px) {
  /* 中央の page-title（ショップ等）が横並びで邪魔なら非表示に */
  .page-title {
    display: none;
  }

  /* ヘッダー余白をスマホ向けに少し小さく */
  header {
    padding: 14px 16px;
  }

  /* header-container は上段：タイトル（左）＋ハンバーガー（右）に */
  .header-container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: relative; /* menu-toggle の絶対配置を基準にする */
  }

  /* ハンバーガーを上段右端に固定（必要なら微調整） */
  .menu-toggle {
    position: absolute;
    right: 16px;
    top: 16px;
    transform: none; /* translateY を解除して高さを調整 */
  }

  /* 2行目：中央揃えのテキストリンクを表示 */
  .mobile-links {
    display: flex;
    justify-content: center;
    gap: 18px;
    padding: 8px 12px 14px;
    margin-top: 8px;
    border-top: 1px solid rgba(0,0,0,0.06);
    background: transparent;
  }
  .mobile-links a {
    text-decoration: none;
    color: #333;
    font-size: 0.95rem;
    line-height: 1;
    padding: 4px 2px;
  }
}
@media (max-width: 768px) {
  /* ハンバーガーを右端に置くだけでOK */
  .menu-toggle {
    position: relative;   /* ← absolute をやめる */
    right: 0;             /* ← リセット */
    top: 0;               /* ← リセット */
    transform: none;      /* ← translateY(-50%) を解除 */
    margin-left: auto;    /* ← 左側の余白を自動で広げ、右端に寄せる */
  }
}

/* ショップページの商品カード内のスタイル */
.shop-grid .item dt {
  text-align: center;   /* タイトルは中央 */
  font-weight: bold;
  margin: 8px 0;
}

.shop-grid .item dd {
  text-align: left;     /* 説明文は左揃え */
  margin: 0 0 10px;
  line-height: 1.6;
}

.shop-grid .item p {
  text-align: center;   /* 価格は中央 */
  font-weight: bold;
  margin: 4px 0 12px;
}
@media (max-width: 768px) {
  .book-detail {
    flex-direction: column; /* 縦並び */
    align-items: center;   /* 中央寄せ */
    text-align: center;    /* テキスト中央寄せ */
  }

  .book-info {
    padding-left: 0;       /* 左余白をリセット */
    text-align: center;    /* テキスト中央寄せ */
  }

  .book-info label {
    text-align: center;    /* 数量も中央寄せ */
  }
}
@media (max-width: 768px) {
  .book-detail {
    flex-direction: column;
    align-items: center;
    text-align: center;
  }

  .book-info {
    padding-left: 0;
    text-align: center;
  }

  .book-info label {
    text-align: center;
  }

  .buy-btn {
    display: inline-block;  /* ← block を inline-block に変更 */
    margin: 15px auto 0;   /* ← 上余白 + 左右中央寄せ */
  }
}

/* フッター調整 */
footer p {
  margin-bottom: 50px; /* サイト名とリンク群の間隔 */
}

footer nav {
  display: flex;
  justify-content: center;
  gap: 40px; /* リンク間隔を広げる */
}

footer nav a {
  text-decoration: none;
  color: #333;
}

/* 風船アニメーション */
.balloons {
  position: fixed;       /* ページ全体に表示 */
  bottom: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;  /* クリック操作を邪魔しない */
  overflow: hidden;
  z-index: 9999;            /* 背景より前・キャラより後ろ */
}

.balloon {
  position: absolute;
  bottom: -150px; /* 下から出現 */
  width: 60px;
  height: 80px;
  background: radial-gradient(circle at 30% 30%, #ff6f91, #ff2e63);
  border-radius: 50% 50% 50% 50%;
  animation: floatUp 12s linear infinite;
  opacity: 0.8;
 
  }


/* 風船ひも */
.balloon::after {
  content: "";
  position: absolute;
  top: 80px;
  left: 50%;
  width: 2px;
  height: 40px;
  background: #666;
  transform: translateX(-50%);
}

/* 上に浮かんで消える */
@keyframes floatUp {
  0% {
    transform: translateY(0) rotate(0deg);
    opacity: 1;
  }
  100% {
    transform: translateY(-120vh) rotate(15deg);
    opacity: 0;
  }
}

/* 複数の風船にランダム性をつける */
.balloon:nth-child(1) { left: 10%; animation-delay: 0s; animation-duration: 14s; }
.balloon:nth-child(2) { left: 30%; animation-delay: 2s; animation-duration: 12s; background: radial-gradient(circle at 30% 30%, #6fc3df, #3235f1); }
.balloon:nth-child(3) { left: 50%; animation-delay: 4s; animation-duration: 15s; background: radial-gradient(circle at 30% 30%, #f7d794, #ffef08); }
.balloon:nth-child(4) { left: 70%; animation-delay: 1s; animation-duration: 13s; background: radial-gradient(circle at 30% 30%, #9b59b6, #8e44ad); }
.balloon:nth-child(5) { left: 85%; animation-delay: 3s; animation-duration: 16s; background: radial-gradient(circle at 30% 30%, #2ecc71, #27ae60); }
.balloon:nth-child(6) { left: 20%; animation-delay: 5s; animation-duration: 11s; background: radial-gradient(circle at 30% 30%, #ff9ff3, #ac1327); }