/* ========================================
   CSS変数（カスタマイズ可能）
   ======================================== */
:root {
    --header-height: 80px;
    --header-bg: rgba(255, 255, 255, 0.95);
    --header-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    --nav-link-color: #333333;
    --nav-link-hover: #096fc8;
    --mobile-breakpoint: 1024px;
    --header-h: 72px;
}

/* ========================================
   ヘッダー基本スタイル
   ======================================== */
.site-header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: var(--header-height);
    background: var(--header-bg);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    box-shadow: var(--header-shadow);
    z-index: 1000;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ページ最上部の時（デスクトップのみ） */
@media (min-width: 1025px) {
    .site-header.is-at-top {
        background: transparent !important;
        backdrop-filter: none !important;
        -webkit-backdrop-filter: none !important;
        box-shadow: none !important;
    }
    
    /* messageページのみ：ページ最上部の時、フォントカラーを白に */
    .site-header.is-white-text .nav-link,
    .site-header.is-white-text .header-logo a {
        color: #FFFFFF !important;
    }
    
    .site-header.is-white-text .nav-link::after {
        background: #FFFFFF !important;
    }
    
    .site-header.is-white-text .nav-link-cta {
        background: #FFFFFF !important;
        color: #096fc8 !important;
    }
    
    .site-header.is-white-text .nav-link-cta:hover {
        background: rgba(255, 255, 255, 0.9) !important;
        color: #096fc8 !important;
    }
    
    .site-header.is-white-text .mobile-menu-toggle .menu-bar {
        background: #FFFFFF !important;
    }
}

.header-container {
    max-width: 1400px;
    height: 100%;
    margin: 0 auto;
    padding: 0 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

/* ========================================
   ロゴスタイル
   ======================================== */
.header-logo {
    flex-shrink: 0;
}

.header-logo a {
    display: flex;
    align-items: center;
    text-decoration: none;
    transition: opacity 0.3s ease;
}

.header-logo a:hover {
    opacity: 0.8;
}

.header-logo img {
    width: 45px;
    height: auto;
    display: block;
}

/* ========================================
   デスクトップナビゲーション
   ======================================== */
.header-nav {
    display: flex;
    align-items: center;
    gap: 32px;
}

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

/* モバイルでは非表示 */
@media (max-width: 1024px) {
    .nav-list {
        display: none;
    }
}

.nav-item {
    position: relative;
}

.nav-link {
    display: inline-block;
    font-size: 15px;
    font-weight: 600;
    color: var(--nav-link-color);
    text-decoration: none;
    padding: 8px 0;
    position: relative;
    transition: color 0.3s ease;
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--nav-link-hover);
    transition: width 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.nav-link:hover {
    color: var(--nav-link-hover);
}

.nav-link:hover::after {
    width: 100%;
}

/* CTAボタンスタイル */
.nav-link-cta {
    background: #096fc8;
    color: #ffffff;
    padding: 10px 24px;
    border-radius: 50px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.nav-link-cta::after {
    display: none;
}

.nav-link-cta:hover {
    background: #065299;
    color: #ffffff;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(9, 111, 200, 0.3);
}

/* ========================================
   ハンバーガーメニューボタン
   ======================================== */
.mobile-menu-toggle {
    display: none;
    flex-direction: column;
    justify-content: space-between;
    width: 30px;
    height: 24px;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 0;
    z-index: 1001;
}

/* モバイルでのみ表示 */
@media (max-width: 1024px) {
    .mobile-menu-toggle {
        display: flex;
    }
}

.menu-bar {
    width: 100%;
    height: 3px;
    background: #096fc8;
    border-radius: 2px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    transform-origin: center;
}

/* ハンバーガーアイコンのアニメーション（×に変化） */
.mobile-menu-toggle.is-active .menu-bar:nth-child(1) {
    transform: translateY(10.5px) rotate(45deg);
}

.mobile-menu-toggle.is-active .menu-bar:nth-child(2) {
    opacity: 0;
}

.mobile-menu-toggle.is-active .menu-bar:nth-child(3) {
    transform: translateY(-10.5px) rotate(-45deg);
    }

    /* ========================================
   モバイルメニュー
       ======================================== */
.mobile-menu {
    position: fixed;
    top: var(--header-height);
    left: 0;
    width: 100%;
    height: calc(100vh - var(--header-height));
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    transform: translateX(-100%);
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    overflow-y: auto;
    z-index: 999;
}

.mobile-menu.is-open {
    transform: translateX(0);
}

.mobile-nav-list {
        list-style: none;
        margin: 0;
    padding: 40px 24px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.mobile-nav-item {
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}

.mobile-nav-link {
        display: block;
    font-size: 18px;
    font-weight: 600;
    color: var(--nav-link-color);
        text-decoration: none;
    padding: 16px 0;
    transition: all 0.3s ease;
}

.mobile-nav-link:hover {
    color: var(--nav-link-hover);
    padding-left: 8px;
}

.mobile-nav-link-cta {
    background: #096fc8;
    color: #ffffff;
    padding: 16px 24px;
    border-radius: 12px;
    text-align: center;
    margin-top: 16px;
}

.mobile-nav-link-cta:hover {
    background: #065299;
    color: #ffffff;
    padding-left: 24px;
    }

    /* ========================================
   メニュー開閉時のbody固定
       ======================================== */
body.menu-open {
    overflow: hidden;
    }

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

/* モバイル（1024px以下） - 背景を透明に */
@media (max-width: 1024px) {
    .site-header {
        background: transparent !important;
        backdrop-filter: none !important;
        -webkit-backdrop-filter: none !important;
        border-bottom: none !important;
        box-shadow: none !important;
    }
    
    .header-container {
        padding: 0 16px;
        background: transparent !important;
        backdrop-filter: none !important;
        -webkit-backdrop-filter: none !important;
    }
    
    .header-logo,
    .header-logo a {
        background: transparent !important;
    }
    
    .header-nav {
        background: transparent !important;
        backdrop-filter: none !important;
        -webkit-backdrop-filter: none !important;
    }
}

/* モバイル（767px以下） */
@media (max-width: 767px) {
    :root {
        --header-height: 70px;
    }
    
    .header-container {
        padding: 0 16px;
    }
    
    .header-logo img {
        width: 40px;
    }
    
    .mobile-menu {
        top: 70px;
        height: calc(100vh - 70px);
    }
}

/* 小型スマートフォン（480px以下） */
@media (max-width: 480px) {
    :root {
        --header-height: 60px;
    }
    
    .header-container {
        padding: 0 12px;
    }
    
    .header-logo img {
        width: 36px;
    }
    
    .mobile-menu {
        top: 60px;
        height: calc(100vh - 60px);
    }
    
    .mobile-nav-list {
        padding: 32px 20px;
    }
    
    .mobile-nav-link {
        font-size: 16px;
        padding: 14px 0;
    }
}

/* ========================================
   レスポンシブ時のcontent要素の位置調整
   （headerと被るように、他の要素のレイアウトは変更しない）
   ======================================== */
@media (max-width: 1024px) {
    /* content要素をheaderの下から開始するように調整（既存のpadding-topを削除） */
    body #content.site-content,
    body .site-content {
        padding-top: 0 !important;
        margin-top: 0 !important;
    }

    /* .main要素のpadding-topを削除してheaderと被るように */
    body .main,
    body main.main {
        padding-top: 0 !important;
        margin-top: 0 !important;
    }

    /* 最初のセクション（通常は.hero）をheaderの下から開始 */
    body .main > section:first-child,
    body #content > section:first-child,
    body .site-content > section:first-child {
        margin-top: 0 !important;
        padding-top: 0 !important;
    }

    /* .heroセクションのみ特別にheaderと被るように調整 */
    body .main > .hero,
    body #content > .hero,
    body .site-content > .hero {
        margin-top: 0 !important;
        padding-top: 0 !important;
    }

    /* index.cssで設定されている負のマージンもリセット */
    body .main > .hero,
    body .site-content > .hero {
        margin-top: 0 !important;
    }
    }

    /* ========================================
   アクセシビリティ
       ======================================== */
.mobile-menu-toggle:focus-visible {
    outline: 2px solid #096fc8;
    outline-offset: 4px;
    border-radius: 6px;
}

.nav-link:focus-visible,
.mobile-nav-link:focus-visible {
    outline: 2px solid #096fc8;
    outline-offset: 2px;
    border-radius: 4px;
}

/* ========================================
   アニメーション無効化（ユーザー設定に応じて）
   ======================================== */
@media (prefers-reduced-motion: reduce) {
    .site-header,
    .nav-link::after,
    .mobile-menu,
    .menu-bar,
    .mobile-menu-toggle {
        transition: none;
        animation: none;
    }
}
