﻿@font-face {
    font-family: 'Shabnam';
    font-weight: normal;
    font-style: normal;
    src: url('/Font/Shabnam.woff2') format('woff2'), url('/Font/Shabnam.woff') format('woff'), url('/Font/Shabnam.ttf') format('truetype');
}

body {
    text-align: center;
    direction: rtl;
    color: #333;
    width: auto;
    background: radial-gradient(circle at top right, #fff5e6 0%, #ffffff 50%, #e6fbff 100%) !important;
    background-attachment: fixed !important; /* باعث می‌شه موقع اسکرول رنگ ثابت بمونه */
    font-family: 'Shabnam', sans-serif !important;
}

h1, h2, h3 {
    font-weight: 700;
}

p {
    font-weight: 400;
    line-height: 1.9;
}

header {
    background-attachment: fixed;
    backdrop-filter: blur(8px);
    padding: 10px 20px;
    display: flex;
    align-items: center;
    /* اینها باعث می‌شود هنگام اسکرول بالای صفحه بماند */
    position: sticky;
    top: 0;
    z-index: 1000;
}

nav {
    display: flex;
    gap: 20px;
}

    nav.nav {
        display: flex;
        align-items: center;
        justify-content: space-between; /* ستون چپ و راست */
        width: 100%;
        /*max-width: 1000px;*/ /* برای نظم بهتر */
        position: relative;
    }


.nav-menu {
    display: flex;
    gap: 30px;
    align-items: center;
}


    .nav-menu a {
        margin: 0 12px;
        text-decoration: none;
        color: #333;
    }

.search-box {
    position: absolute;
    left: 20px;
}

    .search-box input,
    .mobile-search input {
        width: 160px;
        padding: 5px 10px;
        border-radius: 6px;
        border: 1px solid #ccc;
    }

nav a {
    position: relative;
    text-decoration: none;
    color: #333;
    padding-bottom: 6px;
    transition: 0.25s;
}

    nav a::after {
        content: "";
        position: absolute;
        left: 0;
        bottom: 0;
        width: 0;
        height: 2px;
        background: #ff8a3d;
        transition: width 0.25s ease;
    }

    nav a:hover::after {
        width: 100%;
    }

    nav a:hover {
        color: #333 !important;
        text-decoration: none !important;
        font-weight: 600;
    }

/* همبرگری مخفی در دسکتاپ */
.hamburger {
    display: none;
    font-size: 30px;
    cursor: pointer;
    padding: 5px;
}

/* جستجوی داخل منو فقط در موبایل */
.mobile-search {
    display: none;
}


/* --- Dropdown Menu --- */
.dropdown {
    position: relative;
    padding-bottom: 0 !important;
    display: inline-block;
}

.dropdown-btn {
    cursor: pointer;
    color: #333;
    font-weight: 400;
    /*padding-bottom: 6px;*/
    transition: 0.5s ease;
    padding-bottom: 0 !important;
}

/* منوی کشویی */
.dropdown-menu {
    position: absolute;
    right: 0;
    min-width: 200px;
    width: max-content;
    margin-top: 20%;
    padding: 8px 0;
    display: none;
    opacity: 0;
    background: radial-gradient(circle at top right, #fff5e6 0%, #ffffff 50%, #e6fbff 100%) !important;
    background-attachment: fixed !important;
    backdrop-filter: blur(8px);
    transition: opacity 2s ease, transform 2s ease;
    border: none !important;
}


.dropdown:hover > .dropdown-btn {
    /*background: #e8d4be;*/ /* دقیقاً هم‌رنگ منو */
}
/* نمایش با hover */
.dropdown:hover .dropdown-menu {
    display: block;
    opacity: 1;
    transform: translateY(0);
}

/* آیتم‌های داخلی منو */
.dropdown-menu a {
    display: block;
    padding: 10px 14px;
    text-decoration: none;
    color: #333;
    font-size: 14px;
    text-align: right;
    transition: 0.2s ease;
}

    /* Hover داخل dropdown */
    .dropdown-menu a:hover {
        color: #ff7a23;
        padding-right: 20px; /* یک انیمیشن نرم و ظریف */
    }



/* Hero */
#hero {
    padding: 40px 20px;
    color: #000;
}

/* ----- ROWS ----- */
.row {
    display: flex;
    align-items: center;
    min-height: 300px;
    /*padding: 20px 20px;*/
    gap: 20px;
    background-attachment: fixed;
    margin-left: 0 !important;
}

    /* ردیف اول → تصویر بچسبد به راست */
    .row.first-row {
        justify-content: space-between;
    }

        /*.row.first-row .box {
            order: 1;*/ /* تصویر سمت راست */
            /*margin-right: 5%;
        }

        .row.first-row .text-box {
            order: 2;
            margin-left: 5%;
        }*/

    /* ردیف دوم → تصویر بچسبد به چپ */
    .row.second-row {
        justify-content: space-between;
    }

        .row.second-row .box {
            order: 2;
            margin-left: 5%;
        }

        .row.second-row .text-box {
            order: 1;
            margin-right: 5%;
        }

    .row .text-box {
        flex: 2;
    }

    .row .box {
        flex: 1;
        max-width: none;
    }


/* Box style */
.box {
    flex: 1;
    background: #ffffffaa;
    backdrop-filter: blur(6px);
    border-radius: 14px;
    box-shadow: 0 4px 12px #00000022;
}

.box-image {
    width: 100%;
    border-radius: 12px;
    object-fit: cover;
}

/* Footer */
footer {
    text-align: center;
    /*padding: 20px;*/
    /*background: rgba(255,255,255,0.5);*/
    /*margin-top: 40px;*/
}



/* جعبه جستجو در navbar */




/*بخش articles*/
.articles-hero {
    text-align: center;
    padding: 30px 20px;
}

    .articles-hero h1 {
        font-size: 42px;
        margin-bottom: 10px;
        color: #1e2a37;
    }

    .articles-hero p {
        font-size: 18px;
        color: #5a6b7d;
    }

.articles-list {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 25px;
    margin: 40px auto;
}

.article-card {
    display: flex;
    flex-direction: column;
    text-decoration: none;
    color: #333;
    border: 1px solid #ddd;
    border-radius: 10px;
    overflow: hidden;
    background: #fff;
    box-shadow: 0 2px 8px rgba(0,0,0,.1);
    transition: .3s;
    height: 100%;
}

    .article-card:hover {
        transform: translateY(-5px);
        box-shadow: 0 20px 40px rgba(0,0,0,0.1);
    }


    .article-card img {
        width: 100%;
        height: 220px;
        object-fit: cover;
    }

.article-title {
    font-size: 20px;
    font-weight: bold;
    padding: 15px;
    min-height: 70px;
}

.article-date {
    font-size: 13px;
    color: #6c7a89;
    margin-bottom: 12px;
}

.article-body {
    font-size: 14px;
    color: #4f5e6b;
    text-align: justify;
    padding: 0 15px;
    flex: 1;
    line-height: 1.8;
}

.read-more {
    margin: 15px;
    padding: 10px;
    background: #007bff;
    color: #fff;
    text-align: center;
    border-radius: 6px;
}
.pagination {
    margin-top: 40px;
    text-align: center;
}

    .pagination a,
    .pagination span {
        display: inline-block;
        padding: 8px 14px;
        margin: 4px;
        border-radius: 6px;
        text-decoration: none;
        background: #f2f2f2;
        color: #333;
    }

        .pagination a:hover {
            background: #ddd;
        }

    .pagination .active {
        background: #333;
        color: white;
    }





/* ----------- Responsive (Tablet & Mobile) ----------- */
@media (max-width: 768px) {

    .row {
        display:contents;
        flex-direction: column; /* تبدیل ردیف به ستون */
        height: auto; /* ارتفاع اتوماتیک */
        padding: 20px 10px;
        gap: 20px;
        text-align: center;
    }

        /* ترتیب نمایش در موبایل: عکس بالا، متن پایین */
        .row.first-row .box,
        .row.second-row .box {
            order: 1;
            margin: 0;
            width: 100%;
        }

        .row.first-row .text-box,
        .row.second-row .text-box {
            order: 2;
            margin: 0;
            width: 100%;
        }

        /* نسبت‌ها در موبایل یکسان می‌شوند */
        .row .text-box,
        .row .box {
            flex: none;
            width: 100%;
        }

    /* تصاویر فول‌ویدث */
    .box-image {
        width: 100%;
        height: auto;
        object-fit: cover;
    }



    /* منو به حالت مخفی */
    .nav-menu {
        display: none;
        flex-direction: column;
        gap: 20px;
        background: radial-gradient(circle at top right, #fff5e6 0%, #ffffff 50%, #e6fbff 100%);
        background-attachment: fixed;
        /*background: rgba(255, 226, 200, 0.97);*/
        padding: 20px;
        position: absolute;
        top: 60px;
        right: 0;
        width: 200px;
        border-radius: 10px;
        box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    }

        /* نمایش وقتی باز شد */
        .nav-menu.show {
            display: flex;
        }

    /* همبرگری در موبایل */
    .hamburger {
        display: block;
    }

    /* جستجو در موبایل داخل منو */
    .mobile-search {
        display: block;
        width: 100%;
    }

    /* پنهان کردن جستجوی دسکتاپ */
    .desktop-search {
        display: none;
    }

    .nav-menu a {
        font-size: 16px;
    }
}
/*html, body, * {
    outline: 1px solid rgba(255,0,0,.25) !important;
}*/
/*
html, body {
    overflow-x: hidden !important;
}*/




/*body {
    background: #f4f7fb;
    font-family: Segoe UI, sans-serif;
}
*/
/*a {
    text-decoration: none !important;
}*/




/*/////////////////////////////////////////////*/

/* --- Instagram Grid Layout --- */

/* کانتینر اصلی: گرید با ۳ ستون */
.instagram-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr); /* تقسیم فضای موجود به ۳ قسمت مساوی */
    gap: 15px; /* فاصله بین مربع‌ها در دسکتاپ */
    margin: 20px auto;
    max-width: 900px; /* محدود کردن عرض برای زیبایی */
}

/* آیتم‌های مربع شکل */
.grid-item {
    position: relative;
    width: 100%;
    aspect-ratio: 1 / 1; /* جادوی اصلی برای مربع ماندن */
    overflow: hidden;
    cursor: pointer;
    border-radius: 8px; /* گرد کردن گوشه‌های مربع */
    background-color: #eee; /* رنگ پس‌زمینه در صورت لود نشدن عکس */
}

    /* تنظیم تصاویر داخل مربع */
    .grid-item img {
        width: 100%;
        height: 100%;
        object-fit: cover; /* پر کردن مربع بدون کشیدگی */
        transition: transform 0.4s ease; /* انیمیشن نرم هنگام زوم */
    }

    /* افکت زوم هنگام بردن موس روی عکس */
    .grid-item:hover img {
        transform: scale(1.1);
    }

/* لایه متن (Overlay) هنگام هاور */
.overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.4); /* تیره کردن عکس */
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
    font-weight: bold;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.5);
}

.grid-item:hover .overlay {
    opacity: 1;
}

/* --- تنظیمات ریسپانسیو (واکنش‌گرا) --- */

/* برای تبلت */
@media (max-width: 768px) {
    .instagram-grid {
        gap: 10px;
    }
}

/* برای موبایل */
@media (max-width: 480px) {
    .instagram-grid {
        gap: 4px; /* فاصله کمتر در موبایل برای حس اپلیکیشنی */
        padding: 0 4px;
    }

    .grid-item {
        border-radius: 2px; /* در موبایل معمولاً گوشه‌ها تیزترند */
    }
}


@media (max-width: 992px) {
    .articles-list {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 576px) {
    .articles-list {
        grid-template-columns: 1fr;
    }
}