
@charset "utf-8";

/* =================================================================
 * header-menu.css
 * 全ページ共通のヘッダーとナビゲーションメニューのスタイル
 * ================================================================= */

/* --------------------------------
 * header
 * -------------------------------- */
.header {
    height: 56px;
    width: 100%;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
    background-color: #fc9624;
    position: fixed;
    top: 0;
    left: 0;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: space-between; /* 子要素を両端に配置 */
    padding: 0 20px;
    box-sizing: border-box;
}

.header-left {
    display: flex;
    align-items: center;
}

.header-logo {
    height: 40px;
    transition: transform 0.3s ease, opacity 0.3s ease;
}

.header-logo:hover {
    transform: scale(1.1);
    opacity: 0.8;
}

.header-right {
    display: flex;
    align-items: center;
}

/* --------------------------------
 * PC Navigation
 * -------------------------------- */
.menu-items {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex; /* PCでは横並び */
}

.menu-item {
    position: relative;
    margin-left: 15px;
}

.menu-item > a {
    display: block;
    line-height: 56px;
    padding: 0 10px;
    color: #fff;
    text-decoration: none;
    transition: all 0.3s ease;
    font-size: 16px;
}

.menu-item > a:hover {
    font-weight: bold;
    transform: scale(1.05);
}

/* PC Submenu */
.submenu {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    background-color: #fc9624;
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
    z-index: 1001;
    min-width: 180px;
    list-style: none;
    padding: 5px 0;
    border-radius: 4px;
}

.menu-item:hover .submenu {
    display: block;
}

.submenu li a {
    display: block;
    padding: 10px 15px;
    color: #fff;
    text-decoration: none;
    line-height: 1.5;
    white-space: nowrap;
    font-size: 15px;
}

.submenu li a:hover {
    background-color: #f5a623;
}


/* --------------------------------
 * Mobile Navigation (Hamburger Menu)
 * -------------------------------- */
.menu-toggle {
    display: none; /* PCでは非表示 */
    width: 44px;
    height: 44px;
    position: relative;
    cursor: pointer;
    background: none;
    border: none;
    padding: 0;
    z-index: 1002;
}

.icon-bar {
    display: block;
    width: 24px;
    height: 3px;
    background-color: white;
    border-radius: 2px;
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    transition: all 0.3s ease;
}

.icon-bar:nth-child(1) {
    top: 14px;
}
.icon-bar:nth-child(2) {
    top: 21px;
}
.icon-bar:nth-child(3) {
    bottom: 14px;
}

/* Active state -> Close (X) icon */
.menu-toggle.is-active .icon-bar:nth-child(1) {
    top: 50%;
    transform: translate(-50%, -50%) rotate(45deg);
}
.menu-toggle.is-active .icon-bar:nth-child(2) {
    opacity: 0;
}
.menu-toggle.is-active .icon-bar:nth-child(3) {
    top: 50%;
    transform: translate(-50%, -50%) rotate(-45deg);
}


/* --------------------------------
 * Responsive Styles (Breakpoint: 923px)
 * -------------------------------- */
@media (max-width: 923px) {
    .header {
        padding: 0 15px;
    }

    .header-logo {
        height: 35px;
    }

    /* Hamburger menu button */
    .menu-toggle {
        display: block; /* モバイルで表示 */
    }

    /* PC menu items */
    .menu-items {
        display: none; /* モバイルでは非表示 */
        flex-direction: column;
        position: absolute;
        top: 56px; /* header height */
        left: 0;
        width: 100%;
        background-color: #fc9624;
        z-index: 999;
        overflow-y: auto;
        max-height: calc(100vh - 56px);
        padding: 10px 0;
    }

    .menu-items.is-open {
        display: flex; /* JSでクラスを付与して表示 */
    }

    .menu-item {
        width: 100%;
        margin-left: 0;
        text-align: center;
        border-bottom: 1px solid rgba(255, 255, 255, 0.2);
    }

    .menu-item:last-child {
        border-bottom: none;
    }

    .menu-item > a {
        padding: 15px 0;
        line-height: 1.5;
        font-size: 16px;
    }

    /* Mobile Submenu */
    .submenu {
        display: none; /* JSで開閉を制御 */
        position: static;
        box-shadow: none;
        background-color: rgba(0, 0, 0, 0.1);
        padding: 0;
        border-radius: 0;
        border-top: 1px solid rgba(255, 255, 255, 0.2);
    }
    
    .menu-item.is-open > .submenu {
        display: block;
    }

    .submenu li a {
        padding: 12px 20px;
        text-align: center;
    }

    /* Submenu indicator */
    .menu-item-has-children > a {
        position: relative;
        padding-right: 30px; /* Arrow space */
    }

    .menu-item-has-children > a::after {
        content: '▼';
        position: absolute;
        right: 15px;
        top: 50%;
        transform: translateY(-50%);
        font-size: 10px;
        transition: transform 0.3s;
    }

    .menu-item-has-children.is-open > a::after {
        transform: translateY(-50%) rotate(180deg); /* Arrow up */
    }
}
