/**
 * CSS for all PDF print pages
 */

/**
Just add bookmarks to section titles, not sub-headings
 */
h1,h2,h3,h4,h5,h6{
    prince-bookmark-level:none;
}
.pmb-depth-0:not([id*='/pmb-']) h1.pmb-title{prince-bookmark-level: 1}
.pmb-depth-1:not([id*='/pmb-']) h1.pmb-title{prince-bookmark-level: 2}
.pmb-depth-2:not([id*='/pmb-']) h1.pmb-title{prince-bookmark-level: 3}
.pmb-depth-3:not([id*='/pmb-']) h1.pmb-title{prince-bookmark-level: 4}
.pmb-depth-4:not([id*='/pmb-']) h1.pmb-title{prince-bookmark-level: 5}

/**
 Accessibility stuff. See  https://www.princexml.com/doc/prince-output/#pdf-tags 
 */
.pmb-toc-list{
    -prince-pdf-tag-type: TOC;
}
.pmb-toc-list .pmb-toc-item{
    -prince-pdf-tag-type: TOCI;
}
.pmb-posts .pmb-dynamic-resize img{
    width:auto;
}
figure.pmb-dynamic-resized, .wp-block-image.pmb-dynamic-resized figure{
    display:flex;
    flex-direction:column;
}

.pmb-dynamic-resized-image-wrapper{
    overflow:auto;
}
.pmb-dynamic-resized .pmb-dynamic-resized-image-wrapper img{
    height:100%;
    max-height:100%;
    width:auto;
    display:block;
    margin-right:auto;
    margin-left:auto;
}

/**
* Use this style to make images take up the full space and then clip it
 */
.pmb-image-clip{
    display:flex;
    flex-direction:column;
    align-items:center;
    justify-content:center;
    overflow:hidden;
}

.pmb-image-clip img{
    max-height:none;
}

.pmb-image-clip.pmb-nudge-up-100 img{
    transform:translate(0, 100px)
}

/* When an image is floating it has a wrapped div that should have no height, so the floating items can stack
 horizontally. When they aren't floating then it's the "figure" that's the top-level block element (even if there's
 no caption) */
div.wp-block-image{
    margin:0;
}

/**
Remove hairline above image captions in grid galleries
 */
.blocks-gallery-grid:not(.has-nested-images) .blocks-gallery-image figcaption, .blocks-gallery-grid:not(.has-nested-images) .blocks-gallery-item figcaption, .wp-block-gallery:not(.has-nested-images) .blocks-gallery-image figcaption, .wp-block-gallery:not(.has-nested-images) .blocks-gallery-item figcaption{
    background-repeat: no-repeat;
}