/* Read More Feature for Elementor Text Editor */
.readmore-box {
    position: relative;
    overflow: hidden;
    transition: max-height 0.6s cubic-bezier(0.4, 0, 0.2, 1); /* smooth expand/collapse */
}

/* Initial state - collapsed */
.readmore-box:not(.expanded) {
    max-height: 10em; /* Adjust height as needed */
}

/* Gradient overlay for collapsed state */
.readmore-box:not(.expanded)::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 80px; /* lebih tinggi biar efek fading natural */
    background: linear-gradient(
        to bottom,
        rgba(255, 255, 255, 0) 0%,
        rgba(255, 255, 255, 0.3) 40%,
        rgba(255, 255, 255, 0.7) 70%,
        rgba(255, 255, 255, 1) 100%
    );
    pointer-events: none; /* biar klik bisa tembus */
    transition: opacity 0.4s ease-in-out;
}

/* Expanded state */
.readmore-box.expanded {
    max-height: none !important;
}

.readmore-box.expanded::after {
    opacity: 0;
    visibility: hidden;
}

/* Read More Link */
.readmore-toggle {
    display: block;
    margin-top: 10px;
    color: #0073aa !important;
    text-decoration: none !important;
    cursor: pointer !important;
    font-size: 13px !important;
    padding: 0 !important;
    background: none !important;
    border: none !important;
    text-align: left;
    width: 100%;
    transition: color 0.3s ease;
}

.readmore-toggle:hover {
    color: #00a0d2 !important;
    text-decoration: underline !important;
}

/* Base font size for paragraphs and direct text in readmore-box */
.readmore-box > p,
.readmore-box > div > p,
.readmore-box > :not(.readmore-toggle) {
    font-size: 14px !important;
    line-height: 1.6;
    margin: 0 0 10px 0;
}

/* Hide the original content's bottom margin when collapsed */
.readmore-box:not(.expanded) > *:last-child {
    margin-bottom: 0;
    padding-bottom: 20px; /* Space for the gradient */
}
