/**
 * ========================================
 * Navigation Menu Styles (New Version)
 * ハンバーガーメニュー完全版
 * ========================================
 */

/* ========================================
 * ハンバーガーメニューボタン
 * ======================================== */

.rain_hamburger-menu {
    position: fixed;
    top: 2%;
    right: 2%;
    z-index: 99999;
    /* 最前面に表示 */
}

.rain_menu-icon {
    position: relative;
    width: 40px;
    height: 40px;
    background: rgb(105, 140, 177);
    border: none;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.3s ease;
}

.rain_menu-icon:hover {
    transform: scale(1.05);
}

/* ハンバーガーアイコン（2本線） */
#rain_icon {
    display: block;
    width: 17px;
    height: 1px;
    background-color: #fff;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, calc(-50% + 4px));
    /* 2本線の中心を円の中心に */
    transition: all 0.3s ease-in-out;
}

#rain_icon::before {
    content: "";
    position: absolute;
    left: 0;
    top: -8px;
    width: 100%;
    height: 1px;
    background-color: #fff;
    transition: all 0.3s ease-in-out;
}

/* クロス状態（メニューオープン時） */
#rain_icon.cross {
    background-color: transparent;
    transform: translate(-50%, -50%);
    /* X状態では通常のセンタリングに戻す */
}

#rain_icon.cross::before {
    top: 0;
    transform: rotate(45deg);
}

/* クロスの下側の線（元の線を回転） */
#rain_icon.cross::after {
    content: "";
    position: absolute;
    left: 0;
    top: 0;
    width: 100%;
    height: 1px;
    background-color: #fff;
    transform: rotate(-45deg);
    transition: all 0.3s ease-in-out;
}

/* ========================================
 * メニューコンテンツ
 * ======================================== */

.rain_menu-content {
    position: fixed;
    top: 0;
    right: 0;
    left: 0;
    margin: 0 auto;
    width: 400px;
    height: 100vh;
    background: linear-gradient(90deg, rgb(217 235 255 / 95%) 0%, rgba(255, 255, 255, 0.95) 100%);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.4s ease, visibility 0.4s ease;
    overflow-y: auto;
    overflow-x: hidden;
    -webkit-overflow-scrolling: touch;
    /* スマホでスムーズスクロール */
    overscroll-behavior: contain;
    /* スクロールの境界でバウンスしない */
    touch-action: pan-y;
    /* 縦方向のタッチスクロールを許可 */
    z-index: 99998;
    /* ハンバーガーメニューより下に */
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
}

/* フォント読み込み中はメニューテキストを非表示 */
.wf-loading .rain_menu-content {
    opacity: 0 !important;
    visibility: hidden !important;
}

.rain_menu-content.visible {
    opacity: 1;
    visibility: visible;
}

@media only screen and (max-width: 500px) {
    .rain_menu-content {
        margin: 0 auto;
        width: 100% !important;
        overflow-y: auto;
    }
}

/* スクロールバーのスタイリング */
.rain_menu-content::-webkit-scrollbar {
    width: 6px;
}

.rain_menu-content::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.1);
}

.rain_menu-content::-webkit-scrollbar-thumb {
    background: rgba(100, 120, 150, 0.3);
    border-radius: 3px;
}

.rain_menu-content::-webkit-scrollbar-thumb:hover {
    background: rgba(100, 120, 150, 0.5);
}

/* ========================================
 * メニューコンテナ
 * ======================================== */

/* フォント読み込み中は非表示 */
.wf-loading .rm_menu-container {
    opacity: 0;
}

/* フォント読み込み完了後に表示 */
.wf-active .rm_menu-container,
.wf-inactive .rm_menu-container {
    opacity: 1;
}

.rm_menu-container {
    width: 100%;
    height: 100%;
    max-height: 100vh;
    line-height: 1.6;
    font-family: "fot-tsukuardgothic-std", sans-serif;
    transition: opacity 1s ease-in-out;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    padding: 80px 0 40px 0;
    box-sizing: border-box;
}

/* ========================================
 * カテゴリリスト
 * ======================================== */

.rm_category-list {
    list-style: none;
    margin: 0;
    padding: 0;
    flex-shrink: 0;
}

.rm_category-item {
    transition: background-color 0.3s ease;
    /* border-bottom: 1px solid #ccc; */
    box-sizing: border-box;
    width: 90%;
    margin: 0 auto;
}

.rm_category-link {
    display: block;
    padding: 16px 32px;
    text-decoration: none;
    color: #2c2c2c;
    transition: padding-left 0.3s ease, background-color 0.2s ease;
}

/* メインテキスト */
.rm_category-main {
    display: block;
    font-size: 16px;
    font-weight: 500;
    letter-spacing: 0.08em;
    margin-bottom: 6px;
    color: #1a1a1a;
    text-transform: lowercase;
}

/* サブテキスト */
.rm_category-sub {
    display: block;
    font-size: 11px;
    color: #888888;
    letter-spacing: 0.05em;
    font-weight: 400;
}

/* ========================================
 * セカンダリーメニュー
 * ======================================== */

.rm_secondary-menu {
    margin-top: 20px;
    padding-top: 20px;
    flex-shrink: 0;
}

.rm_secondary-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.rm_secondary-item {
    transition: background-color 0.3s ease;
}

.rm_secondary-item:hover {
    background-color: rgba(220, 235, 255, 0.2);
}

.rm_secondary-link {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 12px 32px;
    text-decoration: none;
    color: #555555;
    font-size: 12px;
    font-weight: 400;
    letter-spacing: 0.12em;
    transition: color 0.3s ease, opacity 0.3s ease;
    text-transform: uppercase;
}

.rm_secondary-item:hover .rm_secondary-link {
    color: #2c2c2c;
}

/* インスタグラムアイコン */
.rm_instagram-icon {
    width: 18px;
    height: 18px;
    margin-right: 10px;
    flex-shrink: 0;
}

/* ソーシャルメディア項目 */
.rm_social-item {
    margin-top: 10px;
    padding-top: 10px;
}

.rm_social-link {
    color: #666666;
    text-transform: lowercase;
    font-size: 13px;
}

/* テキスト選択無効化 */
.rm_category-link,
.rm_secondary-link {
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
}

/* ========================================
 * レスポンシブデザイン
 * ======================================== */

/* スマートフォン向け */
@media only screen and (max-width: 500px) {

    .rm_category-link {
        padding: 15px 25px;
    }

    .rm_category-main {
        font-size: 15px;
        margin-bottom: 5px;
    }

    .rm_category-sub {
        font-size: 10px;
    }

    .rm_secondary-menu {
        margin-top: 30px;
        padding-top: 25px;
    }

    .rm_secondary-link {
        padding: 14px 24px;
        font-size: 11px;
    }

    .rm_instagram-icon {
        width: 16px;
        height: 16px;
        margin-right: 8px;
    }
}

/* タブレット向け */
@media (min-width: 501px) and (max-width: 768px) {
    .rm_menu-container {
        max-width: 500px;
    }

    .rm_category-main {
        font-size: 17px;
    }

    .rm_category-sub {
        font-size: 11px;
    }
}

/* 大画面向け */
@media (min-width: 1024px) {
    .rm_menu-container {
        max-width: 450px;
    }

    .rm_category-main {
        font-size: 17px;
    }

    .rm_category-sub {
        font-size: 12px;
    }

    .rm_secondary-link {
        font-size: 13px;
    }

    .rm_instagram-icon {
        width: 20px;
        height: 20px;
    }
}

/* ========================================
 * アニメーション
 * ======================================== */

@keyframes fadeInMenu {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.rain_menu-content.visible .rm_menu-container {
    animation: fadeInMenu 0.5s ease forwards;
}