@charset "utf-8";

/* ==========================================================
   3. ヘッダー（修正版）
   .ham / .header__navWrap : 常時DOMに存在。.wrapper 直下に置き、
                             .wrapper__fix--left の display:none の
                             影響を受けないようにする。
   .header__sidebar-extra  : 1001px以上でのみ表示する装飾サイドバー
                             （.wrapper__fix--left の中のまま）
   ========================================================== */

/*
  left/right は 745:200 の比率で伸縮するので、centerの左端は
  常にビューポート中央にあるわけではない（左右非対称）。
  「(100% - center幅) / 2」という対称前提の式だと、centerの実際の
  位置とズレてしまうため、left/right比率を反映した式に置き換える。

  natural-w   = left-w + center-w + right-w = 745 + 480 + 200 = 1425px
                （この幅ちょうどのときに left=745px, right=200px になる基準値）
  left-ratio  = left-w / (left-w + right-w) = 745 / 945 ≈ 0.788360
  right-ratio = right-w / (left-w + right-w) = 200 / 945 ≈ 0.211640

  center左端 = left-w + (100vw - natural-w) * left-ratio
  center右端 = right-w + (100vw - natural-w) * right-ratio
*/
:root {
  --natural-w: 1425px;
  --left-ratio: 0.78836;
  --right-ratio: 0.21164;
}

/* ---- 3-1. デスクトップ専用の装飾サイドバー ---- */
.header__sidebar-extra {
  display: none; /* ベース(モバイル/タブレット)では非表示 */
}
.header__navWrap .header__sidebar-extra {
  display: block;
}

@media screen and (min-width: 1001px) {
  .header__sidebar-extra {
    display: block;
    padding-top: 125px; /* 旧 .header の padding-top をここに移動 */
  }
  .header__navWrap .header__sidebar-extra {
    padding-top: 0;
  }
}

.header__logo {
  width: 100%;
  max-width: 277px;
  margin: 0 auto 22px;
  /* 表示/非表示は親 .header__sidebar-extra の display に任せる */
}

.header__logo a {
  display: block;
}

.nav__list {
  display: flex;
  flex-direction: column;
  margin: 0 auto;
}
.nav__item {
  position: relative;
}
.nav__link {
  width: fit-content;
  margin: 0 auto;
  display: block;
  position: relative;
}
.nav__label {
  color: #fff;
  display: block;
}

.nav--low {
  margin-bottom: 46px;
}
.nav--low .nav__list {
  gap: 0;
}
.nav--low .nav__label {
  color: #fff;
  font-size: 24px;
  font-family: "Noto Serif TC", serif;
  font-weight: 400;
  text-align: center;
  line-height: 1.9;
  letter-spacing: 0.04em;
}

.nav--header02 .nav__list {
  flex-wrap: wrap;
  flex-direction: row;
  justify-content: center;
  gap: 7px 25px;
}
.nav--header02 .nav__label {
  font-size: 12px;
  font-weight: 600;
  line-height: 2.1;
  letter-spacing: 0.08em;
}
.header__navWrap .nav--header02 .nav__list {
  width: 290px;
}

.header__entry-btn {
  width: 100%;
  max-width: 360px;
  margin: 0 auto 66px;
}
.header__entry-btn a {
  font-size: 16px;
  font-family: "Noto Serif TC", serif;
  font-weight: 600;
  text-align: center;
  line-height: 1.46;
  letter-spacing: -0.02em;
  padding: 16px 20px;
  display: block;
  background-color: #deb971;
  border-radius: 27px;
  position: relative;
  transition: all 0.3s;
}
.header__entry-btn a::after {
  content: "";
  display: block;
  width: 0;
  height: 0;
  border-style: solid;
  border-top: 4px solid transparent;
  border-bottom: 4px solid transparent;
  border-left: 7px solid #447065;
  border-right: 0;
  position: absolute;
  top: 50%;
  right: 25px;
  z-index: 1;
  transform: translateY(-50%);
  transition: all 0.3s;
}
.header__entry-btn a:hover {
  color: #deb971;
  background-color: #447065;
}
.header__entry-btn a:hover::after {
  border-left: 7px solid #deb971;
}

@media screen and (max-width: 480px) {
  .header__logo {
    max-width: 57.7083vw;
    margin: 0 auto 4.5833vw;
    /* 表示/非表示は親 .header__sidebar-extra の display に任せる */
  }

  .nav--low {
    margin-bottom: 9.5833vw;
  }
  .nav--low .nav__label {
    font-size: 5vw;
  }

  .nav--header02 .nav__list {
    gap: 1.4583vw 15px;
  }
  .nav--header02 .nav__label {
    font-size: 2.5vw;
  }
  .header__navWrap .nav--header02 .nav__list {
    width: 60.4166vw;
  }

  .header__entry-btn {
    max-width: 75vw;
    margin: 0 auto 13.75vw;
  }
  .header__entry-btn a {
    font-size: 3.3333vw;
    padding: 3.3333vw 20px;
  }
  .header__entry-btn a::after {
    border-top: 0.8333vw solid transparent;
    border-bottom: 0.8333vw solid transparent;
    border-left: 1.4583vw solid #447065;
    right: 5.2083vw;
  }
  .header__entry-btn a:hover::after {
    border-left: 1.4583vw solid #deb971;
  }
}

/* ---- 3-2. ハンバーガーボタン ----
   .wrapper 直下（常時DOMに存在）。position:fixedなので
   コンテナの表示状態に関係なく常に機能する。            */
.ham {
  width: 40px;
  height: 40px;
  background: #fff;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  cursor: pointer;
  z-index: 99;
  position: fixed;
  top: 8px;
  right: 8px;
}

.lang__list {
  z-index: 2;
  position: fixed;
  top: 13px;
  right: 68px;
}

@media screen and (min-width: 481px) {
  .ham {
    /* centerの右端に合わせる（left:right = 745:200 の非対称比率を反映）
       100vw ではなく 100% を使う：fixed要素の%はスクロールバー分を除いた
       幅で解決されるため、.wrapper__left/right の実際の幅と基準が揃う */
    right: calc(var(--right-w) + (100% - var(--natural-w)) * var(--right-ratio) + 8px);
  }

  .lang__list {
    position: fixed;
    top: 13px;
    right: calc(var(--right-w) + (100% - var(--natural-w)) * var(--right-ratio) + 75px);
    z-index: 2;
  }
}

.ham__lineWrapper {
  position: relative;
  width: 14px;
  height: 10px;
}
.ham__lineWrapper span {
  display: block;
  width: 100%;
  height: 1px;
  background-color: #007183;
  position: absolute;
  left: 50%;
  transition: 0.3s;
}
.ham__lineWrapper span:nth-child(1) {
  transform: translateX(-50%);
  top: 0px;
}
.ham__lineWrapper span:nth-child(2) {
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
}
.ham__lineWrapper span:nth-child(3) {
  transform: translateX(-50%);
  bottom: 0px;
}

.ham.open {
  background: #fff;
}
.ham.open .ham__lineWrapper span {
  background: #007183;
}
.ham.open .ham__lineWrapper span:nth-child(1) {
  transform: translate(-50%, -50%) rotate(45deg);
  top: 50%;
}
.ham.open .ham__lineWrapper span:nth-child(2) {
  opacity: 0;
}
.ham.open .ham__lineWrapper span:nth-child(3) {
  transform: translate(-50%, -50%) rotate(-45deg);
  top: 50%;
}

.lang__list {
  width: 88px;
  padding: 5px 5px 5px 7px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  background-color: #fff;
  border-radius: 3px;
  overflow: hidden;
  max-height: 30px; /* ← li 1つ分の実際の高さに合わせて調整 */
  transition: max-height 0.7s;
}

.lang__list.is-open {
  max-height: 260px;
}

/* ホバー中は全項目が収まるだけの高さまで展開 */
.lang__list:hover {
  max-height: 260px; /* ← 項目数×行の高さより少し大きめに */
}

/* 各項目のスタイル（縦積み・中央寄せ） */
.lang__list-item {
  white-space: nowrap;
}

.lang__list-item a {
  font-size: 12px;
  font-weight: 400;
  line-height: 1.75;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

/* 現在の言語を強調したい場合 */
.lang__list-item.current a {
  font-weight: 700;
  text-decoration: underline;
}

/* スラッシュ区切り画像の余白調整（元のPHPそのまま利用） */
.lang__list img {
  width: 13px;
  height: 13px;
  display: block;
}
.lang__list span {
  width: calc(100% - 24px);
}

/* ---- 3-3. ハンバーガーで開閉する全画面ナビ ----
   .wrapper 直下（常時DOMに存在）。全ブレークポイント共通。   */
.nav--header {
  display: block;
}

.header__navWrap {
  width: 100%;
  max-width: var(--center-w);
  height: 100dvh;
  padding-top: 44px;
  background: url("../imgs/common/header_bg.png") center center / cover no-repeat;
  position: fixed;
  top: 0;
  left: calc((100% - 100vw) / 2); /* ベース(モバイル)：ほぼ0 */
  z-index: -99;
  opacity: 0;
  transition: all 0.3s;
  pointer-events: none;
}
.header__navWrap.panelactive {
  opacity: 1;
  pointer-events: all;
  z-index: 98;
  overflow-y: auto;
}

/* ナビゲーションの縦スクロール（ナビの数が増えた場合） */
.header__navWrap.panelactive .header__navScroll {
  position: fixed;
  z-index: 98;
  width: 100%;
  max-width: var(--center-w);
  height: 100vh;
  overflow: auto;
  -webkit-overflow-scrolling: touch;
}
.header__navWrap.panelactive .header__navScroll {
  max-width: 100vw;
}

.icon-list {
  width: 82px;
  margin: 20px 20px 0 auto;
  display: flex;
  align-items: center;
  gap: 16px;
}
.icon-list__item:nth-child(1) {
  width: 17px;
}
.icon-list__item:nth-child(2) {
  width: 15px;
}
.icon-list__item:nth-child(3) {
  width: 17px;
}
.icon-list__item a {
  display: block;
}

.header__navWrap .icon-list {
  margin: 0 auto 65px;
}

@media screen and (min-width: 481px) {
  .header__navWrap {
    /* centerの左端に合わせる（left:right = 745:200 の非対称比率を反映） */
    /* 100vw ではなく 100% を使う（理由は .ham と同じ） */
    left: calc(var(--left-w) + (100% - var(--natural-w)) * var(--left-ratio));
  }
  .header__navWrap.panelactive .header__navScroll {
    max-width: var(--center-w);
  }
  .nav__list {
    max-width: none;
  }
}

@media screen and (min-width: 481px) and (max-width: 1000px) {
  .ham {
    right: calc((100% - var(--center-w)) / 2 + 20px);
  }
  .header__navWrap {
    left: calc((100% - var(--center-w)) / 2);
  }
  .lang__list {
    right: calc((100% - var(--center-w)) / 2 + 85px);
  }
}

@media screen and (max-width: 1070px) {
  .wrapper__right .icon-list {
    display: none;
  }
}

@media screen and (max-width: 480px) {
  .header__navWrap {
    padding-top: 9.1666vw;
  }

  .icon-list {
    margin: 4.1666vw 4.1666vw 0 auto;
  }

  .header__navWrap .icon-list {
    margin: 0 auto 13.5416vw;
  }
}
