/* =========================================================================
   RFW + TQQR (Make Room for Reading) — print stylesheet
   Linked with media="print" from rfwAppMaster (and the rfw-dev layouts).
   The screen design centres a translucent card over a full-bleed themed
   background; on paper we flatten that to plain black-on-white text.
   ========================================================================= */

@page {
    margin: 1.6cm;
}

/* body[class] variants out-rank the brand skins (e.g. body.brand-TQQR
   sets background: var(--primary) !important at higher specificity). */
html,
body,
body[class],
html body[class][class] {
    background: #fff !important;
    color: #000 !important;
}

body {
    font-size: 12pt;
    line-height: 1.5;
}

/* ---- app chrome: never useful on paper --------------------------------- */
.top-nav,
header.tqqr-nav,
.bottom-nav,
footer.bottom-nav,
.theme-selector,
.book-lightbox-overlay,
.status-toast,
.otb-va-banner,               /* "viewing as" banner */
#audiobook-panel,
.audiobook-panel,
.start-audiobook-btn,
.net-status,                  /* offline / back-online banner */
.tqqr-a2hs,                   /* TQQR add-to-home-screen prompt */
.cc-banner,                   /* cookie consent */
.rag-ui,                      /* Ask course assistant */
.rag-dock,
.rag-fab,                     /* floating "Ask" pill */
.rag-ask-btn,
.tqqr-course-subnav,          /* TQQR course/section strip under the header */
.header-actions,              /* bookmark + mark-as-read circles under the title */
.progress-dot-link,           /* section progress dots */
.progress-line,
.lightbox-zoom-badge,         /* zoom corner overlaid on lightboxed images */
.page .btn-primary,           /* Next / action pills inside course content */
.page-navigation,             /* prev/next course controls */
.rfw-modal-overlay,
.note-toolbar,                /* summernote chrome — the answer text stays */
.note-statusbar,
button[type="submit"],
audio,
video,
iframe {
    display: none !important;
}

/* ---- flatten the centred-card layout to the full sheet ----------------- */
/* The brand themes paint .page (and body pseudo-elements) with full-bleed
   colour/texture — kill those so paper stays white. */
.page,
.page.active {
    background: none !important;
    min-height: 0 !important;
}

body::before,
body::after {
    display: none !important;
}

.page .min-h-screen,
.min-h-screen {
    min-height: 0 !important;
    display: block !important;
    padding: 0 !important;
}

.content-overlay {
    background: #fff !important;
    border-radius: 0 !important;
    box-shadow: none !important;
    padding: 0 !important;
    margin: 0 !important;
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
}

.max-w-5xl {
    max-width: none !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 {
    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). */
.page a[href^="http"]:not(:has(img))::after {
    content: " (" attr(href) ")";
    font-size: 0.8em;
    font-weight: normal;
    word-break: break-all;
}

/* 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;
}
