/* ============================================================
   Arcensoft Show More - v1.1
   Elegant slide-down with cubic-bezier easing.
   Animation duration is configurable via --aes-anim-duration (default 550ms)
   set globally in :root by the admin settings.
   ============================================================ */

.aes-showmore {
    position: relative;
    margin: 0 0 1em 0;
}

/* --- Content wrapper --- */
.aes-showmore__content {
    position: relative;
    overflow: hidden;
    max-height: var(--aes-h-desktop, 180px);
    transition: max-height var(--aes-anim-duration, 550ms) cubic-bezier(0.22, 0.61, 0.36, 1);
    will-change: max-height;
}

/* Responsive heights via CSS variables */
@media (max-width: 1024px) {
    .aes-showmore__content {
        max-height: var(--aes-h-tablet, var(--aes-h-desktop, 180px));
    }
}

@media (max-width: 767px) {
    .aes-showmore__content {
        max-height: var(--aes-h-mobile, var(--aes-h-tablet, var(--aes-h-desktop, 180px)));
    }
}

/* --- Fade overlay (gradient) --- */
.aes-showmore__content::after {
    content: "";
    position: absolute;
    inset: auto 0 0 0;
    height: var(--aes-fade-height, 60px);
    background: linear-gradient(
        to bottom,
        rgba(255, 255, 255, 0) 0%,
        var(--aes-fade-color, #ffffff) 100%
    );
    pointer-events: none;
    opacity: 1;
    transition: opacity 0.4s ease;
}

/* --- Expanded state --- */
.aes-showmore.is-expanded .aes-showmore__content {
    max-height: var(--aes-full, 5000px);
}

.aes-showmore.is-expanded .aes-showmore__content::after {
    opacity: 0;
}

/* --- Short content : disable mechanics --- */
.aes-showmore.is-short .aes-showmore__content {
    max-height: none;
}

.aes-showmore.is-short .aes-showmore__content::after {
    display: none;
}

.aes-showmore.is-short .aes-showmore__btn {
    display: none;
}

/* --- Button --- */
.aes-showmore__btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-top: 16px;
    padding: 10px 22px;
    background: var(--aes-btn-bg, #1F4E79);
    color: var(--aes-btn-color, #ffffff);
    border: none;
    border-radius: var(--aes-btn-radius, 4px);
    font-size: 14px;
    font-weight: 500;
    font-family: inherit;
    line-height: 1.4;
    cursor: pointer;
    text-decoration: none;
    transition:
        background 0.25s ease,
        transform 0.15s ease,
        box-shadow 0.25s ease;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

.aes-showmore__btn:hover {
    background: var(--aes-btn-bg-hover, #163a5c);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.12);
}

.aes-showmore__btn:active {
    transform: translateY(1px);
    box-shadow: 0 1px 1px rgba(0, 0, 0, 0.1);
}

.aes-showmore__btn:focus-visible {
    outline: 2px solid var(--aes-btn-bg, #1F4E79);
    outline-offset: 2px;
}

/* --- Alignment --- */
.aes-showmore[data-align="center"] {
    text-align: center;
}

.aes-showmore[data-align="right"] {
    text-align: right;
}

/* --- Icon (chevron) --- */
.aes-showmore__icon {
    transition: transform var(--aes-anim-duration, 400ms) cubic-bezier(0.22, 0.61, 0.36, 1);
    flex-shrink: 0;
    display: inline-block;
    vertical-align: middle;
}

.aes-showmore.is-expanded .aes-showmore__icon {
    transform: rotate(180deg);
}

/* --- Reduced motion --- */
@media (prefers-reduced-motion: reduce) {
    .aes-showmore__content,
    .aes-showmore__icon,
    .aes-showmore__btn {
        transition: none !important;
    }
}

/* --- Print : show all content --- */
@media print {
    .aes-showmore__content {
        max-height: none !important;
        overflow: visible !important;
    }
    .aes-showmore__content::after {
        display: none !important;
    }
    .aes-showmore__btn {
        display: none !important;
    }
}
