/*
 * Copyright (c) 2025 JAAB Tech SAS, Uruguay All Rights Reserved
 * See https://jaab.tech
 */

/* --- Page Layout & Header Logo --- */

/* Named page for Cover to exclude header */
@page cover {
    margin: 0;

    /* Full bleed for cover */
    @top-left {
        content: none;
    }

    @top-center {
        content: none;
    }

    @top-right {
        content: none;
    }
}

.pdf-cover {
    page: cover;
}

/* Default Page Style (Normal Pages) */
@page {
    margin-top: 2.5cm;
    /* Ensure space for header */

    @top-left {
        content: " ";
        /* Space required to render box */
        background-image: url('../assets/fluxrig_logo.svg');
        background-repeat: no-repeat;
        background-position: left center;
        background-size: auto 25%;
        /* Smaller logo (was 50%) */
        width: 25mm;
        /* Smaller width (was 25mm) */
    }
}

/* Fonts */
@font-face {
    font-family: 'Plus Jakarta Sans';
    src: url('../fonts/PlusJakartaSans-Regular.ttf') format('truetype');
    font-weight: normal;
    font-style: normal;
}

@font-face {
    font-family: 'Plus Jakarta Sans';
    src: url('../fonts/PlusJakartaSans-SemiBold.ttf') format('truetype');
    font-weight: bold;
    font-style: normal;
}

/* Apply Font */
body,
h1,
h2,
h3,
h4,
h5,
h6,
p,
li,
a,
span,
div {
    font-family: 'Plus Jakarta Sans', sans-serif !important;
}

/* --- Brand Coloring for PDF Text --- */
/* In PDF/Print, we are always on White Background. Text MUST be Dark. */
h1,
h2,
h3,
h4,
h5,
h6,
.h1,
.h2,
.h3,
.h4,
.h5,
.h6,
.pdf-chapter-title,
.pdf-toc-title {
    color: #2F627D !important;
    /* flux-blue-2 */
}

/* Fix "Red Line" - Make it Brand Accent Color */
h1,
h2,
.pdf-chapter-title,
.pdf-toc-title {
    border-bottom: 2px solid #2CB2A7 !important;
    /* flux-green-1 */
}

/* --- Links (Fix "Invisible Links") --- */
a,
a:visited,
a:hover,
a:active {
    color: #2F627D !important;
    /* flux-blue-2 per user request */
    text-decoration: underline !important;
}

/* --- Logo Sizing in Content --- */
/* User Request: "fluxrig logo in first section... not more than 30% of page width" */
img[alt="fluxrig Logo"] {
    width: 30% !important;
    max-width: 30% !important;
}

/* --- Diagram Centering (Fix "Not Centered") --- */
.mermaid-container {
    display: block !important;
    width: 100% !important;
    text-align: center !important;
    margin: 20px 0 !important;
    page-break-inside: avoid;
}

/* Target the SVG specifically with margin auto */
.mermaid-container svg,
.mermaid-container img {
    display: block !important;
    margin-left: auto !important;
    margin-right: auto !important;
    max-width: 80% !important;
}

/* --- List Indentation --- */
ul,
ol {
    margin-left: 2em !important;
    padding-left: 1em !important;
}

li {
    margin-bottom: 0.5em;
    line-height: 1.4;
    color: #303030 !important;
    /* flux-black-2 */
}

p {
    color: #303030 !important;
}

/* Ensure markers are visible */
ul {
    list-style-type: disc;
}

ol {
    list-style-type: decimal;
}

/* Admonition/Blockquote */
blockquote {
    border-left: 4px solid #2F627D;
    padding-left: 1em;
    margin-left: 0;
    color: #555;
    background-color: #f8f8f8;
}

/* Code blocks */
pre {
    background-color: #f5f5f5 !important;
    border: 1px solid #ddd;
    padding: 0.5em;
    border-radius: 4px;
    font-family: monospace;
    page-break-inside: avoid;
}