/* Default CSS stylesheet for PyCivil Markdown Reports */
/* Used by weasyprint for PDF generation */

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

    @top-center {
        content: "PyCivil Engineering Report";
        font-size: 9pt;
        color: #666;
    }

    @bottom-center {
        content: "Page " counter(page) " of " counter(pages);
        font-size: 9pt;
        color: #666;
    }
}

/* Base typography */
body {
    font-family: "Segoe UI", "Helvetica Neue", Arial, sans-serif;
    font-size: 11pt;
    line-height: 1.5;
    color: #333;
    max-width: 100%;
}

/* Headings */
h1 {
    font-size: 20pt;
    font-weight: bold;
    color: #1a1a1a;
    margin-top: 1.5em;
    margin-bottom: 0.5em;
    border-bottom: 2px solid #333;
    padding-bottom: 0.3em;
    page-break-after: avoid;
}

h2 {
    font-size: 16pt;
    font-weight: bold;
    color: #2a2a2a;
    margin-top: 1.2em;
    margin-bottom: 0.4em;
    border-bottom: 1px solid #666;
    padding-bottom: 0.2em;
    page-break-after: avoid;
}

h3 {
    font-size: 13pt;
    font-weight: bold;
    color: #3a3a3a;
    margin-top: 1em;
    margin-bottom: 0.3em;
    page-break-after: avoid;
}

h4 {
    font-size: 11pt;
    font-weight: bold;
    color: #4a4a4a;
    margin-top: 0.8em;
    margin-bottom: 0.2em;
    page-break-after: avoid;
}

/* Paragraphs */
p {
    margin-top: 0.5em;
    margin-bottom: 0.5em;
    text-align: justify;
}

/* Tables */
table {
    width: 100%;
    border-collapse: collapse;
    margin: 1em 0;
    font-size: 10pt;
    page-break-inside: auto;
}

thead {
    display: table-header-group;
}

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

th, td {
    border: 1px solid #ccc;
    padding: 0.4em 0.6em;
    text-align: left;
    vertical-align: top;
}

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

tr:nth-child(even) {
    background-color: #fafafa;
}

/* Code blocks */
code {
    font-family: "Consolas", "Monaco", "Courier New", monospace;
    font-size: 9pt;
    background-color: #f4f4f4;
    padding: 0.1em 0.3em;
    border-radius: 3px;
}

pre {
    font-family: "Consolas", "Monaco", "Courier New", monospace;
    font-size: 9pt;
    background-color: #f4f4f4;
    padding: 1em;
    border: 1px solid #ddd;
    border-radius: 4px;
    overflow-x: auto;
    white-space: pre-wrap;
    word-wrap: break-word;
    page-break-inside: avoid;
}

pre code {
    background: none;
    padding: 0;
}

/* Lists */
ul, ol {
    margin-top: 0.5em;
    margin-bottom: 0.5em;
    padding-left: 2em;
}

li {
    margin-bottom: 0.3em;
}

/* Emphasis */
strong {
    font-weight: bold;
}

em {
    font-style: italic;
}

/* Horizontal rule */
hr {
    border: none;
    border-top: 1px solid #ccc;
    margin: 1.5em 0;
}

/* Images */
img {
    max-width: 100%;
    height: auto;
    display: block;
    margin: 1em auto;
}

/* Blockquotes */
blockquote {
    margin: 1em 0;
    padding: 0.5em 1em;
    border-left: 4px solid #ccc;
    background-color: #f9f9f9;
    font-style: italic;
}

/* Math formulas (displayed as LaTeX syntax in markdown) */
/* Styling for inline math notation */
.math {
    font-family: "Times New Roman", serif;
    font-style: italic;
}

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

a:hover {
    text-decoration: underline;
}

/* Header table (used in eng-cal template) */
table:first-of-type {
    margin-top: 0;
}

/* Document metadata styling */
.metadata {
    color: #666;
    font-size: 10pt;
}
