/*
 * Raleway
 *
 * This font is used for the TOC and headings in PDFs for latin alphabets.
 * The separate css file is required because the PDF library xhtml2pdf doesn't understand the multiple src syntax for browser compatibility.
 */

/* raleway-regular - latin */
@font-face {
    font-family: "Raleway";
    font-style: normal;
    font-weight: normal;
    src: url(assets/raleway-v28-vietnamese_latin-ext_latin_cyrillic-ext_cyrillic-regular-cedc82ec9fbfca66222a.ttf);
}

/* raleway-700 - latin */
@font-face {
    font-family: "Raleway";
    font-style: normal;
    font-weight: bold;
    src: url(assets/raleway-v28-vietnamese_latin-ext_latin_cyrillic-ext_cyrillic-700-b430856ea5fc5c516851.ttf);
}

/*
 * Open Sans
 *
 * This font is used for latin alphabets in PDFs.
 * The separate css file is required because the PDF library xhtml2pdf doesn't understand the multiple src syntax for browser compatibility.
 */

/* open-sans-regular - vietnamese_latin-ext_latin_greek-ext_greek_cyrillic-ext_cyrillic */
@font-face {
    font-family: "Open Sans";
    font-style: normal;
    font-weight: normal;
    src: url(assets/open-sans-v18-latin_latin-ext_greek_greek-ext_cyrillic_cyrillic-ext_vietnamese-regular-a509a050157734e120b3.ttf);
}

/* open-sans-700 - vietnamese_latin-ext_latin_greek-ext_greek_cyrillic-ext_cyrillic */
@font-face {
    font-family: "Open Sans";
    font-style: normal;
    font-weight: bold;
    src: url(assets/open-sans-v18-latin_latin-ext_greek_greek-ext_cyrillic_cyrillic-ext_vietnamese-700-07aedd3c4c1c9402ec76.ttf);
}

/*
 * Noto Sans SC
 *
 * This font is used for chinese alphabets in PDFs.
 * The separate css file is required because the PDF library xhtml2pdf doesn't understand the multiple src syntax for browser compatibility.
 */

/* noto-sans-sc-regular - chinese-simplified */
@font-face {
    font-family: "Noto Sans SC";
    font-style: normal;
    font-weight: normal;
    src: url(assets/noto-sans-sc-v36-chinese-simplified_latin-regular-6acd4551c24f93da40e5.ttf);
}

/* noto-sans-sc-700 - chinese-simplified */
@font-face {
    font-family: "Noto Sans SC";
    font-style: normal;
    font-weight: bold;
    src: url(assets/noto-sans-sc-v36-chinese-simplified_latin-700-b0517451d6a263642512.ttf);
}

/*
 * DejaVu Sans
 *
 * This font is used for right-to-left alphabets in PDFs.
 * It is required because the PDF library xhtml2pdf doesn't support the default font Lateef.
 */

/* dejavu-sans - arabic */
@font-face {
    font-family: "DejaVu";
    font-style: normal;
    font-weight: normal;
    src: url(assets/dejavu-sans-60fc56f7c4ca745a7664.ttf);
}

/* dejavu-sans-bold - arabic */
@font-face {
    font-family: "DejaVu";
    font-style: normal;
    font-weight: bold;
    src: url(assets/dejavu-sans-bold-766ec7f37f27362a3922.ttf);
}

/*
 * Noto Sans Ethiopic
 *
 * This font is used for ethiopic alphabets in PDFs.
 * The separate css file is required because the PDF library xhtml2pdf doesn't understand the multiple src syntax for browser compatibility.
 */

/* noto-sans-ethiopic-regular - amharic */
@font-face {
    font-family: "Noto Sans Ethiopic";
    font-style: normal;
    font-weight: normal;
    src: url(assets/noto-sans-ethiopic-v42-latin-ext_latin_ethiopic-regular-e8787ebd8c5b7a94378c.ttf);
}

/* noto-sans-ethiopic-700 - amharic */
@font-face {
    font-family: "Noto Sans Ethiopic";
    font-style: normal;
    font-weight: bold;
    src: url(assets/noto-sans-ethiopic-v42-latin-ext_latin_ethiopic-700-385d8e69c9c47195437a.ttf);
}

/*
 * Noto Sans Georgian
 *
 * This font is used for georgian alphabets in PDFs.
 * The separate css file is required because the PDF library xhtml2pdf doesn't understand the multiple src syntax for browser compatibility.
 */

/* noto-sans-georgian-regular */
@font-face {
    font-family: "Noto Sans Georgian";
    font-style: normal;
    font-weight: normal;
    src: url(assets/noto-sans-georgian-v44-georgian_latin_latin-ext-regular-c59804181d9da30ba550.ttf);
}

/* noto-sans-georgian-700 */
@font-face {
    font-family: "Noto Sans Georgian";
    font-style: normal;
    font-weight: bold;
    src: url(assets/noto-sans-georgian-v44-georgian_latin_latin-ext-700-e48be52ebcd7893e59b3.ttf);
}

@page {
    size: a4;
    margin: 2cm;
    @frame header_frame {
        /* static frames: stay the same across different pages
        is marked with -pdf-frame-content */
        -pdf-frame-content: header;
        left: 1cm;
        top: 0.5cm;
        right: 1cm;
        height: 1cm;
    }
    @frame footer_frame {
        -pdf-frame-content: footer;
        left: 1cm;
        bottom: 0.1cm;
        right: 1cm;
        height: 1.5cm;
    }
    @frame footer_bar_frame {
        /* due to a malfunction of border-top property,
        which selects all other borders (left, right, bottom) also,
        this work-around uses a separate static frame with minimal height
        to draw a single horizontale line at the bottom of the page */
        -pdf-frame-content: footer_bar;
        height: 0.001cm;
        bottom: 2.0001cm;
        left: 1cm;
        right: 1cm;
        border-top-color: black;
        border-top-style: solid;
        border-top-width: 1px;
    }
    @frame header_bar_frame {
        /* due to a malfunction of border-top property,
        which selects all other borders (left, right, bottom) also,
        this work-around uses a separate static frame with minimal height
        to draw a single horizontale line at the bottom of the page */
        -pdf-frame-content: header_bar;
        height: 0.001cm;
        top: 1.6001cm;
        left: 1cm;
        right: 1cm;
        border-top-color: black;
        border-top-style: solid;
        border-top-width: 1px;
    }
}
.content,
#footer {
    font-size: large;
}
/* the following styles are applied only to the table of content
at the first page of the pdf document */
pdftoc {
    /* applied to the whole toc */
    font-size: large;
}
pdftoc.pdftoclevel1 {
    /* applied for all children of the root page */
    margin-left: 1em;
}
pdftoc.pdftoclevel2 {
    /* applied to all sub headers of the pages */
    margin-left: 2em;
}
pdftoc.pdftoclevel3 {
    /* applied to all sub headers of the pages */
    margin-left: 3em;
}
pdftoc.pdftoclevel4 {
    /* applied to all sub headers of the pages */
    margin-left: 4em;
}
pdftoc.pdftoclevel5 {
    /* applied to all sub headers of the pages */
    margin-left: 5em;
}
h1,
h2,
h3,
h4,
h5,
h6 {
    font-size: x-large;
    margin: 0.83em 0;
    padding: 3px 0px;
}
h2,
h3,
h4,
h5,
h6 {
    -pdf-outline: false;
}
h1.level-0 {
    font-size: xx-large;
    margin: 0.67em 0;
    -pdf-outline-level: 0;
    /* keep the following html tag in the same frame */
    -pdf-keep-with-next: false;
}
h1.level-1 {
    -pdf-outline-level: 1;
}
h1.level-2 {
    -pdf-outline-level: 2;
}
h1.level-3 {
    -pdf-outline-level: 3;
}
h1.level-4 {
    -pdf-outline-level: 4;
}
h1.level-5 {
    -pdf-outline-level: 5;
}
/* title of document on first page should not show up
    in the table of content */
#title_page {
    -pdf-outline: false;
}
p,
ol,
ul {
    padding: 0;
}
li {
    padding: 1px 0px;
}
ul li div:first-child {
    display: inline-block;
}
.right-to-left {
    text-align: right;
}
#header {
    text-align: right;
}
#first-footer {
    text-align: left;
}
#second-footer {
    text-align: center;
}
#third-footer {
    text-align: right;
    background-color: white;
}

/* force linebreak between images wrapped in links */
p a img {
    display: block;
}
p a:first-child img {
    display: inline-block;
}

