/**
 * More Mobile - Option A : CSS + media query
 * Desktop : contenu complet visible, lien masqué
 * Mobile : contenu tronqué, dégradé + bouton toggle visible, extended masqué
 */

/* Marqueur <!--more--> (WordPress: span, Elementor: div) */
span[id^="more-"],
div[id^="more-"] {
    display: block;
    height: 0;
    line-height: 0;
    overflow: hidden;
    margin: 0;
    padding: 0;
}

/* Desktop : tout afficher, masquer le lien */
@media (min-width: 768px) {
    .more-mobile-link {
        display: none !important;
    }

    .more-mobile-fade {
        display: none !important;
    }

    .more-mobile-after {
        display: inline;
    }
}

/* Mobile : lien visible, extended masqué par défaut */
@media (max-width: 767px) {
    .more-wrapper {
        position: relative;
        display: block;
		scroll-margin-top: 100px;
    }

    .more-mobile-fade {
        display: block;
        height: 120px;
        margin-top: -120px;
        pointer-events: none;
        background: linear-gradient(to bottom, rgba(255, 255, 255, 0), rgba(255, 255, 255, 1));
    }

    .more-mobile-fade.expanded {
        display: none;
    }

    .more-mobile-link {
        display: block;
        width: 100%;
        margin: 16px 0 0;
        padding: 5px 25px;
        font-weight: 500;
        text-decoration: none;
        cursor: pointer;
        border: 2px solid var(--e-global-color-accent);
        color: var(--e-global-color-accent);
        line-height: 2;
        text-align: center;
    }

    .more-mobile-after {
        display: none;
    }

    .more-mobile-after.expanded {
        display: block;
    }

    .more-wrapper {
        display: block;
        position: relative;
        z-index: 2;
    }

    .more-wrapper .more-mobile-fade {
        position: absolute;
        bottom: 0;
        right: 0;
        left: 0;
        min-height: 300px;
        z-index: -1;
        background: linear-gradient(to bottom, rgba(255, 255, 255, 0) 0%, #f0f0ec 100%);
    }
    
    .more-wrapper.expanded {
        display: flex;
        flex-direction: column-reverse;
    }
    
    .more-wrapper .more-mobile-after.expanded {
        line-height: initial;
        height: auto;
    }
}