/*
  グローバルヘッダーとフッター。

  ヘッダーはメインビジュアルの上に重ねて置く前提で、背景色も影も持たない。
  位置決め（重ねる）は base.css の .site__header が持つ。
  768px 以下ではナビをハンバーガーの中に畳み、開いている間だけ全面のパネルとして出す。
*/

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

/*
  768px より上では折り返さない。畳む役目はハンバーガーが持つので、
  折り返しを許すとブレークポイント直前だけ 2 段になった状態が見えてしまう
*/
.header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 28px;
  max-width: var(--content-max-width);
  min-height: var(--header-height);
  margin: 0 auto;
  padding: 16px var(--gutter);
}

.header__brand {
  display: flex;
  align-items: center;
  gap: 8px;
}

.header__mark {
  display: block;
  width: 24px;
  height: 24px;
}

.header__brand-name {
  color: var(--color-text);
  font-family: var(--font-logo);
  font-size: 19.2px;
  line-height: 1.25;
  letter-spacing: -0.54px;
  white-space: nowrap;
}

.header__toggle {
  display: none;
  position: relative;
  width: 24px;
  height: 24px;
  padding: 0;
  border: 0;
  background: none;
  cursor: pointer;
}

.header__toggle-bar {
  position: absolute;
  left: 2px;
  width: 20px;
  height: 1.5px;
  background: var(--color-text);
  transition: transform 0.25s ease;
}

.header__toggle-bar:nth-child(1) {
  top: 8px;
}

.header__toggle-bar:nth-child(2) {
  top: 15px;
}

.header--open .header__toggle-bar:nth-child(1) {
  transform: translateY(3.5px) rotate(45deg);
}

.header--open .header__toggle-bar:nth-child(2) {
  transform: translateY(-3.5px) rotate(-45deg);
}

.header__nav {
  display: flex;
  align-items: center;
  gap: 28px;
}

.header__menu {
  display: flex;
  align-items: center;
  gap: 26px;
  list-style: none;
}

.header__link {
  color: var(--color-text-muted);
  font-family: var(--font-ui);
  font-size: 14px;
  font-weight: 400;
  line-height: 1.2;
  letter-spacing: 0.8px;
  white-space: nowrap;
  transition: opacity 0.2s ease;
}

.header__link:hover {
  opacity: 0.6;
}

.header__contact {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 14px 31px;
  border-radius: 32px;
  background: var(--color-primary);
  color: var(--color-text-inverse);
  font-family: var(--font-ui);
  font-size: 14px;
  font-weight: 400;
  line-height: 1.2;
  white-space: nowrap;
  transition: opacity 0.2s ease;
}

.header__contact:hover {
  opacity: 0.8;
}

@media screen and (max-width: 768px) {
  .header__inner {
    min-height: var(--header-height-sp);
  }

  .header__toggle {
    display: block;
  }

  /* ハンバーガーとロゴはパネルより前に出す */
  .header__brand,
  .header__toggle {
    position: relative;
    z-index: 1;
  }

  /*
    閉じている間は display で落とす。opacity / visibility の遷移で隠す形にすると、
    ブレークポイントを跨いだ瞬間にも遷移が走り、PC の並びが縦に積み直りながら
    消えていくのが見えてしまう。display は遷移しないので切り替えが一瞬で済む。
  */
  .header__nav {
    display: none;
    position: fixed;
    inset: 0;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 40px;
    padding: var(--header-height-sp) var(--gutter) 40px;
    background: var(--color-background);
  }

  .header--open .header__nav {
    display: flex;
    animation: nav-open 0.25s ease;
  }

  .header__menu {
    flex-direction: column;
    align-items: center;
    gap: 0;
  }

  /* 指で押せる高さを確保する。文字サイズはヘッダーと揃えたまま */
  .header__link {
    display: block;
    padding: 14px 0;
  }
}

@keyframes nav-open {
  from {
    opacity: 0;
  }

  to {
    opacity: 1;
  }
}

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

.footer {
  padding-block: 80px;
  background: var(--color-background);
}

.footer__inner {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 40px;
}

.footer__company {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.footer__brand {
  display: flex;
  align-items: center;
  gap: 8px;
}

.footer__mark {
  display: block;
  width: 24px;
  height: 24px;
}

.footer__brand-name {
  color: var(--color-text);
  font-family: var(--font-logo);
  font-size: 19.2px;
  line-height: 1.25;
  letter-spacing: -0.54px;
  white-space: nowrap;
}

.footer__address {
  display: flex;
  flex-direction: column;
  gap: 16px;
  color: var(--color-text-muted);
  font-family: var(--font-ui);
  font-size: 14px;
  line-height: 1.6;
  letter-spacing: 0.03em;
}

.footer__map {
  display: inline-flex;
  align-items: center;
  align-self: flex-start;
  gap: 4px;
  color: var(--color-link);
  text-decoration: underline;
}

.footer__map:hover {
  text-decoration: none;
}

.footer__tel,
.footer__email {
  align-self: flex-start;
  color: inherit;
}

.footer__tel:hover,
.footer__email:hover {
  text-decoration: underline;
}

.footer__map-icon {
  font-size: 18px;
}

/* 右側はナビと著作権表示を上下に離して右端に寄せる */
.footer__side {
  display: flex;
  flex: 1 1 auto;
  flex-direction: column;
  align-items: flex-end;
  gap: 24px;
  min-width: 0;
}

.footer__actions {
  display: flex;
  align-items: flex-start;
  gap: 40px;
}

.footer__menu {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 32px;
  list-style: none;
}

.footer__link {
  color: var(--color-text-muted);
  font-family: var(--font-ui);
  font-size: 16px;
  font-weight: 500;
  line-height: 1.3;
  letter-spacing: 0.05em;
  white-space: nowrap;
  transition: opacity 0.2s ease;
}

.footer__link:hover {
  opacity: 0.6;
}

.footer__buttons {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.footer__button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 170px;
  padding: 14px 36px;
  border: 1px solid var(--color-primary);
  border-radius: 32px;
  font-family: var(--font-ui);
  font-size: 16px;
  font-weight: 500;
  line-height: 1.3;
  white-space: nowrap;
  transition:
    background-color 0.2s ease,
    color 0.2s ease;
}

.footer__button--outlined {
  background: var(--color-background);
  color: var(--color-primary);
}

.footer__button--outlined:hover {
  background: var(--color-primary);
  color: var(--color-text-inverse);
}

.footer__button--filled {
  background: var(--color-primary);
  color: var(--color-text-inverse);
}

.footer__button--filled:hover {
  background: var(--color-background);
  color: var(--color-primary);
}

.footer__copyright {
  color: var(--color-text-muted);
  font-family: var(--font-en);
  font-size: 12px;
  line-height: 1.3;
  letter-spacing: 0.08em;
}

@media screen and (max-width: 960px) {
  .footer__inner {
    flex-direction: column;
    gap: 48px;
  }

  .footer__side {
    align-items: flex-start;
    width: 100%;
  }

  .footer__actions {
    flex-direction: column;
    gap: 32px;
  }
}

@media screen and (max-width: 768px) {
  .footer {
    padding-block: 56px;
  }

  .footer__buttons {
    width: 100%;
  }

  .footer__button {
    width: 100%;
    padding: 13px 28px;
    font-size: 15px;
  }

  .footer__link {
    font-size: 15px;
  }
}
