/*********************************************************
 * Print & PDF Styles
 *********************************************************/

:root {
    --pdfreactor-major-version: "12";
}

/* * * * * * * * * * * * * * * * * * * * * * * * * * * * *
 * Basic Page Layout
 * * * * * * * * * * * * * * * * * * * * * * * * * * * * */

@page {
    padding-top: 0.5cm;
    font-family: var(--font-family-primary);
    counter-increment: page 1;

    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;
    padding: 0;
    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%;
		z-index: -1;
    }
}


/* * * * * * * * * * * * * * * * * * * * * * * * * * * * *
 * 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;
    width: 15cm;
}

.bookinfo .title {
    color: var(--color-text);
    font-size: 52pt;
    top: 11cm;
    text-transform: uppercase;
    padding: 0;
    margin-left: -6px;
    letter-spacing: 0.05em;
}

.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: 550pt;
    font-weight: normal;
    content: var(--pdfreactor-major-version);
    position: absolute;
    top: 1.7cm;
    left: 2.2cm;
    z-index: -2;
    font-weight: normal;
    white-space: nowrap;
    letter-spacing: -0.2em;
}

#Logo > img {
    width: 100%;
    margin-left: -1cm;
}

.productFamily {
    display: none;
}

/* 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 */
/* (before 2nd to avoid style propagating when there is no 2nd) */
tbody:first-of-type > tr:nth-child(2),
li:nth-child(2) {
    break-before: avoid;
}

/* Avoid breaks only two lines after a heading */
h1 + * {
    orphans: 4;
}

/* Avoid breaks after rows that are like headings */
tr.subCaption {
    break-after: avoid;
}


/* * * * * * * * * * * * * * * * * * * * * * * * * * * * *
 * PDF Bookmarks & Tags
 * * * * * * * * * * * * * * * * * * * * * * * * * * * * */

body > section:not(.simple) > h1,
.preface > h1,
.toc > h1 {
    bookmark-level: 1;
    bookmark-label: content(before) content(text);
    -ro-pdf-tag-type: H1;
}

body > section:not(.simple) > section:not(.simple) > h1 {
    bookmark-level: 2;
    bookmark-label: content(before) content(text);
    -ro-pdf-tag-type: H2;
}  

body > section:not(.simple) > section:not(.simple) > section:not(.simple) > h1 {
    bookmark-level: 3;
    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 {
    bookmark-level: 4;
    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 {
    bookmark-level: none;
    -ro-pdf-tag-type: H5;
}

section.simple > h1 {
    bookmark-level: none;
    -ro-pdf-tag-type: H;
}

body section:not(.simple) section:not(.simple) h1 {
    /* Close level 2+ bookmarks */
    bookmark-state: closed;
}

td > a[href^="#"] {
    -ro-pdf-tag-type: Link;
}

.note::before,
.see::before,
.important::before,
.example::before {
    -ro-pdf-tag-type: H;
}


/* * * * * * * * * * * * * * * * * * * * * * * * * * * * *
 * 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
 * * * * * * * * * * * * * * * * * * * * * * * * * * * * */

.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";
}

/* Barcode Appendix */

#appendix-barcodes p {
    margin-top: 1.5mm;
    margin-bottom: 1.5mm;
}

#appendix-barcodes.intro {
    break-after: always;
}

.barcode-infobox {
    margin-bottom: 2mm;
    display: flex;
    flex-direction: row;
    justify-content: space-between;
    break-inside: avoid;
}

.barcode-infobox .info {
    max-width: 70%;
}

.barcode-infobox table {
    break-inside: avoid;
}

.barcode-infobox .barcode-example {
    margin-top: 10mm;
    -ro-replacedelement: barcode;
    -ro-barcode-content: attr(data-content);
    -ro-barcode-type: attr(data-type -ro-ident);
    object-fit: contain;
    width: 20%;
}

.barcode-example[data-type="composite"] {
    -ro-barcode-composite-content: "[00]223456789123456789";
}

.barcode-example[data-type="channelcode"] {
    width: 9% !important;
    padding-right: 5%;
}

.version-table {
    break-before: avoid;
    break-inside: avoid;
}


/* * * * * * * * * * * * * * * * * * * * * * * * * * * * *
 * Code Sets
 * * * * * * * * * * * * * * * * * * * * * * * * * * * * */

.codeSet,
.codeSet.static > [data-lang-name] {
    position: relative;
}

.codeSet .allLanguagesLink {
    position: absolute;
    right: -1em;
    top: -0.7em;
    margin: 0;
    font-size: 0.7em;
    background-color: var(--color-secondary);
    padding: 0.2em 0.5em;
    border-radius: 1em;
}

.codeSet .allLanguagesLink a {
    color: var(--color-text-inverted) !important;
}

.important .codeSet .allLanguagesLink {
    right: 0.7em;
}

.heading {
    padding-top: 2mm;
    break-after: avoid;
    font-style: italic;
}

.codeSet.static > [data-lang-name]::before {
    content: attr(data-lang-name);
    position: absolute;
}
    
.heading::after {
    content: ":";
}

.note .codeSet > pre,
.see .codeSet > pre {
    border: 1pt dotted gray;
    margin: 2mm;
}

.note .heading,
.note .codeSet > p,
.important .heading,
.important .codeSet > p {
    padding-left: 2mm;
}

.backlink {
    break-after: avoid;
}


#codeSamplesForOtherLanguagesContainer .simpleSect {
    position: relative;
}

#codeSamplesForOtherLanguagesContainer .simpleSect > .title,
.codeSet.static > [data-lang-name]::before {
    position: absolute;
    top: 0;
    right: 0;
    margin: 0;
    font-size: 0.5rem;
    background-color: var(--color-tertiary);
    padding: 1mm;
}

/* * * * * * * * * * * * * * * * * * * * * * * * * * * * *
 * Transliteration values list
 * * * * * * * * * * * * * * * * * * * * * * * * * * * * */

#transliterateList {
    column-count: 5;
    column-gap: 2.5em;
    font-size: 0.7em;
}

#transliterateList > span {
    display: flex;
    justify-content: space-between;
    width: 100%;
}

#transliterateList > span > span {
    text-overflow: -ro-scale-down;
    min-width: 0;
    white-space: pre;
    width: max-content;
}

#transliterateValues {
    break-before: always;
}

/* Hide framework support table controls */
#frameworkSupport nav {
    display: none;
}

/* Continuation markers for tables */
table::-ro-before-break,
table::-ro-after-break {
    content: "Continued";
    font-size: 6pt;
    color: gray;
    height: 0;
    text-align: right;
    padding-inline: 3pt;
}
table::-ro-after-break {
    transform: translate(0, -1lh);
    text-align: left;
}
