/**
 * Wedding typography — additive only. English fonts (Cinzel, Ovo, newtemplate)
 * stay loaded from wedding-fonts.css and are never removed.
 *
 * Arabic (apply only where you want):
 *   font-ar-display  → Amiri
 *   font-ar-heading  → El Messiri
 *   font-ar-body     → Noto Naskh Arabic
 *
 * Keep original English fonts on specific elements:
 *   font-en-display / font-keep-original → newtemplate (GT Super stack)
 *   font-en-ceremonial                   → Cinzel
 *   font-en-body                         → Ovo
 *   font-latin / font-en                 → English display + LTR for names/dates
 *
 * RTL layout only (fonts unchanged): <html lang="ar" dir="rtl" class="locale-ar">
 * Optional bulk Arabic fonts on Tilda blocks: also add class "typography-ar"
 */

/* --- Arabic @font-face (paths relative to /css/) --- */

@font-face {
    font-family: 'Amiri';
    font-style: normal;
    font-weight: 400;
    font-display: swap;
    src: url('../fonts/ar/amiri/amiri-400-arabic.woff2') format('woff2');
    unicode-range: U+0600-06FF, U+0750-077F, U+0870-088E, U+0890-0891, U+0897-08E1, U+08E3-08FF,
        U+FB50-FDFF, U+FE70-FEFE;
}

@font-face {
    font-family: 'Amiri';
    font-style: normal;
    font-weight: 400;
    font-display: swap;
    src: url('../fonts/ar/amiri/amiri-400-latin.woff2') format('woff2');
    unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC;
}

@font-face {
    font-family: 'Amiri';
    font-style: normal;
    font-weight: 700;
    font-display: swap;
    src: url('../fonts/ar/amiri/amiri-700-arabic.woff2') format('woff2');
    unicode-range: U+0600-06FF, U+0750-077F, U+0870-088E, U+0890-0891, U+0897-08E1, U+08E3-08FF,
        U+FB50-FDFF, U+FE70-FEFE;
}

@font-face {
    font-family: 'Amiri';
    font-style: normal;
    font-weight: 700;
    font-display: swap;
    src: url('../fonts/ar/amiri/amiri-700-latin.woff2') format('woff2');
    unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC;
}

@font-face {
    font-family: 'El Messiri';
    font-style: normal;
    font-weight: 400;
    font-display: swap;
    src: url('../fonts/ar/elmessiri/elmessiri-400-arabic.woff2') format('woff2');
    unicode-range: U+0600-06FF, U+0750-077F, U+0870-088E, U+0890-0891, U+0897-08E1, U+08E3-08FF,
        U+FB50-FDFF, U+FE70-FEFE;
}

@font-face {
    font-family: 'El Messiri';
    font-style: normal;
    font-weight: 400;
    font-display: swap;
    src: url('../fonts/ar/elmessiri/elmessiri-400-latin.woff2') format('woff2');
    unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC;
}

@font-face {
    font-family: 'El Messiri';
    font-style: normal;
    font-weight: 600;
    font-display: swap;
    src: url('../fonts/ar/elmessiri/elmessiri-600-arabic.woff2') format('woff2');
    unicode-range: U+0600-06FF, U+0750-077F, U+0870-088E, U+0890-0891, U+0897-08E1, U+08E3-08FF,
        U+FB50-FDFF, U+FE70-FEFE;
}

@font-face {
    font-family: 'El Messiri';
    font-style: normal;
    font-weight: 700;
    font-display: swap;
    src: url('../fonts/ar/elmessiri/elmessiri-700-arabic.woff2') format('woff2');
    unicode-range: U+0600-06FF, U+0750-077F, U+0870-088E, U+0890-0891, U+0897-08E1, U+08E3-08FF,
        U+FB50-FDFF, U+FE70-FEFE;
}

@font-face {
    font-family: 'Noto Naskh Arabic';
    font-style: normal;
    font-weight: 400;
    font-display: swap;
    src: url('../fonts/ar/noto-naskh/noto-naskh-400-arabic.woff2') format('woff2');
    unicode-range: U+0600-06FF, U+0750-077F, U+0870-088E, U+0890-0891, U+0897-08E1, U+08E3-08FF,
        U+FB50-FDFF, U+FE70-FEFE;
}

@font-face {
    font-family: 'Noto Naskh Arabic';
    font-style: normal;
    font-weight: 400;
    font-display: swap;
    src: url('../fonts/ar/noto-naskh/noto-naskh-400-latin.woff2') format('woff2');
    unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC;
}

@font-face {
    font-family: 'Noto Naskh Arabic';
    font-style: normal;
    font-weight: 600;
    font-display: swap;
    src: url('../fonts/ar/noto-naskh/noto-naskh-600-arabic.woff2') format('woff2');
    unicode-range: U+0600-06FF, U+0750-077F, U+0870-088E, U+0890-0891, U+0897-08E1, U+08E3-08FF,
        U+FB50-FDFF, U+FE70-FEFE;
}

/* --- Design tokens --- */

:root {
    /* Arabic */
    --font-ar-display: 'Amiri', 'Times New Roman', serif;
    --font-ar-heading: 'El Messiri', 'Segoe UI', sans-serif;
    --font-ar-body: 'Noto Naskh Arabic', 'Segoe UI', serif;

    /* English (unchanged from original site) */
    --font-en-ceremonial: 'Cinzel', Georgia, serif;
    --font-en-display: 'newtemplate', 'Cinzel', Georgia, serif;
    --font-en-body: 'Ovo', Georgia, serif;

    /* Active defaults (English until locale-ar is enabled) */
    --font-display: var(--font-en-display);
    --font-heading: var(--font-en-display);
    --font-body: var(--font-en-body);
}

html.locale-ar {
    --font-display: var(--font-ar-display);
    --font-heading: var(--font-ar-heading);
    --font-body: var(--font-ar-body);
}

/* --- Utility classes (use on any element) --- */

.font-ar-display {
    font-family: var(--font-ar-display) !important;
}

.font-ar-heading {
    font-family: var(--font-ar-heading) !important;
}

.font-ar-body {
    font-family: var(--font-ar-body) !important;
}

.font-en-ceremonial {
    font-family: var(--font-en-ceremonial) !important;
}

.font-en-display,
.font-keep-original {
    font-family: var(--font-en-display) !important;
}

.font-en-body {
    font-family: var(--font-en-body) !important;
}

/* English names, dates, or Latin text inside Arabic layout */
.font-latin,
.font-en {
    font-family: var(--font-en-display) !important;
    direction: ltr;
    unicode-bidi: isolate;
}

.font-latin-ceremonial {
    font-family: var(--font-en-ceremonial) !important;
    direction: ltr;
    unicode-bidi: isolate;
}

/* Optional: swap Tilda newtemplate → Arabic only when typography-ar is set */
html.locale-ar.typography-ar [style*="font-family:'newtemplate'"],
html.locale-ar.typography-ar [style*='font-family: newtemplate'],
html.locale-ar.typography-ar [style*="font-family: 'newtemplate'"],
html.locale-ar.typography-ar .tn-atom[style*="newtemplate"] {
    font-family: var(--font-ar-heading) !important;
}

/* English fonts always win when class is present (even in Arabic RTL mode) */
html.locale-ar .font-en,
html.locale-ar .font-en-display,
html.locale-ar .font-keep-original,
html.locale-ar .font-latin {
    font-family: var(--font-en-display) !important;
}

html.locale-ar .font-en-body {
    font-family: var(--font-en-body) !important;
}

html.locale-ar .font-en-ceremonial,
html.locale-ar .font-latin-ceremonial {
    font-family: var(--font-en-ceremonial) !important;
}
