/**
 * Print Stylesheet for Nova's Garage Articles
 *
 * Optimizes article pages for printing with:
 * - Serif fonts for better readability on paper
 * - Point (pt) units instead of pixels
 * - Removal of navigation, UI elements
 * - Proper page breaks
 * - Orphan/widow control
 * - URL display for external links
 *
 * Based on HTML5 Boilerplate + Bootstrap print styles
 */

/* ===================================================================
   Page Configuration
   =================================================================== */

@page {
	size: A4;
	margin: 2cm;
}

@page :first {
	margin-top: 3cm; /* Extra space for first page */
}

/* ===================================================================
   Base Typography
   =================================================================== */

body {
	font-family: Georgia, 'Times New Roman', Times, serif;
	font-size: 12pt;
	line-height: 1.6;
	color: #000;
	background: #fff;
}

/* Headings */
h1 {
	font-size: 24pt;
	font-weight: bold;
	margin-top: 0;
	margin-bottom: 12pt;
	page-break-after: avoid;
}

h2 {
	font-size: 18pt;
	font-weight: bold;
	margin-top: 18pt;
	margin-bottom: 9pt;
	page-break-after: avoid;
}

h3 {
	font-size: 14pt;
	font-weight: bold;
	margin-top: 12pt;
	margin-bottom: 6pt;
	page-break-after: avoid;
}

h4,
h5,
h6 {
	font-size: 12pt;
	font-weight: bold;
	margin-top: 9pt;
	margin-bottom: 6pt;
	page-break-after: avoid;
}

/* Paragraphs */
p {
	margin: 0 0 9pt 0;
	orphans: 3;
	widows: 3;
}

/* ===================================================================
   Links
   =================================================================== */

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

/* Show URLs after external links */
a[href^='http']::after {
	content: ' (' attr(href) ')';
	font-size: 10pt;
	font-style: italic;
}

/* Don't show URLs for internal links or anchor links */
a[href^='/']::after,
a[href^='#']::after {
	content: '';
}

/* ===================================================================
   Lists
   =================================================================== */

ul,
ol {
	margin: 0 0 9pt 18pt;
	padding: 0;
}

li {
	margin-bottom: 3pt;
}

/* ===================================================================
   Images
   =================================================================== */

img {
	max-width: 100% !important;
	height: auto !important;
	page-break-inside: avoid;
}

figure {
	margin: 12pt 0;
	page-break-inside: avoid;
}

figcaption {
	font-size: 10pt;
	font-style: italic;
	margin-top: 6pt;
}

/* ===================================================================
   Tables
   =================================================================== */

table {
	width: 100%;
	border-collapse: collapse;
	margin: 12pt 0;
	page-break-inside: avoid;
}

th,
td {
	border: 1pt solid #ddd;
	padding: 6pt;
	text-align: left;
}

th {
	background: #f5f5f5;
	font-weight: bold;
}

thead {
	display: table-header-group; /* Repeat header on each page */
}

/* ===================================================================
   Code Blocks
   =================================================================== */

pre,
code {
	font-family: 'Courier New', Courier, monospace;
	font-size: 10pt;
	background: #f5f5f5;
	border: 1pt solid #ddd;
}

pre {
	padding: 6pt;
	margin: 12pt 0;
	white-space: pre-wrap;
	page-break-inside: avoid;
}

code {
	padding: 1pt 3pt;
}

/* ===================================================================
   Blockquotes
   =================================================================== */

blockquote {
	margin: 12pt 18pt;
	padding-left: 12pt;
	border-left: 3pt solid #ddd;
	font-style: italic;
	page-break-inside: avoid;
}

/* ===================================================================
   Page Breaks
   =================================================================== */

/* Prevent page breaks inside these elements */
h1,
h2,
h3,
h4,
h5,
h6,
img,
figure,
table,
pre,
blockquote {
	page-break-inside: avoid;
	break-inside: avoid;
}

/* Avoid page breaks right after headings */
h1,
h2,
h3,
h4,
h5,
h6 {
	page-break-after: avoid;
	break-after: avoid;
}

/* ===================================================================
   Hide UI Elements
   =================================================================== */

/* Remove navigation, header, footer, and UI elements */
header,
footer,
nav,
.header,
.footer,
.navigation,
.nav-menu,
.breadcrumbs,
.toc, /* Table of Contents */
.reading-progress, /* Reading progress bar */
.social-share, /* Social sharing buttons */
.comments, /* Comments section */
.related-posts, /* Related posts */
.series-nav, /* Article series navigation */
button,
.button,
.btn,
form,
input,
textarea,
select,
video,
iframe,
.video-embed,
.ad,
.advertisement {
	display: none !important;
}

/* ===================================================================
   Article-Specific Styles
   =================================================================== */

/* Article title */
.article-title {
	font-size: 24pt;
	margin-bottom: 6pt;
}

/* Article meta (date, author) */
.article-meta {
	font-size: 10pt;
	color: #666;
	margin-bottom: 18pt;
	padding-bottom: 9pt;
	border-bottom: 1pt solid #ddd;
}

/* Article content */
.article-content,
.article-body,
.lexical-content {
	font-size: 12pt;
	line-height: 1.6;
}

/* Author bio - keep but simplify */
.about-authors,
.author-card {
	margin-top: 18pt;
	padding-top: 18pt;
	border-top: 1pt solid #ddd;
}

.author-photo {
	display: none; /* Hide photo to save ink */
}

.author-name {
	font-weight: bold;
	margin-bottom: 6pt;
}

.author-bio {
	font-size: 10pt;
	margin-bottom: 6pt;
}

.author-social {
	display: none; /* Hide social links */
}

/* Featured image - keep but optimize */
.featured-image {
	max-height: 300pt;
	margin-bottom: 18pt;
	page-break-inside: avoid;
}

/* Specification tables (car specs) */
.spec-table {
	width: 100%;
	font-size: 10pt;
}

/* Quote blocks */
.quote-block {
	margin: 12pt 0;
	padding: 9pt;
	border-left: 3pt solid #000;
}

/* ===================================================================
   Utilities
   =================================================================== */

/* Force page breaks */
.page-break-before {
	page-break-before: always;
	break-before: always;
}

.page-break-after {
	page-break-after: always;
	break-after: always;
}

/* Prevent page breaks */
.no-page-break {
	page-break-inside: avoid;
	break-inside: avoid;
}
