@media print {
    :root {
        --color-background: #fff;
        --color-text: #000;
        --color-muted: #000;
        --color-accent: #000;
        --color-highlight: #000;
    }

    html, body {
        display: block !important;
        margin: 0 !important;
        padding: 0 !important;
        min-height: 0 !important;
        height: auto !important;
        overflow: visible !important;
    }

    @page {
        size: A4;
        margin: 16mm 12mm;
        @bottom-center { content: string(address); vertical-align: top; }
    }

    @page:left {
        @top-left { content: counter(page);   vertical-align: bottom; }

    }

    @page:right {
        @top-right    { content: counter(page);   vertical-align: bottom; }
    }

    @page:first {
        @top-left   { content: string(edition); vertical-align: bottom; }
        @top-right  { content: string(date);    vertical-align: bottom; }
    }

    body > header,
    body > footer {
        display: none;
    }

    a::after {
       content: " (" attr(href) ")";
    }

    .pagedjs_margin-content {
        font-family: var(--font-base) !important;
        letter-spacing: 2pt !important;
        line-height: 1;

    }

    .pagedjs_margin-top {
        font-weight: bold;
        padding-bottom: 4pt;
        border-bottom: 2pt solid var(--color-text) !important;
    }

    .pagedjs_margin-bottom {
        font-weight: normal;
        padding-top: 4pt;
        border-top: 2pt solid var(--color-text) !important;
    }

    .pagedjs_area {
        padding: 10pt 8pt !important;
        box-sizing: border-box;
        display: flex;
        flex-direction: column;
        align-items: center;
    }

    .header,
    .article {
        width: 100%;
        margin: 0;
    }

    .header {
        display: grid;
        grid-template-columns: 1fr;
        align-content: center;
        justify-items: center;
        border-bottom: 2pt solid var(--color-text);
        line-height: 1;
        padding-bottom: 2pt;
    }

    .header span {
        display: none;
    }

    .publication-title {
        string-set: title content(text);
        margin: 0;
        padding: 0;
        font-size: 48pt;
    }

    .publication-subtitle {
        font-family: var(--font-accent);
    }

    .date {
        string-set: date content(text);
    }

    .edition {
        string-set: edition content(text);
    }

    .address {
        string-set: address content(text);
    }

    .article {
        display: flex;
        flex-direction: column;
        align-items: center;
    }

    .article-title {
        break-inside: avoid;
        width: 100%;
        margin: 6pt 0 6pt;
        padding: 10pt;
        font-size: 18pt;
        line-height: 1.1;
        text-align: center;
        color: var(--color-background);
        background-color: var(--color-text);
    }

    .article-title.image {
        background-image: var(--header-image);
        background-size: cover;
        background-position: center;
        filter: grayscale(1);
    }

    .article-text {
        column-count: 2;
        column-gap: 14pt;
        padding: 6pt;
        font-size: 8pt;
        line-height: 1.1;
        text-align: justify;
    }

    code {
        font-size: 6pt;
    }

    .article-text > :first-child { 
        margin-top: 0 !important;
    }

    .article-text > :last-child  {
        margin-bottom: 0 !important;
    }
}