/* Scoped to the Academy-owned WordPress certificate page only. */
.wwts-certificate-ready .academy-article__header { display: none; }
.wwts-cert-admin-context { max-width: 1122px; margin: 0 auto 12px; padding: 10px 14px; background: #f1eee8; color: #47392b; font: 14px/1.5 Arial, sans-serif; }
.wwts-cert-admin-context a { color: #624a30; text-decoration: underline; }
.wwts-cert-toolbar { text-align: center; margin: 0 auto 22px; }
.wwts-cert-toolbar button { padding: 12px 20px; cursor: pointer; border: 1px solid #897452; background: #fff; color: #203b60; }
.wwts-cert-toolbar button:focus-visible { outline: 2px solid #203b60; outline-offset: 3px; }
.wwts-cert-paper {
    margin: 0 auto 30px;
    max-width: 1122px;
    min-height: 790px;
    padding: clamp(40px, 6vw, 92px);
    border: 30px solid #f1eee8;
    outline: 2px solid #b6a58d;
    outline-offset: -41px;
    background: #fffdfa;
    color: #203b60;
    text-align: center;
    font-family: Georgia, 'Times New Roman', serif;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    box-sizing: border-box;
    overflow-wrap: anywhere;
}
.wwts-cert-paper .wwts-cert-logo { margin: 0 auto 26px; }
.wwts-cert-paper .wwts-cert-logo-img { display: block; max-width: 180px; max-height: 100px; width: auto; height: auto; margin: auto; object-fit: contain; }
.wwts-cert-brand-fallback { font: 700 18px/1.5 Georgia, serif; letter-spacing: .18em; }
.wwts-cert-paper .wwts-cert-kicker { font: bold 11px/1.5 Arial, sans-serif; letter-spacing: .3em; color: #8b7655; }
.wwts-cert-paper h2 { font: normal 32px/1.3 Georgia, serif; letter-spacing: .12em; margin: 16px 0; color: #203b60; }
.wwts-cert-paper .wwts-cert-name { font-size: 39px; line-height: 1.2; margin: 6px 0 14px; }
.wwts-cert-paper .wwts-cert-description { font: 15px/1.5 Arial, sans-serif; color: #5a5b5b; }
.wwts-cert-paper .wwts-cert-course { font-size: 22px; line-height: 1.4; margin: 4px 0 28px; }
.wwts-cert-paper .wwts-cert-date { font: 13px/1.5 Arial, sans-serif; color: #6b5c46; }
.wwts-cert-paper .wp-block-group { max-width: 100%; }
.wwts-cert-paper .wp-block-image img { max-width: 100%; height: auto; }
.wwts-cert-message { margin: 20px 0 45px; padding: 25px; border: 1px solid #dfd6c9; background: #fffdfa; }
.wwts-cert-message h2 { margin-top: 0; }
@media (max-width: 850px) {
    .wwts-cert-paper { min-height: 0; padding: 45px 25px; border-width: 15px; outline-offset: -23px; }
    .wwts-cert-paper .wwts-cert-name { font-size: 29px; }
    .wwts-cert-paper .wwts-cert-course { font-size: 19px; }
}
@page { size: A4 landscape; margin: 0; }
@media print {
    html:has(body.wwts-certificate-ready), body.wwts-certificate-ready { width: 100% !important; min-height: 0 !important; margin: 0 !important; background: white !important; print-color-adjust: exact; -webkit-print-color-adjust: exact; }
    body.wwts-certificate-ready #wpadminbar,
    body.wwts-certificate-ready .academy-header,
    body.wwts-certificate-ready .academy-footer,
    body.wwts-certificate-ready .academy-skip-link,
    body.wwts-certificate-ready .academy-article__header,
    body.wwts-certificate-ready .wwts-cert-toolbar,
    body.wwts-certificate-ready .wwts-cert-admin-context { display: none !important; }
    body.wwts-certificate-ready .academy-main,
    body.wwts-certificate-ready .academy-page,
    body.wwts-certificate-ready .academy-article,
    body.wwts-certificate-ready .academy-container,
    body.wwts-certificate-ready .academy-editor-content { margin: 0 !important; padding: 0 !important; width: 100% !important; min-width: 0 !important; max-width: none !important; min-height: 0 !important; border: 0 !important; }
    /* The Elementor page containing the shortcode can add heading, gutters and flex layout. */
    body.wwts-certificate-ready #academy-main :has(.wwts-cert-paper) {
        display: contents !important;
    }
    body.wwts-certificate-ready :is(#academy-main, #academy-main :has(.wwts-cert-paper))
        > :not(.wwts-cert-paper, :has(.wwts-cert-paper)) {
        display: none !important;
    }
    body.wwts-certificate-ready .wwts-cert-paper {
        box-sizing: border-box !important;
        width: 100% !important;
        height: 210mm !important;
        min-height: 210mm !important;
        max-width: none !important;
        margin: 0 !important;
        padding: 15mm 19mm !important;
        border: 10mm solid #f1eee8 !important;
        outline-offset: -13mm !important;
        page-break-inside: avoid !important;
        break-inside: avoid !important;
    }
}

/* Elementor owns the visual canvas. The plugin retains only safe page geometry. */
.wwts-cert-paper.wwts-cert-paper--elementor {
    display: block;
    padding: 0;
    border: 0;
    outline: none;
    background: transparent;
    text-align: inherit;
    font-family: inherit;
    min-height: 0;
}
@media print {
    body.wwts-certificate-ready .wwts-cert-paper.wwts-cert-paper--elementor {
        padding: 0 !important;
        border: 0 !important;
        outline: none !important;
        display: block !important;
        height: auto !important;
        min-height: 0 !important;
        /* Keep fractional A4 pixel rounding within the printable box. */
        width: calc(100% - 1px) !important;
        overflow: hidden !important;
    }
}
