/* ========================================
   Top Page - 雲の王国
   ======================================== */

/* ========================================
   Hero Section
   ======================================== */
.hero {
  position: relative;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  padding-top: var(--header-h);
}

/* 背景: hero_bg.jpg がない間は CSS グラデーションで代替 */
.hero-bg {
  position: absolute;
  inset: 0;
  background:
    /* 中央に宇宙的な深い青の輝き */
    radial-gradient(ellipse 90% 70% at 50% 30%, rgba(20, 60, 140, 0.55) 0%, transparent 70%),
    /* 上部に星雲風のブルーグロー */
    radial-gradient(ellipse at 50% -10%, rgba(80, 140, 255, 0.22) 0%, transparent 55%),
    /* 右下に微かなゴールドアクセント */
    radial-gradient(ellipse at 85% 90%,  rgba(200, 168, 75, 0.07) 0%, transparent 45%),
    /* ベース: 上部は深宇宙ブルー → 下部は暗い */
    linear-gradient(to bottom, #0e2244 0%, #0a1632 30%, #08111f 60%, #07091a 100%);
}

/*
  ★ hero_bg.jpg を配置したら下記のコメントを外してください
  .hero-bg {
    background: url('../images/bg/hero_bg.jpg') center/cover no-repeat;
  }
  .hero-bg::after {
    content: '';
    position: absolute;
    inset: 0;
    background: rgba(7, 9, 26, 0.55);
  }
*/

/* 星雲風のアニメーション装飾 */
.hero-bg::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 70% 50% at 25% 50%, rgba(60, 120, 220, 0.10) 0%, transparent 100%),
    radial-gradient(ellipse 50% 40% at 75% 25%, rgba(100, 60, 180, 0.08) 0%, transparent 100%);
  animation: cloudDrift 12s ease-in-out infinite alternate;
}

@keyframes cloudDrift {
  from { transform: translateX(-10px) translateY(0); }
  to   { transform: translateX(10px)  translateY(-8px); }
}

/* 星空レイヤー（hero-bg の1つ上、hero-content の下） */
.hero-stars {
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
  /* 下方向へフェード: ロゴエリアには星が出ないよう */
  -webkit-mask-image: linear-gradient(to bottom, black 0%, black 48%, transparent 78%);
  mask-image: linear-gradient(to bottom, black 0%, black 48%, transparent 78%);
}


.hero-content {
  position: relative;
  z-index: 1;
  text-align: center;
  padding: 0;
  animation: heroFadeIn 1.2s ease 0.4s both;
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;             /* 全幅確保 → 子要素のグラデーションを画面端まで伸ばす */
}

@keyframes heroFadeIn {
  from { opacity: 0; transform: translateY(24px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* スライダー全体ラッパー（画像と横棒を同幅に揃える） */
.hero-slider-wrap {
  display: inline-flex;
  flex-direction: column;
  max-width: min(500px, 85vw);
}

/* スライダーコンテナ（表示領域・グラデーションは元の .hero-poster をそのまま継承） */
.hero-slider {
  position: relative;
  display: block;
  line-height: 0;
  box-shadow: 0 20px 80px rgba(0, 0, 0, 0.7);
  /* 左右端をアルファフェードで背景に馴染ませる */
  -webkit-mask-image: linear-gradient(
    to right,
    transparent 0%,
    black 1%,
    black 99%,
    transparent 100%
  );
  mask-image: linear-gradient(
    to right,
    transparent 0%,
    black 1%,
    black 99%,
    transparent 100%
  );
}

.hero-slide {
  display: block;
  max-height: 72vh;
  width: auto;
  max-width: min(500px, 85vw);
  opacity: 0;
  transition: opacity 0.8s ease;
  position: absolute;
  top: 0;
  left: 0;
}

.hero-slide.active {
  opacity: 1;
  position: relative;
}

/* 横棒ナビゲーション */
.hero-slider-bars {
  display: flex;
  gap: 4px;
  margin-top: 10px;
  position: relative;
  z-index: 2;
}

.hero-slider-bar {
  flex: 1;
  height: 20px;          /* タップ領域の高さ */
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px 0;
  box-sizing: border-box;
  position: relative;
}

.hero-slider-bar::after {
  content: '';
  display: block;
  height: 4px;
  background: rgba(255, 255, 255, 0.28);
  transition: background var(--transition);
}

.hero-slider-bar.active::after {
  background: var(--color-accent);
}

.hero-logo-area {
  align-self: stretch;
  margin-top: -20px;       /* ポスター下端に20pxだけ被せてグラデーションを馴染ませる */
  position: relative;
  z-index: 1;
  background: linear-gradient(to bottom, transparent 0%, var(--bg-dark) 40%);
  padding: 40px 24px 0;    /* padding-top 40px → 文字はポスターから +20px 下に出る */
}

.hero-subtitle {
  font-size: 0.9rem;
  letter-spacing: 0.35em;
  color: var(--color-accent);
  margin-bottom: 0;
}

.hero-title {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  margin-top: 0px;
  margin-bottom: 28px;
}

.hero-logo-img {
  width: 500px;        /* ← ここだけ変えてサイズ調整 */
  max-width: 90vw;     /* スマホでの画面はみ出し防止（変更不要） */
  height: auto;
  filter: drop-shadow(0 0 30px rgba(74, 158, 222, 0.25));
}

.hero-title-ja {
  font-size: clamp(3.2rem, 9vw, 6.5rem);
  font-weight: 700;
  letter-spacing: 0.28em;
  padding-right: 0.28em;
  line-height: 1.1;
  text-shadow:
    0 0 60px rgba(74, 158, 222, 0.3),
    0 2px 4px rgba(0, 0, 0, 0.5);
}

.hero-title-en {
  font-family: var(--font-ja);
  font-size: clamp(0.6rem, 1.6vw, 0.85rem);
  font-weight: 400;
  letter-spacing: 0.45em;
  color: var(--color-accent);
  opacity: 0.85;
}

.hero-catch {
  font-size: clamp(0.75rem, 2vw, 0.95rem);
  color: var(--color-muted);
  letter-spacing: 0.2em;
  margin-bottom: 44px;
  line-height: 1;
}

.hero-btn {
  display: inline-block;
  border: 1px solid var(--color-primary);
  color: var(--color-primary);
  font-family: var(--font-en);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.22em;
  padding: 14px 40px;
  transition:
    background var(--transition),
    color var(--transition),
    box-shadow var(--transition);
}

.hero-btn:hover {
  background: var(--color-primary);
  color: var(--bg-dark);
  box-shadow: 0 0 24px rgba(74, 158, 222, 0.35);
}

/* Amazon KDP リンクボタン */
.hero-kdp-btn {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  background: linear-gradient(135deg, #b8943e 0%, #e8c870 50%, #b8943e 100%);
  color: #07091a;
  padding: 18px 60px;
  border-radius: 6px;
  box-shadow: 0 4px 24px rgba(200, 168, 75, 0.35);
  transition:
    opacity var(--transition),
    transform var(--transition),
    box-shadow var(--transition);
}

.hero-kdp-btn:hover {
  opacity: 0.88;
  transform: translateY(-3px);
  box-shadow: 0 10px 32px rgba(200, 168, 75, 0.5);
}

.hero-kdp-btn-main {
  font-family: var(--font-ja);
  font-size: 1.2rem;
  font-weight: 700;
}

.hero-kdp-btn-sub {
  font-family: var(--font-ja);
  font-size: 0.8rem;
  font-weight: 600;
  opacity: 0.65;
}

/* スクロール促進ライン */
.hero::after {
  content: '';
  position: absolute;
  bottom: 28px;
  left: 50%;
  transform: translateX(-50%);
  width: 1px;
  height: 44px;
  background: linear-gradient(to bottom, var(--color-muted), transparent);
  animation: scrollPulse 2.5s ease-in-out infinite;
}

@keyframes scrollPulse {
  0%, 100% { opacity: 0.2; transform: translateX(-50%) translateY(0); }
  50%       { opacity: 0.7; transform: translateX(-50%) translateY(6px); }
}

/* ========================================
   NEWS Section
   ======================================== */
.news-section {
  --news-section-pad: 30px; /* ← ここだけ変えてNEWS領域全体の上下余白を調整 */
  padding: var(--news-section-pad) 0;
  background: var(--bg-surface);
  border-top: 1px solid var(--color-border);
  border-bottom: 1px solid var(--color-border);
}

.news-list {
  display: flex;
  flex-direction: column;
}

.news-item {
  --news-item-h: 50px; /* ← ここだけ変えてnewsアイテムの縦幅を調整 */
  display: flex;
  align-items: center;
  gap: 16px;
  height: var(--news-item-h);
  border-bottom: 1px solid var(--color-border);
  transition: padding-left var(--transition);
}

.news-item:first-child {
  border-top: 1px solid var(--color-border);
}

.news-item:hover {
  padding-left: 8px;
}

.news-date {
  font-family: var(--font-en);
  font-size: 0.72rem;
  color: var(--color-muted);
  white-space: nowrap;
  letter-spacing: 0.06em;
  min-width: 6em;
}

.news-tag {
  display: inline-block;
  font-size: 0.62rem;
  padding: 2px 8px;
  border: 1px solid var(--color-accent);
  color: var(--color-accent);
  white-space: nowrap;
  letter-spacing: 0.08em;
  flex-shrink: 0;
}

.news-link {
  font-size: 0.88rem;
  color: var(--color-text);
  transition: color var(--transition);
  flex: 1;
}

.news-link:hover {
  color: var(--color-primary);
}

/* ========================================
   STORY Preview Section
   ======================================== */
.story-section {
  position: relative;
  overflow: hidden;
}

.story-section::before {
  content: '';
  position: absolute;
  right: -5%;
  top: -20%;
  width: 45%;
  height: 140%;
  background: radial-gradient(ellipse, rgba(74, 158, 222, 0.05) 0%, transparent 70%);
  pointer-events: none;
}

.story-preview {
  max-width: 700px;
}

.story-text {
  font-size: 1rem;
  line-height: 2.3;
  color: var(--color-text);
  margin-bottom: 36px;
  padding-left: 20px;
  border-left: 2px solid var(--color-primary);
}

/* ========================================
   CHARACTER Preview Section
   ======================================== */
.characters-section {
  background: var(--bg-surface);
  border-top: 1px solid var(--color-border);
  border-bottom: 1px solid var(--color-border);
}

.character-cards {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}

.character-card {
  display: block;
  background: var(--bg-card);
  border: 1px solid var(--color-border);
  overflow: hidden;
  transition: border-color var(--transition), transform var(--transition), box-shadow var(--transition);
  cursor: pointer;
  text-decoration: none;
  color: inherit;
}

.character-card:hover {
  border-color: var(--color-primary);
  transform: translateY(-6px);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.4);
}

.character-img-placeholder {
  width: 100%;
  aspect-ratio: 3 / 4;
  background: linear-gradient(160deg, #0d1226 0%, #1a2240 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--color-border);
  font-family: var(--font-en);
  font-size: 0.7rem;
  letter-spacing: 0.25em;
  border-bottom: 1px solid var(--color-border);
  position: relative;
  overflow: hidden;
}

/* 画像プレースホルダーの装飾 */
.character-img-placeholder::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse at 50% 30%, rgba(74, 158, 222, 0.08) 0%, transparent 60%);
}

/* 画像が配置されたとき全体を覆って表示 */
.character-img-placeholder img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top center;
  z-index: 1;
}

.character-info {
  padding: 16px 18px;
}

.character-name-ja {
  font-size: 1rem;
  font-weight: 500;
  margin-bottom: 2px;
  letter-spacing: 0.08em;
}

.character-name-en {
  font-family: var(--font-en);
  font-size: 0.62rem;
  letter-spacing: 0.18em;
  color: var(--color-accent);
  margin-bottom: 10px;
}

.character-desc {
  font-size: 0.8rem;
  color: var(--color-muted);
  line-height: 1.75;
}

/* ========================================
   レスポンシブ
   ======================================== */
@media (max-width: 768px) {
  :root {
    --hero-logo-sp: 65vw; /* ← スマホ版ロゴサイズはここだけ変更 */
  }

  .hero {
    align-items: flex-start;
    min-height: auto;
  }

  .hero-logo-img {
    width: var(--hero-logo-sp);
    max-width: var(--hero-logo-sp);
  }

  .hero-catch {
    display: none;
  }

  .hero-kdp-btn {
    padding: 12px 32px;
  }

  .hero-kdp-btn-main {
    font-size: 0.95rem;
    white-space: nowrap;
  }

  .hero-kdp-btn-sub {
    font-size: 0.7rem;
    white-space: nowrap;
  }

  .character-cards {
    grid-template-columns: 1fr;
    max-width: 280px;
    margin-left: auto;
    margin-right: auto;
  }

  .character-cards .character-card:nth-child(n+2) {
    display: none;
  }

  .news-item {
    flex-wrap: wrap;
    gap: 6px;
  }

  .story-text {
    font-size: 0.9rem;
    line-height: 2.1;
  }
}

@media (max-width: 480px) {
  .hero-btn {
    padding: 12px 28px;
  }
}
