/**
 * BPAG Collection SEO Frontend Styles
 */

.bpag-collection-description {
    margin: 20px 0 30px;
    position: relative;
}

.bpag-description-content {
    line-height: 1.6;
    color: #333;
    position: relative;
    overflow: hidden;
    max-height: 3.2em; /* Approximately 2 lines based on line-height */
    transition: max-height 0.5s ease-in-out;
}

.bpag-description-content.expanded {
    /* max-height set dynamically via JavaScript */
}

.bpag-description-content:not(.expanded)::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 1.6em;
    background: linear-gradient(to bottom, rgba(255, 255, 255, 0), rgba(255, 255, 255, 1));
    pointer-events: none;
}

.bpag-read-more {
    background: none;
    border: none;
    color: #0073aa;
    cursor: pointer;
    font-size: 14px;
    margin-top: 10px;
    padding: 5px 0;
    text-decoration: underline;
    transition: color 0.2s;
}

.bpag-read-more:hover {
    color: #005a87;
}

.bpag-read-more:focus {
    outline: 2px solid #0073aa;
    outline-offset: 2px;
}

/* Hide the button if content is short enough */
.bpag-collection-description.no-overflow .bpag-read-more {
    display: none;
}

.bpag-collection-description.no-overflow .bpag-description-content::after {
    display: none;
}

/* Bottom Description Styles */
.bpag-collection-bottom-description {
    margin: 40px 0 30px;
    padding-top: 30px;
    border-top: 1px solid #e0e0e0;
    position: relative;
}

.bpag-bottom-description-content {
    line-height: 1.6;
    color: #333;
    position: relative;
    overflow: hidden;
    max-height: 4.8em; /* Approximately 3 lines based on line-height */
    transition: max-height 0.5s ease-in-out;
}

.bpag-bottom-description-content.expanded {
    /* max-height set dynamically via JavaScript */
}

.bpag-bottom-description-content:not(.expanded)::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 1.6em;
    background: linear-gradient(to bottom, rgba(255, 255, 255, 0), rgba(255, 255, 255, 1));
    pointer-events: none;
}

.bpag-read-more-bottom {
    background: none;
    border: none;
    color: #0073aa;
    cursor: pointer;
    font-size: 14px;
    margin-top: 10px;
    padding: 5px 0;
    text-decoration: underline;
    transition: color 0.2s;
}

.bpag-read-more-bottom:hover {
    color: #005a87;
}

.bpag-read-more-bottom:focus {
    outline: 2px solid #0073aa;
    outline-offset: 2px;
}

/* Hide the button if content is short enough */
.bpag-collection-bottom-description.no-overflow .bpag-read-more-bottom {
    display: none;
}

.bpag-collection-bottom-description.no-overflow .bpag-bottom-description-content::after {
    display: none;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .bpag-description-content,
    .bpag-bottom-description-content {
        font-size: 14px;
    }
    
    .bpag-read-more,
    .bpag-read-more-bottom {
        font-size: 13px;
    }
}
