/* variables */

:root {
    --alpha: rgba(0, 0, 0, 0);
    /* border */
    --border-off: var(--border-width) none var(--alpha);
    --border-on: var(--border-width) solid var(--border-color);
    --border-width: .1rem;
    /* margin */
    --margin: .4rem;
    /* theme */
    color-scheme: light dark;
    /* theme / gradients */
    --anchor-gradient: linear-gradient(to top, var(--alpha), var(--anchor-background), var(--alpha));
    --banner-gradient: linear-gradient(to top, var(--alpha), var(--banner-background));
    --body-gradient: linear-gradient(to top, var(--alpha), var(--body-background));
    --header-gradient: linear-gradient(to top, var(--alpha), var(--header-background));
    --item-even-gradient: linear-gradient(to top, var(--alpha), var(--item-even));
    --item-odd-gradient: linear-gradient(to top, var(--alpha), var(--item-odd));
    --org-gradient: linear-gradient(to top, var(--alpha), var(--org-background));
    /* theme / light */
    --anchor-background: #fcc;
    --anchor-text: #f00;
    --banner-background: #ccf;
    --body-background: #fff;
    --body-text: #000;
    --border-color: #888;
    --button-background: #bbb;
    --header-background: #ccc;
    --item-even: #ddd;
    --item-odd: #eee;
    --org-background: #afa;
    --qrcode-background: ;
    --ruler-border: #888;
}
@media screen {
[data-theme="dark"] {
    /* theme / dark */
    --anchor-background: #622;
    --anchor-text: #f88;
    --banner-background: #558;
    --body-background: #000;
    --body-text: #aaa;
    --border-color: #888;
    --button-background: #444;
    --header-background: #444;
    --item-even: #222;
    --item-odd: #111;
    --org-background: #030;
    --qrcode-background: #aaa;
    --ruler-border: #444;
}
}

/* main */

#item, #link, #swap, #theme {
    background-color: var(--button-background);
}
#swap::after { content: "▸"; }
body.swap #swap::after { content: "◂"; }
#vcard {
    background-color: var(--qrcode-background);
}

@font-face {
    font-display: swap;
    font-family: "fa";
    src: url("font/fa.woff2");
}

html {
    font-family: "DejaVu Sans", sans-serif;
    text-align: start;
}

body {
    background-color: var(--body-background);
    color: var(--body-text);
    margin-inline: auto;
    max-inline-size: 108ch;
    padding-inline: .25rem;
}

article, h2, h3, table {
    margin-block-start: var(--margin);
}

h2, h3, header {
    border-bottom: var(--border-off);
    border-left: var(--border-on);
    border-right: var(--border-on);
    border-top: var(--border-on);
}

.link a:not(:has(img)),
.link button.link {
    background: var(--anchor-gradient);
}
a:not(:has(img)) {
    color: inherit;
    padding: 0 .2em;
    text-decoration: none;
    text-decoration-skip-ink: auto;
    text-underline-offset: .2em;
}
a:hover {
    color: var(--anchor-text);
}

body.item button.item {
    background: var(--item-odd-gradient);
}

article.org, header {
    border-radius: .25em;
    padding-block: .25em;
}
header {
    padding-inline: .5em;
    background: var(--header-gradient);
}
header.org {
    background: var(--org-gradient);
}

article header {
    display: flex;
    justify-content: space-between;
}

div.org {
    display: flex;
}

section.banner {
    align-items: center;
    display: flex;
    justify-content: space-evenly;
}
.banner {
    margin-block-start: .5em;
}

button {
    block-size: 2em;
    border-radius: .25em;
    color: var(--body-text);
    margin-block: 0 auto;
    margin-inline: .25em;
    padding-inline: .5em;
}

h1, h2, h3 {
    border-radius: .25em;
    font-weight: bold;
}
h1 {
    font-size: 1.15rem;
}
h2 {
    background: var(--banner-gradient);
    font-size: 1.10rem;
    padding-block: .25em;
    text-align: center;
}
h3 {
    background: var(--header-gradient);
    font-size: 1.05rem;
    padding: .125em .25em;
}

hr {
    border: .1em dashed;
    border-color: var(--ruler-border);
    margin-block: var(--margin);
}

img.big {
    block-size: 5em;
}
img.inline {
    block-size: 1.5em;
    vertical-align: middle;
}
a.logo {
    block-size: 2em;
    margin-block: 0 auto;
}
img.logo {
    block-size: 100%;
    margin-inline: auto;
}
img.org {
    block-size: 2em;
    margin-inline-end: .5em;
}

body.item li:nth-of-type(even) {
    background: var(--item-even-gradient);
}
body.item li:nth-of-type(odd) {
    background: var(--item-odd-gradient);
}

strong, th {
    text-shadow: .05em .05em .05em;
}

.banner table {
    margin-block-start: 0;
    margin-inline: 0;
}
table {
    border-collapse: separate;
    border-spacing: .5em .125em;
    margin-inline: auto;
}
table h3 {
    text-align: center;
}
th.logo, td.logo {
    block-size: 1.5em;
}
th {
    text-align: end;
}

ul {
    list-style-type: disc;
    padding-inline-start: 1.25em;
}

.columns, .halves {
    display: grid;
    gap: .75em;
    grid-template-columns: 1fr;
}
.level {
    text-align: center;
}
.title, .duration.org {
    font-weight: bold;
}
.sub, .period {
    font-size: .75em;
}
.time {
    text-align: end;
}

@media (width > 66ch), print {
    .columns { grid-template-columns: 1fr 2fr; }
    body.swap .columns { grid-template-columns: 2fr 1fr; }
    body.swap aside { order: 2; }
    body.swap main { order: 1; }
    .halves { grid-template-columns: 1fr 1fr; }
}

@media print {
    @page { size: A4; }
    html { font-size: 3mm; }
    button { display: none; }
    /* way too blurry as PDF output above .041em */
    strong, th { text-shadow: .05em .05em .041em; }
}

@media screen {
    .link #qa { background: var(--anchor-gradient); }
}
