/* Energy Bartar News Archive Patch v1.1.1
 * فقط ظاهر فرانت آرشیو اخبار را پولیش می‌کند؛ محتوا و ساختار Elementor دست‌نخورده می‌ماند.
 */

body.eb-news-archive-polished .eb-news-card {
    transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}

@media (hover:hover) and (pointer:fine) {
    body.eb-news-archive-polished .eb-news-card:hover {
        transform: translateY(-3px);
        box-shadow: 0 16px 38px rgba(15, 59, 35, .08) !important;
    }
}

/* خبر ویژه: ارتفاع مصنوعی و فضای خالی اضافه را کم کن. */
body.eb-news-archive-polished .eb-news-feature {
    min-height: 0 !important;
    align-items: center !important;
}

body.eb-news-archive-polished .eb-news-feature img {
    max-height: 390px !important;
    object-fit: contain !important;
    object-position: center center !important;
}

/*
 * آخرین ردیف تک‌کارت:
 * در RTL باید کارت به ستون/لبه راست برود. در 1.1.0 دو مقدار logical برعکس عمل می‌کردند
 * (end و margin-inline-start:auto) و در بعضی ساختارهای Elementor کارت را وسط/چپ نگه می‌داشتند.
 */
@media (min-width: 981px) {
    body.eb-news-archive-polished .eb-news-orphan-single {
        justify-self: start !important;       /* inline-start در RTL = راست */
        grid-column-start: 1 !important;      /* خط 1 در grid RTL = سمت راست */
        margin-left: auto !important;          /* در block/flex کارت را به راست هل می‌دهد */
        margin-right: 0 !important;
        margin-inline-start: 0 !important;
        margin-inline-end: auto !important;
    }

    body.eb-news-archive-polished .eb-news-orphan-single-wrap {
        direction: rtl !important;
        text-align: right !important;
    }

    body.eb-news-archive-polished .eb-news-orphan-single-wrap.eb-news-orphan-flex-wrap {
        justify-content: flex-start !important;
        align-items: stretch;
    }

    body.eb-news-archive-polished .eb-news-orphan-single-wrap.eb-news-orphan-grid-wrap {
        justify-content: stretch !important;
    }

    /* اگر خود ردیف wrapper یک container معمولی باشد، تک کارت از مرکز خارج شود. */
    body.eb-news-archive-polished .eb-news-orphan-single-wrap > .eb-news-orphan-single,
    body.eb-news-archive-polished .eb-news-orphan-single-wrap .eb-news-orphan-single {
        float: none !important;
    }
}

/* ردیف دوکارت در صفحات بعد متعادل و بدون فاصله غیرعادی بماند. */
@media (min-width: 981px) {
    body.eb-news-archive-polished .eb-news-orphan-pair {
        align-self: stretch !important;
    }
}

/* پوسترهای عمودی و تصاویر با نسبت‌های مختلف کامل دیده شوند. */
body.eb-news-archive-polished .eb-news-card img {
    max-width: 100%;
}

body.eb-news-archive-polished .eb-news-card:not(.eb-news-feature) img {
    object-position: center center !important;
}

/* در موبایل چیدمان تک‌ستونه طبیعی بماند. */
@media (max-width: 980px) {
    body.eb-news-archive-polished .eb-news-orphan-single,
    body.eb-news-archive-polished .eb-news-orphan-pair {
        width: 100% !important;
        max-width: none !important;
        margin-inline: 0 !important;
    }
}
