/* Default CSS for Mac-letterhead Markdown Processing
 * This file contains all the default styling values used by Mac-letterhead.
 * Copy and modify this file to create your own brand-specific styling.
 *
 * Usage: uvx mac-letterhead install letterhead.pdf --css my-brand.css --name "My Company"
 */

/* ==================== PAGE LAYOUT ==================== */
@page {
    /* Page margins are automatically calculated based on letterhead content */
    /* These will be overridden by the letterhead analysis */
    margin-top: 72pt;
    margin-right: 72pt; 
    margin-bottom: 72pt;
    margin-left: 72pt;
    
    /* Page footer with page numbers */
    @bottom-center {
        content: counter(page);
        font-family: Helvetica, Arial, sans-serif;
        font-size: 9pt;
        color: #666666;
    }
}

/* ==================== BODY AND BASE TYPOGRAPHY ==================== */
body {
    font-family: Helvetica, Arial, sans-serif;
    font-size: 9pt;
    line-height: 1.3;
    color: #000000;
    max-width: 100%;
    margin: 0;
    padding: 0;
    text-align: left;
}

/* Reset margins for consistent spacing */
* {
    margin-top: 0;
}

* + * {
    margin-top: 4pt;
}

/* ==================== HEADINGS ==================== */
h1 {
    font-family: Helvetica, Arial, sans-serif;
    font-size: 14pt;
    font-weight: bold;
    color: #000000;
    margin-top: 12pt;
    margin-bottom: 6pt;
    line-height: 1.2;
    page-break-after: avoid;
    keep-with-next: always;
}

h2 {
    font-family: Helvetica, Arial, sans-serif;
    font-size: 12pt;
    font-weight: bold;
    color: #000000;
    margin-top: 10pt;
    margin-bottom: 4pt;
    line-height: 1.2;
    page-break-after: avoid;
    keep-with-next: always;
}

h3 {
    font-family: Helvetica, Arial, sans-serif;
    font-size: 10pt;
    font-weight: bold;
    color: #000000;
    margin-top: 8pt;
    margin-bottom: 4pt;
    line-height: 1.2;
    page-break-after: avoid;
    keep-with-next: always;
}

h4 {
    font-family: Helvetica, Arial, sans-serif;
    font-size: 9pt;
    font-weight: bold;
    color: #000000;
    margin-top: 6pt;
    margin-bottom: 3pt;
    line-height: 1.2;
    page-break-after: avoid;
}

h5 {
    font-family: Helvetica, Arial, sans-serif;
    font-size: 9pt;
    font-weight: bold;
    color: #000000;
    margin-top: 6pt;
    margin-bottom: 3pt;
    line-height: 1.2;
    page-break-after: avoid;
}

h6 {
    font-family: Helvetica, Arial, sans-serif;
    font-size: 9pt;
    font-weight: bold;
    color: #000000;
    margin-top: 6pt;
    margin-bottom: 3pt;
    line-height: 1.2;
    page-break-after: avoid;
}

/* Adjust spacing after headings */
h1 + *, h2 + *, h3 + *, h4 + *, h5 + *, h6 + * {
    margin-top: 4pt;
}

/* ==================== PARAGRAPHS ==================== */
p {
    font-family: Helvetica, Arial, sans-serif;
    font-size: 9pt;
    line-height: 1.3;
    color: #000000;
    margin-top: 4pt;
    margin-bottom: 4pt;
    text-align: left;
    orphans: 2;
    widows: 2;
}

/* ==================== TEXT FORMATTING ==================== */
strong, b {
    font-weight: bold;
    color: inherit;
}

em, i {
    font-style: italic;
    color: inherit;
}

u {
    text-decoration: underline;
}

s, strike, del {
    text-decoration: line-through;
}

small {
    font-size: 8pt;
}

/* ==================== LINKS ==================== */
a {
    color: #0066cc;
    text-decoration: none;
}

a:hover {
    color: #004499;
    text-decoration: underline;
}

a:visited {
    color: #663399;
}

/* ==================== LISTS ==================== */
ul {
    margin-top: 6pt;
    margin-bottom: 6pt;
    padding-left: 20pt;
    list-style-type: disc;
}

ol {
    margin-top: 6pt;
    margin-bottom: 6pt;
    padding-left: 20pt;
    list-style-type: decimal;
}

li {
    margin-bottom: 3pt;
    line-height: 1.3;
    orphans: 2;
    widows: 2;
}

/* Nested lists */
ul ul, ol ol, ul ol, ol ul {
    margin-top: 3pt;
    margin-bottom: 3pt;
}

ul ul {
    list-style-type: circle;
}

ul ul ul {
    list-style-type: square;
}

/* Custom bullet styling */
ul li::marker {
    color: #000000;
}

ol li::marker {
    color: #000000;
    font-weight: normal;
}

/* ==================== CODE AND PREFORMATTED TEXT ==================== */
code {
    font-family: Courier, 'Courier New', monospace;
    font-size: 8pt;
    background-color: #f5f5f5;
    color: #333333;
    padding: 1pt 3pt;
    border-radius: 3pt;
    border: 1px solid #e0e0e0;
}

pre {
    font-family: Courier, 'Courier New', monospace;
    font-size: 8pt;
    line-height: 1.3;
    background-color: #f5f5f5;
    color: #333333;
    border: 1px solid #cccccc;
    border-radius: 4pt;
    padding: 8pt;
    margin: 8pt 0;
    white-space: pre-wrap;
    word-wrap: break-word;
    overflow-wrap: break-word;
    page-break-inside: avoid;
}

pre code {
    background-color: transparent;
    padding: 0;
    border: none;
    border-radius: 0;
}

/* ==================== SYNTAX HIGHLIGHTING ==================== */
/* Pygments syntax highlighting classes */
.codehilite {
    background-color: transparent;
    border: none;
    padding: 0;
    margin: 0;
    overflow-x: auto;
}

.codehilite pre {
    margin: 0;
    padding: 8pt;
    background-color: #f5f5f5;
    border: 1px solid #cccccc;
    white-space: pre-wrap;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

/* Syntax highlighting colors */
.codehilite .hll { background-color: #ffffcc; }
.codehilite .c { color: #008000; font-style: italic; } /* Comment */
.codehilite .err { border: 1px solid #ff0000; } /* Error */
.codehilite .k { color: #0000ff; font-weight: bold; } /* Keyword */
.codehilite .o { color: #666666; } /* Operator */
.codehilite .ch { color: #008000; font-style: italic; } /* Comment.Hashbang */
.codehilite .cm { color: #008000; font-style: italic; } /* Comment.Multiline */
.codehilite .cp { color: #0000ff; } /* Comment.Preproc */
.codehilite .cpf { color: #008000; font-style: italic; } /* Comment.PreprocFile */
.codehilite .c1 { color: #008000; font-style: italic; } /* Comment.Single */
.codehilite .cs { color: #008000; font-style: italic; } /* Comment.Special */
.codehilite .gd { color: #a00000; } /* Generic.Deleted */
.codehilite .ge { font-style: italic; } /* Generic.Emph */
.codehilite .gr { color: #ff0000; } /* Generic.Error */
.codehilite .gh { color: #000080; font-weight: bold; } /* Generic.Heading */
.codehilite .gi { color: #00a000; } /* Generic.Inserted */
.codehilite .go { color: #888888; } /* Generic.Output */
.codehilite .gp { color: #000080; font-weight: bold; padding-right: 4pt; } /* Generic.Prompt */
.codehilite .gs { font-weight: bold; } /* Generic.Strong */
.codehilite .gu { color: #800080; font-weight: bold; } /* Generic.Subheading */
.codehilite .gt { color: #0044dd; } /* Generic.Traceback */
.codehilite .kc { color: #0000ff; font-weight: bold; } /* Keyword.Constant */
.codehilite .kd { color: #0000ff; font-weight: bold; } /* Keyword.Declaration */
.codehilite .kn { color: #0000ff; font-weight: bold; } /* Keyword.Namespace */
.codehilite .kp { color: #0000ff; } /* Keyword.Pseudo */
.codehilite .kr { color: #0000ff; font-weight: bold; } /* Keyword.Reserved */
.codehilite .kt { color: #2b91af; } /* Keyword.Type */
.codehilite .ld { color: #cc0000; } /* Literal.Date */
.codehilite .m { color: #666666; } /* Literal.Number */
.codehilite .s { color: #cc0000; } /* Literal.String */
.codehilite .na { color: #ff0000; } /* Name.Attribute */
.codehilite .nb { color: #0000ff; } /* Name.Builtin */
.codehilite .nc { color: #2b91af; } /* Name.Class */
.codehilite .no { color: #cc0000; } /* Name.Constant */
.codehilite .nd { color: #2b91af; } /* Name.Decorator */
.codehilite .ni { color: #999999; font-weight: bold; } /* Name.Entity */
.codehilite .ne { color: #cc0000; font-weight: bold; } /* Name.Exception */
.codehilite .nf { color: #0000ff; } /* Name.Function */
.codehilite .nl { color: #cc0000; } /* Name.Label */
.codehilite .nn { color: #0000ff; font-weight: bold; } /* Name.Namespace */
.codehilite .nt { color: #2b91af; } /* Name.Tag */
.codehilite .nv { color: #003366; } /* Name.Variable */
.codehilite .ow { color: #0000ff; font-weight: bold; } /* Operator.Word */
.codehilite .w { color: #bbbbbb; } /* Text.Whitespace */
.codehilite .mb { color: #666666; } /* Literal.Number.Bin */
.codehilite .mf { color: #666666; } /* Literal.Number.Float */
.codehilite .mh { color: #666666; } /* Literal.Number.Hex */
.codehilite .mi { color: #666666; } /* Literal.Number.Integer */
.codehilite .mo { color: #666666; } /* Literal.Number.Oct */
.codehilite .sa { color: #cc0000; } /* Literal.String.Affix */
.codehilite .sb { color: #cc0000; } /* Literal.String.Backtick */
.codehilite .sc { color: #cc0000; } /* Literal.String.Char */
.codehilite .dl { color: #cc0000; } /* Literal.String.Delimiter */
.codehilite .sd { color: #cc0000; font-style: italic; } /* Literal.String.Doc */
.codehilite .s2 { color: #cc0000; } /* Literal.String.Double */
.codehilite .se { color: #cc0000; font-weight: bold; } /* Literal.String.Escape */
.codehilite .sh { color: #cc0000; } /* Literal.String.Heredoc */
.codehilite .si { color: #aa0000; font-weight: bold; } /* Literal.String.Interpol */
.codehilite .sx { color: #cc0000; } /* Literal.String.Other */
.codehilite .sr { color: #33aa33; } /* Literal.String.Regex */
.codehilite .s1 { color: #cc0000; } /* Literal.String.Single */
.codehilite .ss { color: #ffcc33; } /* Literal.String.Symbol */
.codehilite .bp { color: #0000ff; } /* Name.Builtin.Pseudo */
.codehilite .fm { color: #0000ff; } /* Name.Function.Magic */
.codehilite .vc { color: #003366; } /* Name.Variable.Class */
.codehilite .vg { color: #003366; } /* Name.Variable.Global */
.codehilite .vi { color: #003366; } /* Name.Variable.Instance */
.codehilite .vm { color: #003366; } /* Name.Variable.Magic */
.codehilite .il { color: #666666; } /* Literal.Number.Integer.Long */

/* ==================== TABLES ==================== */
table {
    border-collapse: collapse;
    width: 100%;
    margin: 12pt 0;
    border: 1px solid #000000;
    page-break-inside: auto;
}

th {
    background-color: #f0f0f0;
    color: #000000;
    font-weight: bold;
    font-family: Helvetica, Arial, sans-serif;
    font-size: 9pt;
    padding: 6pt;
    text-align: left;
    vertical-align: top;
    border: 0.25pt solid #000000;
}

td {
    font-family: Helvetica, Arial, sans-serif;
    font-size: 9pt;
    color: #000000;
    padding: 6pt;
    text-align: left;
    vertical-align: top;
    border: 0.25pt solid #000000;
}

tr {
    page-break-inside: avoid;
    page-break-after: auto;
}

/* Alternating row colors for better readability */
tbody tr:nth-child(even) {
    background-color: #f9f9f9;
}

/* ==================== BLOCKQUOTES ==================== */
blockquote {
    margin: 12pt 30pt 12pt 30pt;
    padding: 8pt 12pt;
    font-style: italic;
    color: #333333;
    border-left: 3pt solid #cccccc;
    background-color: #f9f9f9;
    page-break-inside: avoid;
}

blockquote p {
    margin: 0;
    font-style: italic;
}

/* Nested blockquotes */
blockquote blockquote {
    margin: 6pt 20pt;
    border-left: 2pt solid #dddddd;
    background-color: #f5f5f5;
}

/* ==================== HORIZONTAL RULES ==================== */
hr {
    border: none;
    height: 1pt;
    background-color: #cccccc;
    margin: 16pt 0;
    page-break-after: avoid;
}

/* ==================== DEFINITION LISTS ==================== */
dl {
    margin: 8pt 0;
}

dt {
    font-weight: bold;
    margin-top: 6pt;
    margin-bottom: 2pt;
}

dd {
    margin-left: 20pt;
    margin-bottom: 4pt;
}

/* ==================== ABBREVIATIONS ==================== */
abbr {
    text-decoration: none;
    border-bottom: 1pt dotted #666666;
    cursor: help;
}

/* ==================== FOOTNOTES ==================== */
.footnote {
    font-size: 8pt;
    line-height: 1.2;
    margin-top: 12pt;
    border-top: 1pt solid #cccccc;
    padding-top: 6pt;
}

.footnote-ref {
    font-size: 7pt;
    vertical-align: super;
    color: #0066cc;
    text-decoration: none;
}

.footnote-backref {
    font-size: 7pt;
    color: #0066cc;
    text-decoration: none;
}

/* ==================== IMAGES ==================== */
img {
    max-width: 100%;
    height: auto;
    margin: 8pt 0;
    page-break-inside: avoid;
}

/* ==================== PRINT OPTIMIZATIONS ==================== */
@media print {
    /* Ensure good contrast for printing */
    body {
        color: #000000;
        background-color: #ffffff;
    }
    
    /* Prevent page breaks after headings */
    h1, h2, h3, h4, h5, h6 {
        page-break-after: avoid;
        page-break-inside: avoid;
    }
    
    /* Avoid breaking these elements */
    pre, blockquote, table, img {
        page-break-inside: avoid;
    }
    
    /* Better table printing */
    table {
        page-break-inside: auto;
    }
    
    tr {
        page-break-inside: avoid;
        page-break-after: auto;
    }
    
    thead {
        display: table-header-group;
    }
    
    /* Ensure links are distinguishable in print */
    a {
        color: #000000;
        text-decoration: underline;
    }
    
    /* Show URL for external links in print */
    a[href^="http"]:after {
        content: " (" attr(href) ")";
        font-size: 8pt;
        color: #666666;
    }
}

/* ==================== CUSTOM UTILITY CLASSES ==================== */
/* Add custom classes that can be used in Markdown with {.class-name} syntax */

.text-center {
    text-align: center;
}

.text-right {
    text-align: right;
}

.text-small {
    font-size: 8pt;
}

.text-large {
    font-size: 11pt;
}

.highlight {
    background-color: #ffff99;
    padding: 1pt 2pt;
}

.note {
    background-color: #e7f3ff;
    border-left: 4pt solid #2196f3;
    padding: 8pt 12pt;
    margin: 8pt 0;
}

.warning {
    background-color: #fff3cd;
    border-left: 4pt solid #ffc107;
    padding: 8pt 12pt;
    margin: 8pt 0;
}

.error {
    background-color: #f8d7da;
    border-left: 4pt solid #dc3545;
    padding: 8pt 12pt;
    margin: 8pt 0;
}

.success {
    background-color: #d4edda;
    border-left: 4pt solid #28a745;
    padding: 8pt 12pt;
    margin: 8pt 0;
}
