/* =========================================================
   Header Styles (header.css)
========================================================= */

/* ページ遷移オーバーレイ */
.p-transition-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100svw;
    height: 100svh;
    background-color: #fff;
    z-index: 9999;
    pointer-events: none;
    opacity: 1;
}

.g-header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100svw;
    z-index: 1000;
    transition: background 0.4s ease, backdrop-filter 0.4s ease, -webkit-backdrop-filter 0.4s ease, padding 0.4s ease;
    padding: 0.5em 0;
    pointer-events: none;
    /* コンテンツのクリックを邪魔しないように */
}

.g-header__inner {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 4vw;
    pointer-events: auto;
    /* 子要素はクリック可能に */
}

/* スクロール時の背景等（JSで制御：上にスクロールした時のみ表示） */
.g-header.is-scrolled-up {
    background: #0005;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

/* メニューオープン時は背景指定を無効化 */
.g-header.is-open.is-scrolled-up {
    background: transparent;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
}

/* センターロゴ */
.g-header__logo {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1001;
    margin: 0;
}

.g-header__logo a {
    display: flex;
    align-items: center;
    text-decoration: none;
    color: #fff;
    font-size: 1.5rem;
    font-weight: 300;
    letter-spacing: 0.15em;
    mix-blend-mode: difference;
    /* 明るい背景でも暗い背景でもロゴが見えるように */
    transition: opacity 0.3s ease;
}

.g-header__logo a:hover {
    opacity: 0.7;
}

.g-header__logo img {
    height: 25px;
    width: auto;
    /* iOSでのアンチエイリアス（半透明の縁）が極端に明るくなり「太って見える」のを防ぐため、brightness(50)を廃止 */
    filter: brightness(0) invert(1);
    transform: translateZ(0); /* iOSの描画にじみ防止（ハードウェアアクセラレーション） */
}

/* ハンバーガーボタン */
.g-header__burger {
    background: transparent;
    border: none;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    width: 48px;
    height: 48px;
    margin-left: auto;
    z-index: 1001;
    position: relative;
    padding: 0;
    outline: none;
}

.g-header__burger-line {
    display: block;
    width: 28px;
    height: 1px;
    background-color: #fff;
    margin: 4px 0;
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1), background-color 0.4s ease;
    mix-blend-mode: difference;
}

/* メニューオープン時の中央ロゴとハンバーガー */
.g-header.is-open .g-header__logo a,
.g-header.is-open .g-header__burger-line {
    mix-blend-mode: normal;
    color: #fff;
}

.g-header.is-open .g-header__burger-line {
    background-color: #fff;
}

.g-header.is-open .g-header__burger-line:nth-child(1) {
    transform: translateY(9px) rotate(45deg);
}

.g-header.is-open .g-header__burger-line:nth-child(2) {
    transform: scaleX(0);
}

.g-header.is-open .g-header__burger-line:nth-child(3) {
    transform: translateY(-9px) rotate(-45deg);
}

/* 全画面ナビゲーション */
.g-nav {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    /* fallback */
    height: 100dvh;
    z-index: 999;
    pointer-events: none;
    visibility: hidden;
}

.g-nav.is-active {
    pointer-events: auto;
    visibility: visible;
}

.g-nav__bg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(20, 20, 20, 0.85);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    clip-path: circle(0% at 90% 10%);
}

.g-nav__wrap {
    position: relative;
    width: 100%;
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow-y: auto;
    /* ヘッダを避けるためpadding */
}

/* WordPress メニューリスト */
.g-nav__list {
    list-style: none;
    margin: 0;
    padding: 0;
    text-align: center;
    width: 100%;
}

.g-nav__list>li {
    margin: 1.5em 0;
    overflow: visible;
    /* トグルボタン等がはみ出しても表示されるように */
    display: flex;
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;
    /* サブメニューを下段に落とす */
}

.g-nav__list>li>a {
    display: inline-block;
    font-size: clamp(1.1rem, 2vw, 1.5rem);
    color: #fff;
    text-decoration: none;
    letter-spacing: 0.25em;
    font-weight: 300;
    position: relative;
    transform: translateY(110%);
    opacity: 0;
    /* padding-bottom: 5px; 中央揃えのために削除、または調整 */
}

/* ホバーした際の下線アニメーション */
.g-nav__list>li>a::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 1px;
    background-color: #fff;
    transition: width 0.4s ease;
}

.g-nav__list>li>a:hover::after {
    width: 100%;
}

/* サブメニューを全幅で下に配置 */
.g-nav__list .sub-menu {
    width: 100%;
    flex-basis: 100%;
}

/* サブメニュー（階層ありの場合） */
.g-nav__list .sub-menu {
    list-style: none;
    padding: 0;
    margin: 0;
    /* マージンを0にして余白問題を回避 */
    display: none;
    overflow: hidden;
    /* 高さが0のときに完全に消えるように */
    width: 100%;
    /* 全幅を確保して回り込みを防止 */
}

/* 開いている時のみ上部に余白を設けるための内部要素調整、またはJSで管理 */
.g-nav__list .sub-menu li:first-child {
    margin-top: 2em;
    /* サブメニューの最初の項目にマージンを持たせる */
}

.g-nav__list .sub-menu li {
    margin: 1.2em 0;
}

.g-nav__list .sub-menu li a {
    font-size: clamp(0.85rem, 1.5vw, 1.1rem);
    color: #ccc;
    text-decoration: none;
    letter-spacing: 0.15em;
    font-weight: 300;
    opacity: 0;
    transform: translateY(10px);
    transition: color 0.3s ease;
}

.g-nav__list .sub-menu li a:hover {
    color: #fff;
}

/* アコーディオン開閉トグルボタン */
.g-nav__toggle {
    display: inline-flex;
    justify-content: center;
    align-items: center;
    width: 44px;
    /* クリック領域を拡大 */
    height: 44px;
    margin-left: 5px;
    cursor: pointer;
    vertical-align: middle;
    position: relative;
    transition: opacity 0.3s ease;
    /* 即座に消すためのアニメーション用 */
}

/* 共通のバー（横棒） */
.g-nav__toggle::before,
.g-nav__toggle::after {
    content: '';
    position: absolute;
    background-color: #fff;
    transition: transform 0.3s ease, opacity 0.3s ease;
}

/* 横棒 */
.g-nav__toggle::before {
    width: 14px;
    height: 1px;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

/* 縦棒（プラス用） */
.g-nav__toggle::after {
    width: 1px;
    height: 14px;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

/* オープン時（マイナスにする：縦棒を回転させて隠す、あるいは横棒と重ねる） */
.g-nav__list li.is-open>.g-nav__toggle::after {
    transform: translate(-50%, -50%) rotate(90deg);
    opacity: 0;
}

@media screen and (max-width: 690px) {
    .g-header {
        padding: 0.5em 0;
    }

    .g-header__logo img {
        height: 25px;
    }

    .g-nav__list>li>a {
        font-size: 1.1rem;
    }
}