@charset "UTF-8";

/* ===============================
   基本スタイル
   =============================== */
body {
  font-family: "Noto Sans JP", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  line-height: 1.6;
  color: #333;
}

@media screen and (min-width: 768px) {
  body {
    background-image: url("../img/sp/bg.webp");
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
  }
}

.main-content {
  width: 100%;
}

/* ===============================
   画像セクション
   =============================== */
.image-section {
  width: 100%;
  margin-bottom: 0; /* 画像間の余白なし */
}

.image-section picture,
.image-section .image-wrapper {
  display: block;
  width: 100%;
}

.image-section img {
  width: 100%;
  height: auto;
  display: block;
}

/* SPのみの画像（PC表示時は最大幅480px・中央寄せ） */
.image-wrapper--sp-only {
  max-width: 480px;
  margin: 0 auto;
}

@media screen and (max-width: 767px) {
  .image-wrapper--sp-only {
    max-width: 100%; /* SP表示時は全幅 */
  }
}

/* ===============================
   ナビゲーションリスト（PC表示時・右側固定）
   =============================== */
.side-nav {
  position: fixed;
  left: calc(75% + 120px); /* 右側エリアの中央（480pxメインコンテンツを除く） */
  top: 50%;
  transform: translate(-50%, -50%);
  z-index: 1000;
  display: none; /* デフォルトは非表示 */
  pointer-events: none; /* コンテナ自体はクリック不可 */
}

@media screen and (min-width: 768px) {
  .side-nav {
    display: block; /* PC表示時のみ表示 */
  }
}

.side-nav__list {
  list-style: none;
  padding: 0;
  margin: 0;
  pointer-events: auto; /* リストはクリック可能 */
}

.side-nav__item {
  margin-bottom: 8px;
}

.side-nav__item:last-child {
  margin-bottom: 0;
}

.side-nav__link {
  display: flex;
  align-items: center;
  justify-content: left;
  padding: 12px 20px;
  min-width: 48px;
  height: auto;
  line-height: 1.5;
  text-align: left;
  color: #333;
  text-decoration: none;
  transition: opacity 0.3s ease;
  font-size: 14px;
  font-weight: 500;
  letter-spacing: 0.3px;
  white-space: nowrap;
}

.side-nav__link:hover {
  opacity: 0.7;
}

.side-nav__link:focus-visible {
  outline: 2px solid #333;
  outline-offset: 2px;
}

/* ===============================
   CTAボタン（セクション内に絶対配置）
   =============================== */
.image-section--cta {
  position: relative;
}

.cta-btn {
  position: absolute;
  display: block;
  z-index: 100;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  animation: float 3s ease-in-out infinite;
  transition: opacity 0.3s ease;
}

.cta-btn:hover {
  opacity: 0.7;
}

/* セクション01のCTAボタンは10px下げる */
#section-01 .cta-btn {
  bottom: 10px;
}

.cta-btn__img {
  display: block;
  width: auto;
  height: auto;
  max-width: 100%;
}

/* ふわふわアニメーション（中央寄せを維持） */
@keyframes float {
  0%, 100% {
    transform: translateX(-50%) translateY(0);
  }
  50% {
    transform: translateX(-50%) translateY(-10px);
  }
}

/* SP表示時のCTAボタン */
@media screen and (max-width: 767px) {
  .cta-btn {
    bottom: 20px;
    left: 20px;
    right: 20px;
    width: auto;
    max-width: 100%;
    transform: translateY(0);
    animation: float-sp 3s ease-in-out infinite;
  }

  .cta-btn__img {
    width: 100%;
  }

  @keyframes float-sp {
    0%, 100% {
      transform: translateY(0);
    }
    50% {
      transform: translateY(-10px);
    }
  }
}

/* PC表示時のCTAボタン（SP画像のみのセクション＝480pxコンテナ） */
@media screen and (min-width: 768px) {
  .image-section--cta:has(.image-wrapper--sp-only) .cta-btn {
    left: 50%;
    right: auto;
    width: auto;
    max-width: calc(480px - 40px); /* 480pxコンテナから左右20pxの余白を引く */
    transform: translateX(-50%);
    animation: float 3s ease-in-out infinite;
  }

  .image-section--cta:has(.image-wrapper--sp-only) .cta-btn__img {
    width: 100%;
    max-width: calc(480px - 40px);
  }
}

/* ===============================
   追従CTAボタン（PC表示時・画面右下に固定）
   ※全セクションSPのみ＋PC目次表示のため右側エリアに固定（6.9節）
   =============================== */
.fixed-cta-btn {
  display: none; /* デフォルトは非表示 */
  transition: opacity 0.3s ease;
}

.fixed-cta-btn:hover {
  opacity: 0.7;
}

@media screen and (min-width: 768px) {
  .fixed-cta-btn {
    position: fixed;
    bottom: 20px;
    right: 20px;
    left: auto;
    transform: none;
    width: auto;
    max-width: min(calc((100vw - 480px) / 2 - 40px), 300px); /* 右側エリアに収まるように、最大300px */
    z-index: 999;
    display: block;
    /* アニメーションなし（固定表示） */
  }

  .fixed-cta-btn__img {
    display: block;
    width: 100%;
    max-width: 100%;
    height: auto;
  }
}

/* ===============================
   追従CTAボタン（SP表示時・画面下部に固定）
   ※100vhスクロールで表示、セクション18到達で非表示（JSで制御）
   =============================== */
.sp-fixed-cta-btn {
  display: none; /* PC表示時は非表示 */
}

@media screen and (max-width: 767px) {
  .sp-fixed-cta-btn {
    position: fixed;
    bottom: 10px;
    left: 20px;
    right: 20px;
    z-index: 1000;
    display: block;
    opacity: 0;
    visibility: hidden;
    transform: translateY(20px);
    transition: opacity 0.3s ease, visibility 0.3s ease, transform 0.3s ease;
    pointer-events: none; /* 非表示中はクリック不可 */
  }

  /* 表示状態（JSで is-visible を付与） */
  .sp-fixed-cta-btn.is-visible {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
    pointer-events: auto;
  }

  .sp-fixed-cta-btn__img {
    display: block;
    width: 100%;
    height: auto;
  }
}
