/* ============================================
   layout.css — ヘッダー・フッター・グリッドなど骨格
   ============================================ */

/* ============================================
   コンテナ
   ============================================ */
.container {
  max-width: var(--container-max);
  margin-inline: auto;
  padding-inline: var(--container-padding);
}

/* ============================================
   ページ本文ラッパー
   ============================================ */
.page-main {
  max-width: var(--container-max);
  margin-inline: auto;
  padding: var(--space-lg) var(--container-padding);
}

/* ============================================
   セクション共通
   ============================================ */
.section {
  padding: var(--space-lg);
  border-radius: var(--radius-lg);
}

.section--light {
  background-color: var(--color-bg-light);
}

.section--blue {
  background-color: var(--color-bg-blue);
}

/* ============================================
   ヘッダー（WordPress → header.php）
   ============================================ */
.header {
  position: sticky;
  top: 0;
  z-index: var(--z-header);
  background-color: var(--color-white);
  box-shadow: var(--shadow-sm);
  transition: background-color var(--transition-base),
              padding var(--transition-base);
}

.header.scrolled {
  background-color: rgba(255, 255, 255, 0.75);
  backdrop-filter: blur(6px);
}

/* ---- ヘッダー内部レイアウト ---- */
.header__inner {
  position: relative;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.2rem var(--space-lg);
  transition: padding var(--transition-base);
}

.header.scrolled .header__inner {
  padding: var(--space-xs) var(--space-md);
}

/* ---- ロゴ ---- */
.header__logo-link img {
  max-height: 80px;
  height: auto;
  width: auto;
  transition: all var(--transition-base);
}

.header.scrolled .header__logo-link img {
  max-height: 80px;
}

@media screen and (max-width: 480px) {
  .header__logo-link img {
    max-height: 60px;
  }

  .header__inner {
    padding: var(--space-xs) var(--space-sm);
  }
}

/* ============================================
   PCナビゲーション
   ============================================ */
.header__nav {
  display: flex;
  align-items: center;
  margin-top: 0.5rem;
  margin-bottom: var(--space-md);
  overflow: hidden;
}

.header__nav ul {
  display: flex;
  gap: 0.6rem;
  flex-wrap: wrap;
  justify-content: center;
}

.header__nav li a {
  position: relative;
  display: inline-block;
  color: var(--color-text);
  font-size: var(--fs-lg);
  font-weight: 500;
  padding: 0.75rem var(--space-sm);
  white-space: nowrap;
  transition: background var(--transition-base), color var(--transition-base);
}

.header__nav li a:hover {
  background-color: var(--color-primary);
  color: var(--color-white);
  border-radius: var(--radius-sm);
}

.header.scrolled .header__nav li a {
  font-size: var(--fs-xl);
  padding: var(--space-xs) var(--space-sm);
}

/* 現在ページのアンダーライン */
.header__nav li a.current::after {
  content: '';
  position: absolute;
  left: 0;
  bottom: 5px;
  width: 100%;
  height: 4px;
  background-color: var(--color-accent);
  border-radius: 2px;
  z-index: 1;
}

/* ============================================
   スマホ専用「体験予約」ボタン（ヘッダー内）
   ============================================ */
.header__trial-btn {
  display: none;
}

@media screen and (max-width: 768px) {
  .header__trial-btn {
    display: inline-block;
    position: absolute;
    top: 50%;
    right: 80px;
    transform: translateY(-65%);
    background-color: var(--color-primary);
    color: var(--color-white);
    font-weight: bold;
    font-size: var(--fs-md);
    padding: 0.6rem 0.8rem;
    border-radius: var(--radius-md);
    white-space: nowrap;
    transition: background-color var(--transition-base), color var(--transition-base);
  }

  .header__trial-btn:hover {
    background-color: var(--color-accent);
    color: var(--color-text);
  }
}

@media screen and (max-width: 480px) {
  .header__trial-btn {
    font-size: var(--fs-sm);
    padding: 0.4rem 0.6rem;
    right: 70px;
  }
}

/* ============================================
   ハンバーガーメニューボタン
   ============================================ */
.hamburger {
  display: none;
}

@media screen and (max-width: 1280px) {
  .hamburger {
    background-color: #333333;
    border-radius: 0;
    width: 80px;
    height: 80px;
    position: absolute;
    top: 0;
    right: 0;
    z-index: var(--z-hamburger);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    border: none;
    cursor: pointer;
  }

  .header__nav {
    display: none;
  }
}

@media screen and (max-width: 768px) {
  .hamburger {
    width: 60px;
    height: 60px;
    padding-top: 6px;
  }
}

.hamburger__box {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.hamburger__box span:not(.hamburger__label) {
  display: block;
  width: 28px;
  height: 1px;
  margin: 4px 0;
  background-color: var(--color-white);
  border-radius: 1px;
  transition: var(--transition-base);
}

@media screen and (max-width: 768px) {
  .hamburger__box span:not(.hamburger__label) {
    width: 24px;
    margin: 3px 0;
  }
}

.hamburger__label {
  font-size: var(--fs-xs);
  color: var(--color-white);
  font-weight: bold;
  letter-spacing: 1px;
  margin-top: 5px;
}

/* ============================================
   全画面ナビゲーション（オーバーレイ）
   ============================================ */
.nav-overlay {
  position: fixed;
  inset: 0;
  z-index: var(--z-overlay);
  background:
    linear-gradient(rgba(0, 0, 0, 0.6), rgba(0, 0, 0, 0.6)),
    url("../img/hamburger-menu-bgimage.jpg") center / cover no-repeat;
  transform: translateY(-100%);
  transition: transform var(--transition-slow);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow-y: auto;
}

body.nav-open .nav-overlay {
  transform: translateY(0);
}

body.nav-open {
  overflow: hidden;
}

/* ナビリスト */
.nav-overlay__list {
  padding: 0;
  text-align: center;
}

.nav-overlay__list li {
  margin: var(--space-md) 0;
}

.nav-overlay__list li a {
  font-size: var(--fs-2xl);
  color: var(--color-white);
  font-weight: bold;
  transition: color var(--transition-base);
}

.nav-overlay__list li a:hover {
  color: var(--color-accent);
}

@media screen and (max-width: 768px) {
  .nav-overlay {
    padding: var(--space-lg) var(--space-sm);
  }

  .nav-overlay__list li {
    margin: 1.2rem 0;
  }

  .nav-overlay__list li a {
    font-size: var(--fs-xl);
  }
}

/* CLOSEボタン */
.nav-overlay__close {
  background-color: var(--color-white);
  width: 80px;
  height: 80px;
  position: absolute;
  top: 0;
  right: 0;
  z-index: var(--z-overlay-btn);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  border: none;
  cursor: pointer;
}

.nav-overlay__close-box {
  position: relative;
  width: 28px;
  height: 28px;
}

/* ×マーク（2本の線） */
.nav-overlay__close-box span:nth-child(1),
.nav-overlay__close-box span:nth-child(2) {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 28px;
  height: 2px;
  background-color: #333333;
  border-radius: 1px;
  transform-origin: center;
  transition: var(--transition-base);
}

.nav-overlay__close-box span:nth-child(1) {
  transform: translate(-50%, -50%) rotate(45deg);
}

.nav-overlay__close-box span:nth-child(2) {
  transform: translate(-50%, -50%) rotate(-45deg);
}

/* 3本目は非表示 */
.nav-overlay__close-box span:nth-child(3) {
  display: none;
}

.nav-overlay__close .hamburger__label {
  color: #333333;
  margin-top: 6px;
}

@media screen and (max-width: 768px) {
  .nav-overlay__close {
    position: fixed;
    width: 60px;
    height: 60px;
  }

  .nav-overlay__close-box {
    width: 24px;
    height: 24px;
  }

  .nav-overlay__close-box span:nth-child(1),
  .nav-overlay__close-box span:nth-child(2) {
    width: 24px;
  }

  .nav-overlay__close .hamburger__label {
    font-size: var(--fs-xs);
    margin-top: 4px;
  }
}

/* 更新済みページの共通UI。site-shell を付けたページから段階的に適用。
   トップは確定済みhome.cssを維持し、旧下層ページには影響させない。 */
html:has(> .site-shell) { scrollbar-gutter: stable; }
.site-shell .header { background-color: var(--color-store-paper); }
.site-shell .header__inner { gap: 20px; }
.site-shell .header__title { flex-shrink: 0; }
.site-shell .header__logo-link img { width: 144px; }
.site-shell .header__nav { display: flex; margin: 0 0 0 auto; overflow: visible; }
.site-shell .header__nav ul { flex-wrap: nowrap; gap: 24px; }
.site-shell .header__nav li a,
.site-shell .header.scrolled .header__nav li a {
  font-size: 16px;
  padding: 12px 0;
  color: var(--color-text);
}
.site-shell .header__nav li a:hover,
.site-shell .header.scrolled .header__nav li a:hover {
  background: transparent;
  color: var(--color-store-blue);
  text-decoration: none;
}
.site-shell .header__nav li a.current::after { height: 2px; background: var(--color-store-blue); }
.site-shell .header__trial-btn {
  display: inline-flex;
  position: static;
  transform: none;
  order: 2;
  margin-left: 12px;
  flex-shrink: 0;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 10px 16px;
  background: #e8aa50;
  color: var(--color-text);
  border-radius: 4px;
  font-size: 14px;
  font-weight: bold;
  white-space: nowrap;
  transition: opacity 200ms ease;
}
.site-shell .header__trial-btn:hover { background: #d99a3d; color: var(--color-text); }
.site-shell .hamburger { display: none; }
.site-shell .trial-btn-fixed { display: none; }
.site-shell { --back-to-top-icon-offset: 3px; }

.site-shell .nav-overlay {
  top: var(--site-header-height, 96px);
  z-index: 998;
  padding: 28px 24px;
  background: linear-gradient(rgba(0,0,0,.84), rgba(0,0,0,.84)), url('../img/hamburger-menu-bgimage.jpg') center / cover no-repeat;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: translateY(-10px);
  transition: opacity 200ms ease, transform 200ms ease, visibility 200ms;
  align-items: safe center;
  overscroll-behavior: contain;
}
.site-shell.nav-open .nav-overlay { opacity: 1; visibility: visible; pointer-events: auto; transform: translateY(0); }
.site-shell .nav-overlay__list { margin: auto; }
.site-shell .nav-overlay__list li { margin: 8px 0; }
.site-shell .nav-overlay__list li a { display: inline-flex; align-items: center; min-height: 48px; padding: 6px 12px; font-size: 20px; }
.site-shell .nav-overlay__list li a:hover { color: var(--color-store-blue); }
.site-shell .nav-overlay :focus-visible { outline-color: var(--color-white); }
.site-shell.nav-open .header { background: var(--color-store-paper); }
@media (max-width: 1319px) {
  .site-shell .header__nav { display: none; }
  .site-shell .header__trial-btn { margin-left: auto; }
  .site-shell .hamburger {
    position: relative;
    top: auto;
    right: auto;
    order: 3;
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    border-radius: 0;
    cursor: pointer;
    flex: 0 0 60px;
    width: 60px;
    height: 60px;
    padding: 0;
    background: var(--color-store-paper);
    box-shadow: inset 0 0 0 1px var(--color-border-light);
  }
  .site-shell .hamburger__box { position: relative; width: 28px; height: 46px; }
  .site-shell .hamburger__box span:not(.hamburger__label) { position: absolute; left: 2px; top: 16px; width: 24px; height: 1px; margin: 0; background: var(--color-text); transition: transform 200ms ease, opacity 200ms ease; }
  .site-shell .hamburger__box span:nth-child(1) { transform: translateY(-7px); }
  .site-shell .hamburger__box span:nth-child(3) { transform: translateY(7px); }
  .site-shell .hamburger__label { position: absolute; top: 29px; margin: 0; color: var(--color-text); font-size: 10px; line-height: 1.2; }
  .site-shell.nav-open .hamburger__box span:nth-child(1) { transform: rotate(45deg); }
  .site-shell.nav-open .hamburger__box span:nth-child(2) { opacity: 0; }
  .site-shell.nav-open .hamburger__box span:nth-child(3) { transform: rotate(-45deg); }
}
@media (max-width: 480px) {
  .site-shell .header__inner { gap: 8px; padding-inline: 12px; }
  .site-shell .header.scrolled .header__inner { padding-inline: 12px; }
  .site-shell .header__logo-link img { width: 108px; }
  .site-shell .header__trial-btn { padding: 8px; font-size: 12px; }
}
@media (prefers-reduced-motion: reduce) {
  .site-shell .header, .site-shell .header *, .site-shell .nav-overlay { transition: none; }
}

/* ============================================
   ページ共通ヒーロー（内部ページのトップ画像）
   ============================================ */
.page-hero {
  position: relative;
  width: 100%;
  height: 500px;
  overflow: hidden;
}

@media screen and (max-width: 1180px) {
  .page-hero {
    height: 350px;
  }
}

@media screen and (max-width: 480px) {
  .page-hero {
    height: 200px;
  }
}

.page-hero__img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.page-hero__overlay {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  justify-content: center;
  align-items: center;
}

.page-hero__title {
  color: var(--color-white);
  font-size: var(--fs-5xl);
  font-weight: bold;
  text-align: center;
}

@media screen and (max-width: 768px) {
  .page-hero__title {
    font-size: var(--fs-3xl);
  }
}

@media screen and (max-width: 480px) {
  .page-hero__title {
    font-size: var(--fs-xl);
  }
}

/* ============================================
   フッター（WordPress → footer.php）
   ============================================ */
.footer {
  text-align: center;
  padding: var(--space-sm);
  background-color: var(--color-accent);
  color: #333333;
}

/* 更新済みページの共通フッター */
.site-footer { background: #222; color: #fff; text-align: left; padding: 58px 0 30px; }
.site-footer__top { display: flex; justify-content: space-between; gap: 60px; align-items: start; }
.site-footer__brand { font-size: 12px; line-height: 1.8; }
.site-footer__name { display: block; font-size: 28px; font-weight: 700; }
.site-footer__nav { display: grid; grid-template-columns: repeat(3, auto); gap: 8px 36px; font-size: 13px; }
.site-footer__nav-link { display: flex; align-items: center; min-height: 44px; }
.site-footer a:hover { text-decoration: underline; text-underline-offset: 5px; }
.site-footer__bottom { margin-top: 42px; padding-top: 24px; border-top: 1px solid #555; display: flex; justify-content: space-between; gap: 24px; font-size: 12px; }
.site-footer__copyright { font-size: 11px; color: #ccc; }
.site-footer__instagram { display: inline-flex; align-items: center; gap: 8px; }
.site-footer__instagram-icon { font-size: 18px; background: linear-gradient(35deg, #feda75, #fa7e1e 25%, #d62976 50%, #962fbf 75%, #4f5bd5); background-clip: text; -webkit-background-clip: text; color: transparent; }
.site-footer a { color: inherit; }
.site-footer :focus-visible { outline: 3px solid #fff; outline-offset: 5px; }
.site-footer__inner { width: min(1120px, calc(100% - 96px)); margin-inline: auto; }
@media (max-width: 1024px) {
  .site-footer__inner { width: calc(100% - 64px); }
}
@media (max-width: 767px) {
  .site-footer__inner { width: calc(100% - 48px); }
  .site-footer__top, .site-footer__bottom { flex-direction: column; gap: 28px; }
  .site-footer__nav { grid-template-columns: repeat(2, 1fr); gap: 4px 24px; font-size: 12px; }
  .site-footer__bottom { margin-top: 28px; font-size: 11px; }
  .site-footer__copyright { font-size: 10px; }
}

/* ============================================
   固定「体験予約」ボタン（右サイド縦書き）
   ============================================ */
.trial-btn-fixed {
  position: fixed;
  right: 0;
  top: 30%;
  transform: translateY(-50%);
  background-color: var(--color-primary);
  color: var(--color-white);
  font-weight: bold;
  padding: 1.6rem 0.8rem;
  border-radius: var(--radius-lg) 0 0 var(--radius-lg);
  writing-mode: vertical-rl;
  text-align: center;
  font-size: var(--fs-lg);
  z-index: var(--z-fixed-btn);
  box-shadow: var(--shadow-lg);
  transition: background-color var(--transition-base), color var(--transition-base);
}

.trial-btn-fixed:hover {
  background-color: var(--color-accent);
  color: var(--color-text);
}

@media screen and (max-width: 768px) {
  .trial-btn-fixed {
    display: none;
  }
}

/* ============================================
   トップに戻るボタン
   ============================================ */
.back-to-top {
  position: fixed;
  bottom: 30px;
  right: 30px;
  width: 80px;
  height: 80px;
  padding-bottom: 10px;
  background-color: rgba(255, 255, 255, 0.85);
  border-radius: var(--radius-full);
  box-shadow: var(--shadow-lg);
  text-align: center;
  z-index: var(--z-fixed-btn);
  text-decoration: none;
  opacity: 0;
  transform: translateY(20px);
  pointer-events: none;
  transition: opacity var(--transition-slow), transform var(--transition-slow);
}

@media screen and (max-width: 768px) {
  .back-to-top {
    bottom: 20px;
    right: 20px;
    width: 60px;
    height: 60px;
    padding-bottom: 8px;
  }
}

.back-to-top.show {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

@media screen and (max-width: 768px) {
  .back-to-top.show {
    gap: 3px;
  }
}

.back-to-top__icon {
  font-size: 1.4rem;
  color: #333333;
  transform: translateY(var(--back-to-top-icon-offset, 0px));
  transition: transform var(--transition-base);
}

@media screen and (max-width: 768px) {
  .back-to-top__icon {
    font-size: var(--fs-sm);
  }
}

.back-to-top__label {
  font-size: var(--fs-sm);
  font-weight: bold;
  color: #333333;
  text-align: center;
  line-height: 1.2;
}

@media (hover: hover) {
  .back-to-top:hover .back-to-top__icon {
    transform: translateY(-16px);
  }
}
