.custom-section {
    background-color: rgb(var(--color-background));
}

.custom-section .block-heading,
.custom-section .subheading {
    width: 100%;
}

.custom-section .subheading,
.custom-section .rte {
    word-break: break-word;
}


/* =========================================================
   MYSH CUSTOM SECTION — MOBILE SWIPE

   仅当后台开启：
   “移动端左右滑动”

   PC：
   完全保持原来的 1:2 / 1:2:1 / 2列 / 3列布局

   MOBILE ≤ 959px：
   每个直接子 Group 变成横向滑动卡片
   ========================================================= */

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

    .custom-section.custom-section--mobile-swipe {
        flex-direction: row !important;
        flex-wrap: nowrap !important;
        justify-content: flex-start !important;

        /*
     * 卡片之间留少量间距。
     */
        column-gap: 12px !important;
        row-gap: 0 !important;

        /*
     * 开启手机端横向滚动。
     */
        overflow-x: auto !important;
        overflow-y: hidden !important;

        /*
     * 类似 Carousel 的吸附体验。
     */
        scroll-snap-type: x mandatory;
        scroll-behavior: smooth;

        /*
     * iPhone / Safari 原生惯性滚动。
     */
        -webkit-overflow-scrolling: touch;

        /*
     * 减少横向滑动时对外层页面的干扰。
     */
        overscroll-behavior-inline: contain;

        /*
     * 隐藏滚动条。
     */
        scrollbar-width: none;
        -ms-overflow-style: none;
    }


    .custom-section.custom-section--mobile-swipe::-webkit-scrollbar {
        display: none;

        width: 0;
        height: 0;
    }


    /*
   * 只处理 Custom Section 的直接子 Group。
   *
   * 不修改 Group 内部嵌套的：
   * 图片 / 标题 / Rich Text / Button / 二级 Group 等。
   */
    .custom-section.custom-section--mobile-swipe>.block-group {
        /*
     * 手机端每张约占当前容器 86%。
     *
     * 好处：
     * 第一张不会挤压；
     * 右边会露出下一张一小部分；
     * 用户自然知道还可以继续横滑。
     */
        flex: 0 0 86% !important;

        width: 86% !important;
        min-width: 86% !important;
        max-width: 86% !important;

        /*
     * 横滑后自动吸附到每张卡片开头。
     */
        scroll-snap-align: start;
        scroll-snap-stop: normal;
    }

}