/* Shared document footer for the editor, website and printed A4 pages. */
[data-statement-sheet],
[data-statement-sheet] * {
    font-family: 'Zain', Tahoma, Arial, sans-serif !important;
}

[data-statement-sheet] .official-form__issuer {
    row-gap: 4px;
    color: #202729; /* the body's ink, like the PDF signature */
    line-height: 1.6;
}

/* The PDF's closing bar (pdf-footer.blade.php) in CSS: same 18mm height,
   olive strip, cream gradient, page cell and 15mm QR box, in mm/pt so it is
   the same size on the A4 sheet as on the printed PDF. */
[data-statement-sheet] .statement-doc-footer {
    position: relative;
    z-index: 2;
    display: flex;
    align-items: stretch;
    flex-shrink: 0;
    width: 100%;
    height: 18mm;
    min-height: 18mm;
    margin-top: auto;
    overflow: hidden;
    border: .25mm solid #dec53c;
    border-top: .9mm solid #615b1f;
    border-radius: 2mm;
    background: linear-gradient(180deg, #f8f5e8, #f1ecd8);
    color: #202729;
    font-family: 'Zain', Tahoma, sans-serif;
    line-height: 1.45;
    break-inside: avoid;
}
[data-statement-sheet] .official-form__issuer + .statement-doc-footer { margin-top: 1.5mm; }
.statement-doc-footer__strip { flex: 0 0 4mm; background: linear-gradient(180deg, #615b1f, #43400f); }
.statement-doc-footer__text { display: flex; flex: 1 1 auto; flex-wrap: wrap; align-items: center; gap: 0 .45em; min-width: 0; padding: 2mm 3.5mm; text-align: right; }
.statement-doc-footer__text > small { color: #8a7a2e; font-size: 6.2pt; }
.statement-doc-footer__text > b { color: #192436; font-size: 8.8pt; font-weight: 700; }
.statement-doc-footer__text > span { color: #606768; font-size: 6.4pt; }
.statement-doc-footer__text > span b { color: #615b1f; font-weight: 700; }
.statement-doc-footer__page { display: grid; flex: 0 0 31mm; align-content: center; justify-items: center; padding: 2mm; border-right: .2mm solid #e3d493; color: #656b6c; font-size: 6.5pt; line-height: 1.55; text-align: center; }
.statement-doc-footer__page b { color: #192436; font-size: 9pt; font-weight: 700; }
.statement-doc-footer__qr { display: grid; flex: 0 0 22mm; place-items: center; padding: 1.4mm 2.5mm; border-right: .2mm solid #e3d493; }
.statement-doc-footer__qr-box { display: grid; place-items: center; width: 15mm; height: 15mm; padding: .7mm; background: #fff; border: .3mm solid #dec53c; isolation: isolate; }
.statement-doc-footer__qr-box > svg { display: block; width: 100%; height: 100%; opacity: 1 !important; filter: none !important; transform: none !important; mix-blend-mode: normal !important; }
.statement-doc-footer__qr-box > svg,
.statement-doc-footer__qr-box > svg * { stroke: none !important; stroke-width: 0 !important; }
.statement-doc-footer__qr-box > svg rect[fill="#ffffff"] { fill: #fff !important; }
.statement-doc-footer__qr-box > svg rect[fill="#000000"] { fill: #000 !important; }
.statement-doc-footer__qr-pending { color: #8a7a2e; font-size: 6pt; line-height: 1.3; text-align: center; }

/* One geometry in every context; header and footer meet the inner frame. */
[data-statement-document] { position: relative; width: 210mm; max-width: none; margin: 0 auto; font-family: 'Zain', Tahoma, sans-serif; }
.statement-pagination-status { display: none; margin: 0 0 12px; color: #515c4c; font-family: 'Zain', Tahoma, sans-serif; font-size: 16px; line-height: 1.6; text-align: center; }
[data-statement-preview] .statement-pagination-status,
[data-pagination-error] .statement-pagination-status { display: block; }
[data-statement-document][data-pagination-error] .statement-pagination-status { color: #b42318; }
[data-statement-sheet].official-document.official-form { padding: 4mm; }
[data-statement-sheet] .official-form__header-image { filter: none; border: 0; }
[data-statement-sheet] .official-form__meta { margin-bottom: 6mm; }
[data-statement-sheet] .official-form__body { padding: 0 5mm; }
[data-statement-sheet] .official-form__issuer { padding: 0 5mm; }
.statement-pages { display: block; width: 210mm; }
[data-statement-document][data-paginated] > [data-statement-source] { display: none !important; }
[data-statement-page].official-document.official-form {
    width: 210mm;
    height: 297mm;
    min-height: 297mm;
    max-height: 297mm;
    margin: 0 0 20px;
    overflow: hidden;
}
[data-statement-page]:last-child { margin-bottom: 0; }
[data-statement-page] .statement-page-content { position: relative; z-index: 2; flex: 1 1 0 !important; display: flex; flex-direction: column; min-height: 0; padding: 0 5mm 2px; }
[data-statement-page] .official-form__body { display: flow-root; flex: 0 0 auto; min-height: 0; padding: 0; }
[data-statement-page] .official-form__issuer { flex: 0 0 auto; min-height: 0; margin: auto auto 8px 0; padding: 4px 0 0; }
[data-statement-page] .statement-doc-footer { flex: 0 0 18mm; margin-top: 0; }
/* Continuation pages carry neither the masthead nor the footer: the text
   starts at the top of the frame and runs to its bottom. */
[data-statement-page]:not([data-statement-page="1"]) .statement-page-content { padding-top: 9mm; }
[data-statement-page] .official-form__body,
[data-statement-page] .official-form__body * { font-synthesis: none; }
[data-statement-page] .official-form__body table { display: table; border-collapse: collapse; }
[data-statement-page] .official-form__body img { max-height: 140mm; object-fit: contain; }
[data-statement-page] .statement-fragment-start { margin-bottom: 0 !important; }
[data-statement-page] .statement-fragment-end { margin-top: 0 !important; text-indent: 0 !important; }
.statement-pagination-measuring { position: absolute; left: -100000px; top: 0; visibility: hidden; pointer-events: none; }
@media screen and (max-width: 767px) {
    .official-statement,
    .official-statement__workspace,
    .official-statement__workspace.ed-shell,
    .statement-sheet-viewport {
        width: 100%;
        min-width: 0;
        max-width: 100%;
        overflow-x: hidden;
    }

    .statement-sheet-viewport {
        overflow-x: hidden;
        overflow-y: visible;
        padding: 0 0 24px;
    }

    [data-statement-document],
    .statement-pages,
    [data-statement-sheet].official-document.official-form,
    [data-statement-page].official-document.official-form {
        width: 100%;
        min-width: 0;
        max-width: 100%;
    }

    [data-statement-sheet].official-document.official-form,
    [data-statement-page].official-document.official-form {
        height: auto;
        min-height: 0;
        max-height: none;
        margin: 0;
        padding: 18px 14px 22px;
        overflow: visible;
    }

    [data-statement-page].official-document.official-form {
        margin-bottom: 16px;
    }

    [data-statement-page]:last-child {
        margin-bottom: 0;
    }

    [data-statement-page]:not([data-statement-page="1"]) .statement-page-content {
        padding-top: 18px;
    }

    [data-statement-sheet] .official-form__banner {
        grid-template-columns: 58px minmax(0, 1fr) auto;
        gap: 10px;
        min-height: 0;
        padding: 12px;
    }

    [data-statement-sheet] .official-form__banner > img {
        width: 58px;
        height: 58px;
    }

    [data-statement-sheet] .official-form__banner strong {
        font-size: 18px;
        line-height: 1.3;
    }

    [data-statement-sheet] .official-form__banner > b {
        min-width: 0;
        padding: 9px 7px;
        font-size: 13px;
    }

    [data-statement-sheet] .official-form__meta {
        flex-direction: column;
        align-items: stretch;
        gap: 7px;
        min-height: 0;
        margin-bottom: 18px;
        padding: 10px 12px;
    }

    [data-statement-sheet] .official-form__meta > div {
        display: flex;
        flex-wrap: wrap;
        gap: 4px 12px;
    }

    [data-statement-sheet] .official-form__meta .is-latin {
        padding: 7px 0 0;
        border-top: 1px solid rgba(173, 140, 80, .3);
        border-left: 0;
    }

    [data-statement-sheet] .official-form__title {
        font-size: clamp(22px, 6vw, 28px);
    }

    [data-statement-sheet] .official-form__watermark {
        width: 75%;
        max-width: 100%;
    }

    [data-statement-sheet] .official-form__body,
    [data-statement-sheet] .official-form__body * {
        font-size: clamp(16px, 4.7vw, 20px) !important;
        line-height: 1.9 !important;
    }

    [data-statement-sheet] .official-form__body {
        padding: 4px 0 10px;
        text-align: right;
    }

    [data-statement-sheet] .official-form__issuer {
        width: 100%;
        margin-top: 18px;
        font-size: 16px;
    }

    [data-statement-page] .statement-doc-footer,
    [data-statement-source] .statement-doc-footer {
        display: flex;
        align-items: stretch;
        flex-wrap: nowrap;
        height: auto;
        min-height: 0;
        margin-top: 12px;
    }

    [data-statement-page] .statement-doc-footer__strip,
    [data-statement-source] .statement-doc-footer__strip {
        flex: 0 0 8px;
    }

    [data-statement-page] .statement-doc-footer__text,
    [data-statement-source] .statement-doc-footer__text {
        flex: 1 1 auto;
        align-content: center;
        padding: 10px 12px;
    }

    [data-statement-page] .statement-doc-footer__page,
    [data-statement-source] .statement-doc-footer__page {
        flex: 0 0 62px;
        min-width: 62px;
        padding: 8px;
        border-right: 0;
        border-bottom: 0;
        border-left: .2mm solid #e3d493;
    }

    [data-statement-page] .statement-doc-footer__qr,
    [data-statement-source] .statement-doc-footer__qr {
        flex: 0 0 76px;
        min-width: 76px;
        padding: 7px;
        border-right: 0;
        border-left: .2mm solid #e3d493;
    }

    [data-statement-page] .statement-doc-footer__qr-box,
    [data-statement-source] .statement-doc-footer__qr-box {
        width: 62px;
        height: 62px;
    }

    [data-statement-page] .statement-doc-footer__text,
    [data-statement-page] .statement-doc-footer__text > *,
    [data-statement-source] .statement-doc-footer__text,
    [data-statement-source] .statement-doc-footer__text > * {
        min-width: 0;
        overflow-wrap: anywhere;
    }
}
@media print {
    @page { size: A4; margin: 0; }
    [data-statement-document], .statement-pages { display: block; width: 210mm !important; margin: 0 !important; padding: 0 !important; }
    .statement-pagination-status { display: none !important; }
    [data-statement-page].official-document.official-form {
        height: 297mm !important;
        min-height: 297mm !important;
        max-height: 297mm !important;
        padding: 4mm !important;
        margin: 0 !important;
        overflow: hidden !important;
        break-inside: avoid;
        break-after: page;
        page-break-after: always;
        print-color-adjust: exact;
        -webkit-print-color-adjust: exact;
    }
    /* Must match the rule above selector-for-selector, or the forced break wins
       on the last sheet too and the browser prints a trailing blank page. */
    [data-statement-page].official-document.official-form:last-child {
        break-after: auto;
        page-break-after: auto;
    }
    [data-statement-page] .statement-doc-footer { margin: 0 !important; }
}
