/* ===============================================================
   The two typefaces
   ===============================================================

   Estedad wears the headings; IRANSansX carries everything else.
   The split is the whole point of this file: the site keeps its
   headline voice and gets a quieter, more even text face under it.

   Both families are declared here rather than in the vendor sheet
   because all three documents the app can serve reach this file:
   the root layout, global-error.tsx, and the standalone documents
   built by lib/error-document.ts. A face declared in a stylesheet
   one of them doesn't link is a face that route renders without.

   Weights are declared one file per step, 100 → 900, so the browser
   picks the real cut instead of synthesising a bold from Regular.
   Nothing downloads until a rule actually asks for that weight, so
   the eighteen faces below cost one request each in practice — the
   site draws on 400/500/600/700 and leaves the rest on the shelf.

   `font-display: swap` — Persian text in the fallback sans is ugly
   but readable, and readable-now beats invisible-then. The layout
   shift it trades for is small: both families run to similar metrics.

   IRANSansX is proprietary (fontiran.com); the licence PDF ships in
   the `IranSansX Pro` folder at the repo root, outside public/ so it
   isn't served. This is the plain cut, not FaNum: the app already
   converts digits with toPersianDigits() in lib/format.ts, so the
   Latin numerals that survive that are meant to be Latin.
   =============================================================== */


/* --- Estedad — headings only ------------------------------------
   Nine weights were already sitting in public/site-v2/fonts; until
   now a single broken @font-face in theme.min.css bound all of them
   to one name at one weight, so the entire site rendered in
   Estedad-Bold whatever weight it asked for. These are the same
   files, mapped properly.
   --------------------------------------------------------------- */

@font-face {
  font-family: 'Estedad';
  font-style: normal;
  font-weight: 100;
  font-display: swap;
  src: url('../fonts/Estedad-Thin.woff2') format('woff2');
}

@font-face {
  font-family: 'Estedad';
  font-style: normal;
  font-weight: 200;
  font-display: swap;
  src: url('../fonts/Estedad-ExtraLight.woff2') format('woff2');
}

@font-face {
  font-family: 'Estedad';
  font-style: normal;
  font-weight: 300;
  font-display: swap;
  src: url('../fonts/Estedad-Light.woff2') format('woff2');
}

@font-face {
  font-family: 'Estedad';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('../fonts/Estedad-Regular.woff2') format('woff2');
}

@font-face {
  font-family: 'Estedad';
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url('../fonts/Estedad-Medium.woff2') format('woff2');
}

@font-face {
  font-family: 'Estedad';
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url('../fonts/Estedad-SemiBold.woff2') format('woff2');
}

@font-face {
  font-family: 'Estedad';
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url('../fonts/Estedad-Bold.woff2') format('woff2');
}

@font-face {
  font-family: 'Estedad';
  font-style: normal;
  font-weight: 800;
  font-display: swap;
  src: url('../fonts/Estedad-ExtraBold.woff2') format('woff2');
}

@font-face {
  font-family: 'Estedad';
  font-style: normal;
  font-weight: 900;
  font-display: swap;
  src: url('../fonts/Estedad-Black.woff2') format('woff2');
}


/* --- IRANSansX — body text --------------------------------------
   The family ships two cuts past 900 (Heavy, ExtraBlack) with no
   CSS weight left to hang them on; they are not copied in.
   --------------------------------------------------------------- */

@font-face {
  font-family: 'IRANSansX';
  font-style: normal;
  font-weight: 100;
  font-display: swap;
  src: url('../fonts/IRANSansX-Thin.woff2') format('woff2');
}

@font-face {
  font-family: 'IRANSansX';
  font-style: normal;
  font-weight: 200;
  font-display: swap;
  src: url('../fonts/IRANSansX-UltraLight.woff2') format('woff2');
}

@font-face {
  font-family: 'IRANSansX';
  font-style: normal;
  font-weight: 300;
  font-display: swap;
  src: url('../fonts/IRANSansX-Light.woff2') format('woff2');
}

@font-face {
  font-family: 'IRANSansX';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('../fonts/IRANSansX-Regular.woff2') format('woff2');
}

@font-face {
  font-family: 'IRANSansX';
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url('../fonts/IRANSansX-Medium.woff2') format('woff2');
}

@font-face {
  font-family: 'IRANSansX';
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url('../fonts/IRANSansX-DemiBold.woff2') format('woff2');
}

@font-face {
  font-family: 'IRANSansX';
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url('../fonts/IRANSansX-Bold.woff2') format('woff2');
}

@font-face {
  font-family: 'IRANSansX';
  font-style: normal;
  font-weight: 800;
  font-display: swap;
  src: url('../fonts/IRANSansX-ExtraBold.woff2') format('woff2');
}

@font-face {
  font-family: 'IRANSansX';
  font-style: normal;
  font-weight: 900;
  font-display: swap;
  src: url('../fonts/IRANSansX-Black.woff2') format('woff2');
}


/* --- Who gets which --------------------------------------------
   Declared here, next to the faces, so the rule and the files it
   depends on stay in one file — and so the error documents, which
   link this sheet and brand.css and nothing of the app's own CSS,
   get the same typography as the rest of the site.

   `html, body` rather than `:root` alone: the vendor sheet sets a
   family on `body` directly, and a rule on `:root` would lose to it
   on specificity even though everything inherits from there anyway.

   The heading list covers the elements and Bootstrap's class
   equivalents (`.h1`…`.h6`, `.display-*`), which is what the markup
   actually uses. The site's own bespoke title classes — `.pd-title`,
   `.ck-title`, `.cu-card-title` and the rest — all sit on h1–h5
   already, so they inherit Estedad without being named.
   --------------------------------------------------------------- */

/* `html body`, not plain `body`: theme.min.css restates
   `body { font-family: IRANSansX }` with no fallbacks at all and is linked
   after this file, so on a bare `body` selector the vendor wins the tie and
   the fallback chain silently disappears — leaving a failed font load to
   land in the browser's default serif rather than system-ui. */
html,
html body {
  font-family: 'IRANSansX', 'Estedad', system-ui, sans-serif;
}

.h1,
.h2,
.h3,
.h4,
.h5,
.h6,
h1,
h2,
h3,
h4,
h5,
h6,
.display-1,
.display-2,
.display-3,
.display-4,
.display-5,
.display-6 {
  font-family: 'Estedad', 'IRANSansX', system-ui, sans-serif;
}


/* --- The exception: product names ------------------------------
   A product name in a grid is an h3 for the outline — screen readers
   and the document structure both want it that way — but it is not a
   section heading, it is the row's label. Fifty of them tiled across
   a shop page in the display face reads as fifty small announcements;
   in the text face they read as a list, which is what they are, and
   the headings around them (`پر بازدید`, `محصولات مشابه`) get their
   Estedad back by contrast.

   Named here rather than in each card's own sheet because this is the
   same decision as the block above — which face carries which job —
   and splitting it across five files is how it drifts.

   The list is every product-name element in the codebase, not just the
   one that ships: `.scard-title` is the card that actually renders on
   the home page, the products list, the sliders and the favourites
   list (ShopCard8, the only variant imported outside /preview-*), and
   it is the one that matters. The rest — `.bcard-title`, the two
   `.card-pv-title` sizes, `.product-title` — are the older card
   variants still mounted by the /preview-* design routes. They are
   included so that comparing designs on those routes compares like
   with like; leave one out and the preview lies about the shipping
   card. `.widget-product-title` is the vendor's sidebar-widget name.

   The product *page* title, `.pd-title`, is a real page heading and
   keeps Estedad — it is the one product name on the site that is
   genuinely the heading of its document.
   --------------------------------------------------------------- */

.scard-title,
.bcard-title,
.product-title,
.card-pv-title,
.card-pv-title-sm,
.widget-product-title {
  font-family: 'IRANSansX', system-ui, sans-serif;
}
