/* =====================================================
   فایل ظاهر سایت (CSS)
   هر بخش با یک عنوان مشخص شده؛ برای تغییر، همان بخش را پیدا کنید.
   ===================================================== */

/* ---------- ۱) رنگ‌ها و تنظیمات اصلی ----------
   برای عوض کردن رنگ کل سایت فقط همین مقادیر را تغییر دهید */
:root {
  --blue: #003a79;        /* آبی اصلی (هدر، فوتر) */
  --blue-dark: #002a5a;   /* آبی تیره‌تر (نوار پایین) */
  --blue-light: #e5ecf6;  /* آبی روشن (پس‌زمینه خدمات) */
  --orange: #f26a21;      /* نارنجی دکمه‌ها */
  --red: #e8312a;         /* قرمز لینک‌ها */
  --text: #222;
  --gray: #555;
  --width: 1140px;        /* حداکثر عرض محتوا */
}

/* ---------- ۲) تنظیمات پایه ---------- */
* { box-sizing: border-box; margin: 0; padding: 0; }  /* حذف فاصله‌های پیش‌فرض مرورگر */
html { scroll-behavior: smooth; }                      /* اسکرول نرم هنگام کلیک روی لینک‌ها */
body {
  font-family: Vazirmatn, Tahoma, "Segoe UI", sans-serif; /* اگر فونت اول نبود، بعدی */
  color: var(--text);
  line-height: 1.9;
  background: #fff;
}
a { text-decoration: none; color: inherit; }
ul { list-style: none; }
img { max-width: 100%; }
input, textarea, button { font-family: inherit; font-size: 14px; }

/* کادر مرکزی که محتوا را وسط صفحه نگه می‌دارد */
.container { width: 100%; max-width: var(--width); margin: 0 auto; padding: 0 20px; }

/* متن کوچک بالای عنوان‌ها و لینک‌های «ادامه مطلب» */
.small { font-size: 14px; color: var(--gray); }
.more { color: var(--red); font-size: 14px; }
.more:hover { text-decoration: underline; }

/* دکمه‌ها: .btn نارنجی ، .btn--red قرمز */
.btn {
  display: inline-block; background: var(--orange); color: #fff;
  border: 0; padding: 14px 40px; cursor: pointer; transition: .2s;
}
.btn:hover { filter: brightness(1.1); }
.btn--red { background: #a94442; padding: 10px 40px; }

/* ---------- ۳) هدر ---------- */
.header { background: var(--blue); color: #fff; position: relative; z-index: 10; }

/* نوار بالایی */
.topbar { background: #00305f; font-size: 13px; padding: 8px 0; }
.topbar__inner { display: flex; justify-content: space-between; align-items: center; }
.social { display: flex; gap: 22px; }
.social a { font-weight: bold; }
.social a:hover { color: var(--orange); }

/* نوار میانی (لوگو، آدرس، تلفن) */
.middlebar { display: flex; justify-content: space-between; align-items: center; padding: 18px 20px; border-bottom: 1px solid rgba(255,255,255,.15); }
.logo { display: flex; align-items: center; gap: 12px; font-size: 24px; font-weight: bold; }
.middlebar__info { display: flex; gap: 0; font-size: 14px; }
.info-item { padding: 0 25px; }
.info-item--line { border-right: 1px solid rgba(255,255,255,.2); }

/* نوار منو */
.navbar { display: flex; justify-content: space-between; align-items: center; padding: 0 20px; min-height: 56px; }
.nav__list { display: flex; gap: 28px; }
.nav__list a { display: block; padding: 16px 0; font-size: 14px; }
.nav__list a:hover, .nav__list a.active { color: #ff5a4d; }

/* زیرمنوی خدمات (با رفتن موس نمایش داده می‌شود) */
.has-dropdown { position: relative; }
.dropdown {
  display: none; position: absolute; top: 100%; right: 0; min-width: 200px;
  background: #fff; color: var(--text); box-shadow: 0 5px 15px rgba(0,0,0,.2);
}
.dropdown a { padding: 10px 18px; border-bottom: 1px solid #eee; }
.dropdown a:hover { background: var(--blue-light); color: var(--blue); }
.has-dropdown:hover .dropdown { display: block; }

/* جستجو و سبد خرید */
.navbar__tools { display: flex; align-items: center; gap: 14px; }
.search { display: flex; }
.search input { width: 200px; padding: 7px 10px; background: transparent; border: 1px solid rgba(255,255,255,.3); color: #fff; }
.search input::placeholder { color: #9fb3cf; }
.search button { background: var(--orange); color: #fff; border: 0; padding: 0 22px; cursor: pointer; }
.cart small { background: #fff; color: var(--blue); border-radius: 50%; padding: 0 6px; }

/* دکمه منوی موبایل (در دسکتاپ مخفی) */
.menu-toggle { display: none; background: none; border: 0; color: #fff; font-size: 26px; cursor: pointer; }

/* ---------- ۴) بخش اصلی (Hero) ----------
   عکس پس‌زمینه: فایل hero.jpg کنار index.html؛ اگر نبود گرادیان آبی دیده می‌شود */
.hero { background: linear-gradient(120deg, #dbe8f7, #f3f7fc); position: relative; }
.hero__inner { display: flex; align-items: center; justify-content: space-between; min-height: 450px; padding-bottom: 60px; }
.hero__text { max-width: 480px; }
.hero__small { color: var(--blue); font-size: 15px; }
.hero h1 { color: var(--blue); font-size: 38px; margin: 12px 0 22px; line-height: 1.5; }
.hero__text p { margin-bottom: 30px; }
.hero__img {
  width: 420px; height: 450px; align-self: flex-end;
  background: url("hero.jpg") center bottom / contain no-repeat;
}

/* ---------- ۵) کارت‌های ویژگی ---------- */
.features { margin-top: -70px; position: relative; z-index: 5; }
.features__grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 22px; }
.feature-card { background: #fff; padding: 28px; box-shadow: 0 10px 25px rgba(0,0,0,.08); min-height: 230px; }
.feature-card__icon { font-size: 34px; display: block; margin-bottom: 8px; }
.feature-card h3 { font-size: 18px; margin-bottom: 8px; }
.feature-card p { font-size: 13px; color: var(--gray); text-align: justify; }

/* ---------- ۶) درباره ما ---------- */
.about { padding: 60px 0; }
.about__box { display: flex; max-width: 1060px; }
.about__text { flex: 1; background: var(--blue); color: #fff; padding: 60px 50px; }
.about__text h2 { font-size: 30px; margin: 10px 0 22px; }
.about__text .small { color: #fff; }
.about__text p { font-size: 14px; text-align: justify; }
.about__sign { margin-top: 30px; display: flex; flex-direction: column; font-size: 13px; }
.signature { font-family: cursive; font-size: 30px; font-style: italic; }
.about__img { flex: 1; min-height: 380px; background: url("about.jpg") center / cover, #8fa9c8; }

/* ---------- ۷) عنوان بخش‌ها (مشترک) ---------- */
.section-head { display: flex; justify-content: space-between; align-items: flex-end; margin-bottom: 45px; }
.section-head h2 { font-size: 34px; line-height: 1.5; }

/* ---------- ۸) خدمات ---------- */
.services { background: var(--blue-light); padding: 70px 0; }
.services__grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 30px; align-items: start; }
.service-card { background: #fff; border: 1px solid #bbb; padding: 70px 25px 30px; }
.service-card h3 { font-size: 18px; margin-bottom: 14px; }
.service-card p { font-size: 13px; color: var(--gray); text-align: justify; margin-bottom: 28px; }
/* ستون وسط کمی پایین‌تر قرار می‌گیرد (چیدمان پلکانی) */
.service-card:nth-child(3n+2) { margin-top: 30px; }

/* ---------- ۹) پروژه‌ها و اسلایدر ---------- */
.projects { padding: 70px 0 40px; }
.slider { position: relative; padding: 0 20px; }
.slider__track { display: flex; gap: 10px; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; }
.slider__track::-webkit-scrollbar { display: none; }
.slide { flex: 0 0 33.3%; height: 350px; scroll-snap-align: start; background-size: cover; background-position: center; background-color: #9db4d1; }
/* عکس‌ها: p1.jpg تا p4.jpg */
.slide--1 { background-image: url("p1.jpg"); }
.slide--2 { background-image: url("p2.jpg"); }
.slide--3 { background-image: url("p3.jpg"); }
.slide--4 { background-image: url("p4.jpg"); }
.slider__btn { position: absolute; top: 50%; transform: translateY(-50%); z-index: 3; background: rgba(0,58,121,.8); color: #fff; border: 0; width: 38px; height: 38px; font-size: 24px; cursor: pointer; }
.slider__btn--next { right: 0; }
.slider__btn--prev { left: 0; }
.projects__text { text-align: center; max-width: 520px; margin: 25px auto 0; font-size: 14px; }

/* ---------- ۱۰) فرم درخواست تماس (لبه مورب پایین) ---------- */
.contact { background: linear-gradient(rgba(0,58,121,.88), rgba(0,58,121,.88)), url("contact.jpg") center / cover, var(--blue); color: #fff; padding: 60px 0 110px; clip-path: polygon(0 0, 100% 0, 100% 85%, 0 100%); }
.contact__inner { display: flex; justify-content: space-between; gap: 40px; }
.contact__text { flex: 1; }
.contact__text h2 { font-size: 34px; margin-bottom: 20px; }
.contact__form { flex: 1; display: grid; grid-template-columns: 1fr 1fr; gap: 6px; align-content: start; }
.contact__form input, .contact__form textarea { padding: 8px 10px; border: 0; background: rgba(255,255,255,.6); color: #000; }
.contact__form input:nth-child(1), .contact__form input:nth-child(2), .contact__form input:nth-child(3) { grid-column: 1; }
.contact__form textarea { grid-column: 2; grid-row: 1 / 4; min-height: 95px; }
.contact__form button { grid-column: 1; justify-self: start; margin-top: 8px; }
.form-msg { grid-column: 1 / -1; font-size: 13px; }

/* ---------- ۱۱) وبلاگ ---------- */
.blog { padding: 60px 0 80px; }
.blog__grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 30px; }
.post { background: #fff; box-shadow: 0 5px 20px rgba(0,0,0,.08); }
.post__img { height: 230px; background-size: cover; background-position: center; background-color: #b7c8de; }
.post__img--1 { background-image: url("blog1.jpg"); }
.post__img--2 { background-image: url("blog2.jpg"); }
.post__img--3 { background-image: url("blog3.jpg"); }
.post__body { padding: 20px; }
.post__body h3 { margin-bottom: 6px; }
.post__body p { font-size: 13px; color: var(--gray); margin-bottom: 8px; }

/* ---------- ۱۲) فوتر ---------- */
.footer { background: var(--blue); color: #fff; padding-top: 60px; }
.footer__grid { display: grid; grid-template-columns: 1.3fr 1fr 1fr 1.2fr; gap: 40px; padding-bottom: 50px; }
.footer__about p { margin: 22px 0 14px; font-size: 14px; }
.footer__col h4 { font-size: 20px; font-weight: normal; margin-bottom: 25px; }
.footer__col li { border-bottom: 1px solid rgba(255,255,255,.15); }
.footer__col li a { display: block; padding: 5px 0; font-size: 13px; }
.footer__col li a:hover { color: var(--orange); }
.footer__form { display: flex; flex-direction: column; gap: 6px; }
.footer__form input, .footer__form textarea { padding: 7px 10px; border: 0; }
.footer__form textarea { height: 120px; }
.footer__form .btn { align-self: flex-start; padding: 8px 40px; margin-top: 10px; }
.copyright { background: var(--blue-dark); padding: 18px 0; font-size: 13px; color: #aab8cc; }

/* ---------- ۱۳) تبلت و موبایل (ریسپانسیو) ----------
   وقتی عرض صفحه کم شود، چیدمان تغییر می‌کند */
@media (max-width: 992px) {
  .features__grid, .footer__grid { grid-template-columns: repeat(2, 1fr); }
  .services__grid, .blog__grid { grid-template-columns: repeat(2, 1fr); }
  .service-card:nth-child(3n+2) { margin-top: 0; }
  .slide { flex-basis: 50%; }
  .hero__img { display: none; }
}
@media (max-width: 768px) {
  .middlebar__info { display: none; }
  .menu-toggle { display: block; }
  .navbar { flex-wrap: wrap; }
  .nav { display: none; width: 100%; order: 3; }
  .nav.open { display: block; }           /* کلاس open را جاوااسکریپت اضافه می‌کند */
  .nav__list { flex-direction: column; gap: 0; }
  .dropdown { position: static; box-shadow: none; }
  .navbar__tools { width: 100%; order: 2; padding-bottom: 12px; }
  .search { flex: 1; } .search input { width: 100%; }
  .features__grid, .services__grid, .blog__grid, .footer__grid { grid-template-columns: 1fr; }
  .features { margin-top: 20px; }
  .about__box, .contact__inner { flex-direction: column; }
  .slide { flex-basis: 85%; }
  .contact__form { grid-template-columns: 1fr; }
  .contact__form textarea { grid-column: 1; grid-row: auto; }
  .hero h1 { font-size: 28px; }
  .section-head h2 { font-size: 26px; }
}
