/* Vazir Matn Font Loading */

/* Check if variable fonts are supported */
@supports (font-variation-settings: normal) {
  @font-face {
    font-family: 'Vazirmatn';
    src: url('fonts/Vazirmatn-VariableFont_wght.ttf') format('truetype-variations');
    font-weight: 100 900;
    font-style: normal;
    font-display: swap;
    font-variation-settings: 'wght' var(--font-weight, 400);
  }
}

/* Fallback to static fonts if variable fonts are not supported */
@supports not (font-variation-settings: normal) {
  @font-face {
    font-family: 'Vazirmatn';
    src: url('fonts/static/Vazirmatn-Thin.ttf') format('truetype');
    font-weight: 100;
    font-style: normal;
    font-display: swap;
  }

  @font-face {
    font-family: 'Vazirmatn';
    src: url('fonts/static/Vazirmatn-ExtraLight.ttf') format('truetype');
    font-weight: 200;
    font-style: normal;
    font-display: swap;
  }

  @font-face {
    font-family: 'Vazirmatn';
    src: url('fonts/static/Vazirmatn-Light.ttf') format('truetype');
    font-weight: 300;
    font-style: normal;
    font-display: swap;
  }

  @font-face {
    font-family: 'Vazirmatn';
    src: url('fonts/static/Vazirmatn-Regular.ttf') format('truetype');
    font-weight: 400;
    font-style: normal;
    font-display: swap;
  }

  @font-face {
    font-family: 'Vazirmatn';
    src: url('fonts/static/Vazirmatn-Medium.ttf') format('truetype');
    font-weight: 500;
    font-style: normal;
    font-display: swap;
  }

  @font-face {
    font-family: 'Vazirmatn';
    src: url('fonts/static/Vazirmatn-SemiBold.ttf') format('truetype');
    font-weight: 600;
    font-style: normal;
    font-display: swap;
  }

  @font-face {
    font-family: 'Vazirmatn';
    src: url('fonts/static/Vazirmatn-Bold.ttf') format('truetype');
    font-weight: 700;
    font-style: normal;
    font-display: swap;
  }

  @font-face {
    font-family: 'Vazirmatn';
    src: url('fonts/static/Vazirmatn-ExtraBold.ttf') format('truetype');
    font-weight: 800;
    font-style: normal;
    font-display: swap;
  }

  @font-face {
    font-family: 'Vazirmatn';
    src: url('fonts/static/Vazirmatn-Black.ttf') format('truetype');
    font-weight: 900;
    font-style: normal;
    font-display: swap;
  }
}

/* CSS Custom Properties for font weights */
:root {
  --font-weight-thin: 100;
  --font-weight-extra-light: 200;
  --font-weight-light: 300;
  --font-weight-regular: 400;
  --font-weight-medium: 500;
  --font-weight-semi-bold: 600;
  --font-weight-bold: 700;
  --font-weight-extra-bold: 800;
  --font-weight-black: 900;
}

/* Utility classes for font weights */
.font-thin { font-weight: var(--font-weight-thin); }
.font-extra-light { font-weight: var(--font-weight-extra-light); }
.font-light { font-weight: var(--font-weight-light); }
.font-regular { font-weight: var(--font-weight-regular); }
.font-medium { font-weight: var(--font-weight-medium); }
.font-semi-bold { font-weight: var(--font-weight-semi-bold); }
.font-bold { font-weight: var(--font-weight-bold); }
.font-extra-bold { font-weight: var(--font-weight-extra-bold); }
.font-black { font-weight: var(--font-weight-black); }

/* Font loading optimization */
.font-loading {
  font-display: swap;
}

/* Ensure proper font rendering */
body {
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

/* Font fallback for better performance */
.font-fallback {
  font-family: 'Vazirmatn', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
}
