/* 40-header.css */

/* ヘッダー：ロゴ高さに合わせたバー高さ・サイトタイトルはH1内に非表示で埋め込み */
#main-header .header-logo-bar {
  min-height: var(--senpai-header-bar-h);
  padding-top: var(--senpai-header-pad-y);
  padding-bottom: var(--senpai-header-pad-y);
  align-items: center;
  transition: min-height 0.35s ease, padding 0.35s ease;
}
#main-header .header-brand-title {
  margin: 0;
  line-height: 0;
}
#main-header .header-brand-link {
  display: inline-block;
  line-height: 0;
}
#main-header .header-logo-img {
  display: block;
  height: var(--senpai-header-logo-h);
  width: auto;
  margin: 0;
  transition: height 0.35s ease;
}

/* SP: ヘッダーロゴサイズ */
@media (max-width: 767px) {
  :root {
    --senpai-header-logo-h-compact: 4rem;
    --senpai-header-bar-h-compact: 5.25rem;
    --senpai-header-logo-h: 5rem;
    --senpai-header-pad-y: 0.5rem;
    --senpai-header-bar-h: calc(var(--senpai-header-logo-h) + var(--senpai-header-pad-y) * 2);
  }
  #main-header.header-on-fv {
    --senpai-header-logo-h: var(--senpai-header-logo-h-compact);
    --senpai-header-pad-y: 0;
    --senpai-header-bar-h: var(--senpai-header-bar-h-compact);
  }
}

/* PC: ヘッダーロゴサイズ（SP変更の影響を受けない） */
@media (min-width: 768px) {
  :root {
    --senpai-header-logo-h-compact: 5.5rem;
    --senpai-header-bar-h-compact: 7.25rem;
    --senpai-header-logo-h: 9rem;
    --senpai-header-pad-y: 0.75rem;
    --senpai-header-bar-h: calc(var(--senpai-header-logo-h) + var(--senpai-header-pad-y) * 2);
  }
  #main-header.header-on-fv {
    --senpai-header-logo-h: var(--senpai-header-logo-h-compact);
    --senpai-header-pad-y: 0;
    --senpai-header-bar-h: var(--senpai-header-bar-h-compact);
  }
}

/* PC: ロゴ左・メニュー2段（リンク行 + CTA行） */
@media (min-width: 768px) {
  #main-header .header-logo-bar {
    align-items: center;
    gap: 1rem;
  }
  #main-header .header-brand-title {
    flex-shrink: 0;
  }
  #main-header .header-nav-wrap {
    flex: 1 1 auto;
    display: flex;
    min-width: 0;
    padding-left: 1rem;
    padding-right: 0.5rem;
  }
  #main-header .header-nav {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 1.35rem;
    width: 100%;
    transition: gap 0.35s ease;
  }
  #main-header.header-on-fv .header-nav {
    gap: 0.7rem;
  }
  #main-header .header-nav-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem 0.85rem;
    width: 100%;
  }
  #main-header .header-nav-row--links {
    justify-content: center;
    width: fit-content;
    max-width: 100%;
    margin-inline: auto;
    gap: 0.55rem 0.75rem;
    font-size: 0.9375rem;
    letter-spacing: 0.08em;
    transition: font-size 0.35s ease, letter-spacing 0.35s ease;
  }
  #main-header .header-nav-row--links .header-first-timer-btn,
  #main-header .header-nav-row--links .header-nav-link {
    font-size: inherit;
    letter-spacing: inherit;
    transition: font-size 0.35s ease, letter-spacing 0.35s ease, color 0.2s ease, border-color 0.2s ease, background 0.2s ease, box-shadow 0.2s ease;
  }
  #main-header .header-nav-row--links .header-first-timer-btn--modal {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    padding: 0.4rem 1rem 0.44rem;
    border: 0;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.14);
    box-shadow: 0 2px 10px rgba(0, 20, 48, 0.12);
    line-height: 1.35;
    white-space: nowrap;
    font-weight: 500;
  }
  #main-header .header-nav-row--links .header-first-timer-btn__label {
    display: inline-block;
  }
  #main-header .header-nav-row--links .header-first-timer-btn--modal::after {
    content: "";
    width: 0.42rem;
    height: 0.42rem;
    border-right: 1.5px solid currentColor;
    border-bottom: 1.5px solid currentColor;
    transform: rotate(45deg) translateY(-0.06em);
    opacity: 0.9;
    flex-shrink: 0;
  }
  #main-header.header-on-fv .header-nav-row--links .header-first-timer-btn--modal {
    padding: 0.32rem 0.82rem 0.36rem;
  }
  #main-header.header-on-fv .header-nav-row--links {
    font-size: 0.8125rem;
    letter-spacing: 0.06em;
  }
  #main-header .header-nav-row--cta {
    justify-content: center;
    width: fit-content;
    max-width: 100%;
    margin-inline: auto;
    gap: 0.45rem;
  }
  #main-header .header-nav-link {
    white-space: nowrap;
  }
  #main-header .header-nav-link--stacked {
    white-space: normal;
    text-align: center;
    line-height: 1.35;
  }
  #main-header.header-on-fv .header-cta-btn {
    width: 8.6rem;
    min-height: 2.45rem;
    padding-top: 0.28rem;
    padding-bottom: 0.32rem;
  }
  #main-header.header-on-fv .header-cta-maintext {
    font-size: 0.68rem;
  }
}

/* PCヘッダー：大画面はリンク1行、区切り線で分離 */
@media (min-width: 1280px) {
  #main-header .header-nav-row--links {
    display: flex;
    flex-wrap: nowrap;
    gap: 0.55rem 0.85rem;
  }
  #main-header .header-nav-row--links > * + * {
    padding-left: 0.5rem;
    border-left: 1px solid rgba(255, 255, 255, 0.34);
  }
  #main-header.header-over-light .header-nav-row--links > * + * {
    border-left-color: rgba(var(--brand-rgb), 0.16);
  }
}

/* PCヘッダー：iPad〜中画面はリンク行を 3×2 グリッド（初めての方へボタン + 4リンク） */
@media (min-width: 768px) and (max-width: 1279px) {
  #main-header .header-nav-row--links {
    display: grid;
    grid-template-columns: repeat(3, auto);
    justify-content: center;
    justify-items: center;
    column-gap: 1rem;
    row-gap: 0.65rem;
    width: 100%;
    max-width: 34rem;
  }
  #main-header .header-nav-row--links > * + * {
    padding-left: 0;
    border-left: none;
  }
  #main-header .header-nav-row--links > *:not(:nth-child(3n + 1)) {
    padding-left: 0.5rem;
    border-left: 1px solid rgba(255, 255, 255, 0.34);
  }
  #main-header.header-over-light .header-nav-row--links > *:not(:nth-child(3n + 1)) {
    border-left-color: rgba(var(--brand-rgb), 0.16);
  }
}

/* ヘッダー：FV上は透明、ライトエリア上では暗い文字＋明るい背景に切替 */
#main-header:not(.header-over-light) {
  background: transparent !important;
}
#main-header.header-over-light {
  background: rgba(250, 249, 246, 0.98) !important;
  color: #2d2d2d !important;
  box-shadow: 0 1px 0 rgba(0, 0, 0, 0.06);
}
#main-header.header-over-light .header-nav,
#main-header.header-over-light .header-nav a,
#main-header.header-over-light .header-nav a.text-white\/90,
#main-header.header-over-light .header-nav-link {
  color: #2d2d2d !important;
}
#main-header.header-over-light .header-nav a:hover,
#main-header.header-over-light .header-nav-link:hover {
  color: var(--brand-color) !important;
  border-color: var(--brand-color) !important;
}
#main-header .header-first-timer-btn--modal {
  color: inherit;
}
#main-header .header-first-timer-btn--modal:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.22);
}
#main-header .header-first-timer-btn--modal[aria-expanded="true"] {
  background: rgba(255, 255, 255, 0.26);
  box-shadow: 0 4px 14px rgba(0, 20, 48, 0.18);
}
#main-header .header-cta-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 9.8rem;
  min-height: 2.7rem;
  padding: 0.35rem 0.75rem 0.4rem;
  border: 1px solid rgba(255, 255, 255, 0.75);
  border-radius: 999px;
  color: #fff;
  line-height: 1.1;
  flex-direction: column;
  gap: 0.14rem;
  text-align: center;
}
#main-header .header-cta-btn:hover {
  background: rgba(255, 255, 255, 0.12);
}
#main-header .header-cta-btn-mail:hover {
  background: rgba(255, 140, 72, 0.42) !important;
  border-color: rgba(255, 203, 170, 0.98) !important;
  color: #fff4ec !important;
}
#main-header .header-cta-btn-line:hover {
  background: rgba(39, 196, 102, 0.42) !important;
  border-color: rgba(169, 236, 193, 0.98) !important;
  color: #effff4 !important;
}
#main-header .header-cta-subtext {
  font-size: 0.53rem;
  letter-spacing: 0.12em;
  opacity: 0.85;
}
#main-header .header-cta-maintext {
  font-size: 0.74rem;
  letter-spacing: 0.06em;
}
#main-header.header-over-light .header-first-timer-btn--modal {
  background: var(--surface-brand-soft);
  box-shadow: 0 2px 8px rgba(var(--brand-rgb), 0.08);
}
#main-header.header-over-light .header-first-timer-btn--modal:hover {
  color: var(--brand-color) !important;
  background: #d8e8f8;
}
#main-header.header-over-light .header-first-timer-btn--modal[aria-expanded="true"] {
  background: #cfe0f4;
  box-shadow: 0 3px 12px rgba(var(--brand-rgb), 0.14);
}
#main-header.header-over-light .header-cta-btn {
  color: var(--brand-color);
  border-color: var(--brand-35);
}
#main-header.header-over-light .header-cta-btn:hover {
  background: var(--brand-08);
}
#main-header.header-over-light .header-cta-btn-phone {
  background: #dcecff;
  border-color: #5f92c9;
  color: #123d69;
}
#main-header.header-over-light .header-nav a.header-cta-btn-phone:hover {
  background: #d4e6fb !important;
  border-color: #5d89bb !important;
  color: #14456f !important;
}
#main-header.header-over-light .header-cta-btn-mail {
  background: #ffe9dc;
  border-color: #dc9a68;
  color: #74350c;
}
#main-header.header-over-light .header-nav a.header-cta-btn-mail:hover {
  background: #ffd8bc !important;
  border-color: #d39a71 !important;
  color: #7d431a !important;
}
#main-header.header-over-light .header-cta-btn-line {
  background: #dcf7e8;
  border-color: #67b987;
  color: #185c35;
}
#main-header.header-over-light .header-nav a.header-cta-btn-line:hover {
  background: #cdefdb !important;
  border-color: #6eaf87 !important;
  color: #1d603b !important;
}
#main-header.header-over-light .hamburger-bar,
#main-header.header-over-light .hamburger-bar.bg-white {
  background-color: #2d2d2d !important;
}

/* モバイルメニュー：閉じられる領域は透明、メニュー領域は現色＋パディング */
#mobile-menu.mobile-menu-backdrop {
  background-color: rgba(7, 22, 43, 0.32);
  backdrop-filter: blur(4px);
  cursor: pointer;
}
#mobile-menu .mobile-menu-panel {
  background: linear-gradient(165deg, rgba(250, 249, 246, 0.98), rgba(239, 246, 255, 0.95));
  border: 1px solid var(--brand-14);
  border-radius: 0.85rem;
  pointer-events: auto;
  cursor: auto;
  padding: 1.2rem 1rem;
  gap: 0.65rem;
  max-height: calc(100vh - 2.5rem);
  overflow-y: auto;
  box-shadow: 0 18px 40px rgba(4, 32, 62, 0.2);
}
#mobile-menu .mobile-menu-panel a,
#mobile-menu .mobile-menu-panel button {
  width: auto;
  display: inline-block;
  min-height: 0;
  padding: 0.18rem 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: var(--brand-color) !important;
  letter-spacing: 0.06em;
  line-height: 1.5;
  transition: color 0.2s ease, opacity 0.2s ease;
}
#mobile-menu .mobile-menu-panel a:hover,
#mobile-menu .mobile-menu-panel button:hover {
  background: transparent;
  border-color: transparent;
  color: #0052a3 !important;
  opacity: 0.86;
  transform: none;
}

.first-timer-modal {
  position: fixed;
  inset: 0;
  z-index: 120;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.25s ease, visibility 0.25s ease;
}
.first-timer-modal.is-open {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}
.first-timer-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 28, 56, 0.52);
  cursor: pointer;
}
.first-timer-modal-panel {
  position: relative;
  width: min(92vw, 34rem);
  border-radius: 0.75rem;
  background: url("../img/method/method_bg.webp") center center / cover no-repeat;
  color: var(--brand-color);
  padding: 2.25rem 1.75rem 1.9rem;
  box-shadow: 0 20px 45px rgba(0, 28, 56, 0.24);
  overflow: hidden;
}
.first-timer-modal-panel::before {
  content: "";
  position: absolute;
  inset: 0;
  background: rgba(250, 249, 246, 0.88);
  pointer-events: none;
}
.first-timer-modal-panel > * {
  position: relative;
  z-index: 1;
}
.first-timer-modal-close {
  position: absolute;
  top: 0.75rem;
  right: 0.75rem;
  width: 2rem;
  height: 2rem;
  border-radius: 999px;
  font-size: 1.25rem;
  line-height: 1;
  color: rgba(var(--brand-rgb), 0.8);
  background: var(--brand-08);
}
.first-timer-modal-kicker {
  margin: 0 0 0.55rem;
  font-size: 0.68rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--brand-62);
  text-align: center;
}
.first-timer-modal-title {
  margin: 0 0 1rem;
  font-family: var(--font-serif);
  font-size: clamp(1.4rem, 4vw, 2rem);
  line-height: 1.3;
  text-align: center;
}
.first-timer-modal-text {
  margin: 0;
  font-size: 1rem;
  line-height: 1.8;
  color: rgba(var(--brand-rgb), 0.86);
}
.first-timer-modal-nav {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  align-items: center;
}
.first-timer-modal-link {
  display: inline-block;
  padding: 0.52rem 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: rgba(var(--brand-rgb), 0.92);
  font-size: 0.98rem;
  line-height: 1.55;
  text-align: center;
  transition: color 0.2s ease, opacity 0.2s ease;
}
.first-timer-modal-link:hover {
  color: rgba(var(--brand-rgb), 1);
  opacity: 0.82;
}
@media (min-width: 768px) {
  .first-timer-modal-panel {
    width: min(88vw, 46rem);
    padding: 2.9rem 3rem 2.6rem;
  }
  .first-timer-modal-kicker {
    font-size: 0.78rem;
    letter-spacing: 0.24em;
    margin-bottom: 0.7rem;
  }
  .first-timer-modal-title {
    font-size: clamp(2rem, 3.2vw, 2.6rem);
    margin-bottom: 1.35rem;
  }
  .first-timer-modal-nav {
    gap: 0.8rem;
  }
  .first-timer-modal-link {
    font-size: 1.14rem;
    line-height: 1.65;
    padding: 0.62rem 0;
  }
}

/* ページ全体：共通フォント */
body {
  font-family: var(--font-serif);
  color: var(--text-color);
  background-color: #FAF9F6;
  overflow-x: hidden;
}

.vertical-text {
  writing-mode: vertical-rl;
  text-orientation: upright;
  letter-spacing: 0.1em;
}

/* SPだけ改行する br（PCでは改行させない） */
@media (min-width: 768px) {
  br.sp-br { display: none; }
}

.fade-in-up {
  animation: fadeInUp 1s ease-out forwards;
  opacity: 0;
  transform: translateY(20px);
}

@keyframes fadeInUp {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes scrollDown {
  0% {
    transform: translateY(-100%);
  }
  100% {
    transform: translateY(200%);
  }
}

.animate-scrollDown {
  animation: scrollDown 2s cubic-bezier(0.77, 0, 0.175, 1) infinite;
}

