/* ==========================================================================
   ひとしずくの奇跡 ── 公式サイト スタイルシート
   テーマ：「絶望の中に残った、小さな希望」
   深いネイビー × チャコールブラック / アクセント：落ち着いたゴールド
   ========================================================================== */

:root {
  /* ベースカラー */
  --c-navy-deep: #070d18;
  --c-navy: #0e1a2b;
  --c-navy-soft: #16273d;
  --c-charcoal: #1a1c20;

  /* 夕暮れ（青みが残る夕暮れ＋控えめなゴールド） */
  --c-dusk-blue: #22334a;
  --c-dusk-gold: #8a7550;

  /* アクセント：ゴールド */
  --c-gold: #c9a961;
  --c-gold-bright: #ddc084;
  --c-gold-dim: rgba(201, 169, 97, 0.45);

  /* 「Kindle」の文字色のみに使う、Kindleブランドを想起させるオレンジ（ロゴ画像は使用しない） */
  --c-kindle-orange: #e8901d;

  /* テキスト：本文は基本的に白系で読みやすく。faintは注釈など控えめな箇所のみに使用 */
  --c-white: #ffffff;
  --c-ivory: #f2ede0;
  --c-ivory-dim: rgba(255, 255, 255, 0.94);
  --c-ivory-faint: rgba(255, 255, 255, 0.72);

  /* 構造 */
  --border-hairline: rgba(201, 169, 97, 0.18);
  --shadow-soft: 0 20px 60px rgba(0, 0, 0, 0.45);

  --radius-md: 4px;
  --radius-lg: 8px;

  --max-width: 1180px;
  --header-height: 76px;

  --ease-slow: cubic-bezier(0.22, 1, 0.36, 1);
  --dur-base: 0.6s;
}

/* ===== リセット ===== */
*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: var(--header-height);
}

body {
  margin: 0;
  background-color: var(--c-navy-deep);
  color: var(--c-ivory);
  font-family: "Hiragino Mincho ProN", "Yu Mincho", "游明朝", serif, "Hiragino Sans", "Noto Sans JP", sans-serif;
  font-family: "Noto Serif JP", "Hiragino Mincho ProN", "Yu Mincho", serif;
  line-height: 1.9;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

a {
  color: inherit;
  text-decoration: none;
}

ul {
  list-style: none;
  margin: 0;
  padding: 0;
}

h1, h2, h3, p {
  margin: 0;
}

button {
  font: inherit;
  color: inherit;
  background: none;
  border: none;
  cursor: pointer;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: absolute;
  top: -100%;
  left: 1rem;
  z-index: 1000;
  background: var(--c-gold);
  color: var(--c-navy-deep);
  padding: 0.6em 1.2em;
  border-radius: var(--radius-md);
  transition: top 0.2s ease;
}

.skip-link:focus {
  top: 1rem;
}

:focus-visible {
  outline: 2px solid var(--c-gold-bright);
  outline-offset: 3px;
}

/* ===== レイアウトユーティリティ ===== */
.section-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: clamp(3.5rem, 8vw, 7rem) 1.5rem;
}

.section-inner--narrow {
  max-width: 760px;
}

.section-title {
  font-size: clamp(1.5rem, 3vw, 2.1rem);
  letter-spacing: 0.06em;
  color: var(--c-white);
  text-align: center;
  margin-bottom: clamp(2rem, 5vw, 3.5rem);
  position: relative;
  padding-bottom: 1.1rem;
}

.section-title::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 44px;
  height: 1px;
  background: var(--c-gold);
}

/* 左右分割レイアウト（この本について／著者からのメッセージ）用：見出しを左寄せにする */
.section-title--left {
  text-align: left;
}

.section-title--left::after {
  left: 0;
  transform: none;
}

/* ===== ボタン ===== */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5em;
  padding: 0.9em 1.9em;
  border: 1px solid var(--c-gold);
  border-radius: 999px;
  font-size: 0.95rem;
  letter-spacing: 0.04em;
  transition: background-color 0.3s var(--ease-slow), color 0.3s var(--ease-slow), transform 0.3s var(--ease-slow), box-shadow 0.3s var(--ease-slow);
  min-height: 44px;
}

.btn--gold {
  background: var(--c-gold);
  color: var(--c-navy-deep);
}

.btn--gold:hover,
.btn--gold:focus-visible {
  background: var(--c-gold-bright);
  border-color: var(--c-gold-bright);
  box-shadow: 0 8px 24px rgba(201, 169, 97, 0.35);
}

.btn--large {
  padding: 1.05em 2.4em;
  font-size: 1.02rem;
}

/* ===== ヘッダー ===== */
.site-header {
  position: sticky;
  top: 0;
  z-index: 500;
  border-bottom: 1px solid var(--border-hairline);
}

/* すりガラス効果は疑似要素側に持たせる。
   backdrop-filterを.site-header自身に付けると、その子要素であるモバイルメニュー
   （position:fixed）の基準（containing block）がビューポートではなくヘッダーの
   小さな箱になってしまい、メニューの高さがヘッダーの高さ分しか取れなくなるため */
.site-header::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: rgba(7, 13, 24, 0.85);
  backdrop-filter: blur(10px);
}

.site-header__inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 1.5rem;
  height: var(--header-height);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.site-logo {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  line-height: 1.3;
}

.site-logo__ja {
  font-size: 1.05rem;
  color: var(--c-white);
  letter-spacing: 0.05em;
}

.site-logo__en {
  font-size: 0.65rem;
  color: var(--c-gold);
  letter-spacing: 0.12em;
  font-family: "EB Garamond", "Times New Roman", serif;
}

.nav-toggle {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 5px;
  width: 44px;
  height: 44px;
  z-index: 510;
}

.nav-toggle__bar {
  width: 22px;
  height: 1.5px;
  background: var(--c-ivory);
  transition: transform 0.3s var(--ease-slow), opacity 0.3s var(--ease-slow);
}

.nav-toggle[aria-expanded="true"] .nav-toggle__bar:nth-child(1) {
  transform: translateY(6.5px) rotate(45deg);
}

.nav-toggle[aria-expanded="true"] .nav-toggle__bar:nth-child(2) {
  opacity: 0;
}

.nav-toggle[aria-expanded="true"] .nav-toggle__bar:nth-child(3) {
  transform: translateY(-6.5px) rotate(-45deg);
}

.site-nav {
  display: flex;
  align-items: center;
  gap: 2.2rem;
}

.site-nav__list {
  display: flex;
  gap: 1.8rem;
  font-size: 0.85rem;
  letter-spacing: 0.05em;
}

.site-nav__list a {
  position: relative;
  padding: 0.3em 0;
}

.site-nav__list a::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -2px;
  width: 100%;
  height: 1px;
  background: var(--c-gold);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.3s var(--ease-slow);
}

.site-nav__list a:hover::after,
.site-nav__list a:focus-visible::after {
  transform: scaleX(1);
}

.site-nav__cta {
  font-size: 0.82rem;
  padding: 0.7em 1.5em;
  border-radius: var(--radius-lg);
}

/* --- モバイルナビゲーション --- */
@media (max-width: 899px) {
  .nav-toggle {
    display: flex;
  }

  .site-nav {
    position: fixed;
    inset: var(--header-height) 0 0 0;
    background: var(--c-navy-deep);
    flex-direction: column;
    align-items: flex-start;
    justify-content: flex-start;
    padding: 3rem 1.75rem;
    transform: translateX(100%);
    transition: transform 0.35s var(--ease-slow);
    overflow-y: auto;
  }

  .site-nav.is-open {
    transform: translateX(0);
  }

  .site-nav__list {
    flex-direction: column;
    gap: 1.6rem;
    font-size: 1.15rem;
    width: 100%;
  }

  .site-nav__cta {
    margin-top: 2.2rem;
  }
}

@media (min-width: 900px) {
  .nav-toggle {
    display: none;
  }
}

/* ===== HERO ===== */
.hero {
  position: relative;
  overflow: hidden;
  /* ヘッダーは position:sticky で通常のフローに自身の高さ分を確保済みのため、
     ここで --header-height を再度足す必要はない（以前は二重に加算されてしまっていた） */
  padding-top: 1rem;
  padding-bottom: clamp(1.5rem, 4vw, 3rem);
}

.hero__bg {
  position: absolute;
  inset: 0;
  z-index: -2;
  /* 背景は先に書いたレイヤーほど手前に表示されるため、実画像を最前面、
     不透明グラデーションは画像が無い場合のフォールバックとして最背面に配置する */
  background:
    radial-gradient(ellipse at 20% 15%, rgba(201, 169, 97, 0.08), transparent 55%),
    url("/images/hero-background.webp"),
    linear-gradient(160deg, var(--c-navy-deep) 0%, var(--c-navy) 45%, var(--c-dusk-blue) 100%);
  background-size: cover;
  background-position: center;
}

/* モバイルは横長写真だと左右が大きくトリミングされるため、縦構図の専用画像に差し替える */
@media (max-width: 899px) {
  .hero__bg {
    background-image:
      radial-gradient(ellipse at 20% 15%, rgba(201, 169, 97, 0.08), transparent 55%),
      url("/images/hero-background-mobile.webp"),
      linear-gradient(160deg, var(--c-navy-deep) 0%, var(--c-navy) 45%, var(--c-dusk-blue) 100%);
  }

  /* スマホでは「実話に基づく物語」〜サブコピーまでを中央揃えにする */
  .hero__copy {
    text-align: center;
  }
}

/* モバイル：文章が横幅いっぱいに広がるため、左右ではなく上下のグラデーションにする。
   上（文章側）は暗く、下（書影側）に向かって明るくなだらかに抜けていく */
.hero__bg::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(
    180deg,
    rgba(7, 13, 24, 0.9) 0%,
    rgba(7, 13, 24, 0.75) 40%,
    rgba(7, 13, 24, 0.45) 65%,
    rgba(7, 13, 24, 0.15) 85%,
    transparent 100%
  );
}

@media (min-width: 900px) {
  /* PCは左右2カラムのため、左半分はほぼ真っ暗、右側（書影の周り）はフィルターなしの明るさに。
     境目は急に切り替わらないよう、広めの範囲でなだらかにフェードさせる */
  .hero__bg::after {
    background: linear-gradient(
      90deg,
      rgba(7, 13, 24, 0.98) 0%,
      rgba(7, 13, 24, 0.85) 38%,
      rgba(7, 13, 24, 0.62) 52%,
      rgba(7, 13, 24, 0.35) 66%,
      rgba(7, 13, 24, 0.12) 78%,
      transparent 90%
    );
  }
}

/* 暗いオーバーレイフィルターは無し。背景写真をそのまま見せる */

/* HEROのみで使用する水滴モチーフ（CSS描画・装飾） */
.hero__droplet {
  position: absolute;
  top: 12%;
  right: 8%;
  width: clamp(60px, 8vw, 110px);
  height: clamp(80px, 10vw, 140px);
  border-radius: 50% 50% 50% 0;
  transform: rotate(-45deg);
  background: radial-gradient(circle at 32% 30%, rgba(221, 192, 132, 0.5), rgba(201, 169, 97, 0.08) 60%, transparent 75%);
  filter: blur(1px);
  z-index: -1;
  opacity: 0.8;
  animation: droplet-drift 9s ease-in-out infinite;
}

@keyframes droplet-drift {
  0%, 100% { transform: rotate(-45deg) translateY(0); }
  50% { transform: rotate(-45deg) translateY(14px); }
}

/*
 * HEROはCSS Gridの名前付きエリアで配置する。
 * モバイル：コピー→書籍表紙→書籍形式→CTA の縦積み
 * デスクトップ：左カラム（コピー→書籍形式→CTA）／右カラム（表紙）の2カラム
 */
.hero__inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 1.5rem;
  display: grid;
  grid-template-columns: 1fr;
  grid-template-areas:
    "copy"
    "formats"
    "cta"
    "visual";
  gap: clamp(2.2rem, 6vw, 3rem);
  align-items: center;
}

.hero__copy {
  grid-area: copy;
  animation: fade-up var(--dur-base) var(--ease-slow) both;
}

.hero__visual {
  grid-area: visual;
  display: flex;
  justify-content: center;
  animation: fade-up var(--dur-base) var(--ease-slow) 0.15s both;
}

.eyebrow {
  color: var(--c-gold);
  font-size: 0.8rem;
  letter-spacing: 0.2em;
  margin-bottom: 1.1rem;
}

.hero__title {
  /* 「それでも、奇跡は起きた。」（12文字）が狭い実機幅でも1行に収まるよう、
     下限を1.9remより下げてvwでの縮小を効かせる（下限が高いと375px前後のスマホで折り返してしまう） */
  font-size: clamp(1.55rem, 5.2vw, 3.1rem);
  line-height: 1.5;
  color: var(--c-white);
  letter-spacing: 0.03em;
  margin-bottom: 1.6rem;
}

.hero__title-line {
  display: block;
  /* 行の途中で意図せず折り返さないようにする（文字数に応じたfont-sizeで幅は収まる想定） */
  white-space: nowrap;
}

.hero__subcopy {
  font-size: clamp(0.95rem, 1.6vw, 1.05rem);
  color: var(--c-ivory-dim);
  line-height: 1.8;
}

.hero__formats {
  grid-area: formats;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.4rem;
  /* 背景写真の明るい部分に重なると文字が読みにくくなるため、
     読みやすさ確保のための控えめな背景パネルを敷く */
  background: rgba(7, 13, 24, 0.55);
  backdrop-filter: blur(6px);
  border-radius: var(--radius-lg);
  padding: 1rem 0.6rem;
}

.format-chip {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 0.5rem;
}

.format-chip__icon {
  flex-shrink: 0;
  width: 32px;
  height: 32px;
  color: var(--c-gold);
  margin-bottom: 0.2rem;
}

.format-chip__icon svg {
  width: 100%;
  height: 100%;
}

.format-chip__title {
  font-size: clamp(0.72rem, 3vw, 0.95rem);
  color: var(--c-gold-bright);
  letter-spacing: 0.02em;
  line-height: 1.4;
}

.format-chip__title,
.format-chip__desc {
  /* <br>による改行位置はそのまま、各行の途中で意図せず折り返さないようにする */
  white-space: nowrap;
}

.format-chip__desc {
  font-size: clamp(0.62rem, 2.6vw, 0.8rem);
  color: var(--c-ivory-faint);
  line-height: 1.6;
}

.format-chip__desc--gold {
  color: var(--c-gold-bright);
  font-size: 0.95rem;
}

/* Kindle Unlimitedのみ、アイコンの代わりに「kindle / unlimited」の2段ロゴ風テキストにする
   （画像化されたロゴは使用せず、あくまで文字のスタイリング） */
.format-chip__logo {
  display: flex;
  flex-direction: column;
  align-items: center;
  line-height: 1.15;
}

.format-chip__logo-main {
  font-size: clamp(1.05rem, 5.5vw, 1.7rem);
  font-weight: 700;
  color: var(--c-kindle-orange);
  letter-spacing: 0.01em;
}

.format-chip__logo-sub {
  font-size: clamp(0.68rem, 3.4vw, 1.05rem);
  color: var(--c-white);
  letter-spacing: 0.02em;
}

/* 「Kindle」という語のみオレンジに。ロゴ画像・ワードマークの模写ではなく単なる文字色 */
.kindle-mark {
  color: var(--c-kindle-orange);
}

.hero__cta-group {
  grid-area: cta;
}

.hero__cta {
  width: 100%;
  justify-content: center;
  border-radius: var(--radius-lg);
}

.hero__note {
  margin-top: 1rem;
  font-size: clamp(0.85rem, 4vw, 1.2rem);
  color: var(--c-ivory-faint);
  text-align: center;
  line-height: 1.7;
}

/* 「Kindle 電子書籍」のような各項目の途中では折り返さず、"/" の前後でのみ改行させる */
.hero__note-item {
  white-space: nowrap;
}

/* 背景が透過のPNG/WebPを想定。箱型の背景・枠は付けず、
   影は矩形のbox-shadowではなく実際のシルエットに沿うdrop-shadowで表現する */
.hero__cover {
  width: min(78vw, 340px);
  height: auto;
  object-fit: contain;
  filter: drop-shadow(0 22px 40px rgba(0, 0, 0, 0.45));
  /* 画像未配置時、alt テキストが読みやすいように */
  color: var(--c-ivory-faint);
  font-size: 0.8rem;
}

/* ===== この本について ===== */
/* 写真をセクション全体に敷く（HEROと同じ考え方）。
   モバイル・タブレットは縦構図の専用画像＋上暗下明、PCは横構図＋左暗右明のグラデーション */
.story {
  position: relative;
  overflow: hidden;
}

.story__bg {
  position: absolute;
  inset: 0;
  z-index: -2;
  background:
    url("/images/story-background-mobile.webp"),
    linear-gradient(160deg, var(--c-navy-soft) 0%, var(--c-charcoal) 100%);
  background-size: cover;
  background-position: center;
}

.story__bg::after {
  content: "";
  position: absolute;
  inset: 0;
  /* モバイル・タブレット：文章が上から下へ流れるので、上は暗く・下に向かって明るく */
  background: linear-gradient(
    180deg,
    rgba(7, 13, 24, 0.92) 0%,
    rgba(7, 13, 24, 0.8) 35%,
    rgba(7, 13, 24, 0.5) 60%,
    rgba(7, 13, 24, 0.2) 80%,
    transparent 95%
  );
}

.story__inner {
  display: grid;
  grid-template-columns: 1fr;
  gap: clamp(2rem, 5vw, 3rem);
  align-items: center;
}

.story__body {
  display: flex;
  flex-direction: column;
  gap: 1.4rem;
  font-size: clamp(0.95rem, 1.6vw, 1.05rem);
  color: var(--c-ivory-dim);
  text-align: center;
}

/* 写真はセクション全体の背景として表示するため、ボックス化された画像自体は非表示にする */
.story__media {
  display: none;
}

@media (min-width: 900px) {
  /* PCのみ：横構図の写真に差し替え、左は暗く・右は明るいグラデーションにする。
     文章は中央揃えで、幅600px以内に収める */
  .story__bg {
    background-image:
      url("/images/story-background.webp"),
      linear-gradient(160deg, var(--c-navy-soft) 0%, var(--c-charcoal) 100%);
  }

  .story__bg::after {
    background: linear-gradient(
      90deg,
      rgba(7, 13, 24, 0.95) 0%,
      rgba(7, 13, 24, 0.85) 38%,
      rgba(7, 13, 24, 0.55) 55%,
      rgba(7, 13, 24, 0.2) 72%,
      transparent 88%
    );
  }

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

  .story__text {
    max-width: 600px;
    margin: 0 auto;
  }
}

/* ===== こんな方へ ===== */
.for-you {
  background: var(--c-navy);
}

.for-you__grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 2.2rem 1.2rem;
}

/* モバイル・タブレットはカード同士の区切りが分かるよう、控えめな枠と背景を付ける。
   PC（4カラム）では区切り線に切り替えるため、下のmin-width:1000pxで解除する */
.for-you__card {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 1.8rem 1.5rem;
  border: 1px solid var(--border-hairline);
  border-radius: var(--radius-lg);
  background: linear-gradient(160deg, rgba(255, 255, 255, 0.04), transparent);
  transition: transform 0.3s var(--ease-slow), border-color 0.3s var(--ease-slow);
}

.for-you__card:hover {
  border-color: var(--c-gold-dim);
  transform: translateY(-3px);
}

.for-you__icon {
  width: 44px;
  height: 44px;
  color: var(--c-gold);
  margin-bottom: 0.9rem;
}

.for-you__icon svg {
  width: 100%;
  height: 100%;
}

.for-you__card h3 {
  color: var(--c-gold-bright);
  font-size: 1.02rem;
  margin-bottom: 0.7rem;
  letter-spacing: 0.02em;
}

.for-you__card p {
  color: var(--c-ivory-dim);
  font-size: 0.9rem;
  line-height: 1.85;
}

@media (min-width: 600px) {
  .for-you__grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 1000px) {
  .for-you__grid {
    grid-template-columns: repeat(4, 1fr);
  }

  /* 4カラム時は枠付きカードをやめ、区切りの縦線だけにする */
  .for-you__card {
    padding: 0 1.3rem;
    border: none;
    border-left: 1px solid var(--border-hairline);
    border-radius: 0;
    background: none;
  }

  .for-you__card:first-child {
    border-left: none;
  }
}

/* ===== 著者からのメッセージ ===== */
/* 写真をセクション全体に敷く（この本についてと同じ考え方）。
   モバイル・タブレットは縦構図の専用画像＋上暗下明、PCは横構図＋右暗左明のグラデーション
   （この本についてとは左右を反転し、テキストを明るい側の反対＝暗い側に重ねる） */
.message {
  position: relative;
  overflow: hidden;
}

.message__bg {
  position: absolute;
  inset: 0;
  z-index: -2;
  background:
    url("/images/message-background-mobile.webp"),
    linear-gradient(200deg, var(--c-navy-soft), var(--c-dusk-blue));
  background-size: cover;
  background-position: center;
}

.message__bg::after {
  content: "";
  position: absolute;
  inset: 0;
  /* モバイル・タブレット：文章が上から下へ流れるので、上は暗く・下に向かって明るく */
  background: linear-gradient(
    180deg,
    rgba(7, 13, 24, 0.92) 0%,
    rgba(7, 13, 24, 0.8) 35%,
    rgba(7, 13, 24, 0.5) 60%,
    rgba(7, 13, 24, 0.2) 80%,
    transparent 95%
  );
}

.message__inner {
  display: grid;
  grid-template-columns: 1fr;
  gap: clamp(2rem, 5vw, 3rem);
  align-items: center;
}

/* 写真はセクション全体の背景として表示するため、ボックス化された画像自体は非表示にする */
.message__media {
  display: none;
}

.message__body {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  font-size: clamp(0.95rem, 1.6vw, 1.05rem);
  color: var(--c-ivory-dim);
  text-align: center;
}

.message__sign {
  margin-top: 2rem;
  text-align: center;
  color: var(--c-gold-bright);
  letter-spacing: 0.08em;
  font-size: 1rem;
}

@media (min-width: 900px) {
  /* PCのみ：横構図の写真に差し替え、右は暗く・左は明るいグラデーションにする。
     文章は中央揃えで、幅600px以内に収める */
  .message__bg {
    background-image:
      url("/images/message-background.webp"),
      linear-gradient(200deg, var(--c-navy-soft), var(--c-dusk-blue));
  }

  .message__bg::after {
    background: linear-gradient(
      270deg,
      rgba(7, 13, 24, 0.95) 0%,
      rgba(7, 13, 24, 0.85) 38%,
      rgba(7, 13, 24, 0.55) 55%,
      rgba(7, 13, 24, 0.2) 72%,
      transparent 88%
    );
  }

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

  .message__text {
    max-width: 600px;
    margin: 0 auto;
  }
}

/* ===== 書籍購入 ===== */
/* HEROのformat-chip（アイコン／ロゴ＋タイトル＋説明）と同じ見た目を踏襲し、購入ボタンを追加する。
   HEROのhero__formats同様、モバイル・タブレットでも3列横並び＋背景パネルにする。
   アイコン／ロゴ行・タイトル行・説明文行・ボタン行の4行は、
   HEROのformat-chipと同じsubgridで3カラムすべての高さを揃える
   （Kindle Unlimitedのみ構成要素の高さが微妙に異なり、通常のflexだとボタンの位置がずれるため） */
.buy {
  background: var(--c-navy);
}

.buy__grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  grid-template-rows: repeat(3, auto);
  gap: 0.4rem;
  background: rgba(7, 13, 24, 0.55);
  backdrop-filter: blur(6px);
  border-radius: var(--radius-lg);
  padding: 1.4rem 0.5rem;
}

.buy__card {
  display: grid;
  grid-template-rows: subgrid;
  grid-row: span 3;
  row-gap: 0.5rem;
  justify-items: center;
  text-align: center;
}

/* アイコン・タイトル・説明文のサイズ・カラーはHEROのformat-chipとまったく同じ値を使う
   （.format-chip__icon 等はクラス自体に定義されているため上書き不要）。
   nowrapのままでもbuyセクションの方が列幅が広く折り返さないが、念のため安全側にnormalにする */
.buy__card .format-chip__title,
.buy__card .format-chip__desc {
  white-space: normal;
}

/* 3形式とも同じ商品ページへのリンクのため、ボタンはカードごとではなく共通で1つにする */
.buy__cta {
  display: flex;
  width: fit-content;
  margin: 2rem auto 0;
  border-radius: var(--radius-lg);
}

@media (min-width: 900px) {
  .buy__grid {
    gap: 0;
    background: none;
    backdrop-filter: none;
    border-radius: 0;
    padding: 0;
  }

  .buy__card {
    row-gap: 0.6rem;
    padding: 0 1.8rem;
    border-left: 1px solid var(--border-hairline);
  }

  .buy__card:first-child {
    border-left: none;
  }
}

/* ===== FAQ ===== */
.faq {
  background: var(--c-charcoal);
}

.faq__list {
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
}

.faq__item {
  border: 1px solid var(--border-hairline);
  border-radius: var(--radius-lg);
  padding: 1.1rem 1.4rem;
}

.faq__question {
  cursor: pointer;
  color: var(--c-ivory);
  font-size: 0.98rem;
  letter-spacing: 0.02em;
  list-style: none;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
}

.faq__question::-webkit-details-marker {
  display: none;
}

.faq__question::after {
  content: "+";
  color: var(--c-gold);
  font-size: 1.1rem;
  flex-shrink: 0;
  transition: transform 0.3s var(--ease-slow);
}

.faq__item[open] .faq__question::after {
  transform: rotate(45deg);
}

.faq__answer {
  margin-top: 0.9rem;
  color: var(--c-ivory-dim);
  font-size: 0.9rem;
  line-height: 1.9;
}

/* ===== フッター ===== */
.site-footer {
  background: var(--c-navy-deep);
  border-top: 1px solid var(--border-hairline);
  padding: 3rem 1.5rem 2rem;
}

.site-footer__inner {
  max-width: var(--max-width);
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 1.8rem;
  align-items: center;
  text-align: center;
}

.site-footer__nav ul {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 1.4rem;
  font-size: 0.82rem;
  color: var(--c-ivory-dim);
}

.site-footer__copyright {
  margin-top: 2.2rem;
  text-align: center;
  font-size: 0.75rem;
  color: var(--c-ivory-faint);
  letter-spacing: 0.04em;
}

@media (min-width: 700px) {
  .site-footer__inner {
    flex-direction: row;
    justify-content: space-between;
    text-align: left;
  }
}

/* ===== デスクトップレイアウト ===== */
@media (min-width: 900px) {
  /* 画面の高さに応じてHEROの高さを自動調整する（狭いノートPCから大型モニターまで
     極端に間延び・圧縮しないよう上限・下限を設ける） */
  .hero {
    /* ヘッダー（sticky）が別途 --header-height 分の高さを消費するため、
       HERO自体は「画面の高さ − ヘッダーの高さ」を基準にする（そうしないと
       ヘッダー＋HEROの合計が画面の高さを常に超えてしまう） */
    min-height: clamp(600px, calc(100vh - var(--header-height)), 1024px);
    display: flex;
    align-items: center;
  }

  /* 低い画面高でも収まりきるよう、縦方向の余白をさらに詰める。
     ヘッダーはsticky（自身の高さをフローに確保済み）のため header-height を足す必要はない */
  .hero {
    padding-top: 0.5rem;
    padding-bottom: clamp(0.75rem, 1.5vw, 1.25rem);
  }

  .eyebrow {
    margin-bottom: 0.6rem;
  }

  .hero__title {
    margin-bottom: 0.9rem;
  }

  .hero__cta {
    padding: 0.8em 2.4em;
  }

  .hero__note {
    margin-top: 0.5rem;
  }

  /* 左カラム：コピー→書籍形式→CTA。テキスト側はヘッダーと同じ中央揃えmax-widthのまま */
  .hero__inner {
    gap: clamp(0.8rem, 1.6vw, 1.25rem);
    grid-template-columns: 1fr 1fr;
    grid-template-areas:
      "copy    visual"
      "formats visual"
      "cta     visual";
    align-items: start;
    width: 100%;
  }

  /* 書影はグリッドの外に出し、.hero（position:relative）を基準に右端いっぱいまで配置。
     天面はセクション上端でクロップされ、映画公式サイトのような大胆な見せ方にする */
  .hero__visual {
    position: absolute;
    inset: 0 4vw 0 auto;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    width: 42vw;
    max-width: 640px;
    pointer-events: none;
  }

  .hero__cover {
    width: 100%;
    height: auto;
  }

  /* アイコン行／見出し行／説明文行の3行を、3カラムすべてで同じ高さの行に揃える
     （subgridで親のrowトラックを共有し、内容量が違っても横並びの基準線がずれないようにする） */
  .hero__formats {
    grid-template-columns: repeat(3, 1fr);
    grid-template-rows: repeat(3, auto);
  }

  .format-chip {
    display: grid;
    grid-template-rows: subgrid;
    grid-row: span 3;
    row-gap: 0.5rem;
    justify-items: center;
  }

  .format-chip__icon {
    width: 38px;
    height: 38px;
    margin-bottom: 0;
  }

  /* 3カラム時のみ、区切りの縦線を入れる（中央揃えのため左右均等パディング） */
  .format-chip {
    padding: 0 1rem;
    border-left: 1px solid var(--border-hairline);
  }

  .format-chip:first-child {
    border-left: none;
  }

  .hero__cta {
    width: 100%;
  }

  .hero__note {
    text-align: center;
  }

  /* 2カラム化するとコピー側の幅が viewport よりかなり狭くなるため、
     見出しはコンテナ幅（cqw）基準にして長い行が折り返さないようにする */
  .hero__copy {
    container-type: inline-size;
  }

  .hero__title {
    font-size: clamp(1.9rem, 7.5cqw, 2.9rem);
  }

  .hero__title-line {
    white-space: nowrap;
  }
}

/* ===== 出現アニメーション ===== */
@keyframes fade-up {
  from {
    opacity: 0;
    transform: translateY(18px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.8s var(--ease-slow), transform 0.8s var(--ease-slow);
}

.reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
}

/* ===== prefers-reduced-motion 対応 ===== */
@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }

  .hero__droplet {
    animation: none;
  }

  .reveal {
    opacity: 1;
    transform: none;
  }
}
