/**
 * Custom Header Styles
 * 
 * 独自ヘッダーのスタイル
 */

/* ==========================================================================
   ヘッダー基本構造
   ========================================================================== */

.site-header-custom {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    background-color: #fff;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    z-index: 1000;
    transition: all 0.3s ease;
}

.header-container {
    max-width: 120rem;
    margin: 0 auto;
    padding: 0 2rem;
}

.header-wrapper {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 8rem;
}

/* ==========================================================================
   ブランド/ロゴ
   ========================================================================== */

.header-brand {
    flex-shrink: 0;
}

.brand-link {
    text-decoration: none;
    display: inline-block;
}

.brand-link:hover {
    text-decoration: none;
}

.brand-text {
    font-size: 2.4rem;
    font-weight: 900;
    color: #000;
    letter-spacing: -0.02em;
}

/* ==========================================================================
   ナビゲーション
   ========================================================================== */

.header-nav {
    flex-grow: 1;
    display: flex;
    justify-content: flex-end;
}

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

.nav-item {
    margin: 0;
}

.nav-link {
    font-size: var(--font-size-base);
    font-weight: var(--font-weight-medium);
    color: #333333;
    text-decoration: none;
    padding: var(--spacing-xs) 0;
    position: relative;
    transition: color var(--transition-base);
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 0;
    height: 2px;
    background-color: var(--color-primary);
    transition: width var(--transition-base);
}

.nav-link:hover {
    color: var(--color-primary);
    text-decoration: none;
}

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

/* CTAボタンスタイル */
.nav-link-cta {
    background-color: var(--color-primary);
    color: var(--color-white);
    padding: calc(var(--spacing-sm) + var(--spacing-xs)) var(--spacing-2xl);
    border-radius: var(--border-radius-sm);
    transition: all var(--transition-base);
}

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

.nav-link-cta:hover {
    background-color: #0284c7;
    color: #ffffff;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 115, 170, 0.3);
    text-decoration: none;
}

/* ==========================================================================
   モバイルメニュー
   ========================================================================== */

.mobile-menu-toggle {
    display: none;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    width: 4.4rem;
    height: 4.4rem;
    padding: 0.8rem;
    background-color: var(--color-primary);
    border: none;
    border-radius: var(--border-radius-sm);
    cursor: pointer;
    position: relative;
    transition: all 0.3s ease;
    z-index: 10000;
}

.mobile-menu-toggle:hover {
    background-color: #0284c7;
    transform: scale(1.05);
}

.menu-icon {
    width: 2.4rem;
    height: 2.4rem;
    color: #ffffff;
    transition: opacity 0.3s ease;
}

.menu-icon-bars {
    display: block;
}

.menu-icon-close {
    display: none;
}

.mobile-menu-toggle.active .menu-icon-bars {
    display: none;
}

.mobile-menu-toggle.active .menu-icon-close {
    display: block;
}

/* ==========================================================================
   スクロール時のスタイル
   ========================================================================== */

.site-header-custom.scrolled {
    box-shadow: 0 2px 20px rgba(0, 0, 0, 0.1);
}

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

@media (max-width: 768px) {
    .header-wrapper {
        height: 6rem;
    }
    
    .brand-text {
        font-size: 2rem;
    }
    
    .header-nav {
        position: fixed;
        top: 6rem;
        left: 0;
        right: 0;
        bottom: 0;
        width: 100%;
        height: calc(100vh - 6rem);
        background-color: #fff;
        box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
        transform: translateX(-100%);
        transition: transform 0.3s ease;
        overflow-y: auto;
        z-index: 9999;
        padding: 0;
        margin: 0;
    }
    
    .header-nav.active {
        transform: translateX(0);
    }
    
    .nav-list {
        flex-direction: column;
        align-items: stretch;
        gap: 0;
        padding: 0;
        margin: 0;
        width: 100%;
    }
    
    .nav-item {
        margin: 0;
    }
    
    .nav-item:not(:last-child) {
        border-bottom: 1px solid #eee;
    }
    
    .nav-link {
        display: block;
        padding: 2rem;
        margin: 0;
        text-align: left;
        font-size: 1.6rem;
        width: 100%;
    }
    
    .nav-link::after {
        display: none;
    }
    
    .nav-link-cta {
        margin: 2rem;
        text-align: center;
        display: block;
        width: calc(100% - 4rem);
        max-width: none;
    }
    
    .mobile-menu-toggle {
        display: flex;
    }
    
    /* メニュー開いた時のアニメーション */
    .mobile-menu-toggle.active {
        background-color: #0284c7;
    }
}

/* メニューが開いた時のbodyのスタイル */
body.menu-open {
    overflow: hidden;
}

@media (min-width: 769px) {
    body.menu-open {
        overflow: auto;
    }
}

/* ページコンテンツの上部余白（ヘッダー分） */
#page {
    padding-top: 8rem;
}

@media (max-width: 768px) {
    #page {
        padding-top: 6rem;
    }
}