/* レスポンシブデザインの調整 */
@media (max-width: 768px) {
    .site-header {
        padding: 0.5rem 1rem;
        height: 50px;
    }

    .site-title {
        font-size: 1.2rem;
    }

    .menu-toggle {
        display: block;
        position: absolute;
        top: 10px;
        right: 10px;
    }

    .main-navigation {
        display: none;
        position: fixed;
        top: 0;
        right: 0;
        width: 250px;
        height: 100vh;
        /* background-color: rgba(0, 0, 0, 0.9); */
        padding: 60px 20px 20px;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
    }

    .main-navigation.toggled {
        display: block;
    }

    .main-navigation ul.main-menu {
        flex-direction: column;
    }

    .main-navigation li {
        margin: 0 0 15px 0;
    }

    .main-navigation a {
        display: block;
        padding: 10px;
        font-size: 1.1rem;
        color: #ffffff;
    }

    .main-navigation ul.sub-menu {
        position: static;
        display: none;
        padding: 0.5rem 0 0.5rem 1rem;
    }

    .main-navigation li:hover > ul.sub-menu {
        display: none;
    }

    .main-navigation li.menu-item-has-children.active > ul.sub-menu {
        display: block;
    }

    .hero-title {
        font-size: 2rem;
    }

    .hero-subtitle {
        font-size: 1.2rem;
    }

    .hero-section {
        position: fixed;
        top: 50px;
        left: 0;
        right: 0;
        height: calc(100vh - 50px);
        width: 100%;
        overflow: hidden;
        z-index: 1;
        will-change: transform;
        transform: translateZ(0);
        -webkit-backface-visibility: hidden;
        backface-visibility: hidden;
        display: flex;
        flex-direction: column;
        justify-content: space-between;
        padding: 2rem 0;
        background-image: var(--hero-background-image);
        background-size: cover;
        background-position: center;
        background-repeat: no-repeat;
    }

    .hero-content {
        position: relative;
        top: auto;
        left: auto;
        transform: none !important;
        width: 90%;
        max-width: 600px;
        margin: 0 auto;
        z-index: 5;
        will-change: opacity;
        -webkit-backface-visibility: hidden;
        backface-visibility: hidden;
        text-align: center;
    }

    .hero-section .hero-navigation {
        position: relative;
        bottom: auto;
        left: 0;
        width: 100%;
        /* background-color: rgba(0, 0, 0, 0.5); */
        padding: 10px 0;
        z-index: 15;
        opacity: 1 !important;
        visibility: visible !important;
        display: flex !important;
        justify-content: center;
        align-items: center;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        transform: translateZ(0);
        -webkit-backface-visibility: hidden;
        backface-visibility: hidden;
    }

    .hero-section .hero-navigation ul {
        display: flex;
        flex-direction: row;
        flex-wrap: nowrap;
        justify-content: space-between;
        padding: 0 15px;
        width: 100%;
        min-width: 100%;
    }

    .hero-section .hero-navigation li {
        margin: 0;
        flex: 1 1 0;
        min-width: 0;
    }

    .hero-section .hero-navigation a {
        font-size: 0.9rem;
        padding: 8px 5px;
        display: block;
        width: 100%;
        text-align: center;
        color: #ffffff;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .hero-section .hero-navigation .hero-menu .sub-menu {
        display: none;
    }

    .hero-section .hero-navigation .hero-menu > li.active > .sub-menu {
        display: block;
    }

    .main-content-wrapper {
        position: relative;
        z-index: 20;
        margin-top: 100vh;
        padding-top: 2rem;
        border-radius: 1rem 1rem 0 0;
        background-color: #ffffff;
        will-change: transform;
        transform: translateZ(0);
        -webkit-backface-visibility: hidden;
        backface-visibility: hidden;
    }

    .main-content-wrapper > *:first-child {
        padding-top: 30px;
    }

    .site-main,
    body.home .site-main {
        padding-top: 0 !important;
    }
}

/* 横幅が広い場合のスタイル */
@media (min-width: 1200px) {
    .hero-section .hero-navigation ul {
        justify-content: space-between;
        padding-left: 0;
        max-width: 1200px;
        margin: 0 auto;
    }

    .hero-section .hero-navigation li {
        margin: 0;
        flex: 1 1 0;
    }
}

/* 縦長の画面に対する調整 */
@media (max-height: 600px) and (max-width: 768px) {
    .hero-section {
        min-height: 100vh;
        padding: 1rem 0;
    }

    .hero-title {
        font-size: 1.5rem;
    }

    .hero-subtitle {
        font-size: 1rem;
    }
}

/* スクロールバーのカスタマイズ（オプション） */
.hero-section .hero-navigation::-webkit-scrollbar {
    height: 3px;
}

.hero-section .hero-navigation::-webkit-scrollbar-thumb {
    background-color: rgba(255, 255, 255, 0.3);
    border-radius: 3px;
}

.hero-section .hero-navigation::-webkit-scrollbar-track {
    /* background-color: rgba(0, 0, 0, 0.1); */
}

/* アニメーションの最適化 */
@media (max-width: 768px) {
    .hero-section,
    .hero-content,
    .hero-section .hero-navigation,
    .main-content-wrapper {
        transition: opacity 0.2s cubic-bezier(0.25, 0.1, 0.25, 1);
    }
}

/* デスクトップ表示でのスタイル */
@media (min-width: 769px) {
    .hero-section,
    .hero-content,
    .hero-section .hero-navigation,
    .main-content-wrapper {
        transition: transform 0.2s cubic-bezier(0.25, 0.1, 0.25, 1), opacity 0.2s cubic-bezier(0.25, 0.1, 0.25, 1);
    }

    .main-content-wrapper {
        transition: transform 0.3s ease, opacity 0.3s ease;
    }

    .hero-section {
        display: flex;
        flex-direction: column;
        justify-content: space-between;
        padding: 4rem 0 2rem;
        height: 100vh;
        background-image: var(--hero-background-image);
        background-size: cover;
        background-position: center;
        background-repeat: no-repeat;
    }

    .hero-content {
        text-align: center;
        margin-bottom: 2rem;
    }

    .hero-title {
        font-size: 3.5rem;
        margin-bottom: 1rem;
    }

    .hero-subtitle {
        font-size: 1.8rem;
        margin-bottom: 2rem;
    }

    .hero-section .hero-navigation {
        width: 100%;
        /* background-color: rgba(0, 0, 0, 0.5); */
        padding: 15px 0;
    }

    .hero-section .hero-navigation ul {
        display: flex;
        justify-content: space-between;
        padding-left: 0;
        max-width: 1200px;
        margin: 0 auto;
    }

    .hero-section .hero-navigation li {
        margin: 0;
        flex: 1 1 0;
        max-width: none;
    }

    .hero-section .hero-navigation a {
        font-size: 1rem;
        padding: 10px 5px;
        display: block;
        width: 100%;
        text-align: center;
        color: #ffffff;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }
}