/*
 * loveprotocol.io · print (handoff 03 LR). Loaded on every page with media="print", after the page styles.
 * Paper: white ground, dark sepia text, headings dark teal, section rules earth red; body 11 pt, mono 9 pt.
 * No chrome (waves, footer band, TOC, buttons, newsletter, social row, permalinks); every Error Code
 * definition visible; ACL and version history stay tables; external links print their URL.
 */
@page { margin: 18mm 16mm; }

html, body { background: #ffffff; }
body {
    display: block;
    min-height: 0;
    color: var(--dark-sepia);
    font-size: 11pt;
    line-height: 1.5;
    overflow: visible;
}

/* ---------- hidden on paper ---------- */
.skip-link,
.header-wrapper,
.footer-wrapper,
.toc,
.hero-actions,
.nf-actions,
.nl-box,
.social,
.pl,
.pl-status,
.err-icon,
button:not(.err-toggle) { display: none !important; }

/* ---------- print-only lines (from constants and the front matter) ---------- */
.print-line {
    display: block;
    margin: 0;
    font-family: var(--font-code);
    font-size: 9pt;
    line-height: 1.5;
    letter-spacing: 0.04em;
    color: var(--dark-sepia);
}
.print-line--top { padding: 0 0 6pt; margin-bottom: 12pt; border-bottom: 2px solid var(--earth-red); }
.print-line--end { padding: 6pt 0 0; margin-top: 18pt; border-top: 1px solid rgba(var(--dark-sepia-rgb), 0.4); }

/* ---------- one column, full paper width ---------- */
.spec-layout, .page-narrow { display: block; max-width: none; padding: 0; margin: 0; }
.spec-hero, .spec-main { max-width: none; }
.spec-main { padding-bottom: 0; }
.hero { padding-top: 0; }
.hero h1 { font-size: 30pt; }
.hero-tagline { margin: 8pt 0 12pt; font-size: 14pt; }
.status-line, .md-line { font-size: 9pt; }
.status-line a, .md-line a { padding: 0; }
.compassion { margin-top: 14pt; padding: 10pt 12pt; }
.privacy h1, .nf h1 { font-size: 24pt; }

/* ---------- type ---------- */
h1, h2, h3, h4, .sec-head, .sec-h, .err-head, .history-lead { break-after: avoid; page-break-after: avoid; }
.sec-h { color: var(--dark-teal); }
/* the heading row carries the rule and the spacing (handoff 04 LAA); the permalink in it is hidden */
.sec-head:has(> .sec-h2) { margin: 24pt 0 8pt; padding-top: 6pt; border-top: 2px solid var(--earth-red); }
.sec-head:has(> .sec-h3) { margin: 16pt 0 6pt; }
.sec-h2 { font-size: 11pt; }
.sec-h3 { font-size: 10pt; }
.spec-main p, .spec-main li { orphans: 3; widows: 3; }
.spec-main ul, .spec-main ol { margin-bottom: 10pt; }
.spec-main li { margin-bottom: 4pt; }
pre.code, code, .err-c, .err-b, .acl-source, .spec-table th, .err-head, .hist-v, .hist-status, .hist-date, .hist-commit { font-size: 9pt; }
pre.code {
    white-space: pre-wrap;
    overflow: visible;
    overflow-wrap: anywhere;
    break-inside: avoid;
    page-break-inside: avoid;
}
.impl-lead { font-size: 12pt; }
.spec-table, .acl, .errs, .acl-access, .impl-more, .license-more, .safety-line, .nl-note { font-size: 10pt; }

/* ---------- tables: no scroll container, no cards, rows never split ---------- */
.table-wrap, .acl-wrap, .hist-wrap { overflow: visible; margin: 8pt 0 14pt; }
.spec-table, .spec-table--wide, .hist { min-width: 0; }
tr, .acl-row, .hist-row, .err { break-inside: avoid; page-break-inside: avoid; }
thead { display: table-header-group; }
.acl-num { font-size: 18pt; }
.acl-access { width: auto; }

/* ---------- 5 Error Codes: every definition visible (beats the global [hidden] rule) ---------- */
.err-def[hidden] { display: block !important; }
.err-toggle { min-height: 0; padding: 6pt 0 2pt; }
.err-def { padding: 0 0 6pt; }
.err.is-open { background: none; }

/* ---------- version history: the current row keeps its tag and tint on paper ---------- */
.hist-commit { white-space: normal; }
.hist-commit a { display: inline; padding: 0; margin: 0; }
.hist-tag, .hist-row.is-current { -webkit-print-color-adjust: exact; print-color-adjust: exact; }

/* ---------- external links in the content print their URL ---------- */
main a[href^="http"]::after {
    content: " (" attr(href) ")";
    font-family: var(--font-code);
    font-size: 8pt;
    letter-spacing: 0;
    overflow-wrap: anywhere;
    word-break: break-all;
}
