/**
 * SiloKala Enterprise Typography System
 *
 * Single source of truth for IranYekan across the entire frontend.
 * Font files live in /font/ (plugin root). Do not load Google Fonts or CDNs.
 *
 * @package SiloKala\Marketplace
 */

/* ============================================================
   @font-face — official IranYekan weights only (one family name)
   ============================================================ */

@font-face {
  font-family: "IranYekan";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("https://silokala.com/wp-content/uploads/2026/06/iranyekanwebregular.b95439c1.b95439c1.woff") format("woff");
}

@font-face {
  font-family: "IranYekan";
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url("https://silokala.com/wp-content/uploads/2026/06/iranyekanwebmedium.2d4f96e5.2d4f96e5.woff") format("woff");
}

/* No separate SemiBold file — map 600 → Bold asset */
@font-face {
  font-family: "IranYekan";
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url("https://silokala.com/wp-content/uploads/2026/06/iranyekanwebbold.e298fdc6.e298fdc6.woff") format("woff");
}

@font-face {
  font-family: "IranYekan";
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url("https://silokala.com/wp-content/uploads/2026/06/iranyekanwebbold.e298fdc6.e298fdc6.woff") format("woff");
}

@font-face {
  font-family: "IranYekan";
  font-style: normal;
  font-weight: 800;
  font-display: swap;
  src: url("https://silokala.com/wp-content/uploads/2026/06/iranyekanwebextrabold.9346e9a2.9346e9a2.woff") format("woff");
}

/* ============================================================
   Typography tokens — the only place font stacks are defined
   ============================================================ */

:root {
  --font-primary: "IranYekan", Tahoma, Arial, sans-serif;
  --font-base: var(--font-primary);
  --font-body: var(--font-primary);
  --font-heading: var(--font-primary);
  --font-button: var(--font-primary);
  --font-input: var(--font-primary);
  --font-ui: var(--font-primary);
  --font-mono: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;

  --fw-regular: 400;
  --fw-medium: 500;
  --fw-semibold: 600;
  --fw-bold: 700;
  --fw-extrabold: 800;

  --text-2xs: 0.6875rem;
  --text-xs: 0.75rem;
  --text-sm: 0.875rem;
  --text-base: 1rem;
  --text-md: 1.125rem;
  --text-lg: 1.375rem;
  --text-xl: 1.75rem;
  --text-2xl: 2.25rem;
  --text-3xl: 3rem;
  --text-4xl: 3.75rem;

  /* Persian RTL-optimized line heights */
  --lh-tight: 1.3;
  --lh-snug: 1.45;
  --lh-normal: 1.7;
  --lh-relaxed: 1.9;

  --ls-none: 0;
  --ls-tight: -0.01em;
  --ls-wide: 0.01em;

  --type-display: var(--fw-extrabold) var(--text-4xl) / var(--lh-tight) var(--font-heading);
  --type-hero: var(--fw-extrabold) var(--text-3xl) / var(--lh-tight) var(--font-heading);
  --type-h1: var(--fw-bold) var(--text-2xl) / var(--lh-tight) var(--font-heading);
  --type-h2: var(--fw-bold) var(--text-xl) / var(--lh-snug) var(--font-heading);
  --type-h3: var(--fw-semibold) var(--text-lg) / var(--lh-snug) var(--font-heading);
  --type-h4: var(--fw-semibold) var(--text-md) / var(--lh-snug) var(--font-heading);
  --type-h5: var(--fw-medium) var(--text-base) / var(--lh-snug) var(--font-heading);
  --type-h6: var(--fw-medium) var(--text-sm) / var(--lh-snug) var(--font-heading);
  --type-lead: var(--fw-regular) var(--text-md) / var(--lh-normal) var(--font-body);
  --type-body-lg: var(--fw-regular) var(--text-md) / var(--lh-normal) var(--font-body);
  --type-body: var(--fw-regular) var(--text-base) / var(--lh-normal) var(--font-body);
  --type-body-sm: var(--fw-regular) var(--text-sm) / var(--lh-normal) var(--font-body);
  --type-meta: var(--fw-regular) var(--text-sm) / var(--lh-snug) var(--font-body);
  --type-caption: var(--fw-regular) var(--text-xs) / var(--lh-snug) var(--font-body);
  --type-label: var(--fw-medium) var(--text-sm) / var(--lh-snug) var(--font-ui);
  --type-button: var(--fw-bold) var(--text-sm) / 1.2 var(--font-button);
  --type-input: var(--fw-medium) var(--text-sm) / var(--lh-snug) var(--font-input);
  --type-helper: var(--fw-regular) var(--text-xs) / var(--lh-snug) var(--font-body);
  --type-error: var(--fw-medium) var(--text-xs) / var(--lh-snug) var(--font-body);
  --type-badge: var(--fw-bold) var(--text-2xs) / 1.2 var(--font-ui);
  --type-table: var(--fw-regular) var(--text-sm) / var(--lh-snug) var(--font-body);
  --type-price: var(--fw-bold) var(--text-md) / var(--lh-tight) var(--font-ui);
  --type-product-title: var(--fw-semibold) var(--text-base) / var(--lh-snug) var(--font-heading);
  --type-vendor-name: var(--fw-medium) var(--text-sm) / var(--lh-snug) var(--font-ui);
}

/* ============================================================
   Global cascade — one application, one typeface
   ============================================================ */

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body,
body.woocommerce,
body.woocommerce-page,
.woocommerce,
.woocommerce-page,
.elementor,
.elementor-widget,
.elementor-element,
.entry-content,
.site,
.site-content,
#page,
#content,
.silokala-auth-root,
.silokala-vendor-dashboard,
.silokala-buyer-registration,
.silokala-vendor-registration,
.sk-reg-page,
.silokala-vendor-store,
.silokala-chat-widget,
.sk-chat-widget,
.silokala-live-chat,
.silokala-ticket-form-wrap,
.silokala-notice,
.silokala-customer-dashboard,
.silokala-resolution,
.sk-resolution,
.woocommerce-account,
.woocommerce-cart,
.woocommerce-checkout,
.woocommerce-MyAccount-content,
.woocommerce-MyAccount-navigation {
  font-family: var(--font-base) !important;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

button,
input,
select,
textarea,
optgroup,
label,
.button,
.wp-element-button,
.woocommerce button.button,
.woocommerce a.button,
.woocommerce input.button,
.woocommerce #respond input#submit,
.woocommerce-page button.button,
.elementor-button,
.elementor-field,
.elementor-field-textual {
  font-family: inherit !important;
}

h1, h2, h3, h4, h5, h6,
.woocommerce h1,
.woocommerce h2,
.woocommerce h3,
.elementor-heading-title {
  font-family: inherit !important;
}

code,
kbd,
pre,
samp,
.silokala-code-block,
.sk-mono {
  font-family: var(--font-mono);
}

.sk-type-display { font: var(--type-display); }
.sk-type-hero { font: var(--type-hero); }
.sk-type-h1 { font: var(--type-h1); }
.sk-type-h2 { font: var(--type-h2); }
.sk-type-h3 { font: var(--type-h3); }
.sk-type-body { font: var(--type-body); }
.sk-type-body-sm { font: var(--type-body-sm); }
.sk-type-caption { font: var(--type-caption); }
.sk-type-label { font: var(--type-label); }
.sk-type-button { font: var(--type-button); }
.sk-type-input { font: var(--type-input); }
.sk-type-price { font: var(--type-price); font-feature-settings: "tnum" 1; }
.sk-type-product-title { font: var(--type-product-title); }
.sk-type-vendor-name { font: var(--type-vendor-name); }
.sk-type-badge { font: var(--type-badge); }
.sk-tnum { font-feature-settings: "tnum" 1; }

.silokala-auth-root,
.silokala-vendor-dashboard,
.silokala-buyer-registration,
.woocommerce-account {
  letter-spacing: var(--ls-none);
  word-spacing: normal;
}

.silokala-auth-root p,
.silokala-vendor-dashboard p,
.woocommerce-account p {
  line-height: var(--lh-normal);
}
