/* layout.css - ヘッダー・フッター・グリッド等のレイアウト */

/* === ヘッダー === */

.site-header {
  position: sticky;
  top: 0;
  z-index: 1000;
  background-color: var(--color-white);
  height: var(--header-height);
  box-shadow: var(--shadow-sm);
  transition: background-color 0.3s ease;
}

.site-header.is-scrolled {
  background-color: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(8px);
}

.header-inner {
  max-width: var(--content-max-width);
  margin: 0 auto;
  padding: 0 var(--space-xl);
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

/* ロゴ */
.header-logo {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  flex-shrink: 0;
}

.header-logo img {
  height: 40px;
  width: auto;
  border-radius: 0;
}

.header-logo-text {
  font-size: var(--font-size-h4);
  font-weight: 700;
  color: var(--color-primary-700);
  white-space: nowrap;
}

/* PC ナビゲーション */
.global-nav {
  display: flex;
  align-items: center;
  gap: var(--space-lg);
}

.global-nav-list {
  display: flex;
  align-items: center;
  gap: var(--space-md);
}

.global-nav-link {
  font-size: var(--font-size-small);
  font-weight: 500;
  color: var(--color-text);
  padding: var(--space-sm) var(--space-xs);
  position: relative;
  white-space: nowrap;
}

.global-nav-link:hover {
  color: var(--color-primary-500);
  opacity: 1;
}

.global-nav-link.nav-active,
.global-nav-link[aria-current="page"] {
  color: var(--color-accent);
  border-bottom: 2px solid var(--color-accent);
}

/* ヘッダーCTAボタン */
.header-cta {
  background-color: var(--color-accent);
  color: var(--color-white);
  border-radius: var(--radius-pill);
  padding: 10px 24px;
  font-size: var(--font-size-small);
  font-weight: 600;
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  gap: var(--space-xs);
  transition: var(--transition);
}

.header-cta:hover {
  background-color: var(--color-accent-hover);
  opacity: 1;
}

/* ハンバーガーメニューボタン */
.hamburger-btn {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  width: 44px;
  height: 44px;
  position: relative;
  z-index: 1001;
}

.hamburger-line {
  display: block;
  width: 24px;
  height: 2px;
  background-color: var(--color-primary-700);
  margin: 5px auto;
  transition: transform 0.3s ease, opacity 0.3s ease;
}

.hamburger-btn.is-active .hamburger-line:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}

.hamburger-btn.is-active .hamburger-line:nth-child(2) {
  opacity: 0;
}

.hamburger-btn.is-active .hamburger-line:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

/* SP メニューパネル */
.sp-menu {
  display: none;
  position: fixed;
  top: 0;
  right: -100%;
  width: 280px;
  height: 100vh;
  height: 100dvh;
  background-color: var(--color-white);
  box-shadow: var(--shadow-md);
  z-index: 999;
  padding: calc(var(--header-height-sp) + var(--space-lg)) var(--space-xl) calc(var(--space-3xl) + env(safe-area-inset-bottom, 16px));
  transition: right 0.3s ease;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

.sp-menu.is-open {
  right: 0;
}

.sp-menu-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.5);
  z-index: 998;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.sp-menu-overlay.is-visible {
  opacity: 1;
  pointer-events: auto;
}

.sp-menu-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-xs);
}

.sp-menu-link {
  display: block;
  padding: var(--space-md) 0;
  font-size: var(--font-size-body);
  font-weight: 500;
  color: var(--color-text);
  border-bottom: 1px solid var(--color-border);
}

.sp-menu-link:hover {
  color: var(--color-accent);
  opacity: 1;
}

.sp-menu-link.nav-active,
.sp-menu-link[aria-current="page"] {
  color: var(--color-accent);
}

/* === フッター === */

.site-footer {
  background-color: var(--color-primary-700);
  color: var(--color-white);
  padding: var(--space-3xl) 0 var(--space-lg);
}

.footer-inner {
  max-width: var(--content-max-width);
  margin: 0 auto;
  padding: 0 var(--space-xl);
}

.footer-main {
  display: grid;
  grid-template-columns: 1fr 2fr;
  gap: var(--space-3xl);
  margin-bottom: var(--space-2xl);
}

/* フッター施設情報 */
.footer-info {
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
}

.footer-logo {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
}

.footer-logo img {
  height: 36px;
  width: auto;
  border-radius: 0;
}

.footer-logo-text {
  font-size: var(--font-size-h4);
  font-weight: 700;
}

.footer-address {
  font-size: var(--font-size-small);
  line-height: 1.8;
  opacity: 0.9;
}

.footer-address a {
  color: var(--color-white);
}

.footer-address a:hover {
  text-decoration: underline;
  opacity: 1;
}

/* フッターナビ */
.footer-nav {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-md);
}

.footer-nav-link {
  font-size: var(--font-size-small);
  color: var(--color-white);
  opacity: 0.8;
  padding: var(--space-xs) 0;
}

.footer-nav-link:hover {
  opacity: 1;
  text-decoration: underline;
}

/* フッター下部 */
.footer-bottom {
  border-top: 1px solid rgba(255, 255, 255, 0.2);
  padding-top: var(--space-lg);
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: var(--space-md);
}

.footer-copyright {
  font-size: var(--font-size-caption);
  opacity: 0.7;
}

.footer-policy-link {
  font-size: var(--font-size-caption);
  color: var(--color-white);
  opacity: 0.7;
}

.footer-policy-link:hover {
  opacity: 1;
  text-decoration: underline;
}

/* === フローティングCTA（SP/Tablet時のみ表示） === */

.floating-cta {
  display: none;
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 900;
  background-color: var(--color-white);
  box-shadow: 0 -2px 8px rgba(0, 0, 0, 0.1);
  padding: var(--space-sm) var(--space-md);
}

.floating-cta.is-hidden {
  transform: translateY(100%);
  transition: transform 0.3s ease;
}

.floating-cta-inner {
  display: flex;
  justify-content: center;
  gap: var(--space-sm);
  max-width: 400px;
  margin: 0 auto;
}

.floating-cta-tel,
.floating-cta-line,
.floating-cta-contact {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-xs);
  padding: 10px var(--space-sm);
  border-radius: var(--radius-pill);
  font-size: var(--font-size-small);
  font-weight: 700;
  min-height: 48px;
  flex: 1;
  white-space: nowrap;
}

.floating-cta-tel {
  background-color: var(--color-accent);
  color: var(--color-white);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
}

.floating-cta-tel ph-phone-call,
.floating-cta-line ph-chat-circle-text {
  font-size: 1.3em;
}

.floating-cta-tel:hover,
.floating-cta-tel:active {
  opacity: 1;
  background-color: var(--color-accent-hover);
}

.floating-cta-line {
  background-color: var(--color-line);
  color: var(--color-white);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
}

.floating-cta-line:hover,
.floating-cta-line:active {
  opacity: 1;
  background-color: var(--color-line-hover);
}

.floating-cta-label-main {
  font-size: var(--font-size-small);
  font-weight: 700;
}

.floating-cta-contact {
  background-color: var(--color-primary-700);
  color: var(--color-white);
}

.floating-cta-contact:hover,
.floating-cta-contact:active {
  opacity: 1;
  background-color: var(--color-primary-500);
}

/* === グリッドレイアウト === */

.grid-2col {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--space-lg);
}

.grid-3col {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-lg);
}

/* サイドバイサイド（テキスト+画像） */
.side-by-side {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-2xl);
  align-items: center;
}

.side-by-side--reverse {
  direction: rtl;
}

.side-by-side--reverse > * {
  direction: ltr;
}

/* === メインコンテンツエリア === */

.main-content {
  min-height: calc(100vh - var(--header-height));
}

/* フローティングCTA表示時のボトムパディング */
.has-floating-cta {
  padding-bottom: 72px;
}
