/* ==========================================================================
   Wizarding Center — "بیشتر بخوانید" related posts redesign.
   Overrides the related-post plugin output (loaded after its CSS). RTL, Estedad.
   Markup: .related-post > .headline + .post-list > .item > (a.title + .thumb > a > img)
   ========================================================================== */

.related-post {
    margin: 44px 0 12px;
    direction: rtl;
    font-family: 'Estedad', sans-serif;
}

/* ---- Headline (repeated class beats the plugin's inline !important) ---- */
.related-post.related-post .headline {
    font-family: 'Estedad', sans-serif !important;
    font-size: 1.55rem !important;
    font-weight: 800 !important;
    color: #e7b24a !important;
    text-align: right !important;
    margin: 0 0 22px !important;
    padding: 0 0 12px !important;
    position: relative;
    line-height: 1.6 !important;
}

.related-post.related-post .headline::after {
    content: "";
    position: absolute;
    bottom: 0;
    right: 0;
    width: 64px;
    height: 3px;
    border-radius: 3px;
    background: linear-gradient(90deg, #e7b24a, rgba(231, 178, 74, 0));
}

/* ---- Grid (not applied to slider/carousel layout) ---- */
.related-post .post-list:not(.owl-carousel) {
    display: grid !important;
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 22px !important;
    width: 100% !important;
    margin: 0 !important;
    text-align: right !important;
    float: none !important;
}

/* ---- Card ---- */
.related-post .post-list .item {
    display: flex !important;
    flex-direction: column !important;
    width: auto !important;
    margin: 0 !important;
    padding: 0 !important;
    max-height: none !important;
    background: linear-gradient(160deg, rgba(45, 28, 52, 0.65), rgba(26, 16, 30, 0.88)) !important;
    border: 1px solid rgba(243, 169, 247, 0.14) !important;
    border-radius: 16px !important;
    overflow: hidden !important;
    box-shadow: 0 10px 26px rgba(0, 0, 0, 0.28) !important;
    transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease !important;
}

.related-post .post-list .item:hover {
    transform: translateY(-4px) !important;
    border-color: rgba(243, 169, 247, 0.5) !important;
    box-shadow: 0 16px 36px rgba(123, 58, 148, 0.35) !important;
}

/* ---- Thumbnail: fixed 16:9 box, proper crop, placed on top ---- */
.related-post .post-list .item .thumb {
    order: 1 !important;
    position: relative !important;
    width: 100% !important;
    height: 0 !important;
    padding-bottom: 56.25% !important; /* 16:9 — bulletproof aspect ratio */
    margin: 0 !important;
    max-height: none !important;
    overflow: hidden !important;
    background: rgba(0, 0, 0, 0.25);
}

.related-post .post-list .item .thumb a {
    position: absolute !important;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
    display: block !important;
    width: 100% !important;
    height: 100% !important;
}

.related-post .post-list .item .thumb img {
    position: absolute !important;
    top: 0;
    left: 0;
    width: 100% !important;
    height: 100% !important;
    object-fit: cover !important;
    object-position: center !important;
    display: block !important;
    margin: 0 !important;
    max-width: none !important;
    border-radius: 0 !important;
    transition: transform 0.4s ease !important;
}

.related-post .post-list .item:hover .thumb img {
    transform: scale(1.06) !important;
}

/* ---- Title: below the image, clamped to two lines ---- */
.related-post .post-list .item .title {
    order: 2 !important;
    display: -webkit-box !important;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden !important;
    margin: 0 !important;
    padding: 14px 16px 16px !important;
    font-family: 'Estedad', sans-serif !important;
    font-size: 1.02rem !important;
    font-weight: 700 !important;
    line-height: 1.85 !important;
    color: #f1e9f4 !important;
    text-align: right !important;
    text-decoration: none !important;
    transition: color 0.2s ease !important;
}

.related-post .post-list .item .title:hover,
.related-post .post-list .item:hover .title {
    color: #e7b24a !important;
}

/* Hide the per-item icon span the plugin can prepend to titles */
.related-post .post-list .item .title .icon {
    display: none !important;
}

/* ---- Excerpt (only if enabled in plugin settings) ---- */
.related-post .post-list .item .excerpt {
    order: 3 !important;
    margin: 0 !important;
    padding: 0 16px 16px !important;
    font-size: 0.9rem !important;
    line-height: 1.95 !important;
    color: #c4b5cb !important;
    text-align: right !important;
}

.related-post .post-list .item .excerpt .read-more {
    color: #e7b24a !important;
    font-weight: 600 !important;
}

/* ---- Responsive ---- */
@media (max-width: 640px) {
    .related-post .post-list:not(.owl-carousel) {
        grid-template-columns: 1fr !important;
        gap: 16px !important;
    }

    .related-post.related-post .headline {
        font-size: 1.3rem !important;
    }
}
