/*
Generic stuff.
Ask PDF viewers to display pages side-by-side by default.
*/
@prince-pdf {
    -prince-pdf-page-layout: two-column-right;
}

/* pagination */
@media print, screen {
    .pmb-front-matter {
        display: block;
        page: front-matter;
        counter-reset: page 1
    }

    @page front-matter:verso {
        @bottom-left {
            content: counter(page, lower-roman)
        }
    }
    @page front-matter:recto {
        @bottom-right {
            content: counter(page, lower-roman)
        }
    }
    @page front-matter:first{
        @bottom-left {
            content: '';
        }
        @bottom-right{
            content: '';
        }
    }

    .pmb-main-matter {
        display: block;
        page: main-matter;
    }

    @page{
        counter-reset: footnote;

        @footnotes {
            border-top: solid black thin;
            padding-top: 8pt;
        }
    }

    @page main-matter:verso {
        @top {
             content: string(part-title, first-except);
        }
        @bottom-left {
            content: counter(page)
        }
    }

    @page main-matter:recto {
        @top {
            content: string(article-title, first-except)
        }
        @bottom-right {
            content: counter(page)
        }
    }

    @page main-matter:blank{
        @top{
            content:normal;
        }
    }

    .pmb-part{
        page:part;
        -prince-page-group: start;
    }

    @page part{
        @top{
            content:normal;
        }
        /* Don't show "Powered by" here again */
        @bottom{
            content:"";
        }
        @bottom-right{
            content:counter(page);
        }
    }

    .pmb-back-matter {
        display:block;
        page:back-matter;
    }

    @page back-matter:verso {
        @top {
            content: normal;
        }
        @bottom-left {
            content: counter(page)
        }
    }

    @page back-matter:recto {
        @top {
            content: normal;
        }
        @bottom-right {
            content: counter(page)
        }
    }

    @page:blank {
        @top {
            content: normal;
        }
    }


    body{
        background-color:white !important;
        background:white !important;
        color:black;
        prince-footnote-policy: keep-with-line;
    }
    a{
        color:black;
        text-decoration:none;
    }
    .blocks-gallery-grid .blocks-gallery-image figcaption a, .blocks-gallery-grid .blocks-gallery-item figcaption a, .wp-block-gallery .blocks-gallery-image figcaption a, .wp-block-gallery .blocks-gallery-item figcaption a{
        color:white;
    }

    /* Title Page styles */
    .pmb-posts-header{
        margin-top:20vh;
        text-align:center;
    }
    .site-description{
        width:90%;
        margin-left:auto;
        margin-right:auto;
        font-size:2em;
    }
    .pmb-url{
        font-style:italic;
        color:darkgray;
        text-align:center;
    }
    .project-byline{
        margin-top:4em;
    }
    .pmb-title-page-meta{
        float:bottom;
    }


    /* toc */
    #pmb-toc-wrapper{
        break-before: right;
    }
    .pmb-toc-list li{
        list-style:none;
    }
    .pmb-toc-item.pmb-toc-height-1{
        font-weight: bold;
        font-size: 1.2em;
        margin-top: 10px;
    }
    .pmb-toc-item.pmb-toc-depth-1{
        margin-left:1em;
    }
    .pmb-toc-list .pmb-toc-item.pmb-toc-front a::after {
        content: leader('.') target-counter(attr(href), page, lower-roman) !important;
    }
    .pmb-toc-list .pmb-toc-item:not(.pmb-toc-front) a::after {
        content: leader('.') target-counter(attr(href), page) !important;
    }

    /* part styling*/
    .pmb-part h1.pmb-title{
        string-set: part-title content();
        margin-top:20vh;
    }
    .pmb-part .entry-content{
        margin-top:10vh;
        width:50%;
        margin-right:auto;
        margin-left:auto;
    }

    /* Article styles */
    .pmb-article h1.pmb-title {
        string-set: article-title content();
    }

    div.pmb-part-wrapper.pmb-section-wrapper{
        break-before:right;
    }
    div.pmb-back-matter{
        break-before:right;
    }

    span.pmb-footnote{
        float:footnote;
        text-align:left;
        margin-left:0;
        font-weight:normal;
        text-indent:0;
    }

    .entry-meta{
        margin-bottom:1em;
    }

    .excerpt{
        width:80%;
        margin-left:auto;
        margin-right:auto;
        size:1.5em;
        font-style:italic;
    }
    img, div.wp-caption{
        max-width:100%;
    }
}