/* ================================================================
   استایل‌های اصلی افزونه IELTS City
   ================================================================ */

/* ----- متغیرهای تم رنگی (سبز) ----- */
:root {
    --ielts-primary: #16a34a;
    --ielts-primary-dark: #12793a;
    --ielts-dark: #1a1a2e;
}

/* ----- آیکون‌های SVG داخلی (جایگزین Font Awesome) -----
   این آیکون‌ها به هیچ فونت یا CDN خارجی وابسته نیستند و در همه
   سیستم‌ها/مرورگرها نمایش داده می‌شوند. رنگشان از رنگ متن والد پیروی
   می‌کند (currentColor) تا با رنگ دکمه/متن اطراف هماهنگ باشد. */
.ielts-icon {
    width: 1em;
    height: 1em;
    display: inline-block;
    vertical-align: -0.125em;
    flex-shrink: 0;
}
.ielts-grid-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px 0;
}

.ielts-grid-header,
.ielts-slider-header,
.ielts-related-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 15px;
    margin-bottom: 25px;
}

.ielts-section-title {
    font-size: 24px;
    font-weight: 700;
    color: #1a1a2e;
    margin: 0;
}

.ielts-grid-view-all,
.ielts-slider-view-all,
.ielts-related-back {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: var(--ielts-primary);
    text-decoration: none;
    font-weight: 600;
    font-size: 15px;
    transition: all 0.3s;
    padding: 8px 18px;
    border: 2px solid var(--ielts-primary);
    border-radius: 8px;
}

.ielts-grid-view-all:hover,
.ielts-slider-view-all:hover,
.ielts-related-back:hover {
    background: var(--ielts-primary);
    color: #fff;
}

.ielts-grid-view-all .ielts-icon,
.ielts-slider-view-all .ielts-icon,
.ielts-related-back .ielts-icon {
    transition: transform 0.3s;
}

.ielts-grid-view-all:hover .ielts-icon,
.ielts-slider-view-all:hover .ielts-icon,
.ielts-related-back:hover .ielts-icon {
    transform: translateX(-5px);
}

.ielts-grid-row {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 30px;
}

/* ----- کارت مقالات ----- */
.ielts-card {
    background: #fff;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    transition: all 0.3s;
    display: flex;
    flex-direction: column;
    width: 100%;
    height: 100%;
}

.ielts-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.15);
}

.ielts-card-image {
    position: relative;
    height: 220px;
    overflow: hidden;
}

.ielts-card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s;
}

.ielts-card:hover .ielts-card-image img {
    transform: scale(1.05);
}

.ielts-card-category {
    position: absolute;
    top: 15px;
    right: 15px;
    background: #1a1a2e;
    color: #fff;
    padding: 4px 14px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
}

.ielts-card-content {
    padding: 20px 22px 22px;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.ielts-card-content h3 {
    font-size: 18px;
    font-weight: 700;
    margin: 0 0 10px 0;
    line-height: 1.4;
}

.ielts-card-content h3 a {
    color: #1a1a2e;
    text-decoration: none;
    transition: color 0.3s;
}

.ielts-card-content h3 a:hover {
    color: var(--ielts-primary);
}

.ielts-card-excerpt {
    color: #666;
    font-size: 14px;
    line-height: 1.7;
    flex: 1;
    margin: 0 0 15px 0;
}

.ielts-card-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: auto;
}

.ielts-card-date {
    color: #888;
    font-size: 13px;
}

.ielts-card-date .ielts-icon {
    margin-left: 5px;
}

.ielts-read-more {
    color: var(--ielts-primary);
    text-decoration: none;
    font-weight: 600;
    font-size: 14px;
    transition: color 0.3s;
}

.ielts-read-more .ielts-icon {
    margin-right: 6px;
    transition: transform 0.3s;
}

.ielts-read-more:hover {
    color: var(--ielts-primary-dark);
}

.ielts-read-more:hover .ielts-icon {
    transform: translateX(-5px);
}

/* ----- صفحه‌بندی ----- */
.ielts-pagination {
    grid-column: 1 / -1;
    text-align: center;
    margin-top: 30px;
}

.ielts-pagination a,
.ielts-pagination span {
    display: inline-block;
    padding: 8px 16px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    margin: 0 4px;
    color: #333;
    text-decoration: none;
    font-size: 14px;
    transition: all 0.3s;
}

.ielts-pagination a:hover {
    background: var(--ielts-primary);
    color: #fff;
    border-color: var(--ielts-primary);
}

.ielts-pagination .current {
    background: var(--ielts-primary);
    color: #fff;
    border-color: var(--ielts-primary);
}

.ielts-pagination .dots {
    border: none;
}

/* ================================================================
   اسلایدر
   ================================================================ */
.ielts-slider-wrapper {
    position: relative;
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px 0 40px;
    overflow: hidden;
}

.ielts-slider-wrapper:focus-visible {
    outline: 3px solid var(--ielts-primary);
    outline-offset: 4px;
}

.ielts-slider-container {
    display: flex;
    transition: transform 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    will-change: transform;
    width: 100%;
    touch-action: pan-y;
    /*
     * نکته مهم: سایت به‌صورت راست‌به‌چپ (rtl) است، اما محاسبه‌ی جابه‌جایی اسلایدها
     * در جاوااسکریپت بر اساس چیدمان چپ‌به‌راست انجام می‌شود (translateX منفی برای
     * رفتن به اسلاید بعدی). اگر این کانتینر جهت rtl را از صفحه به ارث ببرد، مرورگر
     * ترتیب چیدمان فرزندان فلکس را از راست به چپ معکوس می‌کند و در نتیجه با
     * جابه‌جایی، به‌جای اسلاید بعدی، فضای خالی/سفید نمایش داده می‌شود.
     * با ثابت نگه‌داشتن جهت این کانتینر روی ltr، ترتیب و محاسبات درست می‌ماند.
     */
    direction: ltr;
}

.ielts-slide {
    flex: 0 0 100%;
    flex-shrink: 0;
    max-width: 100%;
    padding: 0 15px;
    box-sizing: border-box;
    /* بازگرداندن جهت راست‌به‌چپ فقط برای محتوای داخل اسلاید */
    direction: rtl;
}

.ielts-slide-card {
    background: #fff;
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.1);
    display: flex;
    flex-direction: row;
    min-height: 320px;
    height: 100%;
}

.ielts-slide-image {
    flex: 0 0 45%;
    overflow: hidden;
}

.ielts-slide-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s;
}

/* جایگزین برای مقالاتی که تصویر شاخص ندارند، تا اسلاید خالی/سفید به نظر نرسد */
.ielts-slide-image-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
    color: rgba(255, 255, 255, 0.85);
    font-size: 48px;
}

.ielts-slide-card:hover .ielts-slide-image img {
    transform: scale(1.05);
}

.ielts-slide-content {
    flex: 1;
    padding: 30px 35px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.ielts-slide-category {
    display: inline-block;
    background: #1a1a2e;
    color: #fff;
    padding: 4px 16px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    margin-bottom: 12px;
    align-self: flex-start;
}

.ielts-slide-content h3 {
    font-size: 24px;
    font-weight: 700;
    margin: 0 0 12px 0;
    line-height: 1.3;
}

.ielts-slide-content h3 a {
    color: #1a1a2e;
    text-decoration: none;
    transition: color 0.3s;
}

.ielts-slide-content h3 a:hover {
    color: var(--ielts-primary);
}

.ielts-slide-excerpt {
    color: #666;
    font-size: 15px;
    line-height: 1.7;
    margin: 0 0 15px 0;
}

.ielts-slide-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
}

.ielts-slide-date {
    color: #888;
    font-size: 13px;
}

.ielts-slide-date .ielts-icon {
    margin-left: 5px;
}

.ielts-slide-read-more {
    color: var(--ielts-primary);
    text-decoration: none;
    font-weight: 600;
    font-size: 15px;
    transition: color 0.3s;
}

.ielts-slide-read-more .ielts-icon {
    margin-right: 6px;
    transition: transform 0.3s;
}

.ielts-slide-read-more:hover {
    color: var(--ielts-primary-dark);
}

.ielts-slide-read-more:hover .ielts-icon {
    transform: translateX(-5px);
}

/* دکمه‌های اسلایدر */
.ielts-slider-prev,
.ielts-slider-next {
    position: absolute;
    top: 55%;
    transform: translateY(-50%);
    width: 50px;
    height: 50px;
    background: rgba(255, 255, 255, 0.95);
    border: none;
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.15);
    transition: all 0.3s;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    color: #333;
}

.ielts-slider-prev:hover,
.ielts-slider-next:hover {
    background: var(--ielts-primary);
    color: #fff;
    transform: translateY(-50%) scale(1.05);
}

.ielts-slider-prev {
    right: 10px;
}

.ielts-slider-next {
    left: 10px;
}

/* نقطه‌های اسلایدر */
.ielts-slider-dots {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-top: 25px;
}

.ielts-slider-dots span {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: #ddd;
    cursor: pointer;
    transition: all 0.3s;
}

.ielts-slider-dots span.active {
    background: var(--ielts-primary);
    transform: scale(1.2);
}

/* ================================================================
   مقالات مرتبط
   ================================================================ */
.ielts-related-container {
    max-width: 1200px;
    margin: 30px auto 0;
    padding: 30px 0 20px;
    border-top: 3px solid #f0f0f0;
}

.ielts-related-title {
    font-size: 22px;
    font-weight: 700;
    color: #1a1a2e;
    margin: 0;
}

.ielts-related-row {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 25px;
}

.ielts-related-item {
    display: flex;
}

.ielts-related-card {
    background: #fff;
    border-radius: 14px;
    overflow: hidden;
    box-shadow: 0 3px 15px rgba(0, 0, 0, 0.07);
    transition: all 0.3s;
    display: flex;
    flex-direction: column;
    width: 100%;
    height: 100%;
}

.ielts-related-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.12);
}

.ielts-related-image {
    height: 160px;
    overflow: hidden;
}

.ielts-related-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.4s;
}

.ielts-related-card:hover .ielts-related-image img {
    transform: scale(1.05);
}

.ielts-related-content {
    padding: 18px 20px 20px;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.ielts-related-content h4 {
    font-size: 16px;
    font-weight: 600;
    margin: 0 0 8px 0;
    line-height: 1.4;
}

.ielts-related-content h4 a {
    color: #1a1a2e;
    text-decoration: none;
    transition: color 0.3s;
}

.ielts-related-content h4 a:hover {
    color: var(--ielts-primary);
}

.ielts-related-excerpt {
    color: #666;
    font-size: 13px;
    line-height: 1.6;
    flex: 1;
    margin: 0 0 10px 0;
}

.ielts-related-read-more {
    color: var(--ielts-primary);
    text-decoration: none;
    font-weight: 600;
    font-size: 13px;
    align-self: flex-start;
    transition: color 0.3s;
}

.ielts-related-read-more .ielts-icon {
    margin-right: 5px;
    transition: transform 0.3s;
}

.ielts-related-read-more:hover {
    color: var(--ielts-primary-dark);
}

.ielts-related-read-more:hover .ielts-icon {
    transform: translateX(-5px);
}

/* ===== دکمه بازگشت به مقالات در صفحه مقاله ===== */
.ielts-single-back-button {
    max-width: 1200px;
    margin: 20px auto 0;
    padding: 0 20px;
}

.ielts-back-to-blog {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: #666;
    text-decoration: none;
    font-size: 14px;
    padding: 8px 16px;
    border-radius: 6px;
    background: #f5f5f5;
    transition: all 0.3s;
}

.ielts-back-to-blog .ielts-icon {
    transition: transform 0.3s;
}

.ielts-back-to-blog:hover {
    background: #1a1a2e;
    color: #fff;
}

.ielts-back-to-blog:hover .ielts-icon {
    transform: translateX(-3px);
}

/* ===== پیام بدون مقاله ===== */
.ielts-no-posts {
    text-align: center;
    padding: 40px;
    color: #888;
    font-size: 16px;
}

/* ================================================================
   ریسپانسیو
   ================================================================ */
@media (max-width: 992px) {
    .ielts-grid-row,
    .ielts-related-row {
        grid-template-columns: repeat(2, 1fr);
        gap: 20px;
    }
    
    .ielts-slide-card {
        flex-direction: column;
        min-height: auto;
    }
    
    .ielts-slide-image {
        flex: 0 0 200px;
    }
    
    .ielts-slide-content h3 {
        font-size: 20px;
    }
}

@media (max-width: 768px) {
    .ielts-grid-row,
    .ielts-related-row {
        grid-template-columns: 1fr;
        gap: 18px;
    }
    
    .ielts-grid-header,
    .ielts-slider-header {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .ielts-section-title {
        font-size: 20px;
    }
    
    .ielts-slide-image {
        flex: 0 0 180px;
    }
    
    .ielts-slide-content {
        padding: 20px;
    }
    
    .ielts-slide-content h3 {
        font-size: 18px;
    }
    
    .ielts-slider-prev,
    .ielts-slider-next {
        width: 40px;
        height: 40px;
        font-size: 16px;
    }
}

@media (max-width: 480px) {
    .ielts-card-image {
        height: 180px;
    }
    
    .ielts-card-content h3 {
        font-size: 16px;
    }
    
    .ielts-slide-image {
        flex: 0 0 160px;
    }
    
    .ielts-slide-content {
        padding: 15px;
    }
    
    .ielts-slide-content h3 {
        font-size: 16px;
    }
    
    .ielts-slider-prev,
    .ielts-slider-next {
        width: 32px;
        height: 32px;
        font-size: 14px;
    }
    
    .ielts-related-image {
        height: 140px;
    }
}