/* SPDX-License-Identifier: BSD-3-Clause */
/* SPDX-FileCopyrightText: 2023-2024 Louis Schul <schul9louis@gmail.com> */

:root {
    --bodyColor: ;
    --font: ;
    --fontSize: ;
    --textColor: ;
    --titleColor: ;
    --linkColor: ;
    --visitedLinkColor: ;
    --codeColor: ;
    --highlightColor: ;
    --codeFont: ;
    --codeFontSize: ;
}

body {
    font-family: var(--font), sans-serif;
    font-size: var(--fontSize); /* was 16, all other font-size are based on that*/
    line-height: 1.6;
    background-color: var(--bodyColor);
    padding: 0px;
    box-sizing: border-box;
    color: var(--textColor);
    word-wrap: normal;
    word-break: break-word;
}

a {
    color: var(--linkColor);
}

a:visited {
    color: var(--visitedLinkColor);
}

a.absent {
    color: #cc0000;
}

a.anchor {
    display: block;
    padding-left: 30px;
    margin-left: -30px;
    cursor: pointer;
    position: absolute;
    top: 0;
    left: 0;
    bottom: 0;
}

h1, h2, h3, h4, h5, h6 {
    margin: 0;
    padding: 0;
    font-weight: bold;
    color: var(--titleColor);
}

h1, h2, h3, h4, h5, h6 {
    line-height: 36px;
}

h1 {
    font-size: calc(var(--fontSize) + 12px);
    margin-bottom: 18px;
}

h2 {
    font-size: calc(var(--fontSize) + 8px);
    margin-bottom: 12px;
}

h3 {
    font-size: calc(var(--fontSize) + 2px);
}

h4 {
    font-size: var(--fontSize);
}

h5 {
    font-size: calc(var(--fontSize) - 2px);
}

h6 {
    font-size: calc(var(--fontSize) - 3px);
}

p, ul, ol, dl, li, table, pre {
    margin: 15px 0;
}

hr {
    margin: 0 0 19px;
    border: 0;
    height: 2px;
    background-image: linear-gradient(90deg, transparent, transparent, var(--linkColor), var(--linkColor), var(--linkColor), transparent, transparent);
    background-size: 10px 2px, 100% 2px;
    border: none;
}

h1 p, h2 p, h3 p, h4 p, h5 p, h6 p {
    margin-top: 0;
}

li p.first {
    display: inline-block;
}

li {
    margin: 0;
}

ul, ol {
    padding-left: 30px;
}

ul :first-child, ol :first-child {
    margin-top: 0;
}

li::marker {
    color: var(--linkColor);
}

mark {
    background-color: var(--highlightColor);
}

/* For custom checkbox
 *thanks to https://moderncss.dev/pure-css-custom-checkbox-style/
 */
.hasCheck {
    list-style-type: none;
    margin: 0.5em;
    margin-left: -20px;
}

.form-control {
    line-height: 1;
    display: grid;
    grid-template-columns: 1em auto;
    gap: 0.5em;
}

input[type="checkbox"]:disabled {
    /* Remove most all native input styles */
    appearance: none;
    /* Not removed via appearance */
    margin: 0;

    font: inherit;
    color: var(--linkColor);
    height: var(--fontSize);
    max-height: var(--fontSize);
    border: 0.15em solid var(--linkColor);
    border-radius: 0.15em;
    cursor: not-allowed;
    display: grid;
    place-content: center;
}

input[type="checkbox"]::before {
    content: "";
    width: 0.5em;
    height: 0.5em;
    transform: scale(0);
    background-color: var(--linkColor);
}

input[type="checkbox"]:checked::before {
    transform: scale(1);
}

blockquote {
    margin: 0;
    padding: 0 15px;
    margin-bottom: 18px;
    border-left: 1px dashed;
    border-image: linear-gradient(var(--bodyColor), var(--linkColor)) 20;
    font-family: serif;
    font-style: italic;
}

blockquote > :first-child {
    margin-top: 0;
}

blockquote > :last-child {
    margin-bottom: 0;
}

blockquote:before {
    content: "\201C";
    font-size: calc(var(--fontSize) + 4px);
    font-family: serif;
    color: var(--titleColor);
}

blockquote p {
    font-weight: 300;
    line-height: 18px;
    margin-bottom: 0;
    font-style: italic;
}

table {
    padding: 0;
    margin: 10px 0 15px 0;
    border-collapse: collapse;
    width: 100%
}

table tr {
    border-top: 1px solid var(--textColor);
    margin: 0;
    padding: 0;
    color: var(--textColor);
    filter: brightness(130%);
    background-color: var(--codeColor);
}

table tr:nth-child(2n) {
    background-color: var(--codeColor);
    filter: brightness(95%);
}

table tr th {
    font-weight: bold;
    border: 1px solid var(--textColor);
    margin: 0;
    padding: 6px 13px;
    filter: brightness(130%);
}

table tr td {
    border: 1px solid var(--textColor);
    margin: 0;
    padding: 6px 13px;
    filter: brightness(130%);
}

img {
    max-width: 100%;
}

code {
    margin: 0 2px;
    padding: 1px 3px;
    white-space: nowrap;
    border: 1px solid var(--titleColor);
    background-color: var(--codeColor);
    -webkit-border-radius: 5px;
    -moz-border-radius: 5px;
    border-radius: 5px;
    filter: brightness(80%);
    font-size: var(--codeFontSize);
}

pre code {
    margin: 0;
    padding: 0;
    white-space: pre-wrap;
    border: none;
    background: transparent;
    font-family: var(--codeFont), monospace;
}

pre {
    background-color: var(--codeColor);
    border: 2px solid var(--linkColor);
    border-radius: 10px;
    filter: brightness(80%);
    display: block;
    padding: 10px;
    margin: 0 0 18px;
    line-height: 16px;
    white-space: pre-wrap;
    word-wrap: break-word;
}

sup {
    font-size: 0.83em;
    vertical-align: super;
    line-height: 0;
}

.footnotes {
    margin-top: 50px;
    border-top: 1px solid var(--linkColor);
    font-size: calc(var(--fontSize) * 0.8);
}

.footnotes ol {
    padding-left: 20px;
}

.klever-copy-button {
    border: 1px solid var(--textColor);
    border-radius: 20%;
    background: var(--bodyColor);
    transition: 0.2s ease-out;
}

.klever-copy-button > svg {
    fill: var(--textColor);
    transition: 0.2s ease-out;
}

.klever-copy-button:hover {
    border: 1px solid var(--linkColor);
    transition: 0.2s ease-out;
}

.klever-copy-button:hover > svg {
    fill: var(--linkColor);
    transition: 0.2s ease-out;
}
