/*
 * header.css
 * 株式会社井清不動産 - ヘッダースタイル
 * iseifudousan-child テーマ用
 *
 * このファイルは style.css に @import するか、
 * functions.php の wp_enqueue_scripts で読み込んでください。
 */

/* ============================================================
   CSS変数(カラー・サイズ定義)
   ============================================================ */
:root {
  --header-bg:        #2e1a0e;   /* ヘッダー背景:ダークブラウン */
  --header-height:    70px;      /* ヘッダーの高さ */
  --nav-text:         #ffffff;   /* ナビテキスト:ホワイト */
  --nav-en-text:      #c5c5c5;   /* 英語サブラベル */
  --divider-color:    #5a3f2b;   /* 縦区切り線 */
  --hover-color:      #c8a882;   /* ホバー色 */

  --drawer-bg:        #333333cc;   /* ドロワー背景:グレーブラウン */
  --drawer-text:      #ffffff;   /* ドロワーテキスト */
  --drawer-divider:   #8a807a;   /* ドロワー区切り線 */
  --tel-btn-bg:       #c59b6d;   /* 電話ボタン背景:ゴールド */
  --tel-btn-text:     #fff;      /* 電話ボタンテキスト */

  --z-header:         100;
  --z-overlay:        200;
  --z-drawer:         300;

  --transition-speed: 0.3s;
}

/* ============================================================
   スムーズスクロール(アンカーリンク用)
   固定ヘッダー分の余白を確保
   ============================================================ */
html {
  scroll-behavior: smooth;
  /* サイト全体をライト基調で統一（フォーム部品・スクロールバー等のネイティブUIも明るく） */
  color-scheme: light;
}

:target,
[id] {
  scroll-margin-top: var(--header-height);
}

/* ============================================================
   固定ヘッダー
   ============================================================ */
.site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: var(--z-header);
  background-color: var(--header-bg);
  height: var(--header-height);
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.4);
}

/* ヘッダーの高さ分だけbodyにpadding-topを追加(functions.phpでも設定可) */
body {
  padding-top: var(--header-height);
}

/* ============================================================
   ヘッダー内レイアウト
   ============================================================ */
.header-inner {
  display: flex;
  align-items: center;
  height: 100%;
  padding: 0 20px 0 28px;
  position: relative; /* ナビの絶対配置基準 */
}

/* ============================================================
   ロゴ
   ============================================================ */
.site-branding {
  display: flex;
  align-items: center;
  flex-shrink: 0;
}

.custom-logo-link {
  display: block;
  line-height: 1;
}

.custom-logo-link img {
  height: 34px;
  width: auto;
  display: block;
}

.site-title {
  color: var(--nav-text);
  font-size: 1.25rem;
  font-weight: 700;
  white-space: nowrap;
}

/* ============================================================
   縦区切り線(ロゴ↔ナビ間)
   ============================================================ */
.header-divider {
  width: 1px;
  height: 36px;
  background-color: var(--divider-color);
  margin: 0;
  flex-shrink: 0;
}

/* ============================================================
   PC用ナビゲーション(ウィンドウ基準で中央寄せ)
   ============================================================ */
.main-navigation {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
}

.nav-menu {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  align-items: center;
}

.nav-item {
  flex-shrink: 0;
}

.nav-link {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 0 22px;
  text-decoration: none;
  transition: opacity var(--transition-speed);
  line-height: 1.2;
}

.nav-link:hover {
  opacity: 0.7;
}

.nav-label-ja {
  color: var(--nav-text);
  font-size: 0.875rem;
  font-weight: 500;
  letter-spacing: 0.05em;
  white-space: nowrap;
}

.nav-label-en {
  color: var(--nav-en-text);
  font-family: acumin-variable, sans-serif;
  font-variation-settings: "slnt" -12, "wdth" 67.5, "wght" 300;
  font-size: 0.9rem;
  letter-spacing: 0.15em;
  text-indent: 0.15em;
  margin-top: 2px;
  white-space: nowrap;
}

/* ナビ項目間の縦区切り線 */
.nav-divider {
  width: 1px;
  height: 30px;
  background-color: var(--divider-color);
  flex-shrink: 0;
}

/* ============================================================
   ハンバーガーボタン
   ============================================================ */
.hamburger-btn {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 5px;
  width: 44px;
  height: 44px;
  margin-left: auto;
  padding: 8px;
  background: transparent;
  border: none;
  cursor: pointer;
  flex-shrink: 0;
}

.hamburger-line {
  display: block;
  width: 26px;
  height: 2px;
  background-color: var(--nav-text);
  border-radius: 1px;
  transition: all var(--transition-speed) 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;
  transform: scaleX(0);
}
.hamburger-btn.is-active .hamburger-line:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

/* ============================================================
   ハンバーガーメニュー(ドロワー)
   ============================================================ */

/* ドロワーパネル(右上から下にドロップ) */
.hamburger-panel {
  position: fixed;
  top: var(--header-height);
  right: 0;
  width: 260px;
  height: auto;
  max-height: calc(100vh - var(--header-height));
  background-color: var(--drawer-bg);
  z-index: var(--z-drawer);
  transform: scaleY(0);
  transform-origin: top right;
  transition: transform var(--transition-speed) ease,
              opacity var(--transition-speed) ease;
  opacity: 0;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
}

/* ドロワーオープン時 */
.hamburger-menu.is-open .hamburger-panel {
  transform: scaleY(1);
  opacity: 1;
}

/* ============================================================
   ドロワーナビゲーション
   ============================================================ */
.drawer-navigation {
  flex: 1;
  padding: 0;
}

.drawer-menu {
  list-style: none;
  margin: 0;
  padding: 0;
}

.drawer-item:hover {
  transition: background-color var(--transition-speed)
}

.drawer-link {
  display: block;
  padding: 14px 10px;
  margin: 0px 40px;
  border-bottom: 1px solid #ffffff;
  color: var(--drawer-text);
  text-decoration: none;
  font-size: 0.875rem;     /* 14px */
  font-weight: 500;
  letter-spacing: 0.08em;
  text-align: center;      /* 中央寄せ */
  transition: background-color var(--transition-speed),
              color var(--transition-speed);
}

.drawer-menu li:nth-child(9) .drawer-link {
  border-bottom: 0;
}

.drawer-item:last-child .drawer-link {
  border-bottom: 0;
}

.drawer-item:hover {
  background-color: rgba(255, 255, 255, 0.06);
}

.drawer-link:hover {
  color: var(--tel-btn-bg);
}

/* ============================================================
   電話番号ボタン
   ============================================================ */
.drawer-tel {
  margin: 0 13px 13px;
}

.tel-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  padding: 6px 0;
  background-color: var(--tel-btn-bg);
  border-radius: 5px;
  text-decoration: none;
  transition: background-color var(--transition-speed);
}

.tel-btn:hover {
  background-color: #b07a42;
}

.tel-icon-number {
  display: flex;
  align-items: center;
  gap: 6px;
}

.tel-icon {
  display: flex;
  align-items: center;
  color: var(--tel-btn-text);
  margin: 0 3px 0 5px;
}

.tel-icon svg {
  width: 31px;
  height: auto;
}

.tel-number {
  color: var(--tel-btn-text);
  font-family: acumin-variable, sans-serif;
  font-variation-settings: "slnt" 0, "wdth" 50, "wght" 800;
  font-size: 2rem;
  letter-spacing: 0.08em;
  line-height: 1;
}

.tel-hours {
  color: var(--tel-btn-text);
  font-size: 0.6rem;
  letter-spacing: 0;
  text-align: center;
}

/* ============================================================
   レスポンシブ
   ============================================================ */

/* ドロワー内のSP専用項目(トップページ・会社情報・アクセス・お問い合わせ)
   769px以上ではPCナビと重複するため非表示 */
@media (min-width: 769px) {
  .drawer-item--sp {
    display: none;
  }
}

/* タブレット以下:PCナビを非表示にして、ハンバーガーのみに */
@media (max-width: 768px) {
  .main-navigation,
  .header-divider {
    display: none;
  }

  .header-inner {
    padding: 0 16px;
    justify-content: space-between;
  }

  .hamburger-btn {
    margin-left: 0;
  }

  .drawer-menu li:nth-child(9) .drawer-link {
    border-bottom: 1px solid #ffffff;
  }
}

/* PC幅でのナビ調整(1024px以下でナビのpadding縮小) */
@media (max-width: 1024px) and (min-width: 769px) {
  .main-navigation {
    position: static;
    transform: none;
    display: flex;
    align-items: center;
  }

  .header-divider {
    margin: 0 0 0 28px;
  }

  .nav-link {
    padding: 0 14px;
  }

  .header-inner {
    padding: 0 16px;
  }
}
