
/* ========================================
   StudyEG - Related Posts
======================================== */

.eg-related-posts {
    position: relative;
    width: 100%;
    padding: 65px 0 75px;
    background: #ffffff;
    direction: rtl;
    font-family: 'Tajawal', sans-serif;
    overflow: hidden;
    box-sizing: border-box;
}

.eg-related-posts *,
.eg-related-posts *::before,
.eg-related-posts *::after {
    box-sizing: border-box;
}

.eg-related-container {
    width: 100%;
    max-width: 1340px;
    margin: 0 auto;
}

/* ========================================
   Section Heading
======================================== */

.eg-related-heading {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 20px;
    margin-bottom: 30px;
}

.eg-related-eyebrow {
    display: inline-block;
    margin-bottom: 10px;
    color: #B4843B;
    font-size: 14px;
    font-weight: 700;
}

.eg-related-heading h2 {
    margin: 0 0 10px;
    color: #68451E;
    font-family: 'Alexandria', sans-serif;
    font-size: 27px;
    font-weight: 700;
    line-height: 1.6;
}

.eg-related-heading p {
    margin: 0;
    color: #77716a;
    font-size: 16px;
    line-height: 1.8;
}

/* ========================================
   All Articles Link
======================================== */

.eg-related-all {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 9px;
    flex-shrink: 0;
    padding: 11px 17px;
    color: #80501D;
    background: #fffaf2;
    border: 1px solid #eee1cd;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 700;
    text-decoration: none;
    transition: all 0.25s ease;
}

.eg-related-all svg {
    width: 17px;
    height: 17px;
    transition: transform 0.25s ease;
}

.eg-related-all:hover {
    color: #ffffff;
    background: #80501D;
    border-color: #80501D;
}

.eg-related-all:hover svg {
    transform: translateX(-4px);
}

/* ========================================
   Related Posts Grid
======================================== */

.eg-related-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 25px 20px;
}

/* ========================================
   Article Card
======================================== */

.eg-related-card {
    display: flex;
    flex-direction: column;
    min-width: 0;
    height: 100%;
    background: #ffffff;
    border: 1px solid #eee9e1;
    border-radius: 13px;
    overflow: hidden;
    transition: transform 0.3s ease,
                box-shadow 0.3s ease,
                border-color 0.3s ease;
}

.eg-related-card:hover {
    transform: translateY(-5px);
    border-color: #e3d2b8;
    box-shadow: 0 12px 28px rgba(104, 69, 30, 0.10);
}

/* ========================================
   Article Image
======================================== */

.eg-related-image {
    position: relative;
    display: block;
    width: 100%;
    aspect-ratio: 16 / 9;
    overflow: hidden;
    background: #f5eee3;
}

.eg-related-image img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.55s ease;
}

.eg-related-card:hover .eg-related-image img {
    transform: scale(1.06);
}

/* ========================================
   Article Category
======================================== */

.eg-related-category {
    position: absolute;
    right: 12px;
    bottom: 12px;
    padding: 6px 11px;
    color: #ffffff;
    background: rgba(104, 69, 30, 0.92);
    border-radius: 5px;
    font-size: 12px;
    font-weight: 700;
    line-height: 1.5;
}

/* ========================================
   Article Information
======================================== */

.eg-related-info {
    display: flex;
    flex: 1;
    flex-direction: column;
    align-items: flex-start;
    padding: 17px 17px 18px;
    min-height: 205px;
}

.eg-related-date {
    display: inline-block;
    margin-bottom: 9px;
    color: #b18a53;
    font-size: 13px;
    font-weight: 600;
}

.eg-related-info h3 {
    width: 100%;
    margin: 0 0 10px;
    color: #68451E;
    font-family: 'Alexandria', sans-serif;
    font-size: 16px;
    font-weight: 600;
    line-height: 1.8;
}

.eg-related-info h3 a {
    color: inherit;
    text-decoration: none;
    transition: color 0.2s ease;
}

.eg-related-info h3 a:hover {
    color: #B4843B;
}

.eg-related-info p {
    margin: 0 0 15px;
    color: #77716a;
    font-size: 14px;
    line-height: 1.8;
}

.eg-related-read {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    margin-top: auto;
    color: #80501D;
    font-size: 14px;
    font-weight: 700;
    text-decoration: none;
    transition: color 0.2s ease;
}

.eg-related-read svg {
    width: 16px;
    height: 16px;
    transition: transform 0.25s ease;
}

.eg-related-read:hover {
    color: #C99543;
}

.eg-related-read:hover svg {
    transform: translateX(-4px);
}

/* ========================================
   Tablet - 1050px
======================================== */

@media (max-width: 1050px) {
    .eg-related-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 22px 16px;
    }

    .eg-related-heading h2 {
        font-size: 25px;
    }
}

/* ========================================
   Small Tablet - 900px
======================================== */

@media (max-width: 900px) {
    .eg-related-posts {
        padding: 55px 22px 65px;
    }

    .eg-related-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 20px 16px;
    }

    .eg-related-info {
        padding: 15px 14px 17px;
    }

    .eg-related-info h3 {
        font-size: 15px;
    }
}

/* ========================================
   Mobile - 700px
======================================== */

@media (max-width: 700px) {
    .eg-related-posts {
        padding: 45px 16px 55px;
    }

    .eg-related-heading {
        align-items: flex-start;
        flex-direction: column;
        gap: 15px;
        margin-bottom: 23px;
    }

    .eg-related-eyebrow {
        margin-bottom: 7px;
        font-size: 12px;
    }

    .eg-related-heading h2 {
        margin-bottom: 7px;
        font-size: 21px;
        line-height: 1.7;
    }

    .eg-related-heading p {
        font-size: 14px;
        line-height: 1.8;
    }

    .eg-related-all {
        padding: 9px 13px;
        font-size: 13px;
    }

    .eg-related-grid {
        grid-template-columns: minmax(0, 1fr);
        gap: 18px;
    }

    .eg-related-card {
        width: 100%;
    }

    .eg-related-image {
        aspect-ratio: 16 / 9;
    }

    .eg-related-info {
        min-height: 0;
        padding: 15px 14px 17px;
    }

    .eg-related-date {
        margin-bottom: 7px;
        font-size: 12px;
    }

    .eg-related-info h3 {
        margin-bottom: 8px;
        font-size: 15px;
        line-height: 1.8;
    }

    .eg-related-info p {
        margin-bottom: 12px;
        font-size: 13px;
        line-height: 1.8;
    }

    .eg-related-read {
        font-size: 13px;
    }

    .eg-related-category {
        right: 10px;
        bottom: 10px;
        padding: 5px 9px;
        font-size: 11px;
    }
}

/* ========================================
   Small Mobile - 380px
======================================== */

@media (max-width: 380px) {
    .eg-related-posts {
        padding: 35px 12px 45px;
    }

    .eg-related-heading h2 {
        font-size: 19px;
    }

    .eg-related-heading p {
        font-size: 13px;
    }

    .eg-related-grid {
        gap: 15px;
    }

    .eg-related-info {
        padding: 13px 12px 15px;
    }

    .eg-related-info h3 {
        font-size: 14px;
    }

    .eg-related-info p {
        font-size: 12px;
    }

    .eg-related-category {
        right: 8px;
        bottom: 8px;
        padding: 4px 8px;
        font-size: 10px;
    }
}

/* ========================================
   Reduced Motion
======================================== */

@media (prefers-reduced-motion: reduce) {
    .eg-related-card,
    .eg-related-image img,
    .eg-related-all,
    .eg-related-all svg,
    .eg-related-info h3 a,
    .eg-related-read,
    .eg-related-read svg {
        transition: none;
    }

    .eg-related-card:hover {
        transform: none;
    }

    .eg-related-card:hover .eg-related-image img {
        transform: none;
    }
}
