/*
   This document has been created with Marked.app <https://markedapp.com>
   Please leave this notice in place, along with any additional credits below.
   ---------------------------------------------------------------
   Title: Course handout
   Author: Thomas Olander
   Description: A theme for displaying academic handouts.
*/

/*@font-face {
    font-family: "Brill";
    src: url("/Library/Fonts/Brill/Brill-Roman.ttf") format("truetype");
    font-style: normal;
    font-weight: normal;
}

@font-face {
    font-family: "Brill";
    src: url("/Library/Fonts/Brill/Brill-Italic.ttf") format("truetype");
    font-style: italic;
    font-weight: normal;
}

@font-face {
    font-family: "Brill";
    src: url("/Library/Fonts/Brill/Brill-Bold.ttf") format("truetype");
    font-style: normal;
    font-weight: bold;
}

@font-face {
    font-family: "Brill";
    src: url("/Library/Fonts/Brill/Brill-BoldItalic.ttf") format("truetype");
    font-style: italic;
    font-weight: bold;
} */

@font-face {
    font-family: "Minion 3";
    src: url("../fonts/Minion 3/Minion 3 Regular.otf") format("opentype");
    font-style: normal;
    font-weight: normal;
}

@font-face {
    font-family: "Minion 3";
    src: url("../fonts/Minion 3/Minion 3 Italic.otf") format("opentype");
    font-style: italic;
    font-weight: normal;
}

@font-face {
    font-family: "Minion 3";
    src: url("../fonts/Minion 3/Minion 3 Semibold.otf") format("opentype");
    font-style: normal;
    font-weight: bold;
}

@font-face {
    font-family: "Minion 3";
    src: url("../fonts/Minion 3/Minion 3 Semibold Italic.otf") format("opentype");
    font-style: italic;
    font-weight: bold;
}

@font-face {
    font-family: "ChurchSlavonic";
    src: url("../fonts/ChurchSlavonicEO.otf") format("opentype");}

body {
    font-style: normal;
    font-size: 1.2em;
    font-family: "Minion 3", Brill, Palatino, Georgia, Times, Serif;
	text-align: justify;
	hyphens: auto;
	max-width: 1000px; /* skal være 700 px når sidepanelet ikke er der, 1000 px når det er der */
	margin: auto;
	font-kerning: normal;
	line-height: 1.4;
	font-variant-numeric: proportional-nums oldstyle-nums;
    counter-reset: h1counter;
	padding-left: 20px;
    padding-right: 20px;
}

ul {
    list-style: none;
    padding-left: 0em;
}

ul li {
    position: relative;
    padding-left: 1.2em;
}

ul li::before {
    content: "•";
    color: #a52a2a;
    position: absolute;
    left: 0;
    top: 0;
}

ol {
    list-style: none;
    padding-left: 0em;
    counter-reset: olcounter;
}

ol li {
    position: relative;
    padding-left: 1.2em;
    counter-increment: olcounter;
}

ol li::before {
    content: counter(olcounter) "";
    position: absolute;
    left: 0;
    top: 0;
}

li {
    font-size: 1em;
}

/* Target the level-2 list nested inside a level-1 list */
ul ul, ol ol, ul ol, ol ul {
  margin-top: 0;
  margin-bottom: 0; /* Optional: removes space below the sub-list as well */
}

li p {
    font-size: 1em;
    margin: .5em 0;
}

/* h1 {
    color: #000;
    font-size: 1.5em;
    font-weight: normal;
    line-height: .6563em;
    margin: .6563em 0;
    text-align: left;
} */

h2 {
    display: block;
    font-size: 1.25em;
    font-weight: normal;
    line-height: .875em;
    margin: .875em 0;
    position: relative; /* for at få plads til en streg nedenunder*/
    padding-bottom: 12px; /* Space to make room for the line */
    counter-reset: h2counter;
    counter-increment: h1counter;
}

/* h1::before {
    content: counter(h1counter) ". ";
} */

h2::after { /* for at få en streg sat ind under h1 */
  content: "";
  position: absolute;
  left: 0;
  bottom: 0;
  height: 2px;          /* Thickness of the line */
  width: 67%;          /* Custom width of the line (e.g., 80px or 30%) */
  background-color: #a52a2a; /* Color of the line */
}

h3 {
    color: #111;
    font-size: 1em;
    line-height: 1em;
    margin: 1em 0;
    counter-reset: h3counter;
    counter-increment: h2counter;
}

/* h2::before {
    content: counter(h1counter) "." counter(h1counter) ". ";
} */

h4 {
    color: #111;
    font-size: 1em;
    line-height: 1.5em;
    margin: 1.5em 0;
    counter-increment: h3counter;
}

/* h3::before {
    content: counter(h1counter) "." counter(h2counter) "." counter(h3counter) ". ";
} */

h5 {
    color: #111;
    font-size: 1em;
    line-height: 1.5em;
    margin: 1.5em 0;
}

h6 {
    font-size: 1em;
    line-height: 1.5em;
    margin: 1.5em 0;
}

body,p,td,div {
    color: #111;
    font-family: "Minion 3", Brill, Palatino, Georgia, Times, Serif;
    word-wrap: break-word;
}

p {
    text-indent: 1.2em;
    margin: 0;
}

table + p, blockquote + p {
    text-indent: 0em;
}

h1 + p,h2 + p,h3 + p,h4 + p,h5 + p,h6 + p, figure + p, img + p {
    text-indent: 0em;
}

ul, ol {
	padding-left: 0em;
}

ul + p, ol + p {
	text-indent: 0em;
}

h2,h3,h4,h5,h6 {
    line-height: 1.5em;
}

a {
    -webkit-transition: color .2s ease-in-out;
    -moz-transition: color .2s ease-in-out;
    -o-transition: color .2s ease-in-out;
    -ms-transition: color .2s ease-in-out;
    transition: color .2s ease-in-out;
    color: #0d6ea1;
    text-decoration: none;
}

a[href*="#sec:"], a[href*="#fig:"], a[href*="#tbl:"] {
    color: #0d6ea1;
    border: 1px solid lightgray;
    background: lightgray;
    border-radius: 3px;
    padding: 0 .2rem;
    font-size: 1em;
}

a:hover {
    color: #3593d9;
}

code {
	font-size: 0.9em;
}

.footnote {
    color: #0d6ea1;
    font-size: .8em;
    vertical-align: super;
}

.ocs {
	font-family: "ChurchSlavonic";
}

#wrapper img {
    max-width: 100%;
    height: auto;
}

dd {
    margin-bottom: 1em;
}

li > p:first-child {
    margin: 0;
}

caption,col,colgroup,table,tbody,td,tfoot,th,thead,tr {
    border-spacing: 0;
}

table {
    border: none;
    border-collapse: collapse;
    display: table;
    empty-cells: hide;
    margin: 1em 0 1em;
    padding: 0;
    table-layout: auto;
    max-width: 900px;
    white-space: nowrap;
}

tbody {
    border-bottom: 1px double black;
}

table.small {
	font-size: 0.9rem;
}

/* Apply {.largetable} to a FENCED DIV wrapping the table (not the
   table's own caption attribute — pandoc-crossref's caption-attribute
   parser only recognizes a bare #id there; adding any class alongside
   it, or a class alone, makes it fall back to unparsed literal text,
   silently breaking the whole table). See usage example below.
   Uses calc() with fixed units only — NOT vw. WeasyPrint crashes with
   an AttributeError ('AnonymousStyle' object has no attribute
   'initial_page_sizes') when resolving vw-based calc() margins near a
   <table>, even through a wrapping Div — the crash is specifically in
   vw/viewport-unit resolution, not calc() itself, which is why plain
   calc() with only px values here is safe.
   700px below = body's own max-width; keep these in sync if that
   value ever changes. */
.largetable, .glossing {
    --breakout-max: 1000px;
    margin-left: 0;
    margin-right: calc(700px - var(--breakout-max));
    font-size: 0.9em;
}

/* Shrink the table to its actual content width instead of stretching
   to fill the wide .largetable/.glossing container. table-layout:
   auto only controls how width is split between columns — it doesn't
   stop the table itself from filling its container like an ordinary
   block element, which is what was padding out narrow columns like
   "ⰵⱄⱅⰵ" with unused space.
   Note: originally used width: fit-content here, but WeasyPrint
   doesn't support that value (silently ignores it — "Ignored
   `width: fit-content`, invalid value"). Turns out it wasn't needed
   anyway: table-layout: auto's native CSS2.1 shrink-to-fit behavior
   already does this correctly on its own, confirmed by testing a
   table with no width override at all inside a deliberately wide
   container. */

/* Fixed width for the label column (Glag./Cyr./Rom./morph./etc.),
   consistent across every .glossing table regardless of which labels
   a given table happens to use. Adjust the value if a label ever
   needs more room than this — content wider than the given width
   still forces the column wider under table-layout: auto, so this is
   a strong hint rather than a hard cap. */
.glossing td:first-child, .glossing th:first-child {
    width: 4.5em;
}

/* No line breaks inside cells — combined with table-layout: auto,
   this makes each column exactly as wide as its widest cell, rather
   than wrapping to fit some other width. */
.largetable td, .largetable th,
.glossing td, .glossing th {
    white-space: nowrap;
}


/* Keep the caption at normal (non-shrunk) text size, undoing the
   0.9em inherited from .largetable above. */
.largetable caption {
    font-size: 1.2rem;
}

/* Apply {.glossing} to a table caption for a borderless, colorless
   variant. Assumes the class lands on the <table> element itself
   (Pandoc's `: caption {.glossing}` syntax) rather than a wrapper. */
/* Apply {.glossing} to a FENCED DIV wrapping the table — same
   reasoning as {.largetable} above: pandoc-crossref's caption
   parser breaks if a class is combined with the #id there, so the
   class must live on a wrapping Div instead, with only the bare
   #id left in the table's own caption. */
.glossing table,
.glossing thead,
.glossing tbody,
.glossing th,
.glossing td {
  border: none !important;
  background: transparent !important;
}

caption {
    caption-side: bottom; /* Force the caption below the table structure */
    display: table-caption;
    font-weight: normal;
    padding-top: 1em;
    margin-bottom: 1em;
}

col {
    display: table-column;
}

colgroup {
    display: table-column-group;
}

tbody {
    display: table-row-group;
}

tfoot {
    display: table-footer-group;
}

thead {
    display: table-header-group;
}

td,th {
    display: table-cell;
}

tr {
    display: table-row;
}

table th,table td {
    padding: 0 1em;
}

table thead {
    background: rgba(0,0,0,0.15);
    border-top: 1px solid black;
    border-bottom: 1px solid black;
}

table tbody td {
    background: rgba(0,0,0,0.05);
}

table tfoot {
    background: rgba(0,0,0,0.15);
    border: 1px solid rgba(0,0,0,0.15);
    border-top: 1px solid rgba(0,0,0,0.2);
}

/* Escape the body's centered column — for figures, tables, etc. that
   should be wider than the main text. Extends only to the right,
   staying flush with the normal text's left edge, rather than
   centering symmetrically. In the PDF this is inert on a normal page
   (WeasyPrint's page content area is already narrower than body's
   700px, so there's nothing to extend into); in HTML it extends into
   the browser viewport up to --breakout-max. */
/* Escape the body's centered column — for figures, tables, etc. that
   should be wider than the main text. Extends only to the right,
   staying flush with the normal text's left edge, rather than
   centering symmetrically.
   Uses calc() with fixed units only — NOT vw. See the longer note on
   .largetable above: WeasyPrint crashes when a vw-based calc() margin
   resolves near a <table>, even through a wrapping Div, so this no
   longer adapts dynamically to viewport width the way it originally
   did — 700px below is body's own max-width, kept in sync manually. */
.breakout {
    --breakout-max: 1000px;
    margin-left: 0;
    margin-right: calc(700px - var(--breakout-max));
    font-size: .95rem;
}

figure {
    display: block;
    position: relative;
    margin: 1em 0 3em;
}

/* Apply {.wide} to an image to make it 80% of the page width, centered */
/*figure.wide {
    display: block;
    margin: 1em auto 2em;
    text-align: center;
} */

figure.wide {
    width: 120%;
    height: auto;
}

img.wide {
    display: block;
    width: 120%;
    height: auto;
    margin: 1em auto;
    text-align: center;
}

table.wide {
	font-size: 0.9rem;
    display: block;
    height: auto;
    margin: 1em auto;
    text-align: center;
}

img.narrow, figure.narrow {
	max-width: 50%;
	height: auto;
}

img.normal-width, figure.normal-width {
	max-width: 100%;
	height: auto;
}

figcaption {
    font-style: italic;
    text-align: center;
    background: white;
    color: #666;
    position: absolute;
    left: 0;
    bottom: -36px;
    width: 98%;
    padding: 1%;
    -webkit-transition: all .2s ease-in-out;
    -moz-transition: all .2s ease-in-out;
    -o-transition: all .2s ease-in-out;
    -ms-transition: all .2s ease-in-out;
    transition: all .2s ease-in-out;
}

figure:hover>figcaption {
    /* background: rgba(0,0,0,1) */
}

.no-indent p {
    text-indent: 0 !important;
    margin: .6563em 0;

}

.author {
	text-indent: 0 !important;
    margin: .6563em 0;
}

.event {
	text-indent: 0em;
    margin: .6563em 0;
}

.subtitle {
	text-indent: 0em !important;
	font-size: 1.25em;
    margin: .6563em 0;
}

.poetry pre {
    display: block;
    font-family: "Hoefler Text", Georgia, Garamond, serif !important;
    font-size: .8em !important;
    font-style: normal;
    line-height: 1.6em;
    margin-left: 1em;
    text-indent: 0em;
}

.poetry pre code {
    font-family: "Hoefler Text", Georgia, Garamond, serif !important;
    font-size: .8em !important;
    text-indent: 0em;
}

blockquote p {
    font-size: 1em;
    font-style: normal;
    line-height: 1.4em;
    text-indent: 0em;
}

/* A blockquote directly after a glossing table (e.g. the free
   translation below an interlinear gloss) lines up flush-left with
   the table above it, rather than getting the browser's default
   blockquote indent. */
.glossing + blockquote {
    margin-left: 0;
}

.footnoteRef sup,sub {
    font-size: 2ex;
    font-style: normal;
    height: 0;
    line-height: 1;
    position: relative;
    vertical-align: super;
    padding-left: 0.35ex;
}

div.refs>p,div#refs>div[id^="ref"]>p {
    padding-left: 2em;
    text-indent: -2em;
}

sub {
    vertical-align: sub;
    top: -1px;
}

dt,th {
    font-weight: 700;
}

/* table tr:nth-child(odd),table th:nth-child(odd),table td:nth-child(odd) {
    background: rgba(255,255,255,0.06);
}

table tr:nth-child(even),table td:nth-child(even) {
    background: rgba(200,200,200,0.25);
} -- der går kludder i farverne når jeg fletter cellerne */

th {
    font-weight: normal;
}

td {
	border-bottom: 1px solid #e0e0e0; /* Thin, light gray line */
}

th, td {
	text-align: left;
}

h1 {
    display: block;
    text-align: left;
    font-size: 1.5em;
    font-weight: normal;
    line-height: 1em;
    max-width: 700px;     /* Matches your text block width */
/*    margin: 4rem auto 3rem auto;    /* Centers the heading and its lines on the screen */
    position: relative;   /* Creates the boundary context for both lines */
    padding-top: 16px;    /* Space for the top line */
    padding-bottom: 16px; /* Space for the bottom line */
}

/* --- THE NEW TOP LINE --- */
h1::before { 
    content: "";
    position: absolute;
    left: 0;
    top: 0;               /* Anchors it to the absolute top of the element */
    height: 4px;          /* Thickness */
    width: 100%;          /* Stretches exactly to the width of the text block */
    background-color: #a52a2a; 
}

/* --- THE UPDATED BOTTOM LINE --- */
h1::after { 
    content: "";
    position: absolute;
    left: 0;
    bottom: 0;            /* Anchors it to the absolute bottom of the element */
    height: 4px;          /* Thickness */
    width: 100%;          /* Stretches exactly to the width of the text block */
    background-color: #a52a2a; 
}

.lgr { /* Leipzig Glossing Rules */
	font-variant: all-small-caps;
}

.versaler {
	letter-spacing: .1em;
	text-transform: uppercase;
}

/* @media print {
    body {
        overflow: auto;
    }

    img,pre,blockquote,table,figure,p {
        page-break-inside: avoid;
    }

    #wrapper {
        background: #fff;
        color: #303030;
        font-size: 85%;
        padding: 10px;
        position: relative;
        text-indent: 0;
    }
} */

@media print {
    body {
        font-size: 11pt;
    }

    /* Wide tables: bleed into the page's side margins (there's no
       room to expand into otherwise, since body already fills the
       whole print page) and center the table within that expanded
       space, rather than the flush-left behavior used in HTML.
       -3cm leaves 0.5cm of your 3.5cm @page margin as a residual
       border rather than running the table to the physical page edge;
       adjust if you want more or less breathing room. Fixed cm units
       only (no vw) — vw-based calc() crashes WeasyPrint near tables. */
    .largetable, .glossing {
        margin-left: -3cm;
        margin-right: -3cm;
    }

    .largetable table, .glossing table {
        margin-left: auto;
        margin-right: auto;
    }
}

@media screen {
    .inverted #wrapper,.inverted {
        background: rgba(37, 42, 42, 1);
    }

    .inverted hr {
        border-color: rgba(51, 63, 64, 1) !important;
    }

    .inverted p,.inverted td,.inverted li,.inverted h1,.inverted h2,.inverted h3,.inverted h4,.inverted h5,.inverted h6,.inverted pre,.inverted code,.inverted th,.inverted .math,.inverted caption,.inverted dd,.inverted dt {
        color: #eee !important;
    }

    .inverted table tr:nth-child(odd),.inverted table th:nth-child(odd),.inverted table td:nth-child(odd) {
        background: none;
    }

    .inverted a {
        color: rgba(172, 209, 213, 1);
    }

    #wrapper {
        padding: 20px;
    }

    ::selection {
        background: rgba(157, 193, 200,.5);
    }

    h1::selection {
        background-color: rgba(45, 156, 208, .3);
    }

    h2::selection {
        background-color: rgba(90, 182, 224, .3);
    }

    h3::selection,h4::selection,h5::selection,h6::selection,li::selection,ol::selection {
        background-color: rgba(133, 201, 232, .3);
    }

    code::selection {
        background-color: rgba(0,0,0,.7);
        color: #eee;
    }

    code span::selection {
        background-color: rgba(0,0,0,.7) !important;
        color: #eee !important;
    }

    a::selection {
        background-color: rgba(255, 230, 102,.2);
    }

    .inverted a::selection {
        background-color: rgba(255, 230, 102,.6);
    }

    td::selection,th::selection,caption::selection {
        background-color: rgba(180, 237, 95, .5);
    }
}
