@font-face {
  font-family: "IRANSansXFaNum";
  src: url("/static/assets/ganikh-fonts/IRANSansXFaNum-Regular.woff2") format("woff2");
  font-style: normal;
  font-weight: 400;
  font-display: swap;
}

@font-face {
  font-family: "IRANSansXFaNum";
  src: url("/static/assets/ganikh-fonts/IRANSansXFaNum-Medium.woff2") format("woff2");
  font-style: normal;
  font-weight: 500;
  font-display: swap;
}

@font-face {
  font-family: "IRANSansXFaNum";
  src: url("/static/assets/ganikh-fonts/IRANSansXFaNum-Bold.woff2") format("woff2");
  font-style: normal;
  font-weight: 700;
  font-display: swap;
}

html:lang(fa),
html:lang(fa) body,
html:lang(fa) button,
html:lang(fa) input,
html:lang(fa) select,
html:lang(fa) textarea {
  font-family: "IRANSansXFaNum", Tahoma, Arial, sans-serif;
}

html:lang(fa) body {
  direction: rtl;
}

html:lang(fa) .ant-modal,
html:lang(fa) .ant-drawer,
html:lang(fa) .ant-dropdown,
html:lang(fa) .ant-menu,
html:lang(fa) .ant-table {
  text-align: right;
}

html:lang(fa) .ant-table-thead > tr > th,
html:lang(fa) .ant-table-tbody > tr > td,
html:lang(fa) .ant-select-selection-item,
html:lang(fa) .ant-select-selection-placeholder,
html:lang(fa) .ant-input,
html:lang(fa) .ant-form-item-label {
  text-align: start !important;
}

/* Keep code and database identifiers readable inside the Persian interface. */
html:lang(fa) pre,
html:lang(fa) code,
html:lang(fa) .ace_editor,
html:lang(fa) .monaco-editor {
  direction: ltr;
  text-align: left;
  unicode-bidi: isolate;
}

/* Superset's page submenus pin .nav-right to physical right: 16px. In RTL
   that covers the title/tabs. Keep both groups in normal, wrapping flow. */
html:lang(fa) .ant-row.menu[role="navigation"] {
  align-items: center;
  flex-wrap: wrap;
  gap: 8px 16px;
  min-width: 0;
}

html:lang(fa) .ant-row.menu[role="navigation"]::after {
  display: none !important;
}

html:lang(fa) .ant-row.menu[role="navigation"] > .header {
  margin: 0;
  text-align: start;
}

html:lang(fa) .ant-row.menu[role="navigation"] > .ant-menu[role="tablist"] {
  display: flex !important;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px;
  min-width: 0;
  max-width: 100%;
  padding-inline: 0 !important;
}

html:lang(fa) .ant-row.menu[role="navigation"] > .ant-menu[role="tablist"] > .ant-menu-item {
  display: inline-flex;
  align-items: center;
  flex: 0 0 auto;
  width: auto !important;
  margin: 0 !important;
  padding: 4px 16px !important;
}

html:lang(fa) .ant-row.menu[role="navigation"] > .nav-right,
html:lang(fa) .ant-row.menu[role="navigation"] > .nav-right-collapse {
  position: static !important;
  inset: auto !important;
  float: none;
  flex-wrap: wrap;
  gap: 8px;
  max-width: 100%;
  margin: 0 !important;
  margin-inline-start: auto !important;
  padding: 0;
}

html:lang(fa) .ant-row.menu[role="navigation"] > .nav-right > .ant-btn,
html:lang(fa) .ant-row.menu[role="navigation"] > .nav-right-collapse > .ant-btn {
  margin: 0 !important;
}

html:lang(fa) .ant-row.menu[role="navigation"] > .ant-menu:empty,
html:lang(fa) .ant-row.menu[role="navigation"] > .nav-right > .ant-menu:empty,
html:lang(fa) .ant-row.menu[role="navigation"] > .nav-right-collapse > .ant-menu:empty {
  display: none !important;
}

/* ListViewCard puts the published badge at bottom/right over RTL metadata.
   Give it a separate flow row beneath the title/actions, above the date. */
html:lang(fa) .ant-card-meta-title .titleRow {
  align-items: center;
  flex-wrap: wrap;
  gap: 4px 8px;
}

html:lang(fa) .ant-card-meta-title .titleRow > span:first-child {
  flex: 1 1 0;
  min-width: 0;
  white-space: nowrap;
}

html:lang(fa) .ant-card-meta-title .titleRow > span:has(> .ant-tag) {
  position: static !important;
  inset: auto !important;
  display: flex;
  flex: 0 0 100%;
  order: 1;
}

html:lang(fa) .ant-card-meta-title .titleRow > .card-actions {
  flex: 0 0 auto;
  align-self: center;
  margin: 0;
  padding-inline: 0;
}
