/* メニューボタン */
#custom-hamburger-btn {
    position: fixed;
    top: 9px;
    right: 20px;
    display: block;
    width: 40px;
    height: 56px;
    margin: 0;
    padding: 0;
    overflow: visible;
    appearance: none;
    -webkit-appearance: none;
    background-color: transparent;
    border: 0;
    border-radius: 0;
    cursor: pointer;
    z-index: 9999;
    box-shadow: none;
    font: inherit;
    transition: background-color 0.4s ease, height 0.4s ease;
}

/* スクロール時 */
#custom-hamburger-btn.is-scrolled {
    background-color: rgba(255, 255, 255,1.00);
}

/* メニュー展開時 */
#custom-hamburger-btn.is-active,
#custom-hamburger-btn.is-active.is-scrolled {
    height: 43px;
    background-color: transparent;
}

/* ボタン内の3本線 */
#custom-hamburger-btn > span {
    position: absolute;
    left: 50%;
    display: block;
    width: 43px;
    height: 2px;
    margin: 0;
    padding: 0;
    background-color: #111111;
    border-radius: 2px;
    transform: translateX(-50%);
    transition: top 0.4s ease, opacity 0.3s ease,
                transform 0.4s ease, background-color 0.4s ease;
}

/* 上・中央・下の線 */
#custom-hamburger-btn > span:nth-of-type(1) {
    top: 7px;
}

#custom-hamburger-btn > span:nth-of-type(2) {
    top: 22px;
}

#custom-hamburger-btn > span:nth-of-type(3) {
    top: 37px;
}

/* MENU文字 */
#custom-hamburger-btn .custom-menu-label {
    position: absolute;
    top: 44px;
    left: 50%;
    display: block;
    margin: 0;
    padding: 0;
    color: #111111;
    font-family: Arial, Helvetica, sans-serif;
    font-size: 12px;
    font-weight: 600;
    line-height: 1;
    letter-spacing: 0.06em;
    white-space: nowrap;
    transform: translateX(-50%);
    transition: opacity 0.25s ease;
}

/* メニュー展開時：上と中央の線で×を作る */
#custom-hamburger-btn.is-active > span:nth-of-type(1) {
    top: 21px;
    background-color: #ffffff;
    transform: translateX(-50%) rotate(45deg);
}

#custom-hamburger-btn.is-active > span:nth-of-type(2) {
    top: 21px;
    background-color: #ffffff;
    transform: translateX(-50%) rotate(-45deg);
}

#custom-hamburger-btn.is-active > span:nth-of-type(3) {
    top: 21px;
    opacity: 0;
    transform: translateX(-50%) scaleX(0);
}

#custom-hamburger-btn.is-active .custom-menu-label {
    opacity: 0;
    pointer-events: none;
}

#custom-hamburger-btn:focus-visible {
    outline: 2px solid #333333;
    outline-offset: 4px;
}

#custom-hamburger-btn.is-active:focus-visible {
    outline-color: #ffffff;
}

/* 全画面黒オーバーレイ */
#custom-overlay-menu {
    box-sizing: border-box;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    height: 100dvh;
    background-color: rgba(0, 0, 0, 0.8);
    z-index: 9998;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.4s ease, visibility 0.4s ease;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 72px 20px 28px;
}

/* オーバーレイ展開時 */
#custom-overlay-menu.is-active {
    opacity: 1;
    visibility: visible;
}

#custom-overlay-menu.is-overflowing { align-items: flex-start; }

@media (max-width: 640px) {
    #custom-overlay-menu { align-items: flex-start; }
}

/* WordPressメニューと子メニュー */
#custom-overlay-menu .custom-overlay-inner {
    width: min(100%, 420px);
    max-height: 100%;
    min-height: 0;
    margin: 0 auto;
    overflow-y: auto;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
}

#custom-overlay-menu .custom-overlay-logo {
    margin: 0 0 24px;
    text-align: center;
}

#custom-overlay-menu .custom-overlay-logo img {
    display: inline-block;
    width: min(240px, 100%);
    height: auto;
}

#custom-overlay-menu ul.custom-overlay-list,
#custom-overlay-menu ul.sub-menu {
    width: 100%;
    margin: 0;
    padding: 0;
    list-style: none;
}

#custom-overlay-menu ul.custom-overlay-list { width: min(100%, 360px); margin: 0 auto; }
#custom-overlay-menu li { position: relative; margin: 0; border-bottom: 1px solid rgba(255, 255, 255, .4); }
#custom-overlay-menu ul.custom-overlay-list > li:first-child { border-top: 1px solid rgba(255, 255, 255, .4); }

#custom-overlay-menu.orc-mobile-menu--no-lines li,
#custom-overlay-menu.orc-mobile-menu--no-lines ul.custom-overlay-list > li:first-child { border: 0; }

#custom-overlay-menu li > a {
    display: block;
    min-height: 38px;
    padding: 16px 52px 12px 16px;
    color: #fff;
    text-decoration: none;
    text-align: left;
    font-family: "Yu Mincho", "YuMincho", "Hiragino Mincho ProN", serif;
    font-size: 21px;
    line-height: 1.4;
    letter-spacing: .08em;
    overflow-wrap: anywhere;
    transition: opacity .3s ease;
}

#custom-overlay-menu.orc-mobile-menu--font-meiryo li > a {
    font-family: "メイリオ", Meiryo, sans-serif;
}

#custom-overlay-menu.orc-mobile-menu--font-yu-gothic li > a {
    font-family: "游ゴシック", "Yu Gothic", YuGothic, "Hiragino Kaku Gothic ProN", sans-serif;
}

#custom-overlay-menu.orc-mobile-menu--font-yu-mincho li > a {
    font-family: "游明朝", "Yu Mincho", YuMincho, "Hiragino Mincho ProN", serif;
}

#custom-overlay-menu li > a:hover { opacity: .7; }
#custom-overlay-menu a:focus-visible,
#custom-overlay-menu .custom-submenu-toggle:focus-visible { outline: 2px solid #fff; outline-offset: -3px; }

#custom-overlay-menu .custom-submenu-toggle {
    position: absolute;
    top: 0;
    right: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 50px;
    min-height: 52px;
    padding: 0;
    border: 0;
    color: #fff;
    background: transparent;
    font-size: 17px;
    cursor: pointer;
}

#custom-overlay-menu .custom-submenu-toggle span {
    display: block;
    transition: transform .2s ease;
}

#custom-overlay-menu .custom-submenu-toggle[aria-expanded="true"] span { transform: rotate(-90deg); }
#custom-overlay-menu ul.sub-menu[hidden] { display: none !important; }
#custom-overlay-menu ul.sub-menu:not([hidden]) { display: block !important; }
#custom-overlay-menu ul.sub-menu { padding: 0 0 8px 14px; }
#custom-overlay-menu ul.sub-menu li:last-child { border-bottom: 0; }
#custom-overlay-menu ul.sub-menu li > a { min-height: 44px; padding-top: 10px; padding-bottom: 10px; font-size: 17px; }

@media (max-width: 480px) {
    #custom-overlay-menu { padding-right: 16px; padding-left: 16px; }
    #custom-overlay-menu li > a { font-size: 19px; }
    #custom-overlay-menu ul.sub-menu li > a { font-size: 16px; }
}

@media (prefers-reduced-motion: reduce) {
    #custom-overlay-menu .custom-submenu-toggle span { transition: none; }
}
