/**
 * Dorvan Read More – front-end styles
 *
 * Uses a CSS custom property (--drm-cutoff) set inline by JS
 * to define the precise collapse height for each container.
 */

/* ---- Collapsed state ---------------------------------------------------- */

.drm-collapsed {
    max-height: var(--drm-cutoff, 400px);
    overflow: hidden;

    /* Smooth expand transition */
    transition: max-height 0s;
}

.drm-expanded {
    /* Generous value to cover any article length */
    max-height: none;
    overflow: visible;
}

/* ---- Gradient overlay ---------------------------------------------------- */

.drm-overlay {
    position: relative;
    /*
     * Pull the overlay UP so it overlaps the bottom of the collapsed
     * container, creating the fade-out illusion.
     */
    margin-top: -120px;
    padding-top: 120px;
    background: linear-gradient(to bottom,
            transparent 0%,
            rgba(255, 255, 255, 0.65) 35%,
            rgba(255, 255, 255, 0.95) 65%,
            #ffffff 100%);
    text-align: center;
    z-index: 10;

    /* Prevent text selection of the gradient area above the button */
    pointer-events: none;
}

/* ---- "Read more" button -------------------------------------------------- */

.drm-button {
    pointer-events: auto;
    /* override the overlay's none */
    display: inline-flex;
    align-items: center;
    gap: 6px;

    margin-top: 8px;
    margin-bottom: 24px;

    padding: 10px 28px;

    background-color: #e02020;
    color: #ffffff;

    font-family: inherit;
    font-size: 0.95rem;
    font-weight: 700;
    line-height: 1.2;
    letter-spacing: 0.03em;
    text-transform: uppercase;

    border: none;
    border-radius: 4px;
    cursor: pointer;

    transition: background-color 0.2s ease, transform 0.1s ease;
}

.drm-button::after {
    content: '';
    display: inline-block;
    width: 0;
    height: 0;
    border-left: 5px solid transparent;
    border-right: 5px solid transparent;
    border-top: 6px solid #ffffff;
}

.drm-button:hover,
.drm-button:focus-visible {
    background-color: #b91c1c;
    outline: 2px solid #b91c1c;
    outline-offset: 3px;
}

.drm-button:active {
    transform: scale(0.97);
}

/* ---- Dark-background themes (optional override) -------------------------- */

@media (prefers-color-scheme: dark) {
    .drm-overlay {
        background: linear-gradient(to bottom,
                transparent 0%,
                rgba(18, 18, 18, 0.65) 35%,
                rgba(18, 18, 18, 0.95) 65%,
                #121212 100%);
    }
}