﻿/*
 * ExFoods - Style 1 Mobile Card Improvements
 * 
 * Purpose:
 * - Better control over card height on small screens for Style 1 (exstyle-1)
 * - Title limited to 3 lines max (with ellipsis)
 * - Image height capped so it doesn't dominate
 * - Price and buttons protected and always visible
 * - Card can grow as needed without becoming excessively tall
 * 
 * Use with the auto-enqueue system or enqueue manually after the main plugin styles.
 */

@media (max-width: 768px) {

    /* Target Style 1 cards */
    .ast-article-single .ex-fdlist.style-1 .exstyle-1 {
        display: flex;
        flex-direction: column;
    }

    /* Control image height (the usual culprit for tall cards) */
    .ast-article-single .ex-fdlist.style-1 .exstyle-1-image {
        max-height: 150px;
        overflow: hidden;
        flex-shrink: 0;
    }

    .ast-article-single .ex-fdlist.style-1 .exstyle-1-image img {
        width: 100%;
        height: 100%;
        object-fit: cover;
    }

    /* Make the caption area flexible */
    .ast-article-single .ex-fdlist.style-1 .exstyle-1 figcaption {
        display: flex;
        flex-direction: column;
        flex: 1;
        min-height: 0;
        padding: 10px;
    }

    /* Title - max 3 lines with ellipsis */
    .ast-article-single .ex-fdlist.style-1 .exstyle-1 figcaption h3 {
        display: -webkit-box;
        -webkit-line-clamp: 3;
        -webkit-box-orient: vertical;
        overflow: hidden;
        text-overflow: ellipsis;
        flex-shrink: 0;
        margin: 0 0 6px 0;
        padding: 0;
    }

    /* Price and button area - pushed to bottom, always visible */
    .ast-article-single .ex-fdlist.style-1 .exstyle-1 figcaption h5,
    .ast-article-single .ex-fdlist.style-1 .exstyle-1 .exbt-inline,
    .ast-article-single .ex-fdlist.style-1 .exstyle-1 .exwoofood-woocommerce {
        margin-top: auto;
        flex-shrink: 0;
    }
}
