/*
 * Roboto and Material Symbols, served from this server.
 *
 * These were loaded from fonts.googleapis.com and fonts.gstatic.com, which are
 * routinely unreachable from Iran. When they fail, every icon in the interface
 * renders as its literal name — "mic", "videocam", "call_end" — and the layout
 * falls back to a system font. Serving them locally removes that dependency.
 *
 * Only the Latin subset and the four weights actually used are shipped.
 */

@font-face {
  font-family: 'Roboto';
  font-style: normal;
  font-weight: 300;
  font-display: swap;
  src: url("../fonts/roboto-latin-300-normal.184504434817.woff2") format('woff2');
}
@font-face {
  font-family: 'Roboto';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("../fonts/roboto-latin-400-normal.b07da7aa3e4f.woff2") format('woff2');
}
@font-face {
  font-family: 'Roboto';
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url("../fonts/roboto-latin-500-normal.02e18aa1a344.woff2") format('woff2');
}
@font-face {
  font-family: 'Roboto';
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url("../fonts/roboto-latin-700-normal.47581e04640c.woff2") format('woff2');
}

@font-face {
  font-family: 'Material Symbols Rounded';
  font-style: normal;
  font-weight: 100 700;
  font-display: block;
  src: url("../fonts/material-symbols-rounded.2e62c2e2ed55.woff2") format('woff2');
}

.material-symbols-rounded,
.material-symbols-outlined {
  font-family: 'Material Symbols Rounded';
  font-weight: normal;
  font-style: normal;
  font-size: 24px;
  line-height: 1;
  letter-spacing: normal;
  text-transform: none;
  display: inline-block;
  white-space: nowrap;
  word-wrap: normal;
  direction: ltr;
  -webkit-font-feature-settings: 'liga';
  -webkit-font-smoothing: antialiased;
  font-variation-settings: 'FILL' 0, 'wght' 400, 'GRAD' 0, 'opsz' 24;

  /*
   * An icon is spelled as a word -- <span>account_circle</span> -- and the
   * font turns that word into one glyph through a ligature. So if the font
   * is not there, the word is what the page shows: a sidebar reading
   * "school PerTutor", "search Find Tutors", a button reading
   * "Get Started arrow_forward". That is not a hypothetical. It is what
   * the site looked like when the woff2 failed to arrive.
   *
   * `font-display: block` above only buys about three seconds. After that
   * the browser falls back, and there is no sane fallback for a family
   * whose glyphs are spelled out in English.
   *
   * So the word is hidden until the font is known to have loaded, and the
   * box it would occupy is held open at one square em so that nothing
   * moves when the glyph appears. A missing icon then reads as a small
   * gap, which is survivable; the word does not.
   */
  visibility: hidden;
  inline-size: 1em;
  block-size: 1em;
  overflow: hidden;
}

/*
 * Set by the guard in base.html once the family really is available, and
 * by <noscript> for anybody without JavaScript -- for them the old
 * behaviour is still better than icons that never appear.
 */
.icons-ready .material-symbols-rounded,
.icons-ready .material-symbols-outlined {
  visibility: visible;
}

/*
 * An icon the layout gives a bigger box to -- a 48px avatar placeholder,
 * the 5xl glyph on an empty state -- sets its own font-size, and
 * `1em` follows it. Anything that sets width or height explicitly wins on
 * specificity anyway, so this only has to not fight them.
 */
.material-symbols-rounded[style*="font-size"],
.material-symbols-outlined[style*="font-size"] {
  inline-size: 1em;
  block-size: 1em;
}

/*
 * Noto Sans Arabic.
 *
 * Roboto's Latin subset carries no Arabic glyph at all, so without this an
 * Arabic page is a page of boxes. Noto Sans Arabic is from the same family
 * of Google designs as Roboto, so the two sit together without the page
 * looking assembled from parts of two different sites.
 *
 * Three weights, matching the Roboto ones the design uses. 300 is left out
 * deliberately: Arabic script at a light weight is hard to read at body
 * size, and the design only uses 300 for large display text.
 *
 * Listed under the same family name as Roboto rather than a separate one,
 * with a `unicode-range` covering the Arabic blocks. The browser then picks
 * per character: Latin stays Roboto even inside an Arabic sentence, which is
 * what you want for a price, a date or a tutor's name written in English.
 * It also means no template has to switch font-family anywhere.
 */
@font-face {
  font-family: 'Roboto';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("../fonts/noto-sans-arabic-arabic-400-normal.24f329fc6c2b.woff2") format('woff2');
  unicode-range: U+0600-06FF, U+0750-077F, U+0870-088E, U+0890-0891, U+0898-08E1, U+08E3-08FF, U+FB50-FDFF, U+FE70-FEFF;
}
@font-face {
  font-family: 'Roboto';
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url("../fonts/noto-sans-arabic-arabic-500-normal.03f58f713886.woff2") format('woff2');
  unicode-range: U+0600-06FF, U+0750-077F, U+0870-088E, U+0890-0891, U+0898-08E1, U+08E3-08FF, U+FB50-FDFF, U+FE70-FEFF;
}
@font-face {
  font-family: 'Roboto';
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url("../fonts/noto-sans-arabic-arabic-700-normal.e2e732b086bd.woff2") format('woff2');
  unicode-range: U+0600-06FF, U+0750-077F, U+0870-088E, U+0890-0891, U+0898-08E1, U+08E3-08FF, U+FB50-FDFF, U+FE70-FEFF;
}

/* Arabic script sits lower and needs more room between lines than Latin at
 * the same size; at Roboto's default the diacritics of one line touch the
 * ascenders of the next. */
[dir="rtl"] body {
  line-height: 1.8;
}
