/*
 * Font faces for content written in the TinyMCE editors (lessons, exercises,
 * library, messages). The editor stores the chosen family inline, e.g.
 * <span style="font-family: 'Boyan Maga'">, so every page that RENDERS that
 * content must know these families too — not just the editor iframe.
 *
 * Loaded by the public and admin layouts, and @imported by tinymce-fonts.css
 * so the editor and the rendered page can never drift apart.
 */

/* MontserratBG (Project default font) */
@font-face {
    font-family: 'MontserratBG';
    src: url('/fonts/MontserratBGCyr/MontserratBGCyr/MontserratBGCyr-Regular.otf') format('opentype');
    font-weight: 400;
    font-style: normal;
}

@font-face {
    font-family: 'MontserratBG';
    src: url('/fonts/MontserratBGCyr/MontserratBGCyr/MontserratBGCyr-Bold.otf') format('opentype');
    font-weight: 700;
    font-style: normal;
}

/* Gabriola */
@font-face {
    font-family: 'Gabriola';
    src: local('Gabriola');
    font-weight: 400;
    font-style: normal;
}

/* Cormorant Garamond, as on the old site: the four cuts the client supplied
   (CormorantGaramond-Bold.ttf.zip on the Trello card holds the whole family;
   these files are byte-identical to it), so regular, italic, bold and bold
   italic each use their own face, as the editor shows them.
   Two family names point at it: 'Cormorant Garamond' is what content migrated
   from the old site carries inline (it had no @font-face here at all, so it
   fell back to a system font), 'Garamond' is what the editor's font menu
   writes. */
@font-face {
    font-family: 'Cormorant Garamond';
    src: url('/fonts/cormorant-garamond/CormorantGaramond-Regular.ttf') format('truetype');
    font-weight: 400;
    font-style: normal;
}

@font-face {
    font-family: 'Cormorant Garamond';
    src: url('/fonts/cormorant-garamond/CormorantGaramond-Italic.ttf') format('truetype');
    font-weight: 400;
    font-style: italic;
}

@font-face {
    font-family: 'Cormorant Garamond';
    src: url('/fonts/cormorant-garamond/CormorantGaramond-Bold.ttf') format('truetype');
    font-weight: 700;
    font-style: normal;
}

@font-face {
    font-family: 'Cormorant Garamond';
    src: url('/fonts/cormorant-garamond/CormorantGaramond-BoldItalic.ttf') format('truetype');
    font-weight: 700;
    font-style: italic;
}

@font-face {
    font-family: 'Garamond';
    src: url('/fonts/cormorant-garamond/CormorantGaramond-Regular.ttf') format('truetype');
    font-weight: 400;
    font-style: normal;
}

@font-face {
    font-family: 'Garamond';
    src: url('/fonts/cormorant-garamond/CormorantGaramond-Italic.ttf') format('truetype');
    font-weight: 400;
    font-style: italic;
}

@font-face {
    font-family: 'Garamond';
    src: url('/fonts/cormorant-garamond/CormorantGaramond-Bold.ttf') format('truetype');
    font-weight: 700;
    font-style: normal;
}

@font-face {
    font-family: 'Garamond';
    src: url('/fonts/cormorant-garamond/CormorantGaramond-BoldItalic.ttf') format('truetype');
    font-weight: 700;
    font-style: italic;
}

/* Century Gothic (Dominik) */
@font-face {
    font-family: 'Century Gothic';
    src: url('/fonts/Dominik.ttf') format('truetype');
    font-weight: 400;
    font-style: normal;
}

/* ADYS V6 Regular */
@font-face {
    font-family: 'ADYS V6';
    src: url('/fonts/ADYSV6-Regular.ttf') format('truetype');
    font-weight: 400;
    font-style: normal;
}

/* ADYS V6 Bold */
@font-face {
    font-family: 'ADYS V6';
    src: url('/fonts/ADYSV6-Bold.ttf') format('truetype');
    font-weight: 700;
    font-style: normal;
}

/* Boyan Maga. Content migrated from the old site names it 'Boyan_Maga'
   (with an underscore), the editor menu writes 'Boyan Maga' — declare both. */
@font-face {
    font-family: 'Boyan Maga';
    src: url('/fonts/Boyan_Maga-Regular.ttf') format('truetype');
    font-weight: 400;
    font-style: normal;
}

@font-face {
    font-family: 'Boyan_Maga';
    src: url('/fonts/Boyan_Maga-Regular.ttf') format('truetype');
    font-weight: 400;
    font-style: normal;
}

/*
 * Let a font chosen in the editor reach everything inside it.
 *
 * The site stylesheet gives every p / li / span its own font-family
 * (MontserratBG_Regular, base/_general.scss). A plain rule on the element
 * beats inheritance, so in content such as
 *     <span style="font-family: Garamond"><span style="font-size: 24px">Избери дума</span></span>
 * the inner span dropped back to MontserratBG on the rendered pages, while
 * the editor (which has no such rule) showed Garamond. Inside an element that
 * sets a font inline, nested p / li / span now inherit it instead. Elements
 * with their own inline font-family keep it (inline style always wins), and
 * the app's own MontserratBG wrappers are left alone.
 */
[style*="font-family" i]:not([style*="MontserratBG" i]) p:not([style*="font-family" i]),
[style*="font-family" i]:not([style*="MontserratBG" i]) li:not([style*="font-family" i]),
[style*="font-family" i]:not([style*="MontserratBG" i]) span:not([style*="font-family" i]) {
    font-family: inherit;
}
