/* ヘッダー全体 */
header {
    position: sticky;
    top: 0;
    z-index: 999;
}

.site-header {
    width: 100%;
    background-color: #ffffff;
    border-bottom: 2px solid #EEEDFE;
    box-shadow: 0 2px 12px rgba(83, 74, 183, 0.08);
    box-sizing: border-box;
}

/* 上段：ロゴ + 右側（パンくず・レベル） + 検索 */
.site-header-top {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.75rem 2rem;
    width: 100%;
}

/* ロゴの右側：パンくず＋レベルを縦並び */
.site-header-right {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    flex: 1;
    min-width: 0;
}

/* 下段：レベル切り替え（廃止・site-header-rightに統合） */
.site-header-levels {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    flex-wrap: wrap;
}

/* パンくずリスト */
.site-hierarchy {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    font-size: 0.875rem;
    flex-shrink: 0;
}

.site-hierarchy a {
    color: #555;
    text-decoration: none;
    display: inline-block;
}

.site-hierarchy a:hover {
    color: #111;
    text-decoration: underline;
}

.site-hierarchy a::after {
    content: "\00a0/\00a0";
    color: #aaa;
    text-decoration: none;
    display: inline-block;
    pointer-events: none;
}

.site-hierarchy a:last-child::after {
    content: none;
}

/* 検索ボックス */
.site-search {
    flex: 1;
    max-width: 280px;
    margin-left: auto;
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.site-search input {
    flex: 1;
    height: 32px;
    border: 1px solid #e5e7eb;
    border-radius: 999px;
    padding: 0 1rem;
    font-size: 0.8rem;
    color: #333;
    outline: none;
    background: #f9fafb;
    transition: border-color 0.15s, background 0.15s;
    box-sizing: border-box;
    min-width: 0;
}

.site-search input:focus {
    border-color: #AFA9EC;
    background: #fff;
}

.site-search-btn {
    width: 32px;
    height: 32px;
    background-color: #534AB7;
    border: none;
    border-radius: 999px;
    cursor: pointer;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: background-color 0.15s;
}

.site-search-btn svg {
    width: 13px;
    height: 13px;
    stroke: #fff;
}

.site-search-btn:hover {
    background-color: #3C3489;
}

/* レベル切り替え */
.level-item {
    font-size: 0.8rem;
    padding: 0.2rem 0.85rem;
    border-radius: 999px;
    text-decoration: none;
    transition: background-color 0.15s;
}

a.level-item {
    color: #534AB7;
    background-color: #EEEDFE;
}

a.level-item:hover {
    background-color: #CECBF6;
    color: #3C3489;
}

.level-current {
    color: #ffffff;
    background-color: #534AB7;
    font-weight: 600;
    cursor: default;
}

/* ハンバーガーボタン（PC時は非表示） */
.hamburger-btn {
    display: none !important;
    flex-direction: column;
    justify-content: center;
    gap: 5px;
    width: 36px;
    height: 36px;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 4px;
    margin-left: auto;
    flex-shrink: 0;
}

.hamburger-btn span {
    display: block;
    width: 100%;
    height: 2px;
    background-color: #444;
    border-radius: 2px;
    transition: transform 0.2s, opacity 0.2s;
}

.hamburger-btn.open span:nth-child(1) {
    transform: translateY(7px) rotate(45deg);
}
.hamburger-btn.open span:nth-child(2) {
    opacity: 0;
}
.hamburger-btn.open span:nth-child(3) {
    transform: translateY(-7px) rotate(-45deg);
}

/* スマホメニュー（PC時は非表示） */
.site-header-menu {
    display: none !important;
    flex-direction: column;
    gap: 0;
    border-top: 1px solid #f0f0f0;
    background-color: #ffffff;
}

@media (max-width: 768px) {
    .site-header-menu.open {
        display: flex !important;
    }
}

/* スマホ対応 */
@media (max-width: 768px) {
    .site-header-top {
        padding: 0.75rem 1rem;
    }

    .site-header-levels,
    .site-header-right,
    .site-hierarchy,
    .site-search {
        display: none;
    }

    .hamburger-btn {
        display: flex !important;
    }

    .menu-hierarchy {
        display: flex;
        align-items: center;
        flex-wrap: wrap;
        padding: 0.75rem 1rem;
        font-size: 0.875rem;
        border-bottom: 1px solid #f0f0f0;
    }

    .menu-hierarchy a {
        color: #555;
        text-decoration: none;
        display: inline-block;
    }

    .menu-hierarchy a::after {
        content: "\00a0/\00a0";
        color: #aaa;
        text-decoration: none;
        display: inline-block;
        pointer-events: none;
    }

    .menu-hierarchy a:last-child::after {
        content: none;
    }

    .menu-levels {
        display: flex;
        align-items: center;
        gap: 0.5rem;
        padding: 0.75rem 1rem;
        flex-wrap: wrap;
        border-bottom: 1px solid #f0f0f0;
    }

    /* スマホメニュー内検索 */
    .menu-search {
        padding: 0.75rem 1rem;
        display: flex;
        align-items: center;
        gap: 0.5rem;
    }

    .menu-search input {
        flex: 1;
        height: 36px;
        border: 1px solid #e5e7eb;
        border-radius: 999px;
        padding: 0 1rem;
        font-size: 0.9rem;
        outline: none;
        background: #f9fafb;
        box-sizing: border-box;
    }

    .menu-search input:focus {
        border-color: #AFA9EC;
        background: #fff;
    }

    .menu-search-btn {
        width: 36px;
        height: 36px;
        background-color: #534AB7;
        border: none;
        border-radius: 999px;
        cursor: pointer;
        display: flex;
        align-items: center;
        justify-content: center;
        flex-shrink: 0;
    }

    .menu-search-btn svg {
        width: 14px;
        height: 14px;
        stroke: #fff;
    }
}