@font-face {
  font-family: "Avini";
  src: local("Aviny"), local("Avini"), url("../fonts/aviny.ttf") format("truetype");
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  size-adjust: 116%;
  unicode-range: U+0600-06FF, U+0750-077F, U+08A0-08FF, U+FB50-FDFF, U+FE70-FEFF, U+200C-200F, U+202A-202E, U+2066-2069;
}

html[dir="rtl"] {
  direction: rtl;
  --font-family-primary: "Avini", sans-serif;
  --font-family-secondary: "Avini", sans-serif;
  --font-family-tertiary: "Avini", sans-serif;
  --font-family-serif: "Avini", sans-serif;
  --font-family-script: "Avini", sans-serif;
  --font-text-family: "Avini", sans-serif;
  --font-heading-family: "Avini", sans-serif;
  --font-display-family: "Avini", sans-serif;
}

html[dir="rtl"],
html[dir="rtl"] body {
  direction: rtl;
  text-align: right;
  font-family: "Avini", sans-serif !important;
}

/* Apply Avini to every text-bearing element, including nested spans/divs
   that were not covered in the previous build. Icon-font elements are excluded. */
html[dir="rtl"] body :where(
  address, article, aside, blockquote, button, caption, dd, details, dialog,
  div, dt, figcaption, footer, form, header, h1, h2, h3, h4, h5, h6,
  input, label, legend, li, main, nav, option, p, section, select, small,
  span, strong, summary, table, tbody, td, textarea, tfoot, th, thead, tr, a
):not([class^="unicon-"]):not([class*=" unicon-"]):not(.uk-icon):not([data-uc-icon]) {
  font-family: "Avini", sans-serif !important;
}

/* Preserve icon fonts and technical/code typography. */
html[dir="rtl"] [class^="unicon-"],
html[dir="rtl"] [class*=" unicon-"] {
  font-family: "Unicons" !important;
}
html[dir="rtl"] code,
html[dir="rtl"] pre,
html[dir="rtl"] kbd,
html[dir="rtl"] samp {
  direction: ltr;
  text-align: left;
  unicode-bidi: embed;
  font-family: Consolas, Monaco, "Courier New", monospace !important;
}

html[dir="rtl"] p,
html[dir="rtl"] li,
html[dir="rtl"] td,
html[dir="rtl"] th { line-height: 1.95; }

html[dir="rtl"] input,
html[dir="rtl"] textarea,
html[dir="rtl"] select { text-align: right; }

html[dir="rtl"] input[type="email"],
html[dir="rtl"] input[type="url"],
html[dir="rtl"] input[type="tel"],
html[dir="rtl"] .crypto-address,
html[dir="rtl"] [class*="address"],
html[dir="rtl"] [class*="contract"] {
  direction: ltr;
  text-align: left;
  unicode-bidi: plaintext;
}
html[dir="rtl"] input[type="email"]::placeholder,
html[dir="rtl"] input[type="url"]::placeholder,
html[dir="rtl"] input[type="tel"]::placeholder {
  direction: rtl;
  text-align: right;
}

html[dir="rtl"] .uc-notification-bottom-left { left: auto; right: 0; }
html[dir="rtl"] .backtotop-wrap.end-0 { right: auto !important; left: 0 !important; }
html[dir="rtl"] .text-start { text-align: right !important; }
html[dir="rtl"] .text-end { text-align: left !important; }
html[dir="rtl"] .ms-auto { margin-right: auto !important; margin-left: 0 !important; }
html[dir="rtl"] .me-auto { margin-left: auto !important; margin-right: 0 !important; }
html[dir="rtl"] .icon-arrow,
html[dir="rtl"] img[src*="chevron-right"],
html[dir="rtl"] img[src*="chevron-left"] { transform: scaleX(-1); }

html[dir="rtl"] p,
html[dir="rtl"] h1,
html[dir="rtl"] h2,
html[dir="rtl"] h3,
html[dir="rtl"] h4,
html[dir="rtl"] h5,
html[dir="rtl"] h6,
html[dir="rtl"] li,
html[dir="rtl"] a,
html[dir="rtl"] button,
html[dir="rtl"] label,
html[dir="rtl"] span,
html[dir="rtl"] div { unicode-bidi: plaintext; }

/* Readable Persian typography scale */
html[dir="rtl"] body {
  font-size: 18px !important;
  line-height: 1.9;
}

html[dir="rtl"] p,
html[dir="rtl"] li,
html[dir="rtl"] dd,
html[dir="rtl"] dt,
html[dir="rtl"] td,
html[dir="rtl"] th,
html[dir="rtl"] label,
html[dir="rtl"] input,
html[dir="rtl"] textarea,
html[dir="rtl"] select,
html[dir="rtl"] option {
  font-size: 18px !important;
  line-height: 2 !important;
}

html[dir="rtl"] .uc-navbar-nav > li > a,
html[dir="rtl"] .uc-nav > li > a,
html[dir="rtl"] .uc-offcanvas-bar a,
html[dir="rtl"] button,
html[dir="rtl"] .btn {
  font-size: 17px !important;
  line-height: 1.75 !important;
}

html[dir="rtl"] small,
html[dir="rtl"] .fs-7,
html[dir="rtl"] .fs-8,
html[dir="rtl"] .text-small,
html[dir="rtl"] .uc-text-small {
  font-size: 16px !important;
  line-height: 1.85 !important;
}

html[dir="rtl"] .fs-6 {
  font-size: 18px !important;
  line-height: 1.9 !important;
}

html[dir="rtl"] h5,
html[dir="rtl"] .h5 {
  font-size: 22px !important;
  line-height: 1.65 !important;
}

html[dir="rtl"] h6,
html[dir="rtl"] .h6 {
  font-size: 19px !important;
  line-height: 1.7 !important;
}

@media (max-width: 767px) {
  html[dir="rtl"] body,
  html[dir="rtl"] p,
  html[dir="rtl"] li,
  html[dir="rtl"] dd,
  html[dir="rtl"] dt,
  html[dir="rtl"] td,
  html[dir="rtl"] th,
  html[dir="rtl"] label,
  html[dir="rtl"] input,
  html[dir="rtl"] textarea,
  html[dir="rtl"] select,
  html[dir="rtl"] option,
  html[dir="rtl"] .fs-6 {
    font-size: 17px !important;
  }

  html[dir="rtl"] .uc-navbar-nav > li > a,
  html[dir="rtl"] .uc-nav > li > a,
  html[dir="rtl"] .uc-offcanvas-bar a,
  html[dir="rtl"] button,
  html[dir="rtl"] .btn {
    font-size: 16px !important;
  }
}

