/*
  layout.css
  ヘッダー・フッター等、全ページ共通のレイアウトパーツ。
  header/footerのHTMLはindex.htmlをマスターとして全ページへ複製する運用のため、
  ここでの変更は自動的に全ページへ反映される。
*/

/* ---------- Header ---------- */

.site-header {
  background: linear-gradient(180deg, var(--color-gold-light), var(--color-gold));
  padding-block: var(--space-s);
}

.site-header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-m);
  flex-wrap: wrap;
}

.site-header__logo {
  flex: 0 1 auto;
  width: clamp(9rem, 8rem + 4vw, 12rem);
}

.site-header__logo img {
  width: 100%;
  height: auto;
}

.global-nav {
  flex: 1 1 auto;
  display: flex;
  justify-content: center;
}

.global-nav__list {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-m);
}

.global-nav__link {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.15em;
  font-family: var(--font-en-sans);
  font-size: 1rem;
  font-weight: 600;
  letter-spacing: 0.03em;
  color: var(--color-white);
  transition: opacity 0.2s ease;
}

.global-nav__link:hover {
  opacity: 0.7;
}

.global-nav__link .jp {
  font-family: var(--font-jp);
  font-size: 0.7rem;
  font-weight: 400;
  color: var(--color-white);
}

.global-nav__link.is-current {
  text-decoration: underline;
  text-underline-offset: 0.3em;
}

.site-header__store {
  flex: 0 0 auto;
}

/* ONLINE STORE + MENU（スマホのみ表示）をまとめるラッパー。PCでは中身がstoreボタンだけになる */
.site-header__actions {
  display: flex;
  align-items: center;
  gap: var(--space-xs);
}

.site-header__menu-btn {
  display: none;
}

.site-header__store-label--short {
  display: none;
}

/* ---------- Footer ---------- */

.site-footer {
  background: var(--color-black);
  color: var(--color-gold-light);
  padding-block: var(--space-l);
}

.site-footer__inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-l);
}

.site-footer__logo {
  width: clamp(8rem, 7rem + 5vw, 11rem);
}

.footer-nav {
  display: grid;
  grid-template-columns: repeat(4, auto);
  gap: var(--space-s) var(--space-l);
  flex: 1 1 20rem;
}

.footer-nav__link {
  font-family: var(--font-en-sans);
  font-size: 1rem;
  letter-spacing: 0.03em;
  transition: opacity 0.2s ease;
}

.footer-nav__link:hover {
  opacity: 0.7;
}

.footer-follow {
  display: flex;
  flex-direction: column;
  gap: var(--space-s);
  align-items: center;
}

.footer-follow__title {
  font-family: var(--font-en-sans);
  font-size: 1rem;
  letter-spacing: 0.1em;
}

.footer-follow__icons {
  display: flex;
  gap: var(--space-xs);
}

.footer-follow__icons a {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 50%;
  background: var(--color-gold);
  color: var(--color-white);
  transition: transform 0.2s ease;
}

.footer-follow__icons a:hover {
  transform: translateY(-0.15rem);
}

.footer-follow__icons svg {
  width: 1.1rem;
  height: 1.1rem;
}

.site-footer__bottom {
  margin-top: var(--space-m);
  text-align: center;
  font-size: 0.75rem;
  color: var(--color-text-sub);
}

/* ---------- ページ内共通見出し(下層ページ用) ---------- */

.page-heading {
  padding-block: var(--space-l) var(--space-m);
}

/* ==========================================================
   モバイル（〜767px）：ヘッダー・フッター共通
   全ページで同じヘッダー/フッターHTMLを複製している構成のため、ここでの変更は
   スクリプトタグ（js/mobile-nav.js）を含めた同じ構造を持つ全ページに同様に適用する想定。
   ========================================================== */
@media (max-width: 767px) {
  .site-header {
    position: relative;
  }

  .site-header__inner {
    flex-wrap: nowrap;
  }

  .site-header__logo {
    width: clamp(7rem, 5.5rem + 12vw, 9.5rem);
  }

  /* スマホ表示のヘッダーロゴのみ白色に反転する（ゴールド背景とのコントラスト対策）。
     PC版のヘッダーロゴ・フッターロゴ（PC/スマホ問わず）は対象外 */
  .site-header__logo img {
    filter: brightness(0) invert(1);
  }

  /* 通常時は非表示。MENUタップでbodyに付く.nav-is-openのときだけヘッダー直下に展開する */
  .global-nav {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    max-height: calc(100vh - 100%);
    overflow-y: auto;
    background: linear-gradient(180deg, var(--color-gold-light), var(--color-gold));
    box-shadow: 0 0.5rem 1rem rgba(23, 19, 15, 0.18);
    z-index: 100;
  }

  body.nav-is-open .global-nav {
    display: block;
  }

  .global-nav__list {
    flex-direction: column;
    flex-wrap: nowrap;
    gap: 0;
  }

  .global-nav__list li {
    border-bottom: 1px solid rgba(255, 255, 255, 0.3);
  }

  .global-nav__link {
    flex-direction: row;
    justify-content: center;
    gap: var(--space-xs);
    padding: var(--space-m);
  }

  .site-header__actions {
    flex: 0 0 auto;
  }

  /* ONLINE STORE(既存の.btn--store)とMENUを、同じ丸ボタンの見た目に揃える */
  .btn.btn--store.site-header__store,
  .site-header__menu-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 3.4rem;
    height: 3.4rem;
    padding: 0;
    border-radius: 50%;
    gap: 0.2rem;
    font-family: var(--font-en-sans);
    font-size: 0.55rem;
    font-weight: 700;
    letter-spacing: 0;
    line-height: 1.2;
  }

  .site-header__menu-btn {
    background: var(--color-white);
    color: var(--color-gold-dark);
  }

  /* ボタンが小さい丸型になるため、表記を「ONLINE STORE」→「STORE」に短縮する */
  .site-header__store-label--full {
    display: none;
  }

  .site-header__store-label--short {
    display: block;
  }

  .site-header__menu-icon {
    width: 1.3rem;
    height: 1.3rem;
  }

  /* ハンバーガー/×アイコンとMENU/CLOSEラベルは、.is-openの有無で片方だけ出し分ける */
  .site-header__menu-icon,
  .site-header__menu-label {
    display: none;
  }

  .site-header__menu-icon--open,
  .site-header__menu-label--open {
    display: block;
  }

  .site-header__menu-btn.is-open .site-header__menu-icon--open,
  .site-header__menu-btn.is-open .site-header__menu-label--open {
    display: none;
  }

  .site-header__menu-btn.is-open .site-header__menu-icon--close,
  .site-header__menu-btn.is-open .site-header__menu-label--close {
    display: block;
  }

  /* フッター：ロゴ→ナビ→FOLLOW US→コピーライトを中央揃えで縦に積む */
  .site-footer__inner {
    flex-direction: column;
    text-align: center;
  }

  .footer-nav {
    /* flex: 1 1 20remはPC(横並び)でのwidth基準のため、
       縦積みになるスマホではheight基準に化けて縦の余白が膨らんでしまう。ここで無効化する */
    flex: 0 0 auto;
    grid-template-columns: repeat(2, auto);
    justify-content: center;
    text-align: left;
    gap: var(--space-s) var(--space-l);
  }
}
