.navbar {
    display: flex;
    align-items: center;
    background-color: #002147;
    padding: 0 16px;
    justify-content: flex-start;
    height: 60px;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 1000;
    box-sizing: border-box; /* スクロールバーの影響を受けないように */
    overflow: hidden; /* 余計なはみ出しを防ぐ */
}

/* ロゴとタイトルを横並びにする */
.logo-title {
    display: flex;
    align-items: center;
    gap: 10px; /* ロゴとタイトルの間隔 */
    flex-grow: 3;
    margin-left: 0;
}

.navbar .logo {
    display: flex;
    align-items: center;
    flex-wrap: nowrap;
    color: #ffffff;
    font-size: 20px;
    font-weight: bold;
    text-decoration: none;
}

.navbar .logo img {
    height: 50px; /* 画像の高さを少し小さく */
    width: auto;
    margin-right: 10px;
    padding: 5px 0; /* 上下に余裕を持たせる */
}

#navbar-title {
    display: flex;
    align-items: center;
    color: #ffffff; /* 文字色を白にする */
    white-space: nowrap; /* タイトルが折り返されないようにする */
    font-weight: bold; /* フォントを太字にする */
    font-size: 1.5em; /* ナビゲーションバーの高さを考慮した少し大きめのサイズ */
}

.navbar .menu {
    display: flex;
    flex-flow: row;
    list-style-type: none;
    margin: 0;
    padding: 0;
    margin-left: auto;
}

.navbar li {
    border-right: 1px solid #bbbbbb;
}

.navbar li:last-child {
    border-right: none;
}

.navbar li a {
    display: block;
    color: #ffffff;
    text-align: center;
    padding: 14px 16px;
    text-decoration: none;
    transition: all .3s;
}

.navbar li a:hover:not(.active) {
    background-color: #1c2b3a; /* ロゴ背景と調和する色 */
}

.navbar .active {
    background-color: #2d4f6c; /* ロゴの背景と調和する色 */
}

.menu li a.active {
    font-weight: bold;
    color: #ff6600;
}

.menu-toggle {
    display: none;
    position: absolute;
    right: 10px;
    top: 10px;
    background: none;
    border: none;
    font-size: clamp(24px, 12vw, 36px); /* 画面サイズに応じて調整 */
    color: white;
    cursor: pointer;
    padding-right: 15px;
}

@media (max-width: 768px) {
    .navbar {
        flex-direction: row;
        align-items: center;
        height: auto;
        padding: 10px;
        position: fixed;
        top: 0;
        left: 0;
        width: 100vw; /* スクロールバーの影響を受けないように */
        z-index: 1000;
    }
    /* メニューの初期状態（閉じている） */
    .navbar .menu {
        display: block;
        max-height: 0;
        overflow: hidden;
        flex-direction: column;
        width: 100%;
        background-color: #002147;
        transition: max-height 0.3s ease-out;
    }

    /* メニューを開いたとき */
    .navbar .menu.active {
        max-height: 300px; /* 適切な高さに調整 */
    }
    .menu-toggle {
        display: block;
    }
}
