﻿/* ==================== تنظیمات پایه ==================== */
html {
    font-size: 14px;
    position: relative;
    min-height: 100%;
}

@media (min-width: 768px) {
    html {
        font-size: 16px;
    }
}

html, body {
    height: 100%;
    margin: 0;
}

body {
    display: grid;
    grid-template-rows: auto 1fr auto;
    min-height: 100vh;
    margin-bottom: 60px;
    font: normal 300 1.4rem/1.86 "IRANSans", "Dana", Tahoma, sans-serif;
    font-family: "Dana", "IRANSans", Tahoma, sans-serif;
    color: #666;
    background-color: #fff;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

main {
    flex: 1;
}

* {
    box-sizing: border-box;
}

/* ==================== فونت‌ها ==================== */
@font-face {
    font-family: 'IRANSans';
    src: url('/fonts/IRANSansWeb_Light.woff2') format('woff2'), url('/fonts/IRANSansWeb_Light.woff') format('woff');
    font-weight: 300;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'IRANSans';
    src: url('/fonts/IRANSansWeb_Light.woff2') format('woff2'), url('/fonts/IRANSansWeb_Light.woff') format('woff');
    font-weight: normal;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'Dana';
    src: url('/fonts/dana-fanum-regular.woff2') format('woff2'), url('/fonts/dana-fanum-regular.woff') format('woff');
    font-weight: normal;
    font-style: normal;
    font-display: swap;
}

/* عنوان‌ها */
h1, h2, h3, h4, h5, h6, .lead, .display-4 {
    font-family: "Dana", "IRANSans", sans-serif;
    font-weight: normal;
}

.text-light, .navbar-brand, .footer {
    font-family: "IRANSans", "Dana", sans-serif;
    font-weight: 300;
}

/* ==================== هدر و فوتر ==================== */
header {
    position: sticky;
    top: 0;
    background-color: white;
    z-index: 1000;
}

footer {
    grid-row: 3;
    background-color: #111;
    color: #fff;
    padding: 30px 20px;
    text-align: center;
    font-family: "IRANSans", "Dana", Tahoma, sans-serif;
}

    footer a {
        color: inherit;
        text-decoration: none;
    }

.footer-chips a {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin: 5px 10px;
}

.footer-chips i {
    font-size: 1.2rem;
}

/* ==================== دکمه‌ها و فرم ==================== */
.btn:focus, .btn:active:focus, .btn-link.nav-link:focus,
.form-control:focus, .form-check-input:focus {
    box-shadow: 0 0 0 0.1rem white, 0 0 0 0.25rem #258cfb !important;
}

/* ==================== بخش‌های عمومی ==================== */
.section {
    padding: 60px 20px;
    text-align: center;
}

    .section h2 {
        font-size: 2.5rem;
        margin-bottom: 15px;
        color: #222;
    }

    .section p.muted {
        font-size: 1.1rem;
        color: #666;
        margin-bottom: 40px;
    }

/* گرید کارت‌ها */
.grid {
    display: grid;
    gap: 20px;
}

.grid-4 {
    grid-template-columns: repeat(4, 1fr);
}

@media (max-width: 1024px) {
    .grid-4 {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 600px) {
    .grid-4 {
        grid-template-columns: 1fr;
    }
}

.card {
    background-color: #fff;
    border-radius: 12px;
    padding: 30px 20px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.08);
    transition: transform 0.3s, box-shadow 0.3s;
}

    .card:hover {
        transform: translateY(-5px);
        box-shadow: 0 8px 25px rgba(0,0,0,0.15);
    }

    .card .icon {
        width: 50px;
        height: 50px;
        color: #4CAF50;
        margin-bottom: 20px;
    }

    .card h3 {
        font-size: 1.3rem;
        margin-bottom: 10px;
        color: #222;
    }

    .card p.muted {
        font-size: 1rem;
        color: #666;
    }

/* انیمیشن موبایل */
@media (max-width: 768px) {
    .col-sm-6 {
        margin: .5rem auto;
        float: none;
        width: 90%;
        opacity: 0;
        transform: translateY(20px);
        animation: fadeInUp 0.6s forwards;
    }

    .row {
        margin-bottom: 1rem;
    }
}

@keyframes fadeInUp {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ==================== بقیه استایل‌های قدیمی (غیرمرتبط با Owl) ==================== */
.container {
    position: relative;
}

.mySlides {
    display: none;
}

.cursor {
    cursor: pointer;
}

.prev, .next {
    cursor: pointer;
    position: absolute;
    top: 40%;
    width: auto;
    padding: 16px;
    margin-top: -50px;
    color: white;
    font-weight: bold;
    font-size: 20px;
    border-radius: 0 3px 3px 0;
    user-select: none;
}

.next {
    right: 0;
    border-radius: 3px 0 0 3px;
}

    .prev:hover, .next:hover {
        background-color: rgba(0,0,0,0.8);
    }

.numbertext {
    color: #f2f2f2;
    font-size: 12px;
    padding: 8px 12px;
    position: absolute;
    top: 0;
}

.caption-container {
    text-align: center;
    background-color: #222;
    padding: 2px 16px;
    color: white;
}

.row:after {
    content: "";
    display: table;
    clear: both;
}

.column {
    float: left;
    width: 16.66%;
}

.demo {
    opacity: 0.6;
}

    .active, .demo:hover {
        opacity: 1;
    }

.featurette {
    padding-top: 3rem;
}

.features {
    color: rgb(61, 153, 245);
    font-weight: bold;
    text-align: center;
}

body, main {
    padding-top: 0 !important;
}



/* ==== حل قطعی مشکل Swiper در موبایل ==== */
.gallery-swiper,
.gallery-swiper .swiper-wrapper,
.gallery-swiper .swiper-slide {
    width: 100% !important;
    height: auto !important;
}

    .gallery-swiper .swiper-slide {
        height: auto !important;
        display: flex !important;
        flex-direction: column;
    }

    .gallery-swiper .card {
        width: 100% !important;
        margin: 0 auto;
        display: flex;
        flex-direction: column;
        height: 100% !important;
    }

    .gallery-swiper img {
        width: 100% !important;
        height: 250px !important; /* ارتفاع ثابت در موبایل */
        object-fit: cover;
        flex-shrink: 0;
    }

    .gallery-swiper .card-body {
        flex-grow: 1;
        display: flex;
        flex-direction: column;
        justify-content: center;
    }

/* فقط در موبایل: فاصله‌ها و دکمه‌ها رو تمیز کن */
@media (max-width: 575.98px) {
    .gallery-swiper {
        padding: 0 0 50px 0 !important;
        margin: 0 -15px; /* برای اینکه به لبه صفحه بچسبه */
        width: 100vw !important;
        position: relative;
        left: 50%;
        right: 50%;
        margin-left: -50vw;
        margin-right: -50vw;
    }

        .gallery-swiper .swiper-button-next,
        .gallery-swiper .swiper-button-prev {
            display: none !important; /* در موبایل دکمه‌ها رو مخفی کن (زیباتر می‌شه) */
        }
}
