/*********************************************************
 * Print & PDF Styles
 *********************************************************/

/* * * * * * * * * * * * * * * * * * * * * * * * * * * * *
 * Basic Page Layout
 * * * * * * * * * * * * * * * * * * * * * * * * * * * * */

@page{
    padding-top: 0.5cm;
    
    font-family: var(--font-family-primary);
    
    counter-increment: page 1;
}

@page {
    margin-left:  1.75cm;
    margin-right: 1.75cm;
    margin-top: 1.5cm;
    margin-bottom: 2cm;
    size: A4 portrait;
    font-size: 10pt;
}

@page:-ro-nth(2) {
    /* Counter will start on third page */
    
    @bottom-left {
        content: none;
        border-radius: 0%;
        background-color: transparent;
    }
}

@page:left{
    /* Header Margin Boxes */
    
    @top-left{
        content: string(chaptertitle);
        white-space: nowrap;
        height: 0.75cm;
        background-color: var(--color-header-footer-background);
        color: var(--color-header-footer-text);
        margin-top: 0.5cm;
        margin-bottom: 0.25cm;
        z-index: 1;
        position: absolute;
        top: 0;
        left: 0;
        width: 100-ro-pw;
        box-sizing: border-box;
        padding-left: 2cm;
        font-weight: bold;
    }
    
    /* Footer Margin Boxes */
    
    @bottom-left{
        content: counter(page);
        text-align: center;
        background-color: var(--color-header-footer-background);
        color: var(--color-header-footer-text);
        font-weight: bold;
        z-index: 10;
        position: absolute;
        margin-bottom: 0.5cm;
        margin-top: 0.5cm;
        height: 1cm;
        width: 1cm;
        left: 1cm;
        bottom: 0;
        border-radius: 50%;
    }
    
    @bottom-center {
        content: "RealObjects PDFreactor " string(version) " " string(doctitle);
        margin-bottom: 0.5cm;
        margin-top: 0.75cm;
        background-color: var(--color-header-footer-background);
        height: 0.75cm;
        position: absolute;
        left: 0;
        bottom: 0;
        width: 100-ro-pw;
        box-sizing: border-box;
        color: var(--color-header-footer-text);
        white-space: nowrap;
    }
}

@page:right{
    /* Header Margin Boxes */
    
    @top-right{
        content: string(sectiontitle);
        white-space: nowrap;
        height: 0.75cm;
        background-color: var(--color-header-footer-background);
        color: var(--color-header-footer-text);
        margin-top: 0.5cm;
        margin-bottom: 0.25cm;
        z-index: 1;
        position: absolute;
        top: 0;
        left: 0;
        width: 100-ro-pw;
        box-sizing: border-box;
        padding-right: 2cm;
    }
    
    /* Footer Margin Boxes */
    
    @bottom-right{
        content: counter(page);
        text-align: center;
        background-color: var(--color-header-footer-background);
        color: var(--color-header-footer-text);
        font-weight: bold;
        z-index: 10;
        position: absolute;
        margin-bottom: 0.5cm;
        margin-top: 0.5cm;
        height: 1cm;
        width: 1cm;
        right: 1cm;
        bottom: 0;
        border-radius: 50%;
    }
    
    @bottom-center {
        content: "www.pdfreactor.com";
        margin-bottom: 0.5cm;
        margin-top: 0.75cm;
        background-color: var(--color-header-footer-background);
        height: 0.75cm;
        position: absolute;
        left: 0;
        bottom: 0;
        width: 100-ro-pw;
        box-sizing: border-box;
        color: var(--color-header-footer-text);
    }
}

/* First Page */

@page:first {
    margin-left: 0;
    margin-right: 0;
    margin-bottom: 6cm;
    counter-increment: page -1;
    
    @top-left {
        background-color: transparent;
    }
    
    @top-right {
        background-color: transparent;
    }
    
    @bottom-right {
        content: none;
        background-color: transparent;
        height: auto;
        width: auto;
    }
    
    @bottom-left {
        content: none;
        background-color: transparent;
        height: auto;
        width: auto;
    }
    
    @bottom-center {
        background-color: var(--color-primary);
        margin: 0;
        content: " ";
        position: static;
        width: 100%;
        height: 100%;
    }
}


/* * * * * * * * * * * * * * * * * * * * * * * * * * * * *
 * Footnotes
 * * * * * * * * * * * * * * * * * * * * * * * * * * * * */

@page:first {
    counter-reset: footnote;
}

.footnote {
    float: footnote;
    font-size: 0.7em;
    font-style: italic;
    font-weight: normal;
    text-align: left;
    font-family: var(--font-family-primary);
    display: inline;
    color: var(--color-text);
}
    
::footnote-call {
    counter-increment: footnote 1;
    content: counter(footnote, decimal);
    line-height: 1;
    font-size: smaller;
    vertical-align: super;
    font-style: normal;
}

::footnote-marker {
    content: counter(footnote, decimal) " ";
    line-height: 1;
    font-size: smaller;
    vertical-align: super;
    font-style: normal;
    color: var(--color-text);
}

.footnote strong {
    font-weight: bold;
}

.footnote a {
    text-decoration: none;
    white-space: nowrap;
}

@page{
    
    @footnote {
        margin-top: 0.5cm;
        border-top-width: 1pt;
        border-top-style: solid;
        border-top-color: var(--color-text);
        -ro-border-length: 30%;
        padding-top: 0.2cm;
        
        width: 100%;
        
        -ro-priority: -1;
    }
}


/* * * * * * * * * * * * * * * * * * * * * * * * * * * * *
 * Title Page & Content
 * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
 
/* Title Page Element Positioning */

.bookinfo .title,
.bookinfo .releaseinfo {
    text-align: left;
    position: absolute;
    font-weight: normal;
    left: 3cm;
}

.bookinfo .title {
    color: var(--color-text);
    font-size: 52pt;
    top: 11cm;
    text-transform: uppercase;
    padding: 0;
    margin-left: -6px;
}

.bookinfo .releaseinfo {
    top: 23.5cm;
    color: var(--color-text-inverted);
}

#Logo {
    padding-top: 4cm;
    margin-left: 3cm;
    margin-top: -1cm;
}

#Logo::after {
    background-color: transparent;
    color: #dddddd;
    font-family: var(--font-family-title);
    font-size: 600pt;
    font-weight: normal;
    content: "10";
    position: absolute;
    top: -5cm;
    right: -0.6cm;
    z-index: -2;
    font-weight: normal;
    white-space: nowrap;
    letter-spacing: -170px;
}

#Logo > img {
    width: 100%;
    margin-left: -1cm;
}

/* Copyright on second page */

.bookinfo .copyright {
    padding-top: 20cm;
    break-before: always;
}

/* Table of Contents on third page */

.toc {
    break-before: always;
}

#poweredby {
    position: absolute;
    bottom: 0cm;
    right: 0cm;
}

#ColorKeywords {
    break-before: always;
}
.toc_sect2 {
    break-before: avoid !important;
}


/* * * * * * * * * * * * * * * * * * * * * * * * * * * * *
 * Pagination
 * * * * * * * * * * * * * * * * * * * * * * * * * * * * */

/* Avoid breaks after the first table row or list item */
tbody:first-of-type > tr:first-child,
li:first-child {
    break-after: avoid;
}

/* Avoid breaks only two lines after a heading */
h1 + * {
    orphans: 4;
}


/* * * * * * * * * * * * * * * * * * * * * * * * * * * * *
 * PDF Bookmarks & Tags
 * * * * * * * * * * * * * * * * * * * * * * * * * * * * */

body > section:not(.simple) > h1,
.preface > h1,
.toc > h1 {
    -ro-bookmark-level: 1;
    -ro-bookmark-label: content(before) content(text);
    -ro-pdf-tag-type: "H1";
}

body > section:not(.simple) > section:not(.simple) > h1 {
    -ro-bookmark-level: 2;
    -ro-bookmark-label: content(before) content(text);
    -ro-pdf-tag-type: "H2";
}  

body > section:not(.simple) > section:not(.simple) > section:not(.simple) > h1 {
    -ro-bookmark-level: 3;
    -ro-bookmark-label: content(before) content(text);
    -ro-pdf-tag-type: "H3";
}  

body > section:not(.simple) > section:not(.simple) > section:not(.simple) > section:not(.simple) > h1 {
    -ro-bookmark-level: 4;
    -ro-bookmark-label: content(before) content(text);
    -ro-pdf-tag-type: "H4";
}

body > section:not(.simple) > section:not(.simple) > section:not(.simple) > section:not(.simple) > section:not(.simple) > h1 {
    -ro-bookmark-level: none;
    -ro-pdf-tag-type: "H5";
}

section.simple > h1 {
    -ro-bookmark-level: none;
    -ro-pdf-tag-type: "H";
}

body section:not(.simple) section:not(.simple) h1 {
    /* Close level 2+ bookmarks */
    -ro-bookmark-state: closed;
}

td > a[href^="#"] {
    -ro-pdf-tag-type: "Link";
}

.note::before,
.see::before,
.important::before,
.example::before {
    -ro-pdf-tag-type: "H";
}

ul > * > * {
    -ro-pdf-tag-type: "LBody";
}
ul > * > *:first-child {
    -ro-pdf-tag-type: "Lbl";
}


/* * * * * * * * * * * * * * * * * * * * * * * * * * * * *
 * Cross-References When Using Segmentation
 * * * * * * * * * * * * * * * * * * * * * * * * * * * * */

h1[id], dt[id], li[id] {
    -ro-target-candidate: all;
}


/* * * * * * * * * * * * * * * * * * * * * * * * * * * * *
 * Preferences
 * * * * * * * * * * * * * * * * * * * * * * * * * * * * */

@-ro-preferences {
    first-page-side: right;
    page-layout: 1 column;
    initial-zoom: fit-page;
}

/* * * * * * * * * * * * * * * * * * * * * * * * * * * * *
 * Barcodes
 * * * * * * * * * * * * * * * * * * * * * * * * * * * * */

.barcode-container {
    break-inside: avoid;
}

#appendix-barcodes p {
    margin-top: 2mm;
    margin-bottom: 2mm;
}

#appendix-barcodes.intro {
    break-after: always;
}

.barcodeTypeCaption {
    margin-bottom: 2.5mm;
}

.example-right {
    object-fit: contain;
}

.example-right#upc {
    -ro-replacedelement: barcode;
    -ro-barcode-type: upc-e;
    -ro-barcode-content: "123456";
}

.example-right#qr {
    -ro-replacedelement: barcode;
    -ro-barcode-type: qrcode;
    -ro-barcode-ecclevel: H;
    -ro-barcode-size: 2;
    -ro-barcode-content: "https://www.pdfreactor.com/";
}

.example-right#maxicode {
    -ro-replacedelement: barcode;
    -ro-barcode-type: maxicode mode-3 "999999999840012";
    -ro-barcode-content: "1234567894561230";
}

.example-right#gridmatrix {
    -ro-replacedelement: barcode;
    -ro-barcode-type: grid-matrix;
    -ro-barcode-content: "https://www.pdfreactor.com/product/doc_html/index.html#Barcodes";
}