/* =========================================================================
   Opening the Book Training — print stylesheet
   Linked with media="print" from AppLoggedInBase / AppNotLoggedInBase_Split,
   so it layers on top of BOTH the legacy cascade (otbtraining.min.css + co)
   and the forked bundle (css/site/site.min.css). Print is always
   black-on-white, so it also neutralises the reading-tools colour themes
   (html[data-otb-theme=...]).
   ========================================================================= */

@page {
    margin: 1.6cm;
}

html,
body,
body[class],
html[data-otb-theme],
html[data-otb-theme] body,
html[data-otb-theme][data-otb-theme] body[class] {
    background: #fff !important;
    color: #000 !important;
}

body {
    font-size: 12pt;
    line-height: 1.5;
}

/* ---- app chrome: never useful on paper --------------------------------- */
nav.navbar,
footer.footer,
.offcanvas,
.offcanvas-backdrop,
.modal-backdrop,
.otb-va-banner,               /* "viewing as" banner */
#audiobook-panel,
.audiobook-panel,
.start-audiobook-btn,
.rag-ui,                      /* Ask course assistant */
.rag-fab,
.rag-ask-btn,
.rdc-ui,                      /* display coach trigger */
.rdc-dock,
#status-toast,
.lightbox-zoom-badge,         /* zoom corner overlaid on lightboxed images */
.goverlay,                    /* glightbox */
.glightbox-container,
.nav-controls,                /* course prev/next + mark-complete row */
.navigation-component,
.note-toolbar,                /* summernote chrome — the answer text stays */
.note-statusbar,
.dataTables_length,           /* DataTables controls around dashboard tables */
.dataTables_filter,
.dataTables_paginate,
.dataTables_info,
.dash-menu-toggle,
button[type="submit"],
.btn-submit-with-spinner,
audio,
video,
iframe {
    display: none !important;
}

/* ---- open the layout out to the full sheet ----------------------------- */
.wrapper,
.main,
main.content,
main.content .container-fluid,
.otb-dashboard {
    display: block !important;
    width: auto !important;
    margin: 0 !important;
    padding: 0 !important;
    background: #fff !important;
    color: #000 !important;
}

.sticky-top,
.fixed-top,
.fixed-bottom,
.position-fixed,
.position-sticky {
    position: static !important;
}

*,
*::before,
*::after {
    box-shadow: none !important;
    text-shadow: none !important;
}

/* ---- readable, well-paginated content ---------------------------------- */
h1, h2, h3, h4, h5, h6 {
    color: #000 !important;
    break-after: avoid;
    page-break-after: avoid;
}

p, li, blockquote {
    orphans: 3;
    widows: 3;
}

img,
figure,
table,
blockquote,
.card,
.accordion-item {
    break-inside: avoid;
    page-break-inside: avoid;
}

img {
    max-width: 100% !important;
}

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

/* Show the destination of external links in body copy (skip image links). */
main.content a[href^="http"]:not(:has(img))::after {
    content: " (" attr(href) ")";
    font-size: 0.8em;
    font-weight: normal;
    word-break: break-all;
}

/* Row-action buttons ("View user" etc.) are noise on paper */
td .btn,
td a.btn {
    display: none !important;
}

/* Tables: plain rules print better than shaded rows */
table,
th,
td {
    background: #fff !important;
    color: #000 !important;
    border-color: #999 !important;
}

/* Learner answers (summernote editors, textareas) keep a visible frame so
   the printed page shows where the response sits. */
.note-editor,
textarea,
input[type="text"] {
    border: 1px solid #999 !important;
    background: #fff !important;
    color: #000 !important;
}
