/* ------------------------------- */
/* تنظیمات اصلی و فونت‌ها */
/* ------------------------------- */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    padding: 0;
    margin: 0;
    overflow-x: hidden;
    direction: rtl;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: #f5f7fb;
}

@font-face {
    font-family: "lalezar";
    src: url("../assets/font/lalezar.ttf");
}
@font-face {
    font-family: "vazir";
    src: url(../assets/font/Vazir.ttf);
}
@font-face {
    font-family: "iransans";
    src: url("../assets/font/iran-sans.ttf");
}

/* ------------------------------- */
/* تنظیمات هدر */
/* ------------------------------- */
.header {
    width: 100%;
    height: 75px;
    background-color: #6ba7d7;
    display: flex;
    border-radius: 3px;
    position: fixed;
    top: 0;
    right: 0;
    z-index: 100;
}

.header-div-sec1 {
    width: 20%;
    height: 75px;
    display: flex;
    justify-content: center;
    align-items: center;
    text-align: center;
    font-family: "iransans";
    border-right: 2px solid yellow;
}

.header-div-sec1 p {
    font-size: 22px;
    color: white;
    margin: 0;
}

.header-div-sec1 a {
    text-decoration: none;
    color: white;
}

.header-div-sec2 {
    width: 80%;
    height: 75px;
    display: flex;
    justify-content: flex-start;
    align-items: center;
    text-align: center;
    font-family: "vazir";
}

.header-div-sec2 p {
    font-size: 18px;
    color: white;
    margin: 0;
    display: flex;
    align-items: center;
}

.header-div-sec2 a {
    text-decoration: none;
    padding: 10px 20px;
    color: white;
    border-radius: 90px;
    display: inline-block;
    transition: 0.3s;
}

.header-div-sec2 a:hover,
.header-div-sec2 a.active {
    background-color: rgba(255, 255, 255, 0.25);
    color: black;
}

/* ------------------------------- */
/* بنر */
/* ------------------------------- */
.banner-side {
    width: 100%;
    height: 400px;
    overflow: hidden;
    margin-top: 75px;
}

.banner-side img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* ------------------------------- */
/* متن بخش */
/* ------------------------------- */
.sec-txt {
    font-size: 30px;
    font-family: "iransans";
    color: #4f8ec1;
    width: 100%;
    height: 80px;
    display: flex;
    justify-content: center;
    align-items: center;
    text-align: center;
    background: linear-gradient(135deg, #f5f7fb, #e8ecf1);
    margin: 20px 0;
}

.sec-txt p {
    position: relative;
    padding-bottom: 10px;
}

.sec-txt p::after {
    content: '';
    position: absolute;
    bottom: 0;
    right: 50%;
    transform: translateX(50%);
    width: 60px;
    height: 3px;
    background: #ffb347;
    border-radius: 3px;
}

/* ------------------------------- */
/* بخش بلاگ (گرید) */
/* ------------------------------- */
.blog-side {
    width: 100%;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 30px;
    padding: 40px;
    justify-items: center;
    background: #f5f7fb;
    min-height: 500px;
}

/* ------------------------------- */
/* کارت بلاگ */
/* ------------------------------- */
.blog-card {
    width: 100%;
    max-width: 350px;
    background: white;
    border-radius: 20px;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    cursor: pointer;
    position: relative;
}

.blog-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.15);
}

.blog-image {
    width: 100%;
    height: 220px;
    overflow: hidden;
}

.blog-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.4s ease;
}

.blog-card:hover .blog-image img {
    transform: scale(1.05);
}

.blog-content {
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    flex: 1;
}

.blog-content h2 {
    font-size: 22px;
    color: #222;
    font-family: "vazir";
    margin: 0;
}

.blog-content p {
    font-size: 14px;
    line-height: 26px;
    color: #666;
    font-family: "vazir";
}

.blog-footer {
    padding: 15px 20px 20px 20px;
}

.blog-footer button {
    width: 100%;
    height: 45px;
    border: none;
    border-radius: 12px;
    background: #6ba7d7;
    color: white;
    font-size: 15px;
    cursor: pointer;
    transition: 0.3s;
    font-family: "lalezar";
}

.blog-footer button:hover {
    background: #4f8ec1;
    transform: scale(0.98);
}

/* ------------------------------- */
/* مودال (پاپ‌آپ مقاله) */
/* ------------------------------- */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(5px);
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.modal-content {
    background: white;
    margin: 5% auto;
    padding: 0;
    width: 80%;
    max-width: 700px;
    border-radius: 20px;
    position: relative;
    animation: slideDown 0.3s ease;
    max-height: 85vh;
    overflow-y: auto;
}

@keyframes slideDown {
    from {
        transform: translateY(-50px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.close-modal {
    position: sticky;
    top: 10px;
    left: 20px;
    float: left;
    color: #aaa;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    transition: 0.2s;
    background: white;
    width: 35px;
    height: 35px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    margin: 10px;
    z-index: 10;
}

.close-modal:hover {
    color: #ff4d4d;
    transform: scale(1.1);
}

.modal-body {
    padding: 20px 30px 30px 30px;
    direction: rtl;
    text-align: right;
}

.modal-body h2 {
    font-family: "lalezar";
    color: #4f8ec1;
    margin-bottom: 15px;
    font-size: 28px;
}

.modal-body .article-image {
    width: 100%;
    border-radius: 15px;
    margin: 15px 0;
}

.modal-body .article-image img {
    width: 100%;
    border-radius: 15px;
}

.modal-body p {
    font-family: "vazir";
    line-height: 1.8;
    color: #333;
    margin: 15px 0;
    font-size: 15px;
}

.modal-body .article-date {
    
    color: #300055;
    font-size: 13px;
    margin-top: 20px;
    font-family: "lalezar";
}

/* ------------------------------- */
/* انیمیشن لودینگ */
/* ------------------------------- */
.loading {
    text-align: center;
    padding: 50px;
    font-family: "vazir";
    color: #6ba7d7;
    font-size: 18px;
    grid-column: 1 / -1;
}

.loading::after {
    content: '';
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid #6ba7d7;
    border-top-color: transparent;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin-right: 10px;
    vertical-align: middle;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* ------------------------------- */
/* ریسپانسیو */
/* ------------------------------- */
@media (max-width: 768px) {
    .header-div-sec1 {
        width: 30%;
    }
    
    .header-div-sec1 p {
        font-size: 14px;
    }
    
    .header-div-sec2 {
        width: 70%;
    }
    
    .header-div-sec2 a {
        padding: 6px 10px;
        font-size: 12px;
    }
    
    .banner-side {
        height: 250px;
    }
    
    .sec-txt {
        font-size: 20px;
        height: 60px;
    }
    
    .blog-side {
        padding: 20px;
        gap: 20px;
    }
    
    .modal-content {
        width: 95%;
        margin: 10% auto;
    }
    
    .modal-body {
        padding: 15px;
    }
}

@media (max-width: 550px) {
    .header-div-sec1 p {
        font-size: 10px;
    }
    
    .header-div-sec2 a {
        padding: 4px 6px;
        font-size: 10px;
    }
    
    .banner-side {
        height: 180px;
    }
    
    .sec-txt {
        font-size: 16px;
        height: 50px;
    }
    
    .blog-side {
        padding: 15px;
    }
}