/*
 * Base: font, reset, typography and utilities.
 * Colors come only from tokens.css (generated from design/tokens.json).
 * Breakpoints: mobile < 768 ≤ tablet < 1024 ≤ desktop; frames are 1440 wide.
 */

/* IRANSansX (licensed) is served from assets/fonts/. Tahoma is the fallback
   through --font-family. */
@font-face {
  font-family: "IRANSansX";
  src: url("../fonts/IRANSansX-Regular.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "IRANSansX";
  src: url("../fonts/IRANSansX-Medium.woff2") format("woff2");
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "IRANSansX";
  src: url("../fonts/IRANSansX-DemiBold.woff2") format("woff2");
  font-weight: 600;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "IRANSansX";
  src: url("../fonts/IRANSansX-Bold.woff2") format("woff2");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

/* ---- Reset ---------------------------------------------------------- */

*,
*::before,
*::after {
  box-sizing: border-box;
}

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

body {
  margin: 0;
  min-height: 100vh;
  background: var(--color-surface-page);
  color: var(--color-text-primary);
  font-family: var(--font-family);
  font-size: 14px;
  line-height: 24px;
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4, h5, h6, p, ul, ol, dl, dd, figure, blockquote {
  margin: 0;
}

ul[role="list"],
ol[role="list"] {
  list-style: none;
  padding: 0;
}

img,
svg {
  display: block;
  max-width: 100%;
}

button,
input,
select,
textarea {
  font: inherit;
  color: inherit;
  letter-spacing: inherit;
}

button {
  cursor: pointer;
}

a {
  color: var(--color-text-link);
}

table {
  border-collapse: collapse;
}

[hidden],
[x-cloak] {
  display: none !important;
}

/* ---- Focus ---------------------------------------------------------- */

:focus {
  outline: none;
}

:focus-visible {
  outline: 2px solid var(--color-focus-ring);
  outline-offset: 2px;
}

/* ---- Typography (component-level classes; text styles live in tokens.css as .t-*) */

.t-muted {
  color: var(--color-text-secondary);
}

.t-subtle {
  color: var(--color-text-tertiary);
}

/* ---- Icons ---------------------------------------------------------- */

.icon {
  flex: none;
  display: inline-block;
  color: inherit;
  vertical-align: middle;
}

.icon--sm { width: var(--size-icon-sm); height: var(--size-icon-sm); }
.icon--md { width: var(--size-icon-md); height: var(--size-icon-md); }
.icon--lg { width: var(--size-icon-lg); height: var(--size-icon-lg); }

/* Directional icons are drawn for LTR; flip them in RTL. */
[dir="rtl"] .icon--mirror {
  transform: scaleX(-1);
}

/* ---- Utilities ------------------------------------------------------ */

/* Latin IDs, codes and mobiles inside RTL text (<bdi dir="ltr">). */
.ltr {
  direction: ltr;
  unicode-bidi: isolate;
  white-space: nowrap; /* never break an ID such as HR-1405-000123 */
}

.mono {
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.01em;
}

.visually-hidden {
  position: absolute !important;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: absolute;
  inset-inline-start: var(--space-16);
  top: -100px;
  z-index: 100;
  padding: var(--space-8) var(--space-16);
  border-radius: var(--radius-md);
  background: var(--color-surface-base);
  color: var(--color-text-primary);
}

.skip-link:focus {
  top: var(--space-16);
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
  }
}
