:root{
    --bg:#f6f8fc;
    --bg-soft:#f8fbff;
    --card:#ffffff;
    --txt:#101828;
    --muted:#667085;
    --muted-2:#98a2b3;
    --brand:#2f6fec;
    --brand-dark:#1d4ed8;
    --brand-soft:#eef4ff;
    --border:#e7ecf3;
    --shadow-sm:0 6px 18px rgba(16,24,40,.06);
    --shadow:0 12px 30px rgba(16,24,40,.08);
    --shadow-lg:0 20px 45px rgba(16,24,40,.12);
    --radius:18px;
    --radius-sm:12px;
    --radius-lg:24px;
    --container:1200px;
}

*,
*::before,
*::after{
    box-sizing:border-box;
}

html{
    scroll-behavior:smooth;
}

body{
    margin:0;
    font-family:system-ui,-apple-system,"Segoe UI",Roboto,"IRANSans",Arial,sans-serif;
    background:
            radial-gradient(circle at top right, rgba(47,111,236,.08), transparent 18%),
            linear-gradient(180deg,#f8fbff 0%, #f6f8fc 100%);
    color:var(--txt);
    line-height:1.7;
    -webkit-font-smoothing:antialiased;
    -moz-osx-font-smoothing:grayscale;
}

img{
    max-width:100%;
    height:auto;
    display:block;
}

a{
    color:inherit;
}

/* Layout */
.container{
    max-width:var(--container);
    margin:auto;
    padding:28px 18px 40px;
}

/* Top bar */
.sitebar{
    position:sticky;
    top:0;
    z-index:50;
    background:rgba(255,255,255,.82);
    backdrop-filter:blur(12px);
    -webkit-backdrop-filter:blur(12px);
    border-bottom:1px solid rgba(231,236,243,.8);
}

.sitebar__inner{
    max-width:var(--container);
    margin:auto;
    padding:14px 18px;
    display:flex;
    align-items:center;
    justify-content:space-between;
    gap:16px;
}

.brand{
    font-weight:900;
    font-size:18px;
    text-decoration:none;
    color:var(--txt);
    letter-spacing:-.2px;
}

.nav{
    display:flex;
    align-items:center;
    flex-wrap:wrap;
    gap:14px;
}

.nav a{
    text-decoration:none;
    color:var(--muted);
    font-weight:700;
    transition:color .2s ease;
}

.nav a:hover{
    color:var(--brand);
}

/* Hero */
.hero{
    position:relative;
    overflow:hidden;
    background:
            linear-gradient(135deg, rgba(47,111,236,.08), rgba(255,255,255,.96)),
            #fff;
    border:1px solid var(--border);
    border-radius:var(--radius-lg);
    padding:30px;
    box-shadow:var(--shadow);
    display:flex;
    align-items:flex-end;
    justify-content:space-between;
    gap:22px;
    flex-wrap:wrap;
}

.hero::before{
    content:"";
    position:absolute;
    inset:auto -50px -50px auto;
    width:220px;
    height:220px;
    background:radial-gradient(circle, rgba(47,111,236,.12), transparent 70%);
    pointer-events:none;
}

.hero__text{
    position:relative;
    z-index:1;
    flex:1 1 520px;
}

.hero__eyebrow{
    display:inline-flex;
    align-items:center;
    gap:8px;
    margin-bottom:12px;
    padding:7px 12px;
    background:var(--brand-soft);
    color:var(--brand-dark);
    border:1px solid #dbe7ff;
    border-radius:999px;
    font-size:13px;
    font-weight:800;
}

.hero h1{
    margin:0 0 10px;
    font-size:clamp(26px, 3vw, 38px);
    line-height:1.35;
    letter-spacing:-.4px;
}

.hero p{
    margin:0;
    max-width:760px;
    color:var(--muted);
    line-height:2;
    font-size:15.5px;
}

/* Search */
.search{
    position:relative;
    z-index:1;
}

.search--modern{
    flex:1 1 340px;
    max-width:460px;
    width:100%;
}

.search--modern .search__box{
    display:flex;
    align-items:center;
    gap:10px;
    width:100%;
    background:rgba(255,255,255,.72);
    border:1px solid var(--border);
    padding:10px;
    border-radius:18px;
    box-shadow:var(--shadow-sm);
}

.search--modern input{
    flex:1;
    min-width:0;
    width:100%;
    height:52px;
    border:1px solid transparent;
    background:#fff;
    color:var(--txt);
    border-radius:14px;
    padding:0 16px;
    outline:none;
    font-size:14.5px;
    transition:border-color .2s ease, box-shadow .2s ease;
}

.search--modern input:focus{
    border-color:#bfd3ff;
    box-shadow:0 0 0 4px rgba(47,111,236,.08);
}

.search--modern input::placeholder{
    color:var(--muted-2);
}

.search--modern button{
    height:52px;
    padding:0 18px;
    border:none;
    border-radius:14px;
    background:linear-gradient(180deg, var(--brand), var(--brand-dark));
    color:#fff;
    font-weight:800;
    cursor:pointer;
    transition:transform .18s ease, box-shadow .18s ease, opacity .18s ease;
    white-space:nowrap;
    box-shadow:0 10px 20px rgba(47,111,236,.22);
}

.search--modern button:hover{
    transform:translateY(-1px);
    box-shadow:0 14px 24px rgba(47,111,236,.28);
}

.search--modern button:active{
    transform:translateY(0);
}

/* Search result bar */
.search-result-bar{
    margin-top:18px;
    margin-bottom:2px;
    padding:16px 18px;
    background:rgba(255,255,255,.8);
    border:1px solid var(--border);
    border-radius:16px;
    display:flex;
    align-items:center;
    justify-content:space-between;
    gap:12px;
    flex-wrap:wrap;
    box-shadow:var(--shadow-sm);
}

.search-result-bar p{
    margin:0;
    color:var(--muted);
    font-size:14px;
}

.search-result-bar strong{
    color:var(--txt);
}

.search-result-bar__reset{
    text-decoration:none;
    color:var(--brand);
    font-weight:800;
}

.search-result-bar__reset:hover{
    color:var(--brand-dark);
}

/* Articles grid */
.grid{
    margin-top:24px;
    display:grid;
    grid-template-columns:repeat(3, minmax(0,1fr));
    gap:22px;
}

.grid--articles{
    align-items:stretch;
}

@media (max-width: 1024px){
    .grid{
        grid-template-columns:repeat(2, minmax(0,1fr));
    }
}

@media (max-width: 640px){
    .grid{
        grid-template-columns:1fr;
    }
}

/* Article card */
.card{
    background:rgba(255,255,255,.94);
    border:1px solid var(--border);
    border-radius:var(--radius);
    overflow:hidden;
    box-shadow:var(--shadow);
    transition:transform .22s ease, box-shadow .22s ease, border-color .22s ease;
}

.card--article{
    display:flex;
    flex-direction:column;
    height:100%;
}

.card:hover{
    transform:translateY(-6px);
    box-shadow:var(--shadow-lg);
    border-color:#dbe4f0;
}

.card__media{
    display:block;
    position:relative;
    aspect-ratio:16 / 9;
    overflow:hidden;
    background:#edf2f8;
}

.card__media::after{
    content:"";
    position:absolute;
    inset:0;
    background:linear-gradient(180deg, transparent 50%, rgba(16,24,40,.04) 100%);
    pointer-events:none;
}

.card__media img{
    width:100%;
    height:100%;
    object-fit:cover;
    transition:transform .4s ease;
}

.card:hover .card__media img{
    transform:scale(1.05);
}

.card__body{
    padding:16px 16px 18px;
    display:flex;
    flex-direction:column;
    gap:12px;
    flex:1;
}

.card__category{
    display:inline-flex;
    align-self:flex-start;
    align-items:center;
    gap:6px;
    padding:6px 10px;
    border-radius:999px;
    background:var(--brand-soft);
    border:1px solid #dbe7ff;
    color:var(--brand-dark);
    font-size:12px;
    font-weight:800;
    line-height:1;
}

.card__title{
    margin:0;
    font-size:18px;
    line-height:1.8;
    font-weight:850;
    letter-spacing:-.2px;
}

.card__title a{
    text-decoration:none;
    color:var(--txt);
    transition:color .2s ease;
}

.card__title a:hover{
    color:var(--brand);
}

.card__desc{
    margin:0;
    color:var(--muted);
    line-height:2;
    font-size:14px;
    flex:1;
    display:-webkit-box;
    -webkit-line-clamp:3;
    -webkit-box-orient:vertical;
    overflow:hidden;
    min-height:84px;
}

.card__meta{
    margin-top:auto;
    padding-top:4px;
    display:flex;
    align-items:center;
    justify-content:space-between;
    gap:12px;
    color:var(--muted);
    font-size:13px;
}

.card__date{
    display:inline-flex;
    align-items:center;
    gap:6px;
    white-space:nowrap;
}

.card__more{
    text-decoration:none;
    color:var(--brand);
    font-weight:900;
    white-space:nowrap;
    transition:color .2s ease, transform .2s ease;
}

.card__more:hover{
    color:var(--brand-dark);
    transform:translateX(-2px);
}

/* Empty state */
.empty-state{
    grid-column:1 / -1;
    text-align:center;
    background:rgba(255,255,255,.94);
    border:1px solid var(--border);
    padding:52px 24px;
    border-radius:24px;
    box-shadow:var(--shadow);
}

.empty-state__icon{
    font-size:42px;
    line-height:1;
    margin-bottom:14px;
}

.empty-state h2{
    margin:0 0 10px;
    font-size:24px;
}

.empty-state p{
    margin:0;
    color:var(--muted);
    line-height:2;
    font-size:15px;
}

.empty-state__btn{
    display:inline-flex;
    align-items:center;
    justify-content:center;
    margin-top:18px;
    min-height:46px;
    padding:0 18px;
    border-radius:14px;
    background:linear-gradient(180deg, var(--brand), var(--brand-dark));
    color:#fff;
    text-decoration:none;
    font-weight:800;
    box-shadow:0 10px 20px rgba(47,111,236,.20);
}

/* Pager */
.pager{
    margin:28px auto 8px;
    display:flex;
    align-items:center;
    justify-content:center;
    gap:12px;
    flex-wrap:wrap;
}

.pager__btn{
    display:inline-flex;
    align-items:center;
    justify-content:center;
    min-width:92px;
    min-height:46px;
    padding:0 16px;
    text-decoration:none;
    border:1px solid var(--border);
    background:rgba(255,255,255,.95);
    border-radius:14px;
    color:var(--txt);
    font-weight:800;
    transition:all .2s ease;
    box-shadow:var(--shadow-sm);
}

.pager__btn:hover{
    border-color:#cfd9e8;
    transform:translateY(-2px);
    box-shadow:var(--shadow);
}

.pager__info{
    color:var(--muted);
    font-size:13px;
    font-weight:700;
    background:rgba(255,255,255,.7);
    border:1px solid var(--border);
    padding:11px 14px;
    border-radius:14px;
}

/* Utilities */
.hidden{
    display:none !important;
}

/* Responsive */
@media (max-width: 768px){
    .container{
        padding:20px 14px 34px;
    }

    .hero{
        padding:22px 18px;
        border-radius:20px;
    }

    .hero h1{
        font-size:24px;
    }

    .hero p{
        font-size:14px;
    }

    .search--modern{
        max-width:none;
    }

    .search--modern .search__box{
        flex-direction:column;
        align-items:stretch;
        padding:12px;
    }

    .search--modern input,
    .search--modern button{
        width:100%;
    }

    .card__body{
        padding:14px;
    }

    .card__title{
        font-size:17px;
    }

    .card__desc{
        min-height:auto;
    }
}

@media (max-width: 480px){
    .sitebar__inner{
        padding:12px 14px;
    }

    .brand{
        font-size:16px;
    }

    .nav{
        gap:10px;
    }

    .nav a{
        font-size:14px;
    }

    .hero__eyebrow{
        font-size:12px;
    }

    .hero h1{
        font-size:22px;
    }

    .search-result-bar{
        padding:14px;
    }

    .empty-state{
        padding:40px 18px;
        border-radius:20px;
    }

    .empty-state h2{
        font-size:20px;
    }
}
