/*
 * ZamaniAuto public typography system
 * Loaded after page styles so shared type and accessibility rules stay consistent.
 */
:root {
  --za-font-fa: "Vazirmatn", Tahoma, Arial, sans-serif;
  --za-font-latin: "Inter", "Segoe UI", Arial, sans-serif;
  --za-type-xs: 0.75rem;
  --za-type-sm: 0.875rem;
  --za-type-base: 1rem;
  --za-type-lg: 1.25rem;
  --za-type-h6: clamp(1rem, 0.98rem + 0.12vw, 1.125rem);
  --za-type-h5: clamp(1.125rem, 1.08rem + 0.22vw, 1.3rem);
  --za-type-h4: clamp(1.25rem, 1.15rem + 0.4vw, 1.55rem);
  --za-type-h3: clamp(1.45rem, 1.25rem + 0.7vw, 1.9rem);
  --za-type-h2: clamp(1.75rem, 1.38rem + 1.25vw, 2.5rem);
  --za-type-h1: clamp(2rem, 1.45rem + 2vw, 3.5rem);
  --za-leading-body: 1.9;
  --za-leading-heading: 1.35;
  --za-reading-measure: 72ch;
}

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body,
button,
input,
select,
textarea {
  font-family: var(--za-font-fa);
}

html[dir="ltr"] body,
html[dir="ltr"] button,
html[dir="ltr"] input,
html[dir="ltr"] select,
html[dir="ltr"] textarea,
[lang="en"] {
  font-family: var(--za-font-latin);
}

body {
  font-size: var(--za-type-base);
  line-height: var(--za-leading-body);
  font-optical-sizing: auto;
  overflow-wrap: break-word;
  word-break: normal;
}

h1, h2, h3, h4, h5, h6 {
  max-inline-size: 100%;
  line-height: var(--za-leading-heading);
  overflow-wrap: break-word;
  word-break: normal;
  text-wrap: balance;
}

h1 { font-size: var(--za-type-h1); }
h2 { font-size: var(--za-type-h2); }
h3 { font-size: var(--za-type-h3); }
h4 { font-size: var(--za-type-h4); }
h5 { font-size: var(--za-type-h5); }
h6 { font-size: var(--za-type-h6); }

p,
li,
dd,
blockquote {
  overflow-wrap: break-word;
  word-break: normal;
}

/* Long-form Persian prose only. UI labels, cards and controls remain start-aligned. */
:is(.post-content, .article-content, .blog-post-content, .policy-content, .sd-copy, .about-story, .rich-text) > p,
:is(.post-content, .article-content, .blog-post-content, .policy-content, .sd-copy, .about-story, .rich-text) > ul,
:is(.post-content, .article-content, .blog-post-content, .policy-content, .sd-copy, .about-story, .rich-text) > ol {
  max-inline-size: var(--za-reading-measure);
  text-align: justify;
  text-align-last: right;
  line-height: var(--za-leading-body);
}

html[dir="ltr"] :is(.post-content, .article-content, .blog-post-content, .policy-content, .sd-copy, .about-story, .rich-text) > p {
  text-align-last: left;
}

:is(code, pre, kbd, samp, [dir="ltr"], .ltr, .sku, .mpn, .phone, .email, .price) {
  unicode-bidi: isolate;
  overflow-wrap: anywhere;
}

:is(button, input, select, textarea, a, [role="button"], [role="link"]):focus-visible {
  outline: 3px solid var(--za-accent, #5eead4);
  outline-offset: 3px;
}

input,
select,
textarea {
  font-size: max(1rem, 16px);
  line-height: 1.5;
}

button,
.btn,
[role="button"] {
  line-height: 1.35;
  min-inline-size: 0;
  white-space: normal;
  overflow-wrap: anywhere;
}

/* Important titles may wrap to two balanced lines instead of clipping. */
.hero-main-title,
.hero-content h1,
.pf-hero h1,
.blog-header h1,
.section-header h2,
.svc-section-header h2,
.pf-cta-title {
  white-space: normal;
  overflow: visible;
  text-overflow: initial;
  text-wrap: balance;
}

@media (max-width: 40rem) {
  :root {
    --za-leading-body: 1.82;
  }

  /* Justification in narrow UI columns creates rivers in Persian text. */
  :is(.card, [class*="-card"], aside, .sidebar) p {
    text-align: start !important;
    text-align-last: auto !important;
  }
}

@media (forced-colors: active) {
  :is(button, input, select, textarea, a, [role="button"], [role="link"]):focus-visible {
    outline-color: Highlight;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
}


/* Explicit centered sections requested by user */
.cst-line,
.svc-hero-sub,
.zlp-sub-desc,
.cert-card,
.cert-card h3,
.cert-card p,
.svc-contact-lead,
.svc-fcard,
.svc-fcard-text,
.svc-fcard-text h3,
.svc-fcard-text p,
.svc-contact-note,
[data-i18n="certs_brands_label"] {
  text-align: center !important;
}


/* ==========================================================================
   USER MANDATED CENTERED ELEMENTS (Highest Specificity & !important)
   ========================================================================== */
.cst-line,
#contact .cst-line,
.svc-hero-sub,
.svc-hero .svc-hero-sub,
.zlp-sub-desc,
#projects .zlp-sub-desc,
.zlp-sub-desc span,
.cert-card,
#certifications .certs-grid .cert-card,
.cert-card h3,
.cert-card p,
.svc-contact-lead,
.svc-contact .svc-contact-lead,
.svc-fcard,
.svc-fcard-text,
.svc-fcard-text h3,
.svc-fcard-text p,
.svc-fcard h3,
.svc-fcard p,
.svc-contact-note,
.svc-contact .svc-contact-note,
[data-i18n="certs_brands_label"],
.brands-strip p {
  text-align: center !important;
  text-align-last: center !important;
}
