@charset "UTF-8";

/* :root variables */
@import url("./variables.css");

/* fonts */
@import url("./fonts.css");

/* reset */
body {
    margin: 0;
}

hr {
    display: none;
}

/* basic */
body {
    font-family: "Georgia";
    font-variant: common-ligatures;
    line-height: 14.5pt;
    font-size: var(--basefontsize);
    color: var(--color2);
    counter-reset: pagenumbermargin footnote;
}

/* general page setup */
@page {
    size: a4 portrait;
    bleed: 3mm;
    margin-top: 15mm;
    margin-bottom: 26mm;
}

@page:left {
    margin-left: 12mm;
    margin-right: 12mm;

    @bottom-left:after {
        content: counter(page);
        font-family: "BasteleurMoonlight";
        font-variant: slashed-zero;
        font-size: 11pt;
        line-height: 12pt;
        border-top: 1px solid;
        vertical-align: top;
        padding-top: 0.25em;
        margin-top: 16mm;
        counter-increment: pagenumbermargin;
    }
}

@page:right {
    margin-left: 12mm;
    margin-right: 12mm;

    @bottom-right:after {
        content: counter(page);
        font-family: "BasteleurMoonlight";
        font-variant: slashed-zero;
        font-size: 11pt;
        line-height: 12pt;
        border-top: 1px solid;
        vertical-align: top;
        padding-top: 0.25em;
        margin-top: 16mm;
        counter-increment: pagenumbermargin;
    }
}

/* Colophon */
#colophon {
    break-before: always;
    page-break-after: always;
    font-family: "SourceCode";
    margin-top: 29em;
}

/* Logos section */
#logos { /* hide title but keep margin */
    display: none;
}

#logos+p {
    margin-left: 0;
}

#logos+p img {
    width: 25%;
    padding-right: 5%;
    box-sizing: border-box;
    display: inline-block;
    position: absolute;
    bottom: 0;
}

#logos+p img:nth-child(1) {
    left: 0;
}

#logos+p img:nth-child(2) {
    left: 25%;
}

#logos+p img:nth-child(3) {
    left: 50%;
}

#logos+p img:nth-child(4) {
    left: 75%;
}

#logos+p img:nth-child(4n) {
    padding-right: 0;
}

a {
    color: var(--color2);
    text-decoration: none;
}

/* insert blank page like this:
 * <div class="blankpage"></div> */
.blankpage {
    break-before: always;
    page-break-after: always;
    content: "&nbsp;";
}

/* page breaks */

h1, h2 {
    break-before: always; /* starts a new page before this elm */
    font-family: "BasteleurBold";
}

h1, h2, h3, h4 { /* no page breaks in or after titles */
    page-break-inside: avoid;
    page-break-after: avoid;
}

.section {
	page-break-inside: avoid;
    page-break-after: avoid;
}

p:last-child {
    page-break-after: avoid;
}

table, figure { /* don't break figures and tables */
    page-break-inside: avoid;
}

li {
	margin-left: -4mm;
}

li:last-child { /* prevent orphan in lists */
    break-before: avoid;
}

li:first-child { /* prevent orphan in lists */
    break-after: avoid;
}

/* element styles */
h1, h2, h3, h4, h5, h6 { 
    margin-bottom: 0;
    font-weight: normal;
    font-family: "BasteleurMoonlight";
    font-variant: slashed-zero;
    font-feature-settings: "ss03" on, "ss04" on, "ss10" on;
    line-height: 24pt;
}

.pull {
    margin-bottom: 0;
    font-weight: normal;
    font-family: "BasteleurMoonlight";
    font-variant: slashed-zero;
    font-feature-settings: "ss03" on, "ss04" on, "ss10" on;
    line-height: 24pt;
    text-align: left;
}

.section {
    margin-top: 6mm;
    margin-bottom: 0;
    font-weight: normal;
    font-family: "BasteleurBold";
    font-variant: slashed-zero;
    font-feature-settings: "ss03" on, "ss04" on, "ss10" on;
    line-height: 24pt;
    text-align: left;
}

p.section:has(+ol) {
    margin-bottom: 0;
}

h1 span,
h2 span {
    display: block;
    padding-left: 10mm;
}

h2 {
    font-size: 19pt;
    line-height: 21pt;
    letter-spacing: 0;
    margin-top: 0;
    margin-bottom: 5mm; /* 20mm for CIL007/9 works better. */
}

h3, h4 {
    margin-left: 64mm;
    font-size: 12pt;
    line-height: 15.5pt;
    letter-spacing: 0.01em;
    margin-bottom: 0;
}

.section {
    text-indent: 0;
    margin-left: 64mm;
    font-size: 12pt;
    line-height: 15.5pt;
    letter-spacing: 0.01em;
    margin-bottom: 0;
}

.subsection {
    text-indent: 0;
    margin-left: 64mm;
    font-size: 11pt;
    line-height: 15.5pt;
    letter-spacing: 0.01em;
    margin-bottom: 0;
}

p.section + p {
	text-indent: 0;
}

p.subsection + p {
	text-indent: 0;
}

h3, h4, h5, figure {
    margin-left: 64mm;
}

h6 { /* aka "pulled quote" */
    border-top: 1px solid;
    padding-top: 1mm;
    margin-bottom: 0.25em;
    font-size: 11.5pt;
    line-height: 14pt;
    letter-spacing: 0.01em;
    width: 54mm;
    float: left;
    display: block;
}

.affiliation {
    text-indent: 0;
    text-align: left;
    border-top: 1px solid;
    margin-left: 0;
    margin-bottom: 0;
    line-height: 14pt;
    letter-spacing: 0.01em;
    width: 54mm;
    float: left;
    display: block;
}

.pull { /* aka "pulled quote" */
    text-indent: 0;
    border-top: 1px solid;
    padding-top: 1mm;
    margin-left: 0mm;
    margin-bottom: 0.25em;
    font-size: 11.5pt;
    line-height: 14pt;
    letter-spacing: 0.01em;
    width: 54mm;
    float: left;
    display: block;
}

h6,
h6 + p {
    margin-top: 2.5mm;
}

.pull,
.pull + p {
    margin-top: 2.5mm;
}

h6 + p {
    text-indent: 0;
}

.pull + p {
    text-indent: 0;
}

ul {
    margin-left: 56.5mm;
    list-style: none;
    text-align: left;
}

ul li:before {
    content: "◈";
    /* content: "◊"; */
    margin-left: -0.85em;
    padding-right: 0.5em;
}

ul li li {
    margin-left: -56.5mm;
    list-style: none;
    text-align: left;
}

ul li li:before {
    content: "◇";
    margin-left: -0.85em;
    padding-right: 0.5em;
}

p {
    text-indent: 10mm;
    margin-top: 0;
    margin-bottom: 0;
    margin-right: 0;
    margin-left: 64mm;
}

p:has(code),
h1 + p,
h2 + p,
h3 + p,
h4 + p,
h5 + p,
h2 + h6 + p {
    text-indent: 0;
}

li p {
    margin: 0;
    text-indent: 0;
}

p {
    text-align: justify;
}

li {
	text-align:left;
}

ol {
    margin-left: 55.8mm; 
}

ol li p {
    margin-left: 2mm;
}

blockquote {
    font-family: "SourceSerif-Italic";
    margin-top: 1em;
    margin-bottom: 1em;
    margin-right: 0;
    margin-left: 74mm;
}

blockquote p,
dl p {
    margin: 0;
    text-indent: 0;
    margin-left: -11mm;
    /* text-align: left; */
}

dl p {
    margin-bottom: 1em;
}

dl {
    margin-left: 64mm;
    margin-top: 1em;
    /* text-indent: 10mm; */
    margin-bottom: 0;
}

dt {
    /* float: left; */
    /* margin-right: 0.4em; */
    margin-left: -5mm;
}

b, strong, dt {
    font-weight: normal;
}

i, em {
}

pre, code {
    background: #e5e5e5;
    padding: 1mm;
    font-family: "SourceCode";
    margin-right: 0;
    width: 100%;
}

pre {
    margin-left: 31.5mm;
    display: block;
}

/* prevent superscripts and subscripts from affecting line-height */
sup, sub {
    vertical-align: baseline;
    position: relative;
    top: -0.3em;
}

sub {
    top: 0.4em;
}

/* tables */
table {
    font-family: "Georgia";
    margin-top: 5mm;
    margin-bottom: 5mm;
    margin-left: 64mm;
    width: 115mm;
    border-collapse: collapse;
    border: .25mm solid;
}

.widetable {
	width: 123mm ;
	margin-left: 0mm;
}

table thead, table b, table strong {
    /* font-family: "SourceSans-Regular"; */
}

table th {
	text-align: justify !important;
	padding: 5mm;
}

table th b, table th em, table th strong {
	font-style: normal;
	font-family: "Georgia";
	font-size: 12pt;
}

table em, table i {
    font-family: "Georgia";
}

table tr {
    border-bottom: .25mm solid;
    border-right: .25mm solid;
}

table,
table tr {
    border-color: rgba(0, 0, 0, 0.8);
}

/* table th,
table td {
    padding: 0 1mm;
} */


/* images */
p img {
    margin: 0;
}

img[data-width='fullcolumnwidth'] {
    width: 138mm;
}

img[data-width='fullpagewidth'] {
    position: static;
    width: 19.5cm;
    margin-left: -79mm;
}

/*
img[src$='#fullcolumnwidth'] {
    width: 138mm;
}

img[src$='#fullpagewidth'] {
    position: static;
    width: 19.5cm;
    margin-left: -79mm;
}
*/

/* footnotes */
.footnotes + h6 {
    break-before: always;
    float: none;
}

.footnote + .pull {
    break-before: always;
    float: none;
}

.footnotes + h6 + p {
    margin-top: -20mm;
}

.footnotes + .pull + p {
    margin-top: -20mm;
}

.footnotes {
    page-break-before: avoid;
    page-break-after: always;
    letter-spacing: 0;
    text-align: left;
    padding-top: 0.5em;
}

.footnotes::before {
    content: "";
    display: block;
    width: 1cm;
    border-top: 1px solid var(--color2);
    margin-top: 15mm;
    margin-bottom: 0.5em;
    margin-left: 64mm;
}

.footnotes ol {
    list-style: none;
    margin-left: 60mm;
    padding: 0;
}

.footnotes li {
    counter-increment: footnote;
    font-family: "Georgia";
    font-size: 9.5pt;
    line-height: 11.5pt;
    margin-bottom: 0.5em;
    display: flex;
    align-items: baseline;
}

.footnotes li::before {
    content: counter(footnote, decimal-leading-zero) " ";
    font-family: "Georgia";
    margin-right: 0.3em;
    flex-shrink: 0;
    width: 2em;
    text-align: right;
}

.footnotes li p {
    margin: 0;
}

.footnotes code {
    margin: 0;
    display: inline;
}

.footnotes i {
    font-family: "Georgia";
}

.footnote-ref {
    font-family: "Georgia";
    font-size: 0.8em;
    vertical-align: super;
    text-decoration: none;
    color: var(--color2);
}

/* e.g., used in references */
.hanging-indent p {
	margin-bottom: 5px;
	margin-left: 64mm;
	text-indent: -20px;
	text-align: left;
}

/* toc,
 * crazy hack: the h2+ only works if we pass a toc-title */
h2+ul ul,
h2+ul li,
h2+ul li:before {
    margin: 0;
    padding: 0;
}

h2+ul li:before {
    content: "";
}

h2+ul li a {
    width: 114mm;
    display: block;
    text-align: left;
}

h2+ul li a:after {
    content: leader(' ') target-counter(attr(href), page); /* leader could also be a dot */
}

/* typst injection */
.typst-math-display {
  text-align: center;
  margin: 1em 0;
}

.typst-math-display img {
  max-width: 100%;
}

.typst-math-inline img {
  vertical-align: middle;
  height: 1em;
}

