:root {
  --primary: #c62828;
  --dark: #222;
  --muted: #666;
  --bg: #fafafa;
  --max-width: 1100px;
}

* {
  box-sizing: border-box;
}
html,
body {
  height: 100%;
}
body {
  margin: 0;
  font-family: "Vazirmatn", system-ui, -apple-system, "Segoe UI", Roboto,
    "Helvetica Neue", Arial;
  background: var(--bg);
  color: var(--dark);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 1rem;
}
.site-header {
  background: var(--primary);
  border-bottom: 1px solid rgba(0, 0, 0, 0.08);
}
/* Keep header above mobile menu */
.site-header {
  position: relative;
  z-index: 1000;
}
.site-header .container {
  display: flex;
  align-items: center;
  gap: 1rem;
}
.brand {
  font-weight: 700;
  color: #fff;
  text-decoration: none;
  font-size: 1.1rem;
  display: inline-flex;
  align-items: center;
  direction: ltr; /* keep image visually on the right */
}
.brand-img {
  height: 50px;
  margin-left: 0.5rem; /* spacing between text and image */
  margin-right: 0;
  vertical-align: middle;
}
.brand-text {
  direction: rtl;
}
.main-nav {
  margin-left: auto;
  display: flex;
  gap: 1rem;
  align-items: center;
}
.main-nav a {
  color: #fff;
  text-decoration: none;
}
.phone {
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  padding: 0.4rem 0.7rem;
  border-radius: 6px;
  text-decoration: none;
}

.hero {
  padding: 3rem 0;
  background: linear-gradient(180deg, #fff 0%, #fff0 100%);
}
.hero-images {
  display: grid;
  gap: 0.6rem;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  align-items: center;
  justify-items: center;
  margin-bottom: 1rem;
}
.hero-images img {
  width: 100%;
  height: 175px;
  object-fit: cover;
  border-radius: 6px;
}
.hero .lead {
  color: var(--muted);
  margin-top: 0.5rem;
}
.cta-row .btn {
  display: inline-block;
  margin: 0.5rem 0.5rem 0 0;
  padding: 0.6rem 1rem;
  border-radius: 6px;
  text-decoration: none;
}
.btn.primary {
  background: var(--primary);
  color: #fff;
}
.btn.secondary {
  background: #fff;
  border: 1px solid #ddd;
  color: var(--dark);
}

.services,
.about,
.faq,
.contact {
  padding: 2rem 0;
  background: #fff;
  margin-top: 1rem;
  border-radius: 10px;
}
.service-list {
  list-style: none;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1rem;
}
.service-list li {
  background: #fafafa;
  padding: 1rem;
  border-radius: 8px;
}

/* Blog styles */
.blog-list {
  padding-top: 2rem;
  padding-bottom: 2rem;
}
.post {
  background: #fff;
  padding: 1rem 1.25rem;
  border-radius: 8px;
  margin-bottom: 1rem;
  border: 1px solid #eee;
}
.post h2 {
  margin-top: 0;
}
.post .cta {
  margin-top: 0.5rem;
}
.post .cta a {
  color: var(--primary);
  text-decoration: underline;
}
.features {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
}
.features > div {
  flex: 1 1 200px;
  background: #fafafa;
  padding: 1rem;
  border-radius: 8px;
}

.contact-grid {
  display: grid;
  grid-template-columns: 1fr 320px;
  gap: 1rem;
}
.contact-form {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}
.contact-form input,
.contact-form textarea {
  padding: 0.6rem;
  border: 1px solid #ddd;
  border-radius: 6px;
}
.form-msg {
  margin-top: 0.5rem;
  color: var(--primary);
}
.contact-info {
  background: #fafafa;
  padding: 1rem;
  border-radius: 8px;
}

.site-footer {
  margin-top: 1rem;
  padding: 1rem 0;
  background: #fff;
  border-top: 1px solid #eee;
}
.site-footer .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.site-footer a {
  text-decoration: none;
  color: var(--muted);
}

@media (max-width: 800px) {
  .container {
    padding: 0.75rem;
  }
  /* Mobile: hide desktop nav and show mobile-style nav as a right-aligned panel */
  .main-nav {
    display: none;
    position: absolute;
    /* place directly below header and align to the right (header is the positioned ancestor) */
    top: 100%;
    right: 0;
    left: auto;
    width: 100%;
    max-width: 360px;
    overflow: auto;
    background: var(--primary);
    flex-direction: column;
    padding: 1rem;
    gap: 0.5rem;
    z-index: 900;
    text-align: right;
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.12);
    border-bottom-left-radius: 8px;
  }
  .main-nav.open {
    display: flex;
  }
  .mobile-menu-toggle {
    display: inline-block;
    background: transparent;
    border: 0;
    color: #fff;
    font-size: 1.4rem;
    padding: 0.4rem 0.6rem;
    border-radius: 6px;
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    right: 1.25rem; /* sit on the right side of header (nudge left slightly)") */
    z-index: 85; /* above header elements */
  }
  /* add extra spacing to the brand image on small screens so the button doesn't overlap */
  .brand-img {
    margin-right: 2.5rem;
  }
  .main-nav a {
    padding: 0.5rem 0.75rem;
  }
  .contact-grid {
    grid-template-columns: 1fr;
  }
}

@media (min-width: 801px) {
  /* On desktop ensure mobile toggle is hidden and nav shows inline */
  .mobile-menu-toggle {
    display: none;
  }
  .main-nav {
    display: flex !important;
    position: static;
    top: auto;
    right: auto;
    left: auto;
    width: auto;
    background: transparent;
    flex-direction: row;
    padding: 0;
    gap: 1rem;
  }
}

/* Accessibility */
.btn:focus,
.phone:focus,
.main-nav a:focus {
  outline: 3px solid rgba(198, 40, 40, 0.2);
  outline-offset: 2px;
}

/* RTL adjustments */
@media (min-width: 801px) {
  /* RTL adjustments for desktop only */
  html[dir="rtl"] .main-nav {
    margin-right: auto;
    margin-left: 0;
  }
}
