/*=============================================
PAGE - PERSIAN VERSION WITH TOOLTIP
=============================================*/

.articles-page{

    padding: 140px 0;
    background: #F8FAFC;
    direction: rtl;
    font-family: 'Vazirmatn', sans-serif;

}

/*=============================================
HEADER
=============================================*/

.page-header{

    max-width: 760px;
    margin: auto;
    text-align: center;
    margin-bottom: 60px;

}

.page-header .section-tag{

    display: inline-block;
    padding: 8px 18px;
    border-radius: 999px;
    background: #eef5ff;
    color: var(--primary);
    font-size: .85rem;
    font-weight: 600;
    letter-spacing: 1px;
    margin-bottom: 18px;

}

.page-header h1{

    margin: 20px 0;
    font-family: 'Vazirmatn', sans-serif;

}

.page-header p{

    font-family: 'Vazirmatn', sans-serif;

}

/*=============================================
SEARCH
=============================================*/

.search-box{

    margin: 40px auto;
    max-width: 600px;

}

.search-box input{

    width: 100%;
    padding: 18px 24px;
    border-radius: 50px;
    border: 1px solid var(--border);
    font-size: 1rem;
    outline: none;
    font-family: 'Vazirmatn', sans-serif;
    text-align: right;

}

.search-box input::placeholder{

    font-family: 'Vazirmatn', sans-serif;
    text-align: right;

}

/*=============================================
FILTERS
=============================================*/

.filter-buttons{

    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 15px;
    margin: 50px 0 70px;

}

.filter-buttons button{

    padding: 12px 22px;
    border-radius: 40px;
    border: none;
    background: white;
    cursor: pointer;
    transition: .3s;
    font-family: 'Vazirmatn', sans-serif;
    font-size: 0.95rem;

}

.filter-buttons button:hover{

    background: var(--primary);
    color: white;

}

.filter-buttons .active{

    background: var(--primary);
    color: white;

}

/*=============================================
GRID
=============================================*/

.articles-grid{

    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 35px;

}

/*=============================================
CARD (Same as homepage but for articles page)
=============================================*/

.article-card{

    background: white;
    border-radius: 22px;
    overflow: hidden;
    border: 1px solid var(--border);
    transition: .35s;
    box-shadow: var(--shadow-sm);
    direction: rtl;
    font-family: 'Vazirmatn', sans-serif;

}

.article-card:hover{

    transform: translateY(-10px);
    box-shadow: var(--shadow-lg);

}

.article-card a{

    display: block;
    text-decoration: none;

}

.article-card img{

    width: 100%;
    height: 240px;
    object-fit: cover;
    transition: .4s;

}

.article-card:hover img{

    transform: scale(1.06);

}

.article-body{

    padding: 30px;
    position: relative;

}

.article-category{

    display: inline-block;
    padding: 7px 14px;
    border-radius: 50px;
    background: #edf4ff;
    color: var(--primary);
    font-size: .82rem;
    font-weight: 600;
    margin-bottom: 18px;
    font-family: 'Vazirmatn', sans-serif;

}

.article-body h3{

    margin-bottom: 18px;
    line-height: 1.35;
    transition: .3s;
    font-family: 'Vazirmatn', sans-serif;
    font-weight: 700;

}

.article-card:hover h3{

    color: var(--primary);

}

/* Description with tooltip */
.article-description-wrapper{

    position: relative;
    display: inline-block;
    width: 100%;

}

.article-description{

    margin-bottom: 25px;
    font-family: 'Vazirmatn', sans-serif;
    font-size: 0.95rem;
    line-height: 1.8;
    color: var(--text-light);
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    text-overflow: ellipsis;
    cursor: pointer;
    transition: color .3s ease;

}

.article-description:hover{

    color: var(--text);

}

/* Tooltip / Popover */
.article-description-tooltip{

    position: absolute;
    bottom: calc(100% + 12px);
    left: 50%;
    transform: translateX(-50%) scale(0.9);
    background: var(--secondary);
    color: white;
    padding: 18px 22px;
    border-radius: var(--radius-md);
    font-size: 0.9rem;
    line-height: 1.9;
    max-width: 380px;
    min-width: 280px;
    box-shadow: var(--shadow-lg);
    z-index: 100;
    font-family: 'Vazirmatn', sans-serif;
    text-align: right;
    opacity: 0;
    visibility: hidden;
    transition: all .25s cubic-bezier(0.4, 0, 0.2, 1);
    pointer-events: none;
    border: 1px solid rgba(255, 255, 255, 0.08);

}

/* Tooltip arrow */
.article-description-tooltip::after{

    content: '';
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    border: 8px solid transparent;
    border-top-color: var(--secondary);

}

/* Show tooltip on hover */
.article-description-wrapper:hover .article-description-tooltip{

    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) scale(1);

}

.read-more{

    color: var(--primary);
    font-weight: 600;
    font-family: 'Vazirmatn', sans-serif;
    display: inline-block;

}

.read-more a{

    text-decoration: none;
    color: inherit;
    transition: .3s;

}

.read-more a:hover{

    color: var(--primary-dark);

}

/*=============================================
PAGINATION
=============================================*/

.pagination{

    margin-top: 80px;
    display: flex;
    justify-content: center;
    gap: 15px;

}

.pagination button{

    padding: 12px 20px;
    border: none;
    background: white;
    border-radius: 12px;
    cursor: pointer;
    font-family: 'Vazirmatn', sans-serif;
    font-size: 0.95rem;

}

.pagination .current{

    background: var(--primary);
    color: white;

}

/*=============================================
RESPONSIVE
=============================================*/

@media(max-width:1100px){

    .articles-grid{

        grid-template-columns: repeat(2,1fr);

    }

}

@media(max-width:700px){

    .articles-grid{

        grid-template-columns: 1fr;

    }

    .filter-buttons{

        gap: 10px;

    }

    .filter-buttons button{

        padding: 10px 16px;
        font-size: 0.85rem;

    }

    .article-description-tooltip{

        max-width: 280px;
        min-width: 220px;
        font-size: 0.85rem;
        padding: 14px 18px;
        bottom: calc(100% + 10px);

    }

}

@media(max-width:480px){

    .article-description-tooltip{

        max-width: 220px;
        min-width: 180px;
        font-size: 0.8rem;
        padding: 12px 14px;
        bottom: calc(100% + 8px);

    }

}


/* Force Vazirmatn everywhere on this page */
.articles-page,
.articles-page * {
    font-family: 'Vazirmatn', 'Inter', sans-serif;
}

/* Make sure title and description look good */
.article-body h3 {
    font-weight: 700;
    line-height: 1.5;
    margin-bottom: 14px;
}

.article-body p {
    font-size: 0.95rem;
    line-height: 1.8;
    color: var(--text-light);
    margin-bottom: 20px;
}

.read-more {
    font-weight: 600;
    color: var(--primary);
}