:root {
    --doc-font-family: Times, serif;
    --light-font-weight: 300;
    --medium-font-weight: 500;
    --bold-font-weight: 600;
    --header-footer-size: 9pt;
    --color-header-footer: #555;
    --font-size-title: 24pt;
    --font-size-h1: 20pt;
    --font-size-h2: 16pt;
    --font-size-h3: 14pt;
    --font-size-body: 12pt;
    --font-size-table: 9pt;
}

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

/* Hide the first h1 that satisfies MD041 linter */
body > h1:first-of-type {
    display: none;
}

body {
    font-family: var(--doc-font-family);
    font-weight: var(--light-font-weight);
    font-size: var(--font-size-body);
    line-height: 1.6;
    color: #000000;

    text-align: justify;
    hyphens: auto;
    -webkit-hyphens: auto;
    hyphenate-limit-chars: 6 3 3;
    text-justify: inter-word;
}

h1 {
    font-size: var(--font-size-h1);
    font-weight: var(--bold-font-weight);
    margin-top: 1cm;
    margin-bottom: 1cm;
}

h2 {
    font-size: var(--font-size-h2);
    font-weight: var(--medium-font-weight);
    margin-top: 8pt;
    margin-bottom: 4pt;
}

h3, h4, h5, h6 {
    font-size: var(--font-size-h3);
    font-weight: var(--medium-font-weight);
    margin-top: 8pt;
    margin-bottom: 4pt;
}

p {
    margin-bottom: 0.5cm;
    hyphens: auto;
}

a {
    color: #0A80A1;
    text-decoration: none;
}

/* Title page */
.title-page {
    text-align: center;
    page-break-after: always;
    display: flex;
    flex-direction: column;
    justify-content: center;
    min-height: 100vh;
}

.title-page .document-title {
    font-size: var(--font-size-title);
    font-weight: var(--bold-font-weight);
    margin-top: 3cm;
    margin-bottom: 0.5cm;
}

.title-page .project-context {
    font-size: var(--font-size-h1);
    margin-bottom: 0.5cm;
}

.title-page .project-reference,
.title-page .project-title {
    font-size: var(--font-size-title);
    font-weight: var(--bold-font-weight);
    margin-bottom: 0.5cm;
}


.title-page .author,
.title-page .doc-version,
.title-page .date-generated {
    font-size: var(--font-size-h3);
    margin: 0.4cm 0;
}

.dependency-graph svg {
    max-width: 100%;
    height: auto;
}

.dependency-graph svg .graph .node text {
    font-family: var(--doc-font-family) !important;
    font-weight: var(--bold-font-weight) !important;
}

.dependency-graph svg .graph .edge text {
    font-family: var(--doc-font-family) !important;
    font-weight: var(--light-font-weight) !important;
}

/* Tables */
table {
    width: 100%;
    font-size: var(--font-size-table);
    border-collapse: collapse;
    margin: 0.5cm 0;
}

table, th, td {
    border: 0.5pt solid black;
}

thead {
    display: table-header-group;
}

th {
    background-color: #f0f0f0;
    padding: 0.1cm;
    text-align: left;
    font-weight: var(--bold-font-weight);
}

td {
    padding: 0.1cm;
}

code {
    font-family: monospace;
    background-color: #f5f5f5;
    padding: 0.1cm 0.2cm;
}

hr {
    margin: 1cm 0;
}

.page-break {
    page-break-before: always;
}

.toc {
    margin-top: 20pt;
    margin-bottom: 4pt;
}

table {
    text-align: left;
}

table.matrix-table {
    table-layout: fixed;
    width: 100%;
    text-align: center;
}

table.matrix-table thead th:not(:first-child) {
    height: 3.6cm;
    width: 1.2cm;
    vertical-align: bottom;
}

table.matrix-table thead th:not(:first-child) > div {
    width: 3.6cm;
    transform-origin: bottom left;
    transform: translateX(1cm) rotate(-90deg);
    word-wrap: break-word;
    text-overflow: ellipsis;
    overflow: hidden;
}

table.table-2d th {
    background-color: #ffffff;
    font-weight: var(--light-font-weight);
}

table.matrix-table thead th:first-child {
    background-color: white;
}

table.matrix-table th,
table.matrix-table td:first-child,
table.table-2d th:first-child,
table.table-2d td:first-child  {
    font-weight: var(--medium-font-weight);
    background-color: #f0f0f0;
}


/* Table of Contents */
.toc a {
    display: block;
    text-decoration: none;
    color: #000000;
    margin: 0.2cm 0;
}

.toc a::after {
    content: leader(dotted) " " target-counter(attr(href), page);
    margin-left: 0.2cm;
}

.toc a:hover {
    text-decoration: underline;
}

/* Indent levels */
.toc a[data-level="1"] {
    display: none;
}

.toc a[data-level="2"] {
    font-weight: var(--bold-font-weight);
    margin-left: 0;    
}

.toc a[data-level="3"] {
    font-weight: var(--light-font-weight);
    margin-left: 1cm;
}

.toc a[data-level="4"] {
    font-weight: var(--light-font-weight);
    margin-left: 2cm;
}

.toc a[data-level="5"] {
    font-weight: var(--light-font-weight);
    margin-left: 3cm;
}

.toc a[data-level="6"] {
    font-weight: var(--light-font-weight);
    margin-left: 4cm;
}
