/*———————————————————————————————————————————————————————————*/
/* Global stuff                                              */
/*———————————————————————————————————————————————————————————*/
:root {
    --corner: 0.3rem;
    --min-column-width: 100px;
    --small-corner: 0.2rem;
    --thin-border: 1px dotted var(--fg-less);
    hyphens: auto;
}

/*——————————————————————————————————--—————————————————————————*/
/* Defaults, before everything else so they can be overridden  */

body {
    background-color: var(--bg);
    color: var(--fg);
    margin: 0.3rem;
}

/* Spacing around and between paragraphs */
main section > p {
    padding-top: 1rem;
}
 
main section > p:first-of-type {
    padding-top: 0;
}

main section > p:last-of-type {
    padding-bottom: 3rem;
}

li {
    padding-inline-start: 0;
    margin: 0;
}

ul, ol {
    padding-left: 0;
    list-style-type: none;
}

/* -------------------------------------------------------------------- */
/* Page Layout */

html {
    height: 100%;
}

body {
    height: 100%;
}

/* The page is one article.  The article is a vertical flexbox.  Each
block within the article—a.k.a. row—is a horizontal flexbox.  The
reason for this arrangement is that, if the display is too narrow for
each row to show all of its flexbox contents side-by-side, then each
row will collapse to a vertical arrangement, keeping the contents of
the row contiguous.

All the rows should be the same width.  This width is limited because
the text will be uncomfortably wide otherwise. */

article {
    max-width: calc(var(--min-column-width) * 8);
    margin-left: auto;
    margin-right: auto;
    display: flex;
    flex-direction: column;
    height: 100%;
}

article > * {
    display: flex;
    flex-wrap: wrap;
    max-width: calc(var(--min-column-width) * 8);
}

article > * > * {
    min-width: calc(var(--min-column-width) * 2);
    max-width: calc(var(--min-column-width) * 2);
}

article > * > :nth-child(2) {
    width: clamp(var(--min-column-width), calc(var(--min-column-width) * 4), 100%);
    max-width: calc(var(--min-column-width) * 4);
}

article > header {
    padding-top: 0.5rem;
    padding-bottom: 1rem;
}

article > header > nav {
    display: flex;
    justify-content: flex-end;
    padding-right: 1rem;
}

footer {
    height: 100%;
}

footer nav {
    display: flex;
    flex-direction: column;
    font-size: 0.7rem;
    justify-content: flex-end;
    padding: 0.5rem;
}

/* -------------------------------------------------------------------- */
/* Page Footer */

footer ul {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    justify-content: space-between;
    align-items: center;
    line-height: 20px;
}

footer img {
    padding-right: 0.2em;
}

footer img.icon {
    vertical-align: text-bottom;
    max-height: 1rem;
    display: inline;
}

.has-icon {
    display: flex;
    align-items: center;
}

.header-title {
    padding-top: 0.5rem;
}

article header h1 {
    margin-top: 0;
    text-align: center;
}

article > main  p {
    line-height: 130%;
}

/* -------------------------------------------------------------------- */
/* Headnotes */

/* Empty headnotes can't be display:none because that will break
   the grid alignment.  */

.headnotes:empty{
    opacity: 0;
    z-index: -1;
    margin: 0;
    padding: 0;
}

.headnotes {
    display: flex;
    flex-direction: column;
    justify-content: space-around;
    color: var(--fg-less);
    font-size: 0.9rem;
    padding-right: 1rem;
    height: fit-content;
}

/* -------------------------------------------------------------------- */
/* Footnotes */

.footnotes {
    color: var(--fg-less);
    font-size: 0.7rem;
    hyphens: auto;
    padding-left: 3rem;
}

.notes_rtl {
    text-align: right;
    margin-left: inherit;
}

.footnotes:empty {
    display: none;
}

.footnotes br {
    margin-bottom: 0.3rem;
}
.footnotes ol {
    margin: 0;
}

.footnotes > ol > li {
    padding-top: 1rem;
}

.footnotes > ol > li:first-child {
    padding-top: 0;
}

.footnote-backref {
    opacity: 60%;
    padding-left: 0.3rem;
    text-decoration: none;
}

.footnotes li {
    list-style-type: decimal;
}

ol.irony {
    padding-inline-start: 2rem;
    list-style-type: none;
}

ol.irony li::marker {
    content: "⸮ ";
}

/* Block an unwanted element of the markdown output */
main .footnotes hr {
    display: none;
}

a.footnote-ref {
    font-weight: 700;
    color: var(--highlight);
    text-decoration: none;
}

a.footnote-ref:hover {
    font-weight: 700;
    color: var(--orange);
}

main .footnotes a.footnote-ref {
    font-weight: inherit;
    font-size: 0.6rem;
}

/* -------------------------------------------------------------------- */
/* footfoot is for footnotes for the footnotes */

div.footfoot {
    display: flex;
    justify-content: flex-end;
}

ol.footfoot {
    border-top: 0.05rem solid var(--fg-more);
    margin-top: 1rem;
    padding-top: 0.5rem;
}

.footfoot li {
    font-size: 0.65rem;
    list-style-type: hebrew;
    margin: 0;
    margin-left: 1rem;
}

/* -------------------------------------------------------------------- */
/* character-level formats                                              */

a {
    color: inherit;
    font-variant-numeric: lining-nums tabular-nums;
    text-decoration-color: var(--fg-less);
    text-decoration-style: dotted;
    text-decoration-thickness: 0.05rem;
}

a:visited {
    text-decoration-color: var(--fg-less);
}

a:hover {
    text-decoration: underline;
    text-decoration-thickness: 0.1rem;
    text-decoration-color: var(--fg-less);
}

.mono-nums {
    font-variant-numeric: lining-nums tabular-nums;
}

.stack-frac {
    font-variant-numeric: stacked-fractions;
}

sup {
    font-size: 70%;
    line-height: 0;
}

.red-circle {
    border: 3px solid var(--red);
    padding: 3px;
    border-bottom-left-radius: 50% 100%;
    border-bottom-right-radius: 50% 100%;
    border-top-left-radius: 50% 100%;
    border-top-right-radius: 50% 100%;
}

/* -------------------------------------------------------------------- */
/* Hugo- and Markdown-specific */

dl.index {
    display: grid;
    grid-template-columns: 1fr 1fr;
}

dl.index dt {
    align-content: baseline;
    display: flex;
    font-family: var(--sans);
    font-size: 0.9rem;
    font-weight: 700;
    justify-content: right;
    padding-right: 1rem;
    padding-top: 0.5rem;
    text-align: right;
}

dl.index dd {
    align-content: baseline;
    padding-top: 0.5rem;
}


/* -------------------------------------------------------------------- */
/* Theme-specific formatting */
/* -------------------------------------------------------------------- */

h1 {
    font-size: 2rem;
    font-weight: 700;
    margin-top: 2rem;
}

h2 {
    font-size: 1.6rem;
    font-weight: 700;
    margin-top: 1.3rem;
}

h3 {
    font-size: 1.3rem;
    font-weight: 700;
    margin-top: 1rem;
}

.redacted { 
    background-color: var(--yellow);
}

.debug_hint {
    display: none;
    background-color: var(--blue);
}


ul.arrows {
    padding-inline-start: 1rem;
}

.arrows > li::marker {
    content: '▶  ';
}


.blog-title {
    font-size: 1.2rem;
    font-weight: 600;
}

.blog-thumb {
    max-width: 5rem;
}

/* -------------------------------------------------------------------- */
/* Category/taxonomy tags                                               */

/* For taxonomy page only */

.taxonomy > main > table {
    padding-top: 2rem;
    padding-bottom: 2rem;
}

.taxonomy > main > table {
    margin-top: 2rem;
    margin-bottom: 2rem;
}

nav.text-toggle {
    text-align: center;
    font-size: 1.2rem;
    color: var(--fg-less);
}

nav.text-toggle a {
    text-decoration: underline;
}

.text-toggle .selected {
    color: var(--fg);
}

.tags {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
}

.tags a {
    border-radius: var(--small-corner);
    box-shadow: var(--box-shadow);
    background-color: var(--bg-more);
    display: flex;
    align-items: center;
    margin: 2px;
    padding: 3px;
    padding-left: 0.5rem;
    padding-right: 0.5rem;
    text-decoration: none;
    width: fit-content;
    height: 100%;
}

.tags div + div {
    margin-top: 0.8rem;
}

.tags img {
    max-width: 20px;
    display: inline;
    text-decoration: none;
    padding-right: 0.3rem;
}

.tags a:hover {
    background-color: var(--bg-less);
    color: var(--fg-more);
}


/* -------------------------------------------------------------------- */
/* Quotes */

.attrib {
    font-style: normal;
    text-align: right;
    width: 100%;
}

blockquote {
    border-left: 0.5rem solid var(--fg-less);
    font-family: var(--sans);
    padding: 0.5rem!important;
    box-shadow: var(--box-shadow);
    margin: 1rem;
    padding-bottom: 0.5rem;
}

blockquote ol {
    padding-left: revert;
    list-style-type: revert;
}

ul.bullet {
    padding-left: revert;
    list-style-type: revert;
    padding-top: 0.5rem;    
}

.bullet li {
    margin-top: 0.5rem;
}

.bullet li p {
    display: contents;
} /* Hack to allow [] footnote parsing within html. dirty! */

/* -------------------------------------------------------------------- */
/* Monospaced styles */



code {
    font-size: 110%;
}

pre {
    box-shadow: var(--box-shadow);
    border-radius: var(--small-corner);
    padding: 0.5rem;
    border: none;
    overflow: scroll;
}

pre.shell {
    background: var(--fg-more)!important;
}

pre.shell p {
    margin: 0;
}

pre.shell *:before {
    content: "$ ";
}

/* -------------------------------------------------------------------- */
/* Images */

.thumbnails {
    display: grid;
    margin-left: auto;
    margin-right: auto;
    margin-bottom: 2rem;
    width: 100%;
    grid-gap: 0rem;
}

.thumbnails .twocol {
    grid-column-end: span 2;
    max-width: 100vw;
}

.thumbnails .tworow {
    grid-row-end: span 2;
    max-width: 100vw;
}

figure {
    align-items: center;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    margin-top: 1rem;
    margin-left: auto;
    margin-right: auto;
    padding-right: 0.5rem; /* make sure the box shadow doesn't get cut off */
    padding-bottom: 0.5rem; /* make sure the box shadow doesn't get cut off */
}

figure figcaption {
    display: flex;
    flex-direction: column;
    font-family: var(--sans);
    color: var(--fg-more);
    flex-grow: 1;
    font-size: 0.7rem;
    line-height: 105%;
    justify-content: flex-start;
    margin-top: 0.5rem;
    text-align: center;
}

.footnotes figcaption {
    color: var(--fg-less);
    font-size: 0.6rem;
}

figure a {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
}

figure img {
    box-shadow: var(--body-shadow);
}

/* -------------------------------------------------------------------- */
/* Tables */

table {
    font-variant-numeric: lining-nums tabular-nums;
    text-align: left;
    margin-top: 1rem;
    margin-left: auto;
    margin-right: auto;
    border-collapse: collapse;
    margin-bottom: 1rem;
}

th {
    font-weight: normal;
}

thead > tr > th {
    font-weight: 700;
    background-color: var(--bg-less);
}

td {
    vertical-align: top;
}


table tr {
    margin-top: 5rem;
}

table tr > td {
    border: none;
    padding: 0.3rem;
}

table.index tbody td {
    padding-top: 2rem;
    padding-right: 1rem;
}

table .num {
    text-align: right;
}

table.border {
    width: 100%;
}

table.border tr > td {
    border: 1px solid var(--fg-less)!important;
    padding: 0.5rem;
}

table.border tr > th {
    border: 1px solid var(--fg-less)!important;
    padding: 0.5rem;
    color: var(--fg-more);
    font-family: var(--sans);
}


/* -------------------------------------------------------------------- */
/* Front Matter */

.byline {
    align-items: flex-end;
    color: var(--fg-less);
    display: flex;
    flex-direction: column;
    font-size: 0.8rem;
    font-weight: 200;
    justify-content: flex-start;
}

.byline > * {
    margin-bottom: 0.8rem;
}    

/* if the author is not the default author, make it more noticable */
.article-author {
    font-size: 1.2rem;
    font-weight: 700;
}

.byline .date {
    padding-left: 0.5rem;
}

.byline a {
    display: inline;
}

.credit {
    text-align: right;

}

.lede {
    background-color: var(--bg-less);
    border: 1px solid var(--bg-more);
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 1.5rem;
}

.lede .byline {
    flex-direction: row;
    align-items: baseline;
    font-size: 70%;
    justify-content: space-between;
}

.lede figure {
    margin-top: 0;
}

.lede .text_side {
    flex: 1 1 auto;
    margin: 0.5rem;
}

.lede .fig_side {
    flex: 0 0 75px;
    margin: 0.5rem;
}

.lede h2 {
    font-size: 1.4rem;
    margin-top: 0;
}

.lede .ledepic {
    min-width: 75px;
}

.lede .ledepic * {
    box-shadow: none;
}

.lede p {
    text-decoration: none;
    font-size: 90%;
    color: var(--fg-less);
}
