/* =========================================================================
 * MARKGALLERY — Persian webfont system
 * =========================================================================
 * Two local families, both SIL Open Font License, both shipped inside this
 * theme so the site never calls Google Fonts or a CDN. That matters in
 * production: Google Fonts is blocked for visitors in Iran, and an external
 * request is one more thing that can fail.
 *
 *   Arad     10 weights   used for HEADINGS and product titles
 *   Estedad   9 weights   used for BODY copy
 *   Playfair  1 file      variable 400-900, LATIN ONLY — the English band on
 *                         the homepage (see the @font-face pair further down)
 *
 * Both were checked glyph by glyph before install: full Persian alphabet,
 * hamza forms, diacritics, ZWNJ, Persian and Arabic-Indic digits, Latin
 * letters, and the punctuation a storefront needs. Every weight is a
 * separate file — pointing two weights at one file is what silently collapsed
 * an earlier setup to a single weight and made the type look flat.
 *
 * TO REPLACE EITHER FAMILY LATER: edit only the two :root stacks at the
 * bottom of this file. Nothing else references a family name.
 * ========================================================================= */
/* ---------- Arad ---------- */
@font-face {
	font-family: 'Arad';
	font-style: normal;
	font-weight: 100;
	font-display: swap;
	src: url(fonts/arad/Arad-Thin.woff2) format('woff2');
}
@font-face {
	font-family: 'Arad';
	font-style: normal;
	font-weight: 200;
	font-display: swap;
	src: url(fonts/arad/Arad-ExtraLight.woff2) format('woff2');
}
@font-face {
	font-family: 'Arad';
	font-style: normal;
	font-weight: 300;
	font-display: swap;
	src: url(fonts/arad/Arad-Light.woff2) format('woff2');
}
@font-face {
	font-family: 'Arad';
	font-style: normal;
	font-weight: 400;
	font-display: swap;
	src: url(fonts/arad/Arad-Regular.woff2) format('woff2');
}
@font-face {
	font-family: 'Arad';
	font-style: normal;
	font-weight: 500;
	font-display: swap;
	src: url(fonts/arad/Arad-Medium.woff2) format('woff2');
}
@font-face {
	font-family: 'Arad';
	font-style: normal;
	font-weight: 600;
	font-display: swap;
	src: url(fonts/arad/Arad-SemiBold.woff2) format('woff2');
}
@font-face {
	font-family: 'Arad';
	font-style: normal;
	font-weight: 700;
	font-display: swap;
	src: url(fonts/arad/Arad-Bold.woff2) format('woff2');
}
@font-face {
	font-family: 'Arad';
	font-style: normal;
	font-weight: 800;
	font-display: swap;
	src: url(fonts/arad/Arad-ExtraBold.woff2) format('woff2');
}
@font-face {
	font-family: 'Arad';
	font-style: normal;
	font-weight: 900;
	font-display: swap;
	src: url(fonts/arad/Arad-Black.woff2) format('woff2');
}
@font-face {
	font-family: 'Arad';
	font-style: normal;
	font-weight: 950;
	font-display: swap;
	src: url(fonts/arad/Arad-ExtraBlack.woff2) format('woff2');
}

/* ---------- Estedad ---------- */
@font-face {
	font-family: 'Estedad';
	font-style: normal;
	font-weight: 100;
	font-display: swap;
	src: url(fonts/estedad/Estedad-Thin.woff2) format('woff2');
}
@font-face {
	font-family: 'Estedad';
	font-style: normal;
	font-weight: 200;
	font-display: swap;
	src: url(fonts/estedad/Estedad-ExtraLight.woff2) format('woff2');
}
@font-face {
	font-family: 'Estedad';
	font-style: normal;
	font-weight: 300;
	font-display: swap;
	src: url(fonts/estedad/Estedad-Light.woff2) format('woff2');
}
@font-face {
	font-family: 'Estedad';
	font-style: normal;
	font-weight: 400;
	font-display: swap;
	src: url(fonts/estedad/Estedad-Regular.woff2) format('woff2');
}
@font-face {
	font-family: 'Estedad';
	font-style: normal;
	font-weight: 500;
	font-display: swap;
	src: url(fonts/estedad/Estedad-Medium.woff2) format('woff2');
}
@font-face {
	font-family: 'Estedad';
	font-style: normal;
	font-weight: 600;
	font-display: swap;
	src: url(fonts/estedad/Estedad-SemiBold.woff2) format('woff2');
}
@font-face {
	font-family: 'Estedad';
	font-style: normal;
	font-weight: 700;
	font-display: swap;
	src: url(fonts/estedad/Estedad-Bold.woff2) format('woff2');
}
@font-face {
	font-family: 'Estedad';
	font-style: normal;
	font-weight: 800;
	font-display: swap;
	src: url(fonts/estedad/Estedad-ExtraBold.woff2) format('woff2');
}
@font-face {
	font-family: 'Estedad';
	font-style: normal;
	font-weight: 900;
	font-display: swap;
	src: url(fonts/estedad/Estedad-Black.woff2) format('woff2');
}

/* ---------- Playfair Display (Latin only) ----------
 * One job: the English display line on the homepage band. It is a variable
 * font (400–900 in a single file), so both files below carry the whole weight
 * axis. Two unicode-ranges split Latin from Latin-Extended: a page that only
 * needs "MARK GALLERY SELECTS" downloads the 38 KB Latin file and nothing else.
 *
 * Deliberately NOT the site-wide display face: it has no Persian glyphs at
 * all, and the rest of the storefront is Persian. See .band in child.css.
 * OFL 1.1 — assets/fonts/playfair/OFL.txt ships with it. */
@font-face {
	font-family: 'Playfair Display';
	font-style: normal;
	font-weight: 400 900;
	font-display: swap;
	src: url(fonts/playfair/PlayfairDisplay-Latin.woff2) format('woff2');
	unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
	font-family: 'Playfair Display';
	font-style: normal;
	font-weight: 400 900;
	font-display: swap;
	src: url(fonts/playfair/PlayfairDisplay-LatinExt.woff2) format('woff2');
	unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

/* =========================================================================
 * The switch — the only place a family name appears
 * =========================================================================
 * Body copy uses Estedad. Headings and product titles use Arad.
 * To swap either one, change the first name in the matching stack.
 * Vazirmatn and Sahel are still installed under assets/fonts/ and can be
 * named here at any time.
 * ========================================================================= */
:root {
	--mg-font: "Estedad", "Vazirmatn", Tahoma, Arial, sans-serif;
	--mg-font-display: "Arad", "Estedad", "Vazirmatn", Tahoma, Arial, sans-serif;
}

/* =========================================================================
 * Persian digits for anything JavaScript rewrites
 * =========================================================================
 * The header cart badge and the mini-cart quantity are replaced by
 * WooCommerce's own JS after the page loads, so no PHP filter can reach them.
 *
 * OpenType has a feature for exactly this: `font-variant-numeric:
 * proportional-num` does not help, but the Persian digit glyphs in both
 * families are reachable through the `locl`/`ss01` route only when the
 * characters themselves are Persian — and they are not, JS writes "0".
 *
 * So the digits are wrapped instead. `.mg-fa-num` is applied by the small
 * script below, which watches the cart fragments and re-renders the badge
 * text with U+06F0-06F9. Everything else stays server-rendered.
 * ========================================================================= */