/* ---------- متغیرهای سایت (جلسه ۱۳) ---------- */
/* رنگ‌ها و اندازه‌های پرتکرار را یک بار اینجا تعریف می‌کنیم
   تا برای تغییر ظاهر سایت فقط همین چند خط عوض شود. */
:root {
    --primary: #2f4f4f;
    --primary-dark: #1c3333;
    --accent: #ff6347;
    --bg-light: #f5f5f5;
    --text: #333333;
    --muted: #666666;
    --border: #dddddd;
    --radius: 10px;
    --shadow-sm: 0 2px 6px rgba(0, 0, 0, 0.06);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.12);
    --shadow-lg: 0 10px 26px rgba(0, 0, 0, 0.16);
}

/* ---------- ریست پایه ---------- */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: Tahoma, sans-serif;
}

html {
    direction: rtl;
    font-size: 16px;
    scroll-behavior: smooth;
}

body {
    color: var(--text);
    line-height: 1.8;
    background-color: #ffffff;
}

a {
    color: inherit;
    text-decoration: none;
}

img {
    max-width: 100%;
    display: block;
}

/* ---------- کلاس‌های کمکی قابل استفاده مجدد ---------- */
.container {
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 20px;
}

.btn {
    display: inline-block;
    padding: 12px 28px;
    background-color: var(--primary);
    color: white;
    border: none;
    border-radius: var(--radius);
    cursor: pointer;
    font-weight: bold;
    font-size: 1rem;
    box-shadow: var(--shadow-md);
    transition: background-color 0.3s, transform 0.3s, box-shadow 0.3s;
}

.btn:hover {
    background-color: var(--accent);
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.btn-outline {
    background-color: transparent;
    border: 2px solid white;
    color: white;
}

.btn-outline:hover {
    background-color: white;
    color: var(--primary);
}

.card {
    background-color: white;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 20px;
    box-shadow: var(--shadow-sm);
    transition: transform 0.3s, box-shadow 0.3s;
}

.card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg);
}

.section-title {
    text-align: center;
    color: var(--primary);
    font-size: 1.8rem;
    margin-bottom: 10px;
}

/* خط تزئینی زیر عنوان بخش‌ها با شبه‌عنصر (جلسه ۱۳) */
.section-title::after {
    content: "";
    display: block;
    width: 60px;
    height: 4px;
    background-color: var(--accent);
    border-radius: 2px;
    margin: 12px auto 0;
}

.section-subtitle {
    text-align: center;
    color: var(--muted);
    margin-bottom: 40px;
}

section {
    padding: 60px 0;
}

/* ---------- هدر و ناوبری ---------- */
.site-header {
    position: sticky;
    top: 0;
    z-index: 100;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background-color: var(--primary);
    color: white;
    padding: 15px 30px;
    box-shadow: var(--shadow-md);
}

.logo {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 1.2rem;
    font-weight: bold;
}

nav {
    display: flex;
    gap: 20px;
}

nav a {
    color: white;
    font-weight: bold;
    transition: color 0.3s;
}

nav a:hover,
nav a.active {
    color: var(--accent);
}

/* ---------- بخش قهرمان (Hero) ---------- */
.hero {
    position: relative;
    background-image: linear-gradient(rgba(20, 40, 40, 0.65), rgba(20, 40, 40, 0.65)), url("images/hero-classroom.jpg");
    background-size: cover;
    background-position: center;
    color: white;
    text-align: center;
    padding: 100px 20px;
}

.hero h1 {
    font-size: 2.2rem;
    margin-bottom: 20px;
    text-shadow: 0 2px 6px rgba(0, 0, 0, 0.4);
}

.hero p {
    font-size: 1.1rem;
    margin-bottom: 30px;
}

/* ---------- آمار مدرسه ---------- */
.stats-section {
    background-color: var(--bg-light);
}

.stats {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 20px;
}

.stat-card {
    text-align: center;
    min-width: 180px;
}

.stat-card .number {
    font-size: 2rem;
    color: var(--primary);
    font-weight: bold;
}

/* ---------- امکانات و ویژگی‌ها ---------- */
.features {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 20px;
}

.feature {
    width: 260px;
    text-align: center;
}

.feature h3 {
    color: var(--primary);
    margin-bottom: 10px;
}

/* ---------- پیش‌نمایش اخبار در صفحه اصلی ---------- */
.news-preview {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
}

.news-preview .card img {
    border-radius: var(--radius) var(--radius) 0 0;
    margin: -20px -20px 15px -20px;
    width: calc(100% + 40px);
    height: 160px;
    object-fit: cover;
}

.news-preview .date {
    color: var(--accent);
    font-size: 0.9rem;
    margin-bottom: 8px;
}

/* ---------- بنر صفحات داخلی ---------- */
.page-banner {
    position: relative;
    background-size: cover;
    background-position: center;
    color: white;
    text-align: center;
    padding: 60px 20px;
}

.page-banner h1 {
    font-size: 1.8rem;
}

/* ---------- صفحه درباره ما ---------- */
.about-section {
    margin-bottom: 40px;
}

.about-section h2 {
    color: var(--primary);
    margin-bottom: 15px;
}

table {
    border-collapse: collapse;
    width: 100%;
    max-width: 500px;
}

th, td {
    padding: 12px;
    text-align: right;
    border: 1px solid var(--border);
}

th {
    background-color: var(--primary);
    color: white;
}

tr:nth-child(even) {
    background-color: var(--bg-light);
}

.facilities {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
}

.facilities .card img {
    border-radius: var(--radius) var(--radius) 0 0;
    margin: -20px -20px 15px -20px;
    width: calc(100% + 40px);
    height: 150px;
    object-fit: cover;
}

/* ---------- صفحه رشته‌های تحصیلی ---------- */
.program-list {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
    margin-bottom: 40px;
}

.program-list .card img {
    border-radius: var(--radius) var(--radius) 0 0;
    margin: -20px -20px 15px -20px;
    width: calc(100% + 40px);
    height: 160px;
    object-fit: cover;
}

.program-list .card h3 {
    color: var(--primary);
    margin-bottom: 10px;
}

.program-list .card ul {
    margin: 10px 20px 0 0;
}

.schedule-title {
    margin-bottom: 15px;
}

/* ---------- صفحه دبیران ---------- */
.dept-list {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
}

.dept-list .card img {
    border-radius: var(--radius) var(--radius) 0 0;
    margin: -20px -20px 15px -20px;
    width: calc(100% + 40px);
    height: 160px;
    object-fit: cover;
}

.dept-list .card h3 {
    color: var(--primary);
    margin-bottom: 10px;
}

/* ---------- گالری تصاویر ---------- */
.gallery-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 15px;
}

.gallery-item {
    position: relative;
    border-radius: var(--radius);
    overflow: hidden;
}

.gallery-item img {
    width: 100%;
    height: 200px;
    object-fit: cover;
    transition: transform 0.3s;
}

.gallery-item:hover img {
    transform: scale(1.08);
}

.gallery-item .caption {
    position: absolute;
    right: 0;
    bottom: 0;
    left: 0;
    background-color: rgba(20, 40, 40, 0.75);
    color: white;
    padding: 8px 12px;
    font-size: 0.9rem;
}

/* ---------- صفحه اخبار ---------- */
.news-list {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.news-item {
    display: flex;
    gap: 20px;
}

.news-item img {
    width: 220px;
    height: 150px;
    object-fit: cover;
    border-radius: var(--radius);
    flex-shrink: 0;
}

.news-item .date {
    color: var(--accent);
    font-size: 0.9rem;
    margin-bottom: 5px;
}

.news-item h3 {
    color: var(--primary);
    margin-bottom: 8px;
}

/* ---------- صفحه تماس با ما ---------- */
.contact-page {
    display: flex;
    gap: 40px;
}

.contact-info,
.contact-form-wrapper {
    flex: 1;
}

.contact-info h2,
.contact-form-wrapper h2 {
    color: var(--primary);
    margin-bottom: 15px;
}

.contact-info p {
    margin-bottom: 10px;
}

form {
    display: flex;
    flex-direction: column;
    gap: 12px;
    max-width: 400px;
}

label {
    font-weight: bold;
    color: var(--primary);
}

input, textarea, select {
    padding: 10px;
    border: 1px solid var(--border);
    border-radius: 6px;
    font-family: Tahoma, sans-serif;
}

input:focus, textarea:focus, select:focus {
    outline: none;
    border-color: var(--primary);
}

/* ---------- فوتر ---------- */
.site-footer {
    background-color: var(--primary-dark);
    color: white;
    text-align: center;
    padding: 25px 20px;
}

.site-footer a {
    color: white;
}

/* ===========================================================
   ریسپانسیو (Responsive) - حالت تبلت
   =========================================================== */
@media (max-width: 900px) {
    .news-preview,
    .facilities,
    .program-list,
    .dept-list,
    .gallery-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .contact-page {
        flex-direction: column;
    }

    form {
        max-width: 100%;
    }

    .hero {
        padding: 80px 20px;
    }
}

/* ===========================================================
   ریسپانسیو (Responsive) - حالت موبایل
   =========================================================== */
@media (max-width: 600px) {
    .site-header {
        flex-direction: column;
        gap: 12px;
        padding: 15px;
    }

    nav {
        flex-wrap: wrap;
        justify-content: center;
        gap: 12px;
    }

    .hero {
        padding: 60px 15px;
    }

    .hero h1 {
        font-size: 1.5rem;
    }

    .hero p {
        font-size: 1rem;
    }

    .page-banner {
        padding: 40px 15px;
    }

    .page-banner h1 {
        font-size: 1.4rem;
    }

    .stats {
        gap: 30px;
    }

    .news-preview,
    .facilities,
    .program-list,
    .dept-list,
    .gallery-grid {
        grid-template-columns: 1fr;
    }

    .news-item {
        flex-direction: column;
    }

    .news-item img {
        width: 100%;
        height: 180px;
    }

    section {
        padding: 40px 0;
    }
}
