/* NEC Liberia: print / Save as PDF layout (loaded with media="print") */
@page { size: A4; margin: 16mm 14mm 18mm; }

html, body { background: #fff !important; color: #111 !important; font-size: 11pt; line-height: 1.5; }
* { box-shadow: none !important; text-shadow: none !important; animation: none !important; transition: none !important; }

/* Anything that only makes sense on screen */
.skip-link, .top-strip, .nav, .menu-btn, .search-btn, .search-overlay, .mobile-menu, #mobileMenu,
.news-ticker, .ticker-reopen, .wa-float, .a11y, .a11y-fab, .a11y-panel, .a11y-footer-link,
.nec-print-btn, .back-home, .breadcrumb, .nec-pager, .pagination, .nec-dt-search, .nec-dt-tools,
.leaflet-control-container, .res-search, .res-view, .res-clear, .dl-arrow, .map-controls, .res-btn, .ticker-close, .a11y-btn, button[type="submit"], video, iframe { display: none !important; }

/* Letterhead: the logo once, at the top of the first page (not sticky, not repeated) */
.site-header, .site-header.scrolled { position: static !important; transform: none !important; background: #fff !important; border: 0 !important; padding: 0 0 6mm !important; height: auto !important; }
.site-header .hdr-inner { display: block !important; padding: 0 !important; }
.site-header .logo img, .site-header .logo svg { height: 16mm !important; width: auto !important; }

/* Page title: plain heading instead of the dark banner */
.page-title-bar, .page-hero { background: none !important; color: #111 !important; padding: 0 0 4mm !important; margin: 0 0 6mm !important; border: 0 !important; border-bottom: 2px solid #0c1b3a !important; }
.page-title-bar h1, .page-title-bar p, .page-hero h1, .page-hero p { color: #111 !important; }
.page-title-bar::before, .page-title-bar::after { display: none !important; }
.container { max-width: none !important; width: 100% !important; padding: 0 !important; margin: 0 !important; }
.page-content { padding: 0 !important; }

/* Scroll-reveal elements are invisible until scrolled on screen: always show them in print */
.reveal, .stg > *, [class*="reveal"] { opacity: 1 !important; transform: none !important; visibility: visible !important; }

/* Text: justified, no orphan headings */
.page-content p, .page-content li, .dept-content p, .exec-ed-blurb p { text-align: justify; hyphens: auto; orphans: 3; widows: 3; }
h1, h2, h3, h4 { page-break-after: avoid; break-after: avoid; color: #0c1b3a !important; }
a { color: #111 !important; text-decoration: none !important; }
.page-content p a[href^="http"]:not([href*="nec.gov.lr"]):not([href*="localhost"]):after { content: " (" attr(href) ")"; font-size: 8.5pt; color: #555; word-break: break-all; }
img, svg, figure { max-width: 100% !important; page-break-inside: avoid; break-inside: avoid; }

/* Tables: full width, header repeats on every page, rows never split, no dependence on background colours */
.table-scroll { overflow: visible !important; border: 0 !important; }
table, .county-table, .parties-table, .res-table, .nec-dt table { width: 100% !important; min-width: 0 !important; border-collapse: collapse !important; font-size: 9.5pt !important; page-break-inside: auto; }
thead { display: table-header-group; }
tfoot { display: table-footer-group; }
tr, td, th { page-break-inside: avoid; break-inside: avoid; }
th, thead th, .county-table th, .parties-table th, .res-table thead th, .nec-dt th { background: #fff !important; color: #0c1b3a !important; border-top: 1.5px solid #0c1b3a !important; border-bottom: 1.5px solid #0c1b3a !important; padding: 5px 8px !important; text-align: left !important; vertical-align: bottom; white-space: normal !important; }
td, .county-table td, .parties-table td, .res-table td { padding: 5px 8px !important; border-bottom: 0.5pt solid #bbb !important; background: none !important; color: #111 !important; vertical-align: top; text-align: left; }

/* Document library: one card per row, full titles (the screen version cuts them at two lines) */
.legal-dl-list { display: block !important; }
.legal-dl-item { display: flex !important; width: 100% !important; margin: 0 0 3mm !important; }
.legal-dl-item .dl-title, .legal-dl-item .dl-desc, .res-table .rt-title a { display: block !important; -webkit-line-clamp: unset !important; overflow: visible !important; }

/* Cards and boxes become simple bordered blocks */
.dept-card, .exec-ed-row, .dept-page-header, .res-card, .doc-card, .nec-card, .card { border: 0.5pt solid #bbb !important; background: #fff !important; page-break-inside: avoid; break-inside: avoid; }

/* Charts and colour chips keep their colours even when "background graphics" is off */
.parliament-chart, .parliament-chart *, .org-badge, .party-dot, .seat, svg * { -webkit-print-color-adjust: exact; print-color-adjust: exact; }

/* Footer: one line instead of the full site footer */
footer[role="contentinfo"] { background: none !important; color: #444 !important; padding: 6mm 0 0 !important; margin-top: 8mm !important; border-top: 0.5pt solid #999; font-size: 9pt; }
footer[role="contentinfo"] > * { display: none !important; }
footer[role="contentinfo"]::after { content: "National Elections Commission of Liberia \2014  www.nec.gov.lr"; display: block; }
