/**
 * iOS Scroll Fix for TOP Page
 * TOPページのスクロール問題を修正するためのCSS
 */

/* iOS Safari用のスクロール最適化 */
@supports (-webkit-touch-callout: none) {
    /* iOS Safari検出 */
    
    /* new-info-list内の要素のスクロール最適化 */
    .new-info-list {
        -webkit-overflow-scrolling: auto; /* touchを使わない */
        transform: translateZ(0); /* ハードウェアアクセラレーション */
    }
    
    .new-info-list ul {
        transform: translateZ(0);
        backface-visibility: hidden;
    }
    
    .new-info-list ul li {
        transform: translateZ(0);
        will-change: auto; /* will-changeを無効化 */
        position: relative;
        z-index: 1;
    }
    
    /* FAQセクションの最適化 */
    .faq-section {
        transform: translateZ(0);
        -webkit-overflow-scrolling: auto;
    }
    
    /* footnavセクションの最適化 */
    .footnav-section {
        transform: translateZ(0);
        position: relative;
        z-index: 1;
    }
    
    /* footer-sectionの最適化 */
    .footer-section {
        transform: translateZ(0);
        position: relative;
        z-index: 1;
    }
    
    /* 全体のスクロール最適化 */
    body.home-page {
        -webkit-overflow-scrolling: auto;
    }
    
    /* アニメーションの無効化 */
    .home-page * {
        animation-duration: 0s !important;
        transition-duration: 0s !important;
    }
}

/* iOSでのposition: fixedの問題を回避 */
@media only screen and (max-width: 767px) {
    @supports (-webkit-touch-callout: none) {
        /* scroll-favorite-count-boxの固定を解除 */
        #scroll-favorite-count-box {
            position: absolute !important;
        }
        
        /* モーダル系の要素も調整 */
        #modal-mask,
        #modal-modal,
        #wpcf7-modal {
            position: absolute !important;
            -webkit-overflow-scrolling: auto;
        }
    }
}

/* 高速スクロール時の再描画を抑制 */
@media only screen and (max-width: 767px) {
    .home-page .new-info-list ul li {
        min-height: auto !important;
        height: auto !important;
    }
    
    /* matchHeightで設定される高さを上書き */
    .home-page .new-info-list ul li[style*="height"] {
        height: auto !important;
    }
}