/* Print Styles for fjzeit.github.io */

/* Hide navigation elements */
header,
.breadcrumbs,
.post-navigation {
    display: none !important;
}

/* Remove top padding */
section, main {
    margin-top: 0 !important;
    padding-top: 0 !important;
}

/* Print byline */
.print-byline {
    display: block !important;
    margin-top: 0;
    margin-bottom: 0;
    font-size: 11pt;
    color: #666;
    font-weight: 400;
    line-height: 1;
}

.print-byline i {
    vertical-align: middle;
    margin-right: 4px;
    font-size: 11pt;
}

.post .subtitle {
    margin-bottom: 24px;
}

/* Print header */
@page {
    margin-top: 40px;
    @top-center {
        content: "fjzeit.github.io";
        font-size: 10px;
        color: #666;
        font-family: monospace;
    }
}

/* Print URL styling - below byline */
.print-url {
    display: block !important;
    font-size: 10px;
    color: #666;
    font-family: monospace;
    font-weight: normal;
    margin-bottom: 24px;
}

/* Hide social sharing elements before footnotes */
.footnotes::before {
    display: none !important;
}

/* Print contact card styling */
.print-contact-card {
    text-align: center;
    margin-bottom: 40px;
    padding: 30px;
    border: 2px solid #333;
}

.print-contact-card h1 {
    font-size: 28pt;
    margin-bottom: 20px;
    font-weight: bold;
}

.contact-info {
    font-size: 14pt;
}

.contact-item {
    margin: 12px 0;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.contact-item i {
    font-size: 16pt;
    width: 20px;
}

/* Print bio summary styling */
.print-bio-summary {
    margin-top: 30px;
}

.print-bio-summary h2 {
    font-size: 18pt;
    margin-bottom: 16px;
    font-weight: bold;
}

.print-bio-summary p {
    font-size: 12pt;
    line-height: 1.6;
    margin-bottom: 16px;
    text-align: justify;
}

/* Hide any like/comment/X elements */
.social-share,
.like-comment,
[class*="share"],
[class*="social"] {
    display: none !important;
}

/* Hide like/comment links at end of footnotes */
.footnotes li p:first-of-type {
    display: none !important;
}

.footnotes li p:not(:first-of-type) {
    margin-top: 0 !important;
}

/* Ensure good print colors */
* {
    background: white !important;
    color: black !important;
    box-shadow: none !important;
}

h1, h2, h3 {
    color: black !important;
}

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

.copyright {
    display: none !important;
}

/* Base page setup */
@page {
    margin: 0.75in 0.75in 1in 0.75in;
}

html, body {
    width: 100%;
    margin: 0;
    padding: 0;
    background: white;
    color: black;
    font-family: 'Georgia', serif;
    font-size: 12pt;
    line-height: 1.5;
}

/* Hide screen-only elements */
header, .headerquote, .cme, .ping, .nocme, .dateLine, .dateLineP, .artsoclink, .reversefootnote {
    display: none !important;
}

/* Hide all home page screen content */
.profile-container, .bio-summary, .postlist, .github-section, .postlist-grid {
    display: none !important;
}

/* Show print-only content */
.print-contact-card, .print-bio-summary {
    display: block !important;
}

/* Layout */
section {
    margin: 0;
    padding: 0;
    background: none;
    max-width: 100%;
    width: 100%;
}

/* Masthead styling */
.dateLine {
    float: none;
    width: 100%;
    text-align: left;
    border-bottom: 1px solid #ccc;
    padding-bottom: 16pt;
    margin-bottom: 18pt;
    color: #444;
}

.profile-image {
    width: 80px;
    height: 80px;
    float: left;
    margin-right: 16pt;
    border: none;
}

.dateLine p {
    margin: 0;
    padding: 0;
    width: auto;
}

/* Fix for masthead links and decorations */
.dateLine a, .dateLine a:link, .dateLine a:visited {
    text-decoration: none;
    border-bottom: none;
    color: #333;
}

/* Format the social icons properly */
.dateLine .socicon {
    display: none;
}

.dateLine a[href*="github.com"],
.dateLine a[href*="x.com"] {
    display: inline-block;
    margin-right: 8pt;
    text-decoration: none;
    border-bottom: none;
}

.dateLine a[href*="github.com"]:after {
    content: " " attr(href);
    font-size: 90%;
    color: #333;
    margin-left: 2pt;
}

.dateLine a[href*="x.com"]:after {
    content: " " attr(href);
    font-size: 90%;
    color: #333;
    margin-left: 2pt;
}

/* Typography */
h1 {
    font-family: 'Arial', 'Helvetica', sans-serif;
    font-size: 24pt;
    font-weight: bold;
    line-height: 1.2;
    margin: 0 0 10pt 0;
    color: #000;
}

h2 {
    font-family: 'Arial', 'Helvetica', sans-serif;
    font-size: 18pt;
    font-weight: bold;
    margin: 18pt 0 8pt 0;
    color: #000;
}

h3 {
    font-family: 'Arial', 'Helvetica', sans-serif;
    color: #000;
    font-size: 14pt;
    font-weight: bold;
}

h4, h5 {
    font-family: 'Arial', 'Helvetica', sans-serif;
    font-size: 14pt;
    color: #000;
    border-left: none;
    margin-left: 0;
    padding-left: 0;
    margin-top: 14pt;
    margin-bottom: 6pt;
}

p {
    text-align: left;
}
p, ul, ol {
    margin-bottom: 12pt;
    orphans: 5;
    widows: 5;
}

li {
    margin-bottom: 4pt;
}

/* Links */
a {
    color: #000;
    text-decoration: none;
    border-bottom: 1px dotted #666;
}

a:after {
    content: " (" attr(href) ")";
    font-size: 90%;
    color: #333;
}

a[href^="#"]:after, 
a[href^="javascript:"]:after {
    content: "";
}

/* Ensure username link shows proper URL */
.dateLine a[href*="fjzeit"] {
    text-decoration: none;
    border-bottom: none;
}

.dateLine a[href*="fjzeit"]:after {
    content: " " attr(href);
    font-size: 90%;
    color: #333;
}

/* Code blocks */
pre, code {
    font-family: 'Courier New', Courier, monospace;
    font-size: 10pt;
    background-color: #f0f0f0;
    border: 1px solid #999;
    white-space: pre-wrap;
    overflow-wrap: break-word;
    color: #000000;
    font-weight: normal;
}

/* Inline code style for print */
:not(pre) > code {
    font-size: 10pt;
    background-color: #f0f0f0;
    padding: 0px 2px;
    font-weight: normal;
    vertical-align: baseline;
    white-space: normal;
    overflow-wrap: break-word;
    color: #000000;
}

pre {
    padding: 12pt;
    margin: 12pt 0;
    page-break-inside: avoid;
    background-color: #f0f0f0;
    border: 1px solid #999;
}

pre > code {
    background: transparent;
    padding: 0;
    border: none;
    color: #000000;
    font-weight: normal;
}

pre.highlight {
    font-weight: normal;
    background-color: #f0f0f0;
    color: #000000;
    border: 1px solid #999;
}

/* Syntax highlighting for print - optimized for greyscale */
.highlight { 
    background-color: #f0f0f0; 
    color: #000000;
    font-weight: normal;
}

/* Reset all elements to normal */
.highlight .c, .highlight .cm, .highlight .cp, .highlight .c1, .highlight .cs,
.highlight .kc, .highlight .kd, .highlight .kn, .highlight .kp, .highlight .kr, .highlight .kt,
.highlight .nc, .highlight .no, .highlight .nd, .highlight .ni, .highlight .ne, .highlight .nf,
.highlight .nl, .highlight .nn, .highlight .nt, .highlight .nv, .highlight .ow, .highlight .w,
.highlight .mf, .highlight .mh, .highlight .mi, .highlight .mo, .highlight .sb, .highlight .sc,
.highlight .sd, .highlight .s2, .highlight .se, .highlight .sh, .highlight .si, .highlight .sx,
.highlight .sr, .highlight .s1, .highlight .ss, .highlight .bp, .highlight .vc, .highlight .vg,
.highlight .vi, .highlight .il, .highlight .p, .highlight .n, .highlight .o, .highlight .l,
.highlight .k, .highlight .m, .highlight .s, .highlight .na, .highlight .nb, .highlight .err,
.highlight .g, .highlight .gd, .highlight .ge, .highlight .gr, .highlight .gh, .highlight .gi,
.highlight .go, .highlight .gp, .highlight .gs, .highlight .gu, .highlight .gt, .highlight .ld,
.highlight .nx, .highlight .py, .highlight .x {
    color: #000000 !important;
    font-weight: normal !important;
    background-color: transparent !important;
}

/* Make only important syntax elements bold */
.highlight .k, .highlight .kc, .highlight .kd, .highlight .kn, .highlight .kp, .highlight .kr, 
.highlight .kt, .highlight .nc, .highlight .nf, .highlight .nt {
    font-weight: bold !important;
}

/* Only use italic for specific cases */
.highlight .s, .highlight .s1, .highlight .s2, .highlight .sb, .highlight .sc, 
.highlight .sd, .highlight .se, .highlight .sh, .highlight .si, .highlight .sx, 
.highlight .sr, .highlight .ss {
    font-style: italic !important;
}

/* Apply specific styles to inline code */
:not(pre) > code.highlight {
    color: #000000 !important;
    font-weight: normal !important;
}

/* Tables */
table {
    width: 100%;
    border-collapse: collapse;
    margin: 16pt 0;
    page-break-inside: avoid;
}

th {
    background-color: #f0f0f0;
    border-bottom: 2px solid #888;
    color: #000;
    padding: 8pt;
    text-align: left;
    font-weight: bold;
}

td {
    border-bottom: 1px solid #ddd;
    padding: 8pt;
    text-align: left;
}

/* Blockquotes */
blockquote {
    border-left: 4px solid #ccc;
    padding-left: 12pt;
    margin: 0;
    font-style: italic;
    color: #444;
    font-size: 12pt;
}

/* Special elements */
.subtitle {
    font-style: italic;
    font-size: 14pt;
    margin-bottom: 16pt;
}

img {
    max-width: 100%;
    page-break-inside: avoid;
    border: none;
}

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

/* Force headings to stay with their following paragraph */
h1, h2, h3, h4, h5 {
    display: block;
    page-break-inside: avoid;
    break-inside: avoid;
}

h1::after, h2::after, h3::after, h4::after, h5::after {
    content: "";
    display: block;
    height: 0;
    margin-bottom: 0;
    page-break-before: avoid;
    break-before: avoid;
}

/* Keep heading with at least first paragraph using pseudo-element binding */
h1 + p, h2 + p, h3 + p, h4 + p, h5 + p {
    page-break-before: avoid;
    break-before: avoid;
    page-break-inside: avoid;
    break-inside: avoid;
}

/* For Safari and other browsers, try to avoid orphans/widows */
p {
    orphans: 5;
    widows: 5;
}