/* ===== Material Design Footer ===== */

/* フッター本体：secondary背景 + マテリアルエレベーション */
.site-footer {
  position: relative;
  background: var(--swx-c-brand-secondary, #6b7280);
  color: #ffffff;
  border-top: 1px solid color-mix(in oklab, var(--swx-c-brand-secondary, #6b7280) 80%, black);
  overflow: hidden;
  /* マテリアルデザインのエレベーション */
  box-shadow: 0 -2px 8px rgba(0, 0, 0, 0.1);
}

/* 上部アクセントライン（マテリアルアクセント） */
.site-footer::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(
    90deg,
    transparent,
    var(--swx-c-brand, #0c6ff9) 50%,
    transparent
  );
  opacity: 0.9;
}

/* ===== フッターバー ===== */
/* WordPressのconstrained layoutの制約を上書き */
.site-footer__bar {
  position: relative;
  width: 100% !important;
  max-width: 1200px !important;
  margin: 0 auto !important;
  padding: clamp(56px, 8vw, 80px) 0 clamp(32px, 5vw, 48px) !important;
  z-index: 1;
}

/* WordPressのcontent-size変数を上書き */
.site-footer,
.site-footer .site-footer__bar,
.site-footer .wp-block-group.has-global-padding {
  --wp--style--global--content-size: 1200px !important;
  --wp--style--global--wide-size: 1200px !important;
}

/* constrained layoutの制約を無効化 */
.site-footer .site-footer__bar.is-layout-constrained > :where(:not(.alignleft):not(.alignright):not(.alignfull)) {
  max-width: 1200px !important;
}

.site-footer .site-footer__bar.is-layout-constrained > .alignwide {
  max-width: 1200px !important;
}

/* 1200px以上ではパディングなし、レスポンシブ時のみパディング */
@media (max-width: 1248px) {
  .site-footer__bar {
    padding-left: clamp(20px, 4vw, 32px) !important;
    padding-right: clamp(20px, 4vw, 32px) !important;
  }
}

/* ===== 上段：50%:50%レイアウト ===== */
.site-footer__main {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: clamp(40px, 5vw, 56px);
  margin-bottom: clamp(40px, 5vw, 56px);
}

@media (max-width: 900px) {
  .site-footer__main {
    grid-template-columns: 1fr;
    gap: clamp(40px, 5vw, 48px);
  }
}

/* 右側：リンク集（3カラム） */
.site-footer__col-navs {
  display: flex;
  flex-direction: column;
}

.site-footer__nav-columns {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: clamp(24px, 3vw, 32px);
}

/* PC版：よりゆったりしたスペーシング */
@media (min-width: 901px) {
  .site-footer__nav-columns {
    gap: clamp(40px, 5vw, 56px);
  }
}

@media (max-width: 900px) {
  .site-footer__nav-columns {
    grid-template-columns: repeat(2, 1fr);
    gap: clamp(24px, 3vw, 32px);
  }

  /* 運営情報を全幅（1カラム）にする */
  .site-footer__nav-columns .wp-block-column.site-footer__col--full,
  .site-footer__nav-columns .site-footer__col--full,
  .site-footer__nav-columns > .wp-block-column:nth-child(3) {
    grid-column: 1 / -1 !important;
  }
}

@media (max-width: 600px) {
  .site-footer__nav-columns {
    grid-template-columns: repeat(2, 1fr);
    gap: clamp(24px, 3vw, 32px);
  }

  /* 運営情報を全幅（1カラム）にする */
  .site-footer__nav-columns .wp-block-column.site-footer__col--full,
  .site-footer__nav-columns .site-footer__col--full,
  .site-footer__nav-columns > .wp-block-column:nth-child(3) {
    grid-column: 1 / -1 !important;
  }
}

/* ===== 左カラム：ブランド ===== */
.site-footer__col-brand {
  display: flex;
  flex-direction: column;
  gap: var(--swx-gap-4, 1rem);
}

/* サイトタイトル（ロゴ） */
.site-footer__title {
  margin: 0;
  font-size: clamp(28px, 4vw, 36px);
  font-weight: 700;
  letter-spacing: -0.02em;
  color: #ffffff;
  line-height: 1.2;
}

.site-footer__title a {
  color: #ffffff;
  text-decoration: none;
  transition: color 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  display: inline-block;
}

/* リップルエフェクト用の疑似要素 */
.site-footer__title a::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.2);
  transform: translate(-50%, -50%);
  transition: width 0.6s, height 0.6s;
}

.site-footer__title a:hover::before {
  width: 300px;
  height: 300px;
}

.site-footer__title a:hover {
  color: var(--swx-c-brand, #0c6ff9);
}

/* リードテキスト */
.site-footer__lead {
  margin: 0;
  color: rgba(255, 255, 255, 0.9);
  font-size: clamp(15px, 1.9vw, 17px);
  line-height: var(--swx-line-height, 1.7);
  max-width: 100%;
}

/* 画像（カラムの下側を埋める構造） */
.site-footer__image {
  margin: var(--swx-gap-4, 1rem) 0 0;
  width: 100%;
  max-width: 100%;
}

.site-footer__image img {
  width: 100%;
  height: auto;
  display: block;
  object-fit: cover;
  border-radius: 8px;
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.site-footer__image:hover img {
  transform: scale(1.02);
}

/* 画像が空の場合は非表示 */
.site-footer__image img[src=''],
.site-footer__image:has(img[src='']) {
  display: none;
}

/* ===== 2-4列目：ナビゲーションカラム ===== */
.site-footer__col {
  display: flex;
  flex-direction: column;
  gap: var(--swx-gap-4, 1rem);
}

/* PC版：よりゆったりしたスペーシング */
@media (min-width: 901px) {
  .site-footer__col {
    gap: clamp(1.5rem, 2vw, 2rem);
  }
}

/* ナビゲーション見出し */
.site-footer__nav-title,
.site-footer__col h3,
.site-footer__col .wp-block-heading.site-footer__nav-title,
.site-footer__col h3.site-footer__nav-title {
  font-size: clamp(16px, 2vw, 18px) !important;
  font-weight: 700 !important;
  margin: 0 !important;
  color: var(--swx-c-brand, #0c6ff9) !important;
  letter-spacing: 0.01em !important;
  position: relative !important;
  padding-bottom: var(--swx-gap-3, 0.75rem) !important;
}

/* PC版：フォントサイズを大きく */
@media (min-width: 901px) {
  .site-footer__nav-title,
  .site-footer__col h3,
  .site-footer__col .wp-block-heading.site-footer__nav-title,
  .site-footer__col h3.site-footer__nav-title {
    font-size: clamp(18px, 2.2vw, 22px) !important;
    padding-bottom: clamp(1rem, 1.2vw, 1.25rem) !important;
  }
}

/* マテリアルデザインのアクセントライン */
.site-footer__nav-title::after,
.site-footer__col h3::after,
.site-footer__col .wp-block-heading.site-footer__nav-title::after {
  content: '' !important;
  position: absolute !important;
  bottom: 0 !important;
  left: 0 !important;
  width: 48px !important;
  height: 4px !important;
  background: var(--swx-c-brand, #0c6ff9) !important;
  border-radius: 2px !important;
  transition: width 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important;
}

.site-footer__col:hover .site-footer__nav-title::after,
.site-footer__col:hover h3::after,
.site-footer__col:hover .wp-block-heading.site-footer__nav-title::after {
  width: 100% !important;
}

/* ナビゲーションリスト */
.site-footer__nav-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: var(--swx-gap-2, 0.5rem);
}

/* PC版：よりゆったりしたスペーシング */
@media (min-width: 901px) {
  .site-footer__nav-list {
    gap: clamp(0.75rem, 1vw, 1rem);
  }
}

.site-footer__nav-list li {
  margin: 0;
  padding: 0;
}

/* ナビゲーションリンク（マテリアルボタン風） */
.site-footer__nav-list a {
  display: inline-flex;
  align-items: center;
  color: rgba(255, 255, 255, 0.85);
  text-decoration: none;
  font-size: clamp(14px, 1.8vw, 15px);
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  padding: var(--swx-gap-2, 0.5rem) var(--swx-gap-3, 0.75rem);
  margin: 0 calc(-1 * var(--swx-gap-3, 0.75rem));
  border-radius: 12px;
  /* タッチターゲットを大きく（最小48px） */
  min-height: 44px;
}

/* PC版：フォントサイズとパディングを大きく */
@media (min-width: 901px) {
  .site-footer__nav-list a {
    font-size: clamp(15px, 1.9vw, 17px) !important;
    padding: clamp(0.75rem, 1vw, 1rem) clamp(1rem, 1.2vw, 1.25rem) !important;
    margin: 0 calc(-1 * clamp(1rem, 1.2vw, 1.25rem)) !important;
    min-height: 48px;
  }
}

/* リップルエフェクト */
.site-footer__nav-list a::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.2);
  transform: translate(-50%, -50%);
  transition: width 0.6s, height 0.6s;
  z-index: 0;
}

.site-footer__nav-list a:hover::before,
.site-footer__nav-list a:focus::before {
  width: 200px;
  height: 200px;
}

/* マテリアルデザインのアンダーライン */
.site-footer__nav-list a::after {
  content: '';
  position: absolute;
  bottom: var(--swx-gap-2, 0.5rem);
  left: var(--swx-gap-3, 0.75rem);
  width: 0;
  height: 2px;
  background: var(--swx-c-brand, #0c6ff9);
  transition: width 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  z-index: 1;
}

.site-footer__nav-list a > * {
  position: relative;
  z-index: 1;
}

.site-footer__nav-list a:hover {
  color: #ffffff;
  text-decoration: none;
  background: rgba(255, 255, 255, 0.1);
}

.site-footer__nav-list a:hover::after {
  width: calc(100% - var(--swx-gap-6, 1.5rem));
}

/* アクティブ状態 */
.site-footer__nav-list a:active {
  transform: scale(0.98);
  background: rgba(255, 255, 255, 0.15);
}

/* ===== 下段：細いバー（左右2分割） ===== */
.site-footer__bottom {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: clamp(24px, 3vw, 32px);
  border-top: 1px solid rgba(255, 255, 255, 0.2);
  gap: var(--swx-gap-4, 1rem);
}

@media (max-width: 600px) {
  .site-footer__bottom {
    flex-direction: column;
    align-items: flex-start;
    gap: var(--swx-gap-3, 0.75rem);
  }
}

/* 左側：お問い合わせ・プライバシーポリシーへのリンク */
.site-footer__bottom-links {
  margin: 0;
  font-size: clamp(13px, 1.6vw, 14px);
  color: rgba(255, 255, 255, 0.8);
}

.site-footer__bottom-links a {
  color: rgba(255, 255, 255, 0.8);
  text-decoration: none;
  transition: color 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.site-footer__bottom-links a:hover {
  color: #ffffff;
  text-decoration: underline;
}

/* 右側：コピーライト */
.site-footer__copy {
  margin: 0;
  font-size: clamp(13px, 1.6vw, 14px);
  color: rgba(255, 255, 255, 0.8);
  text-align: right;
  position: relative;
  z-index: 1;
}

@media (max-width: 600px) {
  .site-footer__copy {
    text-align: left;
  }
}

.site-footer__copy-name {
  font-weight: 600;
  color: #ffffff;
}

.site-footer__copy-name em {
  font-style: normal;
  font-weight: 700;
  color: var(--swx-c-brand, #0c6ff9);
}

/* ===== 強制配色（WPテーマのGlobal Styles上書き） ===== */
:root .wp-site-blocks footer.site-footer {
  background: var(--swx-c-brand-secondary, #6b7280) !important;
  color: #ffffff !important;
}

:root footer.site-footer .site-footer__title,
:root footer.site-footer .site-footer__title a,
:root footer.site-footer .site-footer__copy,
:root footer.site-footer .site-footer__copy-name {
  color: #ffffff !important;
}

:root footer.site-footer .site-footer__nav-title,
:root footer.site-footer .site-footer__col h3,
:root footer.site-footer .site-footer__col .wp-block-heading.site-footer__nav-title {
  color: var(--swx-c-brand, #0c6ff9) !important;
}

:root footer.site-footer .site-footer__nav-list a {
  color: rgba(255, 255, 255, 0.85) !important;
}

:root footer.site-footer .site-footer__nav-list a:hover {
  color: #ffffff !important;
}

/* ===== レスポンシブ調整 ===== */
@media (max-width: 767px) {
  .site-footer__bar {
    padding: 48px 20px 32px !important;
  }
}

/* ===== アニメーション ===== */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.site-footer__col-brand,
.site-footer__col {
  animation: fadeInUp 0.6s cubic-bezier(0.4, 0, 0.2, 1) backwards;
}

.site-footer__col:nth-child(2) {
  animation-delay: 0.1s;
}

.site-footer__col:nth-child(3) {
  animation-delay: 0.2s;
}

.site-footer__col:nth-child(4) {
  animation-delay: 0.3s;
}

/* Reduce Motion対応 */
@media (prefers-reduced-motion: reduce) {
  .site-footer__col-brand,
  .site-footer__col,
  .site-footer__nav-list a,
  .site-footer__image img {
    animation: none;
    transition: none;
  }

  .site-footer__nav-list a::after,
  .site-footer__nav-list a::before,
  .site-footer__title a::before {
    transition: none;
  }

  .site-footer__image:hover img {
    transform: none;
  }
}

/* ===== ダークモード調整 ===== */
@media (prefers-color-scheme: dark) {
  .site-footer {
    background: color-mix(in oklab, var(--swx-c-brand-secondary, #6b7280) 90%, black);
    border-top-color: color-mix(in oklab, var(--swx-c-brand-secondary, #6b7280) 70%, black);
  }
}
