/* ═══ i18n: language switcher, per-language fonts, LTR overrides, contact form ═══ */

/* Fonts — IRANSans (fa digits) for Persian, Tajawal for Arabic, Space Grotesk for English */
html[lang="ar"] { --font-fa: 'Tajawal', 'IRANSans', sans-serif; }
html[lang="en"] { --font-fa: 'Space Grotesk', system-ui, sans-serif; }
html[lang="en"] body { font-size: 15.5px; }
html[lang="en"] .section-label { letter-spacing: .3em; text-transform: uppercase; }

/* ═══ LANGUAGE SWITCHER ═══ */
.lang-switch {
  display: inline-flex;
  align-items: center;
  padding: 2px;
  border-radius: 7px;
  border: 1px solid rgba(34, 211, 238, .18);
  background: rgba(34, 211, 238, .03);
}

.lang-switch .lang-link {
  min-width: 30px;
  padding: 2px 8px;
  border-radius: 5px;
  font-size: .72rem;
  font-weight: 700;
  line-height: 1.6;
  text-align: center;
  color: var(--text-500);
  text-decoration: none;
  transition: color .2s, background .2s;
}

.lang-switch .lang-link[lang="en"] { font-family: 'Space Grotesk', system-ui, sans-serif; letter-spacing: .04em; }
.lang-switch .lang-link:hover { color: var(--cyan); }
.lang-switch .lang-link.active { color: #080d14; background: var(--lime); }

/* Mobile drawer version */
.mobile-menu .mobile-lang {
  align-self: center;
  margin-top: 14px;
  padding: 3px;
}

.mobile-menu .mobile-lang .lang-link {
  display: block;
  padding: 6px 16px;
  font-size: .85rem;
  border: none;
}

.mobile-menu .mobile-lang .lang-link.active { background: var(--lime); color: #080d14; }

@media(max-width:768px) {
  .topbar .lang-switch { display: none; }
  .topbar .lang-switch + .topbar-sep { display: none; }
}

/* ═══ LTR (English) — mirror the RTL-only rules from main.css ═══ */
[dir="ltr"] body { direction: ltr; }

[dir="ltr"] .mobile-menu {
  right: auto;
  left: 0;
  border-left: none;
  border-right: 1px solid rgba(34, 211, 238, .2);
  transform: translateX(-110%);
  box-shadow: 20px 0 60px rgba(0, 0, 0, .6);
}

[dir="ltr"] .mobile-menu.open { transform: translateX(0); }
[dir="ltr"] .mobile-close { left: auto; right: 18px; }

[dir="ltr"] .stat-item { border-left: none; border-right: 1px solid rgba(34, 211, 238, .08); }
[dir="ltr"] .stat-item:last-child { border-right: none; }

/* ═══ CONTACT FORM ═══ */
.contact-card {
  display: grid;
  grid-template-columns: 1fr 1.4fr;
  gap: 36px;
  padding: 34px;
}

.contact-card:hover { transform: none; }

.contact-intro h3 {
  color: var(--text-100);
  font-size: 1.35rem;
  font-weight: 800;
  margin-bottom: 10px;
}

.contact-intro p { color: var(--text-500); margin-bottom: 22px; }

.contact-direct { display: flex; flex-direction: column; gap: 10px; }
.contact-direct a { color: var(--lime); text-decoration: none; font-weight: 700; font-size: .92rem; }
.contact-direct a:hover { color: var(--cyan); }

.contact-form { display: flex; flex-direction: column; gap: 14px; }
.contact-form label { display: flex; flex-direction: column; gap: 6px; }
.contact-form label span { font-size: .78rem; font-weight: 700; color: var(--text-500); letter-spacing: .04em; }

.contact-form input,
.contact-form textarea {
  font: inherit;
  color: var(--text-100);
  background: rgba(8, 13, 20, .6);
  border: 1px solid rgba(34, 211, 238, .18);
  border-radius: 10px;
  padding: 11px 14px;
  outline: none;
  resize: vertical;
  transition: border-color .2s, box-shadow .2s;
}

.contact-form input:focus,
.contact-form textarea:focus {
  border-color: var(--cyan);
  box-shadow: 0 0 0 3px rgba(34, 211, 238, .12);
}

.contact-form input[aria-invalid="true"],
.contact-form textarea[aria-invalid="true"] { border-color: var(--orange); }

.contact-form button { align-self: flex-start; font-family: inherit; }
.contact-form button[disabled] { opacity: .6; cursor: wait; transform: none; }

.form-status { min-height: 1.5em; font-size: .88rem; font-weight: 600; }
.form-status.ok { color: var(--lime); }
.form-status.err { color: var(--orange); }

@media(max-width:768px) {
  .contact-card { grid-template-columns: 1fr; padding: 24px 20px; gap: 24px; }
}

/* ═══ PORTFOLIO ═══ */
.section-intro {
  color: var(--text-500);
  max-width: 640px;
  margin: -8px 0 28px;
  line-height: 1.9;
}

.pf-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: auto;
  padding-top: 14px;
}

.pf-tags span {
  font-size: .7rem;
  font-weight: 700;
  padding: 3px 9px;
  border-radius: 999px;
  color: var(--cyan);
  background: rgba(34, 211, 238, .07);
  border: 1px solid rgba(34, 211, 238, .2);
  direction: ltr;
  unicode-bidi: isolate;
}

.portfolio-card {
  display: flex;
  flex-direction: column;
}

.pf-cta {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 12px;
  margin-top: 28px;
  color: var(--text-500);
  flex-wrap: wrap;
}

/* ═══ FOOTER NAV ═══ */
.footer-nav {
  flex-basis: 100%;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px 24px;
  padding-bottom: 16px;
  margin-bottom: 4px;
  border-bottom: 1px solid rgba(34, 211, 238, .08);
}

.footer-nav a {
  font-weight: 500;
}

/* ═══ LEGAL PAGES ═══ */
.legal {
  position: relative;
  z-index: 1;
  max-width: 820px;
  padding-top: 48px;
  padding-bottom: 64px;
}

.legal h1 {
  font-size: 2rem;
  margin: 18px 0 6px;
}

.legal-updated {
  color: var(--text-500);
  font-size: .85rem;
  margin-bottom: 24px;
}

.legal-body {
  padding: 28px 32px;
  line-height: 2;
  color: var(--text-300, #cbd5e1);
}

.legal-body h2 {
  font-size: 1.1rem;
  color: var(--cyan);
  margin: 22px 0 6px;
}

.legal-body ul {
  padding-inline-start: 20px;
}

.legal-body a {
  color: var(--lime);
}

@media (max-width: 768px) {
  .legal-body {
    padding: 20px;
  }
}

/* Keep section titles clear of the sticky navbar when scrolled to */
section[id] {
  scroll-margin-top: 84px;
}

/* ═══ SEO CONTENT PAGES ═══ */
.content-wrap {
  position: relative;
  z-index: 1;
  padding: 32px 0 56px;
}

.breadcrumb ol {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  list-style: none;
  padding: 0;
  margin: 0 0 24px;
  font-size: .82rem;
  color: var(--text-500);
}

.breadcrumb li + li::before {
  content: "›";
  margin-inline-end: 6px;
  opacity: .6;
}

[dir="rtl"] .breadcrumb li + li::before {
  content: "‹";
}

.breadcrumb a {
  color: var(--cyan);
  text-decoration: none;
}

.content-head {
  max-width: 860px;
  margin-bottom: 36px;
}

.content-head h1 {
  font-size: clamp(1.6rem, 4vw, 2.5rem);
  line-height: 1.4;
  margin: 10px 0 12px;
  color: var(--text-100);
}

.content-meta {
  color: var(--text-500);
  font-size: .85rem;
  margin-bottom: 14px;
}

.content-intro,
.content-body {
  line-height: 2.05;
  color: var(--text-300, #cbd5e1);
  font-size: 1.02rem;
}

.content-intro p + p,
.content-body p + p {
  margin-top: 12px;
}

.content-cta {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 22px;
}

.content-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: 40px;
  align-items: start;
}

.content-body section {
  margin-bottom: 34px;
}

.content-body h2,
.related h2 {
  font-size: 1.35rem;
  line-height: 1.6;
  color: var(--text-100);
  margin-bottom: 12px;
}

.content-body h3 {
  font-size: 1.08rem;
  color: var(--cyan);
  margin: 18px 0 6px;
}

.content-body ul,
.content-body ol {
  padding-inline-start: 22px;
  margin: 10px 0;
}

.content-body li {
  margin-bottom: 6px;
}

.content-body a {
  color: var(--lime);
}

.content-body strong {
  color: var(--text-100);
}

.content-body code {
  direction: ltr;
  unicode-bidi: embed;
  font-family: ui-monospace, monospace;
  font-size: .88em;
  background: rgba(34, 211, 238, .08);
  border-radius: 4px;
  padding: 1px 5px;
}

.toc {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 22px;
  margin-bottom: 30px;
  background: rgba(13, 21, 32, .6);
}

.toc ol {
  margin: 8px 0 0;
}

.toc a {
  color: var(--text-300, #cbd5e1);
  text-decoration: none;
}

.toc a:hover {
  color: var(--cyan);
}

.faq details {
  border: 1px solid var(--border);
  border-radius: 10px;
  margin-bottom: 10px;
  background: rgba(13, 21, 32, .6);
}

.faq summary {
  cursor: pointer;
  padding: 14px 18px;
  font-weight: 700;
  color: var(--text-100);
  list-style: none;
  display: flex;
  justify-content: space-between;
  gap: 12px;
}

.faq summary::-webkit-details-marker {
  display: none;
}

.faq summary::after {
  content: "+";
  color: var(--cyan);
  font-size: 1.2rem;
  line-height: 1;
}

.faq details[open] summary::after {
  content: "−";
}

.faq details p {
  padding: 0 18px 16px;
  margin: 0;
}

.content-aside {
  position: sticky;
  top: 92px;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.aside-cta,
.aside-links {
  padding: 22px;
}

.aside-cta:hover,
.aside-links:hover,
.seo-card:hover {
  transform: none;
}

.aside-cta h3,
.aside-links h3 {
  font-size: 1.02rem;
  color: var(--text-100);
  margin-bottom: 8px;
}

.aside-cta p {
  font-size: .88rem;
  line-height: 1.9;
  color: var(--text-500);
  margin-bottom: 16px;
}

.aside-cta .btn-start {
  display: flex;
  justify-content: center;
  margin-bottom: 12px;
}

.aside-direct,
.aside-links a {
  display: block;
  padding: 6px 0;
  font-size: .88rem;
  color: var(--text-300, #cbd5e1);
  text-decoration: none;
}

.aside-direct:hover,
.aside-links a:hover {
  color: var(--cyan);
}

.seo-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 16px;
  margin-top: 14px;
}

.seo-card {
  display: block;
  padding: 20px;
  text-decoration: none;
  color: inherit;
}

.seo-card:hover {
  border-color: rgba(34, 211, 238, .45);
}

.seo-card h3 {
  font-size: 1rem;
  line-height: 1.7;
  color: var(--text-100);
  margin-bottom: 6px;
}

.seo-card p {
  font-size: .84rem;
  line-height: 1.9;
  color: var(--text-500);
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.seo-card .learn-more {
  display: inline-block;
  margin-top: 8px;
}

.related {
  margin-top: 24px;
}

.seo-block-title {
  font-size: 1.3rem;
  color: var(--text-100);
  margin: 36px 0 4px;
}

.seo-featured .seo-block-title:first-child {
  margin-top: 0;
}

/* footer link columns */
.footer-cols {
  flex-basis: 100%;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 24px;
  padding: 12px 0 20px;
  margin-bottom: 4px;
  border-bottom: 1px solid rgba(34, 211, 238, .08);
}

.footer-col h3 {
  font-size: .85rem;
  color: var(--text-100);
  margin-bottom: 10px;
}

.footer-col a {
  display: block;
  padding: 3px 0;
  line-height: 1.8;
}

@media (max-width: 960px) {
  .content-grid {
    grid-template-columns: 1fr;
  }

  .content-aside {
    position: static;
  }

  .footer-cols {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 480px) {
  .footer-cols {
    grid-template-columns: 1fr;
  }
}

.content-eyebrow {
  display: inline-block;
  padding: 3px 12px;
  border-radius: 999px;
  border: 1px solid rgba(34, 211, 238, .25);
  background: rgba(34, 211, 238, .07);
  color: var(--cyan);
  font-size: .75rem;
  font-weight: 700;
}

.toc strong {
  color: var(--text-100);
}

.latin {
  font-family: system-ui, -apple-system, "Segoe UI", sans-serif;
}

/* brand logo (white background artwork) */
.nav-logo { display: inline-flex; align-items: center; background: #fff; border-radius: 10px; padding: 5px 10px; line-height: 0; flex-shrink: 0; }
.nav-logo img { display: block; height: 30px; width: auto; }
@media (max-width: 600px) { .nav-logo img { height: 24px; } }
