:root {
  --primary: #00664b;
  --primary-700: #00553f;
  --accent: #f2b705;
  --muted: #e6f4f1;
  --bg: #fbfbfb;
  --text: #222;
  --white: #fff;
  --radius: 12px;
  --container: 1200px;
  --gap: 1.25rem;
  font-size: 16px;
}

/* font preload in head; font-display optional in @font-face in original */
@font-face {
  font-family: "shabnam";
  src: url("../assets/fonts/shabnam/Shabnam-Medium.woff") format("woff");
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}

* {
  box-sizing: border-box;
}
html,
body {
  height: 100%;
  margin: 0;
  padding: 0;
  direction: rtl;
  background: var(--bg);
  color: var(--text);
  font-family: "shabnam", "Vazirmatn", sans-serif;
  scroll-behavior: smooth;
}
.container {
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 1rem;
}
body {
  overflow-x: hidden;
}
a {
  color: inherit;
  text-decoration: none;
}
img {
  max-width: 100%;
  height: auto;
  display: block;
}

/* TOPBAR */
.topbar {
  background: var(--primary);
  color: var(--muted);
  text-align: center;
  font-size: clamp(0.9rem, 1.6vw, 1.1rem);
  display: flex;
  align-items: stretch;
  justify-content: center;
  height: 70px;
}
.tel-link {
  color: var(--muted);
  text-decoration: underline;
}

.topbar__text {
  height: 100%;
  line-height: 70px;
}

/* NAVBAR */
.navbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem 1rem;
  gap: 1rem;
  background: transparent;
}
.navbar__brand img {
  border-radius: 10px;
}
.nav-list {
  display: flex;
  gap: 1.5rem;
  align-items: center;
  margin: 0;
  padding: 0;
  list-style: none;
}
.nav-list a {
  padding: 0.5rem 0.6rem;
  border-radius: 8px;
  transition: background 0.18s, transform 0.12s;
  color: var(--primary);
  font-weight: 700;
  position: relative;
}

.nav-list a:after {
  position: absolute;
  content: "";
  width: 0;
  height: 2px;
  bottom: 0;
  right: 0;
  background-color: var(--primary);
  transition: all ease 0.3s;
}
.nav-list a:hover::after {
  width: 100%;
}
.nav-cta .btn--primary {
  background: var(--primary);
  color: var(--white);
  padding: 0.5rem 1rem;
  border-radius: 999px;
  border: none;
}

/* HERO */
.hero {
  position: relative;
  min-height: 500px;
  display: flex;
  align-items: center;
  color: var(--white);
  background-image: linear-gradient(
      90deg,
      rgba(0, 0, 0, 0.45),
      rgba(0, 0, 0, 0.25)
    ),
    url("../assets/images/ai.png");
  background-size: cover;
  background-position: center;
  padding: 3rem 0;
}
.hero__inner {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  max-width: 900px;
}
.hero__title {
  font-size: clamp(1.6rem, 4vw, 2.2rem);
  line-height: 1.1;
  margin: 0;
  font-weight: 800;
}
.hero__subtitle {
  font-size: clamp(1rem, 2.2vw, 1.25rem);
  opacity: 0.95;
}
.hero__actions {
  display: flex;
  gap: 1rem;
  margin-top: 0.8rem;
}
.social:hover {
  color: var(--primary);
}
.btn {
  display: inline-block;
  padding: 0.6rem 1rem;
  border-radius: 999px;
  border: 2px solid transparent;
  cursor: pointer;
  font-weight: 700;
}
.btn--primary {
  background: var(--primary);
  color: var(--white);
}

.btn--primary:hover {
  background-color: var(--primary-700);
}

.btn--secondary {
  background: transparent;
  border-color: var(--white);
  color: var(--white);
}
.btn--outline {
  background: transparent;
  border: 2px solid var(--primary);
  color: var(--primary);
  padding: 0.6rem 0.9rem;
  border-radius: 10px;
}

/* MAIN SECTIONS */
.about {
  padding: 3rem 0;
  background: transparent;
}
.about__inner {
  display: grid;
  grid-template-columns: 1fr 360px;
  gap: 2rem;
  align-items: center;
}
.about__text h2 {
  margin: 0 0 0.6rem;
  font-size: 1.6rem;
}
.about__text p {
  margin: 0 0 1rem;
  line-height: 1.8;
}
.about__features {
  list-style: disc;
  margin: 0 0 1rem 1.25rem;
  padding: 0;
}
.about__media {
  display: flex;
  align-items: center;
  justify-content: center;
}

/* CARDS (services) */
.services {
  padding: 2.5rem 0;
}
.services h2 {
  text-align: center;
  margin-bottom: 1rem;
}
.cards {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
}
.card {
  background: var(--white);
  padding: 1.25rem;
  border-radius: 12px;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.06);
  transition: transform 0.18s, box-shadow 0.18s, border 0.3s;
  border: 2px solid rgba(0, 0, 0, 0.04);
}

.card h3 {
  margin: 0 0 0.5rem;
  color: var(--primary);
}
.card:hover {
  transform: translateY(-6px);
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.08);
  border: 2px solid var(--primary);
}

/* FAQ */
.faq {
  padding: 2.5rem 0;
  background: transparent;
}
.faq-item {
  margin-bottom: 0.6rem;
}
#faqTitle {
  text-align: center;
  margin-bottom: 2rem;
}
.faq-q {
  width: 100%;
  text-align: right;
  padding: 0.8rem;
  border-radius: 8px;
  background: var(--white);
  border: 1px solid rgba(0, 0, 0, 0.04);
  cursor: pointer;
  font-weight: 700;
}
.faq-a {
  max-height: 0;
  overflow: hidden;
  padding: 0 1rem;
  background: rgba(0, 0, 0, 0.02);
  border-radius: 8px;
  margin-top: 0.4rem;
  transition: max-height 0.35s ease, padding 0.35s ease;
}

.faq-a.open {
  max-height: 1000px; /* ارتفاع کافی برای متن */
  padding: 0.9rem 1rem;
}

/* CONTACT */

/* TITLE */

.contact-section {
  margin-bottom: 2rem;
}

.contact-title {
  text-align: center;
  font-size: 2rem;
  margin-bottom: 2rem;
  font-weight: 500;
}

/* FLEX ROW (MAP + INFO) */
.contact-flex {
  display: flex;
  align-items: stretch;
  justify-content: center;
  gap: 2rem;
}

/* MAP BOX */
.contact-map {
  flex: 1;
}

/* INFO BOX */
.contact-info {
  flex: 1;
  background: #fafafa;
  padding: 1.8rem;
  border-radius: 14px;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.07);
}

.contact-info h3 {
  margin-bottom: 1rem;
  font-size: 1.3rem;
}

.contact-info p {
  margin-bottom: 0.7rem;
  line-height: 1.8;
}

.contact-info a {
  font-weight: 500;
}
.contact-info a:hover {
  color: var(--primary);
}

/* BUTTONS */
.contact-buttons {
  margin-top: 1.2rem;
  display: flex;
  gap: 1rem;
}

/* RESPONSIVE */
@media (max-width: 768px) {
  .contact-flex {
    flex-direction: column;
  }

  .contact-map {
    height: 300px;
  }
}

/* FOOTER */
.site-footer {
  background: var(--primary);
  color: var(--white);
  padding: 1.5rem 0;
  position: relative;
}
.footer__inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
}
.back-to-top {
  position: fixed;
  left: 1rem;
  bottom: 1rem;
  background: var(--primary-700);
  color: #fff;
  padding: 0.6rem;
  border-radius: 6px;
  text-decoration: none;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.12);
}

/* Shared Styles */
.section-title {
  font-size: 30px;
  font-weight: 700;
  text-align: center;
  color: #222;
  margin-bottom: 45px;
}

/* Service Card Style */
.service-card-section {
  padding: 80px 0;
}
.service-card-section.alt-bg {
  background: #f7faff;
}

.card-wrapper {
  display: grid;
  gap: 18px;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
}
.info-card {
  background: #fff;
  padding: 20px 22px;
  font-size: 17px;
  border-radius: 20px;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.05);
  transition: 0.35s;
  border: 1px solid #e7edf3;
}
.info-card:hover {
  transform: translateY(-6px);
  box-shadow: 0 10px 18px rgba(0, 0, 0, 0.08);
  border-color: #d7e7f9;
}

/* Timeline */
.timeline-section {
  padding: 95px 0;
}
.timeline {
  position: relative;
  max-width: 780px;
  margin: auto;
}
.timeline::before {
  content: "";
  position: absolute;
  right: 50%;
  top: 0;
  height: 100%;
  width: 3px;
  background: var(--primary);
  transform: translateX(50%);
}
.timeline-item {
  position: relative;
  background: #ffffff;
  margin: 30px 0;
  padding: 20px 26px;
  border-radius: 18px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.06);
  width: 48%;
}
.timeline-item:nth-child(odd) {
  margin-right: auto;
}
.timeline-item:nth-child(even) {
  margin-left: auto;
}
.timeline-item::after {
  content: "";
  position: absolute;
  top: 24px;
  width: 14px;
  height: 14px;
  background: var(--primary);
  border-radius: 50%;
  border: 3px solid #fff;
}
.timeline-item:nth-child(odd)::after {
  right: -9px;
}
.timeline-item:nth-child(even)::after {
  left: -9px;
}

.timeline-item h3 {
  font-size: 19px;
  color: var(--primary);
  margin-bottom: 6px;
}
.timeline-item p {
  font-size: 15px;
  color: #555;
}

/* خدمات مادریار حرفه‌ای */
.service-madaryar {
  padding: 90px 0;
}

.madaryar-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 25px;
}

.madaryar-card {
  background: #fff;
  padding: 28px 22px;
  border-radius: 25px;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.08);
  transition: 0.35s ease;
  text-align: center;
  position: relative;
  overflow: hidden;
  cursor: pointer;
}
.madaryar-card:hover {
  transform: translateY(-10px) scale(1.02);
  box-shadow: 0 18px 35px rgba(0, 0, 0, 0.12);
}

/* Icon */
.madaryar-card .icon {
  font-size: 36px;
  margin-bottom: 15px;
  display: inline-block;
  background: linear-gradient(135deg, #4f7bcc, #1ab2ff);
  color: #fff;
  width: 60px;
  height: 60px;
  line-height: 60px;
  border-radius: 50%;
  transition: 0.35s;
}
.madaryar-card:hover .icon {
  transform: rotate(15deg) scale(1.1);
}

/* Title */
.madaryar-card h3 {
  font-size: 18px;
  font-weight: 700;
  color: #184b96;
  margin-bottom: 10px;
}

/* Description */
.madaryar-card p {
  font-size: 15px;
  color: #555;
  line-height: 1.6;
}

/* Responsive */
@media (max-width: 576px) {
  .madaryar-grid {
    gap: 20px;
  }
  .madaryar-card {
    padding: 20px 16px;
  }
  .madaryar-card h3 {
    font-size: 16px;
  }
  .madaryar-card p {
    font-size: 14px;
  }
}

@media (max-width: 576px) {
  .timeline::before {
    right: auto;
    left: 20px;
  }
  .timeline-item {
    width: 100%;
    padding-right: 50px;
  }
  .timeline-item:nth-child(even),
  .timeline-item:nth-child(odd) {
    margin: 20px 0;
  }
  .timeline-item::after {
    left: 12px !important;
  }
  .section-title {
    font-size: 24px;
  }
}

/* responsive: large -> tablet -> mobile */
@media (max-width: 1000px) {
  .cards {
    grid-template-columns: repeat(2, 1fr);
  }
  .about__inner {
    grid-template-columns: 1fr 300px;
  }
}
@media (max-width: 720px) {
  .nav-cta {
    display: none;
  }
  .hero {
    padding: 2rem 0;
    min-height: 360px;
  }
  .container {
    padding: 0 0.75rem;
  }
}
@media (max-width: 480px) {
  .cards {
    grid-template-columns: 1fr;
  }
  .about__inner {
    grid-template-columns: 1fr;
    gap: 1rem;
  }
  .hero__title {
    font-size: 1.6rem;
  }
  .topbar__text {
    font-size: 0.95rem;
  }
  .nav-list {
    display: flex;
    align-items: center;
    justify-content: center;
  }
  .nav-list > li {
    font-size: 0.8rem;
  }
}
