/* ================== پایه کلی ================== */

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    direction: rtl;
    font-family: system-ui, -apple-system, BlinkMacSystemFont, "IRANSans", sans-serif;
    background: #f4f6ff;
    color: #111827;
}

.container {
    width: 100%;
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 16px;
}

a {
    text-decoration: none;
    color: inherit;
}

/* ================== هدر (site-header) ================== */

.site-header {
    position: sticky;
    top: 0;
    z-index: 1000;
    background: linear-gradient(135deg, #4f46e5, #0ea5e9, #22c55e);
    box-shadow: 0 6px 18px rgba(15, 23, 42, 0.35);
}

/* کارت داخل هدر */
.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 10px 0;
}

/* باکس سفید کارت‌طور برای زیبایی */
.site-header .container {
    background: #ffffff;
    border-radius: 20px;
    padding: 10px 14px;
    margin: 8px auto 10px;
    box-shadow: 0 10px 25px rgba(15, 23, 42, 0.16);
}

/* سمت راست: لوگو + متن */
.header-left {
    display: flex;
    align-items: center;
    gap: 10px;
}

.header-left img {
    width: 48px;
    height: 48px;
    border-radius: 16px;
    box-shadow: 0 6px 16px rgba(79, 70, 229, 0.45);
}

.header-title h1 {
    margin: 0;
    font-size: 1rem;
    color: #111827;
}

.header-title p {
    margin: 2px 0 0;
    font-size: 0.78rem;
    color: #6b7280;
}

/* سمت چپ: منو + دکمه‌ها */
.header-right {
    display: flex;
    align-items: center;
    gap: 8px;
}
/* موبایل: هدر و دکمه‌ها */
@media (max-width: 768px) {

    /* کارت هدر بشه ستونی */
    .header-inner {
        flex-direction: column;
        align-items: stretch;
        gap: 10px;
    }

    .header-left {
        justify-content: center;
        text-align: center;
    }

    /* بخش راست (منو + دکمه‌ها) زیر هم بیاد */
    .header-right {
        width: 100%;
        display: flex;
        flex-direction: column;
        align-items: stretch;
        gap: 8px;
    }

    /* دکمه منو یک ردیف کامل */
    .nav-toggle {
        width: 100%;
        justify-content: center;
        margin-bottom: 4px;
    }

    /* کانتینر دکمه‌ها */
    .header-actions {
        width: 100%;
        display: flex;
        flex-direction: column;   /* دکمه‌ها زیر هم */
        gap: 6px;
    }

    /* خود دکمه‌ها تمام عرض */
    .header-actions .button {
        width: 100%;
        justify-content: center;
        padding: 9px 14px;
        font-size: 0.9rem;
    }
}
/* ================== هدر موبایل کاملاً کوچک، جمع‌وجور، حرفه‌ای ================== */

@media (max-width: 768px) {

    .header-inner {
        flex-direction: column;
        align-items: center;
        gap: 6px;
        padding: 6px 0;
    }

    /* لوگو کوچک‌تر */
    .header-left img {
        width: 38px;
        height: 38px;
        border-radius: 12px;
    }

    .header-title h1 {
        font-size: 0.85rem;
        margin: 0;
    }

    .header-title p {
        font-size: 0.72rem;
        margin-top: 2px;
    }

    /* منو و دکمه‌ها */
    .header-right {
        width: 100%;
        display: flex;
        flex-direction: column;
        align-items: stretch;
        gap: 6px;
    }

    /* دکمه منو */
    .nav-toggle {
        width: 100%;
        padding: 6px 0;
        font-size: 0.9rem;
        border-radius: 12px;
        background: #eef2ff;
        color: #4f46e5;
    }

    /* ردیف دکمه‌ها */
    .header-actions {
        width: 100%;
        display: flex;
        flex-direction: row;
        justify-content: space-between;
        gap: 6px;
    }

    .header-actions .button {
        flex: 1 1 auto;
        padding: 6px 2px;
        font-size: 0.75rem;
        border-radius: 10px;
        text-align: center;
        white-space: nowrap;
        border: none;
    }

    /* اندازه دکمه‌ها کوچک و یک‌دست */
    .button.primary {
        padding: 7px 2px;
        font-size: 0.78rem;
    }

    /* حذف سایه اضافی */
    .button:hover,
    .nav-toggle:hover {
        transform: translateY(-1px);
        box-shadow: 0 2px 4px rgba(0,0,0,0.08);
    }
}

/* دکمه عمومی */
.button,
.nav-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 7px 14px;
    border-radius: 999px;
    border: 1px solid #e5e7eb;
    background: #ffffff;
    font-size: 0.85rem;
    color: #111827;
    cursor: pointer;
    transition: transform 0.12s ease,
                box-shadow 0.12s ease,
                background 0.12s ease,
                border-color 0.12s ease;
}

/* ثبت‌نام */
.button.primary {
    background: linear-gradient(135deg, #22c55e, #16a34a);
    color: #ffffff;
    border-color: transparent;
}

/* بقیه دکمه‌ها */
.header-actions .button:not(.primary) {
    background: linear-gradient(135deg, #0ea5e9, #2563eb);
    color: #ffffff;
    border-color: transparent;
}

/* دکمه منو */
.nav-toggle {
    width: 40px;
    padding: 0;
    border-radius: 999px;
    background: #eef2ff;
    color: #4f46e5;
    border-color: transparent;
    font-size: 1.1rem;
    box-shadow: 0 4px 10px rgba(148, 163, 184, 0.6);
}

/* hover دکمه‌ها */
.button:hover,
.nav-toggle:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(15, 23, 42, 0.15);
    border-color: #cbd5f5;
}

/* کانتینر دکمه‌های هدر */
.header-actions {
    display: flex;
    gap: 6px;
}

/* موبایل: هدر ستونی و دکمه‌ها تمام‌عرض‌تر */
@media (max-width: 768px) {
    .header-inner {
        flex-direction: column;
        align-items: stretch;
        gap: 10px;
    }

    .header-left {
        justify-content: center;
    }

    .header-right {
        width: 100%;
        justify-content: center;
        flex-wrap: wrap;
    }

    .header-actions {
        width: 100%;
        flex-wrap: wrap;
        justify-content: center;
    }

    .header-actions .button {
        flex: 1 1 30%;
        min-width: 110px;
        justify-content: center;
    }
}

/* ================== منوی کناری (sidenav) ================== */

.sidenav {
    position: fixed;
    top: 0;
    right: 0;
    height: 100%;
    width: 0; /* JS: کلاس sidenav-open اضافه می‌کند */
    background: radial-gradient(circle at top right, #1e293b 0%, #020617 60%);
    backdrop-filter: blur(10px);
    overflow-x: hidden;
    transition: width 0.28s ease;
    padding-top: 64px;
    z-index: 2000;
    box-shadow: -8px 0 24px rgba(15, 23, 42, 0.8);
}

/* کلاس باز شدن (JS اضافه/حذف می‌کند) */
.sidenav-open {
    width: 260px;
}

@media (max-width: 768px) {
    .sidenav-open {
        width: 80%;
    }
}

/* دکمه بستن */
.closebtn {
    position: absolute;
    top: 14px;
    left: 16px;
    padding: 6px 14px;
    border-radius: 999px;
    border: none;
    background: #ef4444;
    color: #f9fafb;
    font-size: 0.8rem;
    cursor: pointer;
}

/* لیست منو */
.sidenav-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.sidenav-list li {
    margin-bottom: 4px;
}

.sidenav a {
    display: block;
    margin: 6px 16px;
    padding: 10px 14px;
    font-size: 0.9rem;
    color: #e5e7eb;
    background: rgba(15, 23, 42, 0.9);
    border-radius: 12px;
    border: 1px solid rgba(148, 163, 184, 0.7);
    transition: background 0.2s ease,
                transform 0.15s ease,
                border-color 0.2s ease;
}

.sidenav a:hover {
    background: linear-gradient(135deg, #4f46e5, #0ea5e9);
    border-color: rgba(191, 219, 254, 0.95);
    transform: translateX(-3px);
}

/* ================== سکشن قهرمان (لوگوها) ================== */

.hero-section {
    margin-top: 16px;
    text-align: center;
}

.hero-logo img {
    display: block;
    margin: 8px auto;
}

/* موبایل: کوچک‌تر */
@media (max-width: 768px) {
    .hero-logo img[width="160"] {
        width: 120px;
        height: auto;
    }
    .hero-logo img[width="350"] {
        width: 240px;
        height: auto;
    }
}

/* ================== دسترسی‌های سریع ================== */

.quick-access {
    margin-top: 24px;
}

.quick-access h2 {
    display: inline-block;
    margin-top: 0;
    padding: 6px 16px;
    background: #eef2ff;
    border-radius: 999px;
    border: 1px solid #c7d2fe;
    color: #111827;
}

.quick-access .text-box {
    margin-top: 16px;
    background: #ffffff;
    border-radius: 18px;
    padding: 14px;
    box-shadow: 0 4px 14px rgba(15,23,42,0.06);
}

/* استفاده از گریدی که خودت گذاشتی */
.quick-access-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 10px;
}

.quick-access .button {
    background: #4f46e5;
    color: #ffffff;
    border-color: #4f46e5;
}

/* ================== چرا گروه قلم ================== */

.why-ghalam {
    margin-top: 32px;
}

.why-ghalam .content {
    background: #ffffff;
    border-radius: 18px;
    padding: 20px;
    box-shadow: 0 4px 14px rgba(15,23,42,0.06);
}

.why-ghalam h2 {
    display: inline-block;
    margin-top: 0;
    padding: 6px 16px;
    background: #eef2ff;
    border-radius: 999px;
    border: 1px solid #c7d2fe;
    color: #111827;
}

.section-subtitle {
    margin-top: 8px;
    font-size: 0.9rem;
    color: #6b7280;
}

/* گرید ویدیوها */
.video-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
    gap: 16px;
    margin-top: 20px;
}

.video-box {
    text-align: center;
}

.video-wrapper {
    position: relative;
    aspect-ratio: 16 / 9;
    overflow: hidden;
    border-radius: 12px;
    background: #000;
    margin-bottom: 8px;
}

.video-wrapper video {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.video-box h3 {
    margin: 6px 0 4px;
    font-size: 0.95rem;
}

.video-box p {
    margin: 0 0 8px;
    font-size: 0.85rem;
    color: #4b5563;
}

/* ================== خدمات ================== */

.services {
    margin-top: 32px;
}

.services .content {
    background: #ffffff;
    border-radius: 18px;
    padding: 20px;
    box-shadow: 0 4px 14px rgba(15,23,42,0.06);
}

.services h2 {
    display: inline-block;
    margin-top: 0;
    padding: 6px 16px;
    background: #eef2ff;
    border-radius: 999px;
    border: 1px solid #c7d2fe;
    color: #111827;
}

.services-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 16px;
    margin-top: 20px;
}

.service-item {
    background: #fff;
    border-radius: 16px;
    padding: 16px;
    box-shadow: 0 4px 12px rgba(15,23,42,0.06);
}

.service-item img {
    width: 100%;
    border-radius: 12px;
    margin-bottom: 8px;
}

.service-item h4 {
    margin: 6px 0;
    font-size: 1rem;
}

.service-item p {
    margin: 4px 0;
    font-size: 0.9rem;
    line-height: 1.7;
}

.service-item a {
    color: #2563eb;
}

/* ================== آمار ================== */

.statistics {
    margin-top: 32px;
}

.statistics .content {
    background: #ffffff;
    border-radius: 18px;
    padding: 20px;
    box-shadow: 0 4px 14px rgba(15,23,42,0.06);
}

.statistics h2 {
    display: inline-block;
    margin-top: 0;
    padding: 6px 16px;
    background: #eef2ff;
    border-radius: 999px;
    border: 1px solid #c7d2fe;
    color: #111827;
}

.stat-item {
    text-align: center;
    background: #fff;
    border-radius: 16px;
    padding: 18px;
    box-shadow: 0 4px 12px rgba(15,23,42,0.06);
    max-width: 320px;
    margin: 12px auto 0;
}

.stat-item img {
    width: 50px;
    height: 50px;
}

.stat-item p {
    margin: 6px 0;
}

.stat-number {
    font-size: 2rem;
    font-weight: 700;
    color: #4f46e5;
}

/* ================== دکمه بازگشت به بالا ================== */

.scroll-to-top-btn {
    position: fixed;
    inset-inline-end: 16px;
    bottom: 16px;
    width: 40px;
    height: 40px;
    border-radius: 999px;
    border: none;
    display: none;
    align-items: center;
    justify-content: center;
    background: #4f46e5;
    color: #fff;
    cursor: pointer;
    box-shadow: 0 6px 16px rgba(0,0,0,0.2);
    z-index: 1500;
}

/* ================== فوتر ================== */

.site-footer {
    margin-top: 40px;
    padding: 28px 0 32px;
    background: linear-gradient(135deg, #0f172a, #1d4ed8);
    color: #e5e7eb;
}

.footer-inner {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    align-items: center;
    justify-content: center;
    text-align: center;
}

.footer-brand img {
    width: 140px;
    height: 140px;
    border-radius: 24px;
    box-shadow: 0 8px 22px rgba(15,23,42,0.8);
}

.contact-info p {
    margin: 10px 0;
    line-height: 1.8;
    font-size: 0.9rem;
}

.footer-contact img {
    width: 24px;
    margin-inline: 4px;
}

/* موبایل فوتر */
@media (max-width: 768px) {
    .footer-brand img {
        width: 110px;
        height: 110px;
    }
}

/* ================== انیمیشن ملایم برای سکشن‌ها ================== */

.animated-section {
    opacity: 0;
    transform: translateY(20px);
    animation: fadeUp 0.6s ease-out forwards;
}

.quick-access  { animation-delay: 0.1s; }
.why-ghalam    { animation-delay: 0.2s; }
.services      { animation-delay: 0.3s; }
.statistics    { animation-delay: 0.4s; }

@keyframes fadeUp {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}
