/* ============================================================================
 * print.css — print/PDF stylesheet (loaded via <link media="print">)
 *
 * Only applies when printing or "Save as PDF". Has no effect on screen.
 * Goal: strip site chrome and render the article body clean and full-width.
 * Article DOM (see assets/sections/answers.php + pageheader.php):
 *   #contentpad › .pagewhitebgarticle › (#bc, #phtitle, .bigpbase,
 *                 #toolpanelwrap, #articlebody)
 * ==========================================================================*/

/* Page setup — sensible margins, let the browser handle headers/footers */
@page {
    margin: 1.5cm;
}

/* ── Base ──────────────────────────────────────────────────────────────── */
html,
body {
    background: #fff !important;
    color: #000 !important;
    font-size: 12pt;
    line-height: 1.45;
    width: auto !important;
    margin: 0 !important;
    padding: 0 !important;
}

/* ── Hide site chrome ──────────────────────────────────────────────────── */
#navwrap,
#menuwrap,
#menuwrapper,
#navsearchwrap,
#searchresultswrap,
#footerwrapper,
#footer,
#hb,
#menuToggle,
#sharewrap,
#share,
#bc,                              /* breadcrumb trail */
#toolpanelwrap,                   /* QR / share / reading-time / audio / key points */
#library,                         /* library page banner */
a#darkmode,
.addthis_inline_share_toolbox_pjut,
.a2a_kit,
[class*="addtoany"],
.cc-window,
.cc-revoke,
.qrcode {
    display: none !important;
}

/* ── Neutralise the layout containers so content runs full width ──────── */
#pagebody,
#contentwrap,
#content,
#contentpad,
.pagewhitebgarticle,
#articlebody {
    position: static !important;
    float: none !important;
    width: auto !important;
    max-width: 100% !important;
    margin: 0 !important;
    padding: 0 !important;
    background: #fff !important;
    box-shadow: none !important;
    border: 0 !important;
}

/* ── Article title / summary ───────────────────────────────────────────── */
#phtitle {
    font-size: 22pt;
    margin: 0 0 0.4em 0;
}

.bigpbase {
    display: block !important;       /* summary may be collapsed on screen */
    font-size: 12pt;
    margin: 0 0 1em 0;
}

/* ── Article body ──────────────────────────────────────────────────────── */
#articlebody {
    margin-top: 0.5em !important;
}

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

/* Smaller main text and key-point headings on paper */
#articlebody,
#articlebody p,
#articlebody li {
    font-size: 9pt !important;
}

.articleheading,
.articleheading a {
    font-size: 10pt !important;      /* down from 16px */
}

.articlenumber {
    font-size: 17pt !important;      /* down from 38px, keeps it proportional */
}

/* Images should never overflow the page */
img {
    max-width: 100% !important;
    height: auto !important;
}

/* Hero image: a third of the page width, floated right so the body text
   wraps around it, cropped to a 16:9 frame. */
.articleimg {
    float: right !important;
    width: 33% !important;
    margin: 0 0 0.6em 0.9em !important;   /* gap below + left of the wrapped text */
    page-break-inside: avoid;
}

.articleimg img {
    display: block;
    width: 100% !important;
    aspect-ratio: 16 / 9;
    object-fit: cover;
    max-height: none !important;          /* drop the earlier full-width cap */
    height: auto !important;
}

/* ── Pagination niceties ───────────────────────────────────────────────── */
h1, h2, h3, h4, h5, h6 {
    page-break-after: avoid;
    break-after: avoid;
}

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

/* Keep verse quotes and images intact, but let article sections
   (.answersectiondivider — one key point each) flow across pages. */
blockquote,
figure,
img {
    page-break-inside: avoid;
    break-inside: avoid;
}
