
/* =========================================================
   RELATED POSTS — Cinematic Hover Interaction
   ========================================================= */

.related {
    --accent: #fd513a;

    width: 80%;
    margin: 70px auto 30px;
    direction: rtl;

    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 18px;
}


/* =========================
   TITLE
========================= */

.related > h3 {
    grid-column: 1 / -1;

    margin: 0 0 12px;
    padding-right: 14px;

    position: relative;

    font-size: 23px;
    font-weight: 700;
    line-height: 1.7;
    color: #2f4e73;
}

.related > h3::before {
    content: "";

    position: absolute;
    right: 0;
    top: 50%;

    width: 4px;
    height: 26px;

    border-radius: 20px;
    background: var(--accent);

    transform: translateY(-50%);
}


/* =========================================================
   CARD
========================================================= */

.related .post-box-3 {
    position: relative;

    min-width: 0;
    height: 360px;

    overflow: hidden;

    border-radius: 20px;

    background: #111;

    isolation: isolate;

    box-shadow:
        0 8px 25px rgba(0,0,0,.06);

    transition:
        transform .65s cubic-bezier(.16,1,.3,1),
        box-shadow .65s cubic-bezier(.16,1,.3,1);
}


/* کارت در Hover کمی «نفس» می‌کشد */
.related .post-box-3:hover {
    transform: translateY(-8px) scale(1.012);

    box-shadow:
        0 25px 50px rgba(0,0,0,.15);
}


/* =========================================================
   IMAGE
========================================================= */

.related .post-box-3 > a:first-child {
    position: absolute;
    inset: 0;

    display: block;

    overflow: hidden;

    z-index: 1;
}

.related .post-box-3 img {
    width: 100%;
    height: 100%;

    display: block;

    object-fit: cover;

    transform:
        scale(1.01)
        translate3d(0,0,0);

    transition:
        transform 1s cubic-bezier(.16,1,.3,1),
        filter .8s ease;
}


/* حرکت اصلی تصویر */
.related .post-box-3:hover img {
    transform:
        scale(1.13)
        translate3d(-10px,-8px,0);

    filter:
        brightness(.72)
        saturate(1.08);
}


/* =========================================================
   DARK GRADIENT
========================================================= */

.related .post-box-3 > a:first-child::after {
    content: "";

    position: absolute;
    inset: 0;

    z-index: 2;

    background:
        linear-gradient(
            to top,
            rgba(0,0,0,.86) 0%,
            rgba(0,0,0,.48) 38%,
            rgba(0,0,0,.05) 75%
        );

    opacity: .72;

    transition:
        opacity .7s ease;
}

.related .post-box-3:hover > a:first-child::after {
    opacity: .94;
}


/* =========================================================
   LIGHT SWEEP
========================================================= */

.related .post-box-3::before {
    content: "";

    position: absolute;

    z-index: 5;

    top: -30%;
    right: -80%;

    width: 55%;
    height: 170%;

    background:
        linear-gradient(
            90deg,
            transparent,
            rgba(255,255,255,.16),
            transparent
        );

    transform: rotate(18deg);

    pointer-events: none;

    transition:
        right .9s cubic-bezier(.16,1,.3,1);
}

.related .post-box-3:hover::before {
    right: 130%;
}


/* =========================================================
   CONTENT
========================================================= */

.related .post-box-3 > a:last-child {
    position: absolute;

    z-index: 6;

    right: 0;
    left: 0;
    bottom: 10px;

    display: block;

    padding: 25px 22px 22px;

    text-decoration: none;

    transform:
        translateY(12px);

    transition:
        transform .65s cubic-bezier(.16,1,.3,1);
}


/* محتوای کارت کمی بالا می‌آید */
.related .post-box-3:hover > a:last-child {
    transform:
        translateY(0);
}


/* =========================================================
   TITLE
========================================================= */

.related .post-box-3 h2 {
    position: relative;

    margin: 0;

    padding-right: 0;

    color: #fff;

    font-size: 17px;
    font-weight: 700;

    line-height: 1.9;

    text-shadow:
        0 2px 12px rgba(0,0,0,.25);

    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;

    overflow: hidden;

    transform: translateY(8px);

    transition:
        transform .6s cubic-bezier(.16,1,.3,1),
        color .35s ease;
}

.related .post-box-3:hover h2 {
    transform: translateY(0);
    color: #fff;
}


/* =========================================================
   ACCENT LINE
========================================================= */

.related .post-box-3 > a:last-child::before {
    content: "";

    display: block;

    width: 0;
    height: 2px;

    margin-bottom: 13px;

    border-radius: 10px;

    background: var(--accent);

    transition:
        width .65s cubic-bezier(.16,1,.3,1);
}

.related .post-box-3:hover > a:last-child::before {
    width: 48px;
}


/* =========================================================
   ARROW
========================================================= */

.related .post-box-3 > a:last-child::after {
    content: "←";

    position: absolute;

    left: 22px;
    bottom: 24px;

    width: 34px;
    height: 34px;

    display: flex;
    align-items: center;
    justify-content: center;

    border: 1px solid rgba(255,255,255,.3);
    border-radius: 50%;

    color: #fff;

    font-family: Arial, sans-serif;
    font-size: 15px;

    opacity: 0;

    transform:
        translateX(12px)
        rotate(10deg);

    transition:
        opacity .4s ease,
        transform .6s cubic-bezier(.16,1,.3,1),
        background .35s ease,
        border-color .35s ease;
}

.related .post-box-3:hover > a:last-child::after {
    opacity: 1;

    transform:
        translateX(0)
        rotate(0deg);

    background: var(--accent);

    border-color: var(--accent);
}


/* =========================================================
   IMAGE TOP CORNER DETAIL
========================================================= */

.related .post-box-3 > a:first-child::before {
    content: "";

    position: absolute;

    z-index: 4;

    top: 18px;
    right: 18px;

    width: 8px;
    height: 8px;

    border-radius: 50%;

    background: var(--accent);

    box-shadow:
        0 0 0 0 rgba(253,81,58,.45);

    transition:
        box-shadow .5s ease,
        transform .5s cubic-bezier(.16,1,.3,1);
}

.related .post-box-3:hover > a:first-child::before {
    transform: scale(1.25);

    box-shadow:
        0 0 0 8px rgba(253,81,58,.12);
}


/* =========================================================
   TABLET
========================================================= */

@media (max-width: 1100px) {

    .related {
        grid-template-columns: repeat(3, 1fr);
        gap: 16px;
    }

    .related .post-box-3 {
        height: 340px;
    }
}

/* =========================================================
   MOBILE — MAX 2 CARDS PER ROW
========================================================= */

@media (max-width: 700px) {

    .related {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 12px;
    }

    .related .post-box-3 {
        height: 250px;
        width: 100%;
    }

    .related .post-box-3>a:last-child {
        padding: 15px 13px;
    }

    .related .post-box-3 h2 {
        font-size: 14px;
        line-height: 1.8;
    }
}


/* =========================================================
   SMALL MOBILE — STILL 2 COLUMNS
========================================================= */

@media (max-width: 460px) {

    .related {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 9px;
    }

    .related .post-box-3 {
        height: 225px;
    }

    .related .post-box-3>a:last-child {
        padding: 13px 11px;
    }

    .related .post-box-3 h2 {
        font-size: 12.5px;
        line-height: 1.8;
        -webkit-line-clamp: 3;
    }
}


/* =========================================================
   EXTRA SMALL — STILL 2 COLUMNS
========================================================= */

@media (max-width: 360px) {

    .related {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 7px;
    }

    .related .post-box-3 {
        height: 210px;
    }

    .related .post-box-3>a:last-child {
        padding: 11px 9px;
    }

    .related .post-box-3 h2 {
        font-size: 12px;
    }
}
/* =========================================================
   TOUCH DEVICES
========================================================= */

@media (hover: none) {

    .related .post-box-3:hover {
        transform: none;
    }

    .related .post-box-3:hover img {
        transform: scale(1.01);
        filter: none;
    }

    .related .post-box-3:hover > a:last-child {
        transform: translateY(12px);
    }

    .related .post-box-3:hover::before {
        right: -80%;
    }

    .related .post-box-3:hover > a:last-child::after {
        opacity: 0;
    }
}
@media (max-width: 700px) {

    .related {
        display: grid !important;
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
        width: 90% !important;
        gap: 12px !important;
    }

    .related .post-box-3 {
        width: auto !important;
        min-width: 0 !important;
        max-width: none !important;
        grid-column: auto !important;
    }

    .related>h3 {
        grid-column: 1 / -1 !important;
    }
}
/* =========================================================
   DESKTOP — SHOW ONLY 5
========================================================= */

@media (min-width: 1101px) {

    .related .related-post-6 {
        display: none;
    }

}


/* =========================================================
   TABLET + MOBILE — SHOW ALL 6
========================================================= */

@media (max-width: 1100px) {

    .related .related-post-6 {
        display: block;
    }

}