/* =========================================================
   YUDA CLINIC / iPhone LOWER PAGE SCROLL FIX v2
   2026-08-10

   目的：
   ・トップ以外のiPhoneスクロール改善を維持
   ・footer／固定下部CTAのデザインには一切触れない
   ・縦スクロールをブラウザ文書へ一本化
========================================================= */

@media screen and (max-width: 768px) {

    /* -----------------------------------------------------
       1. 下層ページの多重スクロール領域を解除
       横方向のクリップはhtmlだけが担当
    ----------------------------------------------------- */
    html {
        width: 100% !important;
        max-width: 100% !important;
        height: auto !important;
        min-height: 100% !important;
        overflow-x: hidden !important;
        overflow-y: auto !important;
        scroll-behavior: auto !important;
        background-attachment: scroll !important;
        -webkit-text-size-adjust: 100%;
        text-size-adjust: 100%;
    }

    @supports (overflow: clip) {
        html {
            overflow-x: clip !important;
        }
    }

    body {
        width: 100% !important;
        max-width: 100% !important;
        height: auto !important;
        min-height: 100% !important;
        max-height: none !important;
        overflow: visible !important;
        overflow-x: visible !important;
        overflow-y: visible !important;
        background-attachment: scroll !important;
        overscroll-behavior-x: none;
    }

    #wrapper,
    #container,
    #main {
        width: 100% !important;
        max-width: 100% !important;
        height: auto !important;
        min-height: 0 !important;
        max-height: none !important;
        overflow: visible !important;
        overflow-x: visible !important;
        overflow-y: visible !important;
        -webkit-overflow-scrolling: auto !important;
    }

    @supports (overflow: clip) {
        body,
        #wrapper,
        #container,
        #main {
            overflow-x: clip !important;
            overflow-y: visible !important;
        }
    }

    /* 旧テーマのPC表示切替用要素はスマホでは描画しない */
    #pc_hyouji {
        display: none !important;
    }

    /* -----------------------------------------------------
       2. 視差背景のみ停止
       footer・固定CTA・ヘッダーの見た目は変更しない
    ----------------------------------------------------- */
    [style*="background-attachment: fixed"],
    .parallax,
    [class*="parallax"] {
        background-attachment: scroll !important;
    }

    /* -----------------------------------------------------
       3. 横スクロールが必要な表だけ個別に維持
    ----------------------------------------------------- */
    .yk-table-wrap,
    .table-scroll,
    .yhc-table-scroll,
    .revision-table-wrap,
    .ydb_comparison_scroll,
    .ydi_table_scroll {
        overflow-x: auto !important;
        overflow-y: hidden !important;
        -webkit-overflow-scrolling: touch !important;
        overscroll-behavior-x: contain;
    }

    img,
    video,
    iframe {
        max-width: 100%;
    }

    img,
    video {
        height: auto;
    }
}
