/* ============================================================================
   Print: a light page with the navigation, toasts and controls taken away, so a
   list, an invoice or a sheet of activation codes prints legibly and without
   wasting ink. Loaded with media="print" by App.razor.

   SipCodeBox's Print button prints just that code box: focus.js marks the box
   with .is-print-target and the page with .sip-print-one while it prints.
   ========================================================================== */

:root,
[data-bs-theme="dark"] {
    --sip-canvas: #FFFFFF;
    --sip-surface: #FFFFFF;
    --sip-card: #FFFFFF;
    --sip-raise: #F4F5F6;
    --sip-input: #FFFFFF;
    --sip-hairline: #D5D7DB;
    --sip-line-strong: #B9BCC2;
    --sip-control-line: #8A8E95;
    --sip-text: #111214;
    --sip-text-2: #3A3D43;
    --sip-muted: #55585E;
    --sip-muted-decor: #75787E;
    --sip-text-rgb: 17, 18, 20;
    --sip-info-text: #0B4F8A;
    --sip-success-text: #0E6B37;
    --sip-warning-text: #8A4100;
    --sip-danger-text: #A3201A;
    --bs-body-bg: #FFFFFF;
    --bs-body-color: #111214;
    color-scheme: light;
}

@page {
    margin: 16mm 14mm;
}

html,
body {
    background: #FFFFFF !important;
    color: #111214 !important;
}

/* Chrome that has no meaning on paper. */
.skip-link,
.app-sidebar,
.app-top,
.app-scrim,
.sip-toaster,
.sip-menu,
.sip-action-menu,
.sip-pager,
.sip-toolbar,
.sip-tabs,
.fx-top,
.fx-steps,
.fx-steps-caption,
.sip-code-box-actions,
.fx-copy,
.btn,
button,
#blazor-error-ui,
#components-reconnect-modal,
.no-print {
    display: none !important;
}

.app,
.app-body {
    display: block !important;
    min-height: 0 !important;
}

.app-main,
.fx-main {
    max-width: none !important;
    padding: 0 !important;
}

.sip-card,
.fx-panel,
.sip-code-box,
.fx-codebox {
    border: 1px solid #B9BCC2 !important;
    background: #FFFFFF !important;
    box-shadow: none !important;
    break-inside: avoid;
}

a {
    color: #111214 !important;
    text-decoration: underline !important;
}

/* Print where a link goes, except for in-page anchors and script links. */
.app-main a[href^="http"]::after,
.fx-main a[href^="http"]::after {
    content: " (" attr(href) ")";
    font-size: 0.85em;
    color: #55585E;
    word-break: break-all;
}

.table thead th {
    position: static !important;
    color: #3A3D43 !important;
}

.table > :not(caption) > * > * {
    color: #111214 !important;
    border-color: #D5D7DB !important;
}

/* Wide tables are kept as tables on paper, never the phone's stacked cards. */
.sip-card:has(table) {
    overflow: visible !important;
}

.chip {
    border-color: #B9BCC2 !important;
    background: none !important;
}

/* Codes print large and unmistakable. */
.sip-code-box-value,
.fx-codebox-value,
.sip-code {
    color: #000000 !important;
    font-size: 20pt !important;
    letter-spacing: 0.08em;
}

/* Print one code box: everything else on the page steps aside. */
html.sip-print-one body * {
    visibility: hidden;
}

html.sip-print-one .is-print-target,
html.sip-print-one .is-print-target * {
    visibility: visible;
}

html.sip-print-one .is-print-target {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
}
