/*
 * Our own fonts, served from our own server.
 *
 * Every page in this application — including the family tracking page, the
 * power of attorney form and the setup page, all three of which are opened
 * by members of the public with no login — used to pull its typefaces from
 * fonts.googleapis.com and fonts.gstatic.com.
 *
 * That means the IP address, browser and exact timing of a bereaved family
 * opening a page about their dead relative were sent to a third party in
 * another country, on every view, with no consent asked and no lawful basis
 * recorded. For a company whose second architectural decision is "hosting
 * must be UK or EU because our clients are British funeral directors", it
 * was the one external call that undid the point of the rest.
 *
 * Same typefaces, same weights, 320 KB, served from here. It is also
 * faster: no DNS lookup, no second TLS handshake, no render-blocking
 * request to a host we do not control.
 *
 * `font-display: swap` so text is readable immediately and re-renders when
 * the font lands — on a mobile connection in Hurghada that difference is
 * the page being usable or not.
 */

@font-face {
  font-family: 'Archivo';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('/fonts/archivo-latin-400-normal.woff2') format('woff2');
}
@font-face {
  font-family: 'Archivo';
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url('/fonts/archivo-latin-500-normal.woff2') format('woff2');
}
@font-face {
  font-family: 'Archivo';
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url('/fonts/archivo-latin-600-normal.woff2') format('woff2');
}
@font-face {
  font-family: 'Archivo';
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url('/fonts/archivo-latin-700-normal.woff2') format('woff2');
}

@font-face {
  font-family: 'IBM Plex Mono';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('/fonts/ibm-plex-mono-latin-400-normal.woff2') format('woff2');
}
@font-face {
  font-family: 'IBM Plex Mono';
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url('/fonts/ibm-plex-mono-latin-500-normal.woff2') format('woff2');
}
@font-face {
  font-family: 'IBM Plex Mono';
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url('/fonts/ibm-plex-mono-latin-600-normal.woff2') format('woff2');
}

/*
 * Arabic in two files per weight, with `unicode-range` so a browser
 * showing an English page never downloads the Arabic one. The Arabic
 * subsets are the largest files here — 45 KB each — and most screens in
 * the office are read in English.
 */
@font-face {
  font-family: 'IBM Plex Sans Arabic';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('/fonts/ibm-plex-sans-arabic-arabic-400-normal.woff2') format('woff2');
  unicode-range: U+0600-06FF, U+0750-077F, U+0870-088E, U+0890-0891, U+08A0-08FF,
                 U+FB50-FDFF, U+FE70-FEFF;
}
@font-face {
  font-family: 'IBM Plex Sans Arabic';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('/fonts/ibm-plex-sans-arabic-latin-400-normal.woff2') format('woff2');
}
@font-face {
  font-family: 'IBM Plex Sans Arabic';
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url('/fonts/ibm-plex-sans-arabic-arabic-500-normal.woff2') format('woff2');
  unicode-range: U+0600-06FF, U+0750-077F, U+0870-088E, U+0890-0891, U+08A0-08FF,
                 U+FB50-FDFF, U+FE70-FEFF;
}
@font-face {
  font-family: 'IBM Plex Sans Arabic';
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url('/fonts/ibm-plex-sans-arabic-latin-500-normal.woff2') format('woff2');
}
@font-face {
  font-family: 'IBM Plex Sans Arabic';
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url('/fonts/ibm-plex-sans-arabic-arabic-600-normal.woff2') format('woff2');
  unicode-range: U+0600-06FF, U+0750-077F, U+0870-088E, U+0890-0891, U+08A0-08FF,
                 U+FB50-FDFF, U+FE70-FEFF;
}
@font-face {
  font-family: 'IBM Plex Sans Arabic';
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url('/fonts/ibm-plex-sans-arabic-latin-600-normal.woff2') format('woff2');
}

/* ---------------------------------------------------------------------
   ARABIC FOR PRINTED DOCUMENTS.

   The console uses IBM Plex Sans Arabic — a clean sans that sits well
   beside Archivo on a screen. It is the wrong face for an official
   document. Egyptian and Gulf authorities read Naskh; a sans-serif Arabic
   on an embassy authorisation looks like a web page somebody printed,
   and on paperwork that decides whether a coffin moves, looking
   provisional is a real cost.

   NOTO NASKH ARABIC is the face, chosen after the office looked at four
   side by side.

   Amiri went first and was rejected — "العربي هو اللي وحش". It is a
   beautiful type and the wrong one here: a faithful revival of the Bulaq
   Press metal, which means calligraphic contrast, fine hairlines and a
   small apparent size. On a screen and on a laser print it reads as
   literary rather than administrative, and this paperwork is
   administrative.

   Noto Naskh is the same script tradition with even stroke weight, a
   larger apparent size and open counters. It is close to what an Egyptian
   office document set in Word actually looks like, which is the correct
   target: our sheet should sit in the pile at the health office without
   announcing itself.

   Amiri and Scheherazade New stay loaded behind it. Both are Naskh with
   the same coverage, so if a file ever fails nothing changes shape — and
   Scheherazade is there because it is wider still, which is the next
   thing to try if a scanned copy ever comes back muddy.
   ------------------------------------------------------------------- */

@font-face {
  font-family: 'Scheherazade New';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('/fonts/scheherazade-new-arabic-400-normal.woff2') format('woff2');
}
@font-face {
  font-family: 'Scheherazade New';
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url('/fonts/scheherazade-new-arabic-700-normal.woff2') format('woff2');
}

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

@font-face {
  font-family: 'Noto Naskh Arabic';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('/fonts/noto-naskh-arabic-arabic-400-normal.woff2') format('woff2');
}
@font-face {
  font-family: 'Noto Naskh Arabic';
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url('/fonts/noto-naskh-arabic-arabic-600-normal.woff2') format('woff2');
}
@font-face {
  font-family: 'Noto Naskh Arabic';
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url('/fonts/noto-naskh-arabic-arabic-700-normal.woff2') format('woff2');
}

/* ---------------------------------------------------------------------
   THE OFFICIAL FACE, for documents that leave the building.

   The office asked for Times New Roman: "عايزين فونت رسمي". That is the
   right instinct — a serif reads as official on paper in a way a
   geometric sans does not, and Times is what the ministries, the
   embassies and the funeral directors all set their own paperwork in, so
   our sheet sits in the pile without announcing itself.

   TINOS IS HERE BECAUSE TIMES CANNOT BE. Times New Roman is Monotype's,
   licensed to Microsoft and Apple; it is on nearly every desktop and it
   is on none of our servers, and we cannot ship it. Tinos is
   METRICALLY COMPATIBLE — same advance widths, same line breaks, same
   number of pages — so a document rendered on the server and the same
   document printed from a colleague's Windows machine come out
   identical. The stack asks for Times first and falls to Tinos, which
   means a coordinator printing locally gets the real thing and our PDFs
   still match it line for line.

   ARABIC STAYS IN NASKH, and this is a deliberate refusal of half the
   instruction. Times New Roman does technically carry Arabic glyphs on
   recent Windows, but they are an afterthought — the letterforms are
   thin, the joins are wrong and the diacritics collide, and on macOS and
   Linux there is no Arabic in it at all, so the sheet would silently
   fall back to whatever the machine had. Naskh IS the official Arabic
   form; Amiri is a revival of the Bulaq Press type that Egyptian
   government printing used. Setting Arabic in Amiri is not a departure
   from "official", it is the same request answered in the right script.
   ------------------------------------------------------------------- */

@font-face {
  font-family: 'Tinos';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('/fonts/tinos-latin-400-normal.woff2') format('woff2');
}
@font-face {
  font-family: 'Tinos';
  font-style: italic;
  font-weight: 400;
  font-display: swap;
  src: url('/fonts/tinos-latin-400-italic.woff2') format('woff2');
}
@font-face {
  font-family: 'Tinos';
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url('/fonts/tinos-latin-700-normal.woff2') format('woff2');
}
@font-face {
  font-family: 'Tinos';
  font-style: italic;
  font-weight: 700;
  font-display: swap;
  src: url('/fonts/tinos-latin-700-italic.woff2') format('woff2');
}
