/**
 * Print styles for Academic Lab Hugo Theme
 * Version: 1.0.0
 */

/* Reset print styles */
* {
    background: transparent !important;
    color: black !important;
    box-shadow: none !important;
    text-shadow: none !important;
}

/* Remove non-essential elements */
.header,
.footer,
.sidebar,
.mobile-menu-btn,
.back-to-top,
.social-link,
.language-switcher,
.breadcrumb,
.pagination,
.copy-code-btn,
.high-contrast-toggle {
    display: none !important;
}

/* Adjust layout for print */
body {
    font-size: 12pt;
    line-height: 1.5;
    margin: 0;
    padding: 0;
}

/* Page breaks */
h1, h2, h3, h4, h5, h6 {
    page-break-after: avoid;
    page-break-inside: avoid;
}

p {
    orphans: 3;
    widows: 3;
}

blockquote {
    page-break-inside: avoid;
}

pre {
    white-space: pre-wrap !important;
    word-wrap: break-word !important;
    page-break-inside: avoid;
}

table {
    page-break-inside: avoid;
}

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

/* Links */
a {
    text-decoration: underline;
    color: black !important;
}

a[href]::after {
    content: " (" attr(href) ")";
    font-size: 0.8em;
    font-weight: normal;
    color: #666 !important;
}

/* Hide external links in print */
a[href^="http://"]::after,
a[href^="https://"]::after {
    content: none !important;
}

/* Show URL for links that don't have href */
a:not([href])::after {
    content: none !important;
}

/* Article styles */
.article {
    margin-bottom: 0;
    padding-bottom: 0;
}

.article-header {
    margin-bottom: 2rem;
}

.article-title {
    font-size: 24pt;
    margin-bottom: 1rem;
}

.article-meta {
    margin-bottom: 2rem;
    font-size: 10pt;
    color: #666 !important;
}

.article-content {
    font-size: 11pt;
    line-height: 1.6;
}

/* Typography */
h1 {
    font-size: 24pt;
    margin-top: 2rem;
    margin-bottom: 1rem;
}

h2 {
    font-size: 18pt;
    margin-top: 1.5rem;
    margin-bottom: 0.75rem;
}

h3 {
    font-size: 14pt;
    margin-top: 1.25rem;
    margin-bottom: 0.5rem;
}

p {
    margin-bottom: 0.75rem;
}

/* Code */
code {
    font-family: monospace;
    font-size: 10pt;
    background-color: #f5f5f5 !important;
    padding: 2px 4px;
    border-radius: 2px;
}

pre {
    font-family: monospace;
    font-size: 9pt;
    border: 1px solid #ccc !important;
    padding: 1rem;
    margin: 1rem 0;
    overflow: visible;
}

pre code {
    background-color: transparent !important;
    padding: 0;
}

/* Lists */
ul, ol {
    margin-bottom: 0.75rem;
    padding-left: 1.5rem;
}

li {
    margin-bottom: 0.25rem;
}

/* Tables */
table {
    width: 100%;
    border-collapse: collapse;
    margin: 1rem 0;
}

th, td {
    padding: 0.5rem;
    border: 1px solid #ccc !important;
    text-align: left;
}

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

/* Blockquotes */
blockquote {
    border-left: 3px solid #ccc !important;
    padding-left: 1rem;
    margin: 1rem 0;
    font-style: italic;
}

/* Images */
img {
    max-width: 100%;
    height: auto;
}

/* Page setup */
@page {
    margin: 2cm;
    size: A4;
}

/* Header and footer for print */
@page {
    @top-center {
        content: "Academic Lab Hugo Theme";
    }
    
    @bottom-center {
        content: counter(page);
    }
}

/* Print-specific classes */
.print-break {
    page-break-after: always;
}

.print-avoid-break {
    page-break-inside: avoid;
}

/* Accessibility for print */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* High contrast for print */
@media print {
    body {
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }
}