html, body, div, span, object, iframe, h1, h2, h3, h4, h5, h6, p, blockquote,
pre, abbr, address, cite, code, del, dfn, rem, img, ins, kbd, q, samp, small,
strong, var, b, i, dl, dt, dd, ol, ul, li, fieldset, form, label,
legend, table, caption, tbody, tfoot, thead, tr, th, td, article, aside, canvas,
details, figcaption, figure, footer, header, hgroup, menu, nav, section,
summary, time, mark, audio, video {
    background: transparent;
    border: 0;
    font-variant: normal;
    font-size: 1em;
    margin: 0;
    outline: 0;
    padding: 0;
    vertical-align: baseline;
}

html {
    font-size: 0.9rem;
}

/*
  Turn off font boosting. It seems to only boost the prose, but not
  the code or the KaTeX.
*/
html * {
  max-height:1000000px;
}

/*
  Instead, make fonts on high-DPI small screens bigger. This is kinda imperfect
  but seems to work OK. I test it with chrome responsive simulator in the dev
  tools.

  I also keep the landscape mode unzoomed so that people can use it to check
  out the code.
*/
@media (-webkit-min-device-pixel-ratio: 1.95) and (max-width: 1000px) and (orientation: portrait) { 
    html {
        font-size: 1.6rem;
    }
}

html, body {
    height: 100%;
}

body {
    color: #00000f;
    font-family: "IBM Plex Serif", Garamond, Georgia, serif;
    margin: 0;
    padding: 0;
    text-align: justify;
    background-color: #FFFFF0;
}

code, samp {
    font-family: "IBM Plex Mono", monospace;
    font-style: normal;
}

pre {
  font-size: 0.9rem;
}

sup {
    font-size: 0.8rem;
}

#title {
    color: #00000f;
    text-align: left;
    margin: 0 2rem;
    font-weight: bold;
    font-size: 5.5rem;
    font-family: "IBM Plex Sans", Helvetica, Arial, sans-serif;
}

#title a {
    text-decoration: none;
    color: #00000f;
}

#wrapper {
    margin: 0 2rem 2rem 2rem;
    width: calc(100% - 4rem);
}

#wrapper, #comments {
  display: grid;
  grid-template-columns: min(60%, 42rem) min(40%, 28rem) auto;
  row-gap: 0;
  column-gap: 0;
  grid-auto-flow: row;
}

#wrapper > *, #comments > * {
    grid-column-start: 1;
    grid-column-end: 2;
}

h1, h2, h3 {
    font-family: "IBM Plex Sans", Helvetica, Arial, sans-serif;
}

h1 a, h2 a, h3 a {
    text-decoration: none;
}

/* Stuff for the index */

#articles {
    max-width: 100%;
    font-family: "IBM Plex Sans", Helvetica, Arial, sans-serif;
    font-size: 1.4rem;
    grid-column-start: 1;
    grid-column-end: 3;
}

.date {
    font-size: 0.9rem;
    font-style: italic;
    line-height: 1.7rem;
    font-weight: 300;
    margin-right: 0.3rem;
}

.post-item-info {
  float: right;
  clear: both;
}

.tag {
    font-size: 0.8rem;
    /* border-radius: 0.25rem; */
    background-color: #e8e8de;
    /* color: white; */
    padding: 0.15rem 0.2rem;
    margin: 0 0.1rem;
    font-weight: 300;
}

.date-tags {
    color:#5b5b5b;
    font-weight: 400;
    text-shadow: none;
    font-size: 0.7rem;
    display: block;
    float: left;
    text-align: right;
    line-height: 2rem;
}

#articles a {
    color: #3e4a4e;
    text-decoration: none;
    font-weight: 700;
}

#articles h2 {
  text-align: left;
}

/* Stuff for the article display */

.article .sourceCode, .article pre {
    grid-column-start: 1 !important;
    grid-column-end: 3 !important;
    justify-self: stretch;
}

@media (-webkit-min-device-pixel-ratio: 1.95) and (max-width: 1000px) { 
    .article h1 {
        grid-column-start: 1 !important;
        grid-column-end: 3 !important;
        justify-self: stretch;
    }    
}

h1, h2, h3, h4, h5, h5 {
    text-align: left;
}

.article .footnotes-end-of-block {
    grid-column-start: 2 !important;
    grid-column-end: 3 !important;
    justify-self: stretch;
    margin-left: 2.5rem;
    border-top: 1px solid black;
    padding-top: 0.5rem;
    opacity: 0.85;
}

.footnotes-end-of-block, .footnotes-end-of-block li, .footnotes-end-of-block p {
    font-size: 0.8rem;
}

.footnotes-end-of-block ul {
    margin: 0.2rem 0 !important;
}

.article h1 {
    color: #3e4a4e;
    text-align:left;
    font-size: 1.8rem;
    font-weight: 700;
}

.article h1 .date {
    float: right;
    padding: 0 0 0 1em;
    font-size: 1em;
}

.article h1 .date span {
    font-size: 1.3rem;
}

p {
    font-family: "IBM Plex Serif", Garamond, Georgia, serif;
    font-size: 1rem;
}

blockquote {
    background: #f0f0f083;
    border-left: 0.2rem solid #7F1315;
    margin: 0 0 0.5rem 2rem;
    padding: 0.5rem 0.7rem;
}

blockquote p {
    text-indent: 0;
}

.article h2 {
    font-size:1.6rem;
    font-weight: 500;
    line-height: 1.7rem;
}

.article h3 {
    font-size:1.3rem;
    font-weight: 500;
}

a {
    color: #00000f;
}

.article ul, .article ol {
    margin-left: 1.5rem;
}

.article li {
    margin:0 0 0.2rem 0;
}

.article li p {
    text-indent: 0;
}

pre {
    margin:0.2rem 0;
    padding:0.4rem 0.7rem;
    font-size: 0.9rem;
    font-family: "IBM Plex Mono", monospace;
}

table {
    margin-left: auto;
    margin-right: auto;
}

/* Pandoc and agda */
pre {
    background-color:rgba(243, 243, 187, 0.7);
    overflow-y: auto;
}

p code, li code {
    background-color:rgba(243, 243, 187, 0.3);
}

p code {
    padding: 0 0.2rem;
}

pre {
    overflow-y: auto;
}

table.sourceCode {
    width:100%;
}

/*
::-webkit-scrollbar {
  width: 7px;
  height: 7px;
}

::-webkit-scrollbar-track {
  background-color: #00000f;
}

::-webkit-scrollbar-thumb {
  background-color: #d8d8ca;
  border-radius: 7px;
}
*/

.article td {
  padding: 0.1rem 0.2rem;
}

.article img {
  max-width: 100%;
}

.figure {
  text-align: center;
}

.center-image {
  text-align: center;
}

.center-image-rounded img {
  border-radius: 0.25rem;
}

.sc {
  font-variant: small-caps;
}

.yt {
  text-align: center;
  margin: 0.3rem 0;
}

sup, sub {
   vertical-align: baseline;
   position: relative;
   top: -0.4rem;
}

sub {
    top: 0.4rem;
}

small {
  font-size: 0.8rem;
}

.presentation-section {
    min-height: 100vh;
}

.text-center {
    text-align: center;
}

.article h2 {
    margin-bottom: 0.5rem;
}

.todo {
    color: rgb(231, 0, 0);
    font-weight: 500;
}

.footer {
    margin-bottom: 0.5rem;
    margin-top: 0.5rem;
}

.article hr {
    width: 100%;
}

hr {
    border: none;
    margin: 0;
}

hr::before {
    content: '❦ ❦ ❦';
    display: block;
    text-align: center;
    font-size: 1.2rem;
    color: rgb(104, 104, 104);
}

#comments hr, .footnotes hr, .footer hr {
    /* border: 0.1rem inset rgb(0, 0, 15);*/
    border-top-width: 0.1rem;
    border-top-style: solid;
    border-color: rgb(104, 104, 104);
}

#comments hr::before, .footnotes hr::before, .footer hr::before {
    content: '';
}

/* section links */

:is(h2, h3, h4, h5, h6) .section-link {
    font-style: italic;
    text-decoration: none;
    color: rgba(128, 128, 128, 0.678);
}

:is(h2, h3, h4, h5, h6):hover .section-link {
    color: grey;
    visibility: visible;
}

/* content vertical paddings. in general, we add spacing _after_ the elements */

.article h1 {
    padding: 0 0 0.5rem 0;
}

p {
    padding: 0 0 0.5rem 0;
}

hr, ul, ol, .article .sourceCode, .article pre, .article h1, .article h2, .article h3 {
    margin-bottom: 0.5rem;
}

/* for this one we make an exception and margin upwards to separate sections a bit */
.article h2 {
    margin-top: 0.5rem;
}

#articles {
    margin-bottom: 0.5rem;
}

#articles h2 {
    margin-bottom: 0.10rem;
}

.footnote-ref {
    margin-left: 0.15rem;
}

.page-sizes-table td, .page-sizes-table th {
  padding: 0.1rem 0.5rem;
}

.page-sizes-table td {
  padding-left: 0.7rem !important;
}

.page-sizes-table th {
  padding-bottom: 0.2rem;
}

.page-sizes-table thead th {
  border-bottom: 1px solid black;
}

.page-sizes-table .even {
  background-color: #00000012;
}

/* Lanczos */

.filters-showcase-container {
  grid-column-end: 4 !important;
  overflow-y: auto;
  margin: 0.5rem 0 1rem 0;
  padding: 0.5rem 0 0.5rem 0;
  text-align: left;
}

.filter-showcase-caption {
  text-align: center;
  margin-bottom: 0.5rem;
}

.filters-showcase {
  emtpy-cells: show;
  font-size: 0.8rem;
  font-weight: normal;
  border: 0;
  margin-left: 0;
}

.filters-showcase th, td {
  text-align: center;
  vertical-align: middle;
}

.filters-showcase tbody th {
  padding: 0 0.50rem;
  position: sticky;
  z-index: 1;
  left: 0;
  background-color: #FFFFF0F0;
}

.filters-showcase .original {
  background-color: #F3F3F3F0;
}

.filters-showcase td {
  padding: 0;
  margin: 0;
}

.filters-showcase .name {
  font-weight: normal;
  font-style: italic;
}

.filters-showcase .sample {
  max-width: max(80px, min(calc(100vh/5 - 2rem), 140px));
  max-height: max(80px, min(calc(100vh/5 - 2rem), 140px));
  overflow: hidden;
}

/* We can't use background image because we can't apply the crisp-edges filter */
.filters-showcase .sample img, .sample-big img {
  max-width: none;
  /*
    According to the latest standard, the right thing is crisp-edges, but chrome doesn't
    support it yet. This is from puzzlescript.
  */
  image-rendering: -moz-crisp-edges;
  image-rendering: -webkit-crisp-edges;
  image-rendering: pixelated;
  image-rendering: crisp-edges;
}

.filters-showcase .sample img {
  margin-left: 50%;
  transform: translateX(-50%);
}

.filters-showcase-container .filters-showcase .sample img {
  margin-left: 50%;
  margin-top: 50%;
  transform: translateX(-50%) translateY(-50%);
}

.filters-showcase .sample img {
  margin-left: 50%;
  transform: translateX(-50%);
}

.full-width-image img {
  width: 100%;
}

.lanczos-table table {
  width: 100%;
}

.lanczos-table td {
  font-size: smaller;
}

.lanczos-table img {
  width: 100%;
}

.lanczos-fourier-showcase {
  grid-column-end: 3 !important;
}


.lanczos-fourier-showcase-full {
  grid-column-end: 3 !important;
  overflow-y: auto;
}

.lanczos-fourier-showcase-full p {
  padding: 0;
}

.lanczos-fourier-showcase-full img {
  width: 70rem;
  max-width: none;
}

.lanczos-maths {
  grid-column-end: 3 !important;
  width: 100%;
  overflow-x: auto;
}

.large-image {
  text-align: center;
}

@media (orientation: portrait) or (max-width: 800px) { 
  .large-image {
    grid-column-end: 3 !important;
  }

  .large-image img {
    width: 100%;
  }
}

.extra-large-image {
  grid-column-end: 3 !important; 
}

@media (orientation: portrait) or (max-width: 800px) { 
  .extra-large-image img {
    width: 100%;
  }
}

.footnote-ref {
  text-decoration: none;
}

.footnote-ref sup {
  text-decoration: underline;
}

/* Comments */

#comments {
  grid-column-start: 1;
  grid-column-end: 3;
  margin-bottom: 0.5rem;
}

.operator {
  font-weight: bold;
}

.comment-date {
  font-style: italic;
}

.comment hr {
  border-top-width: 0.1rem;
  width: calc(100% - 1rem);
  border-color: rgb(104, 104, 104, 0.5) !important;
}

.comment blockquote {
  margin-left: 1rem;
}

.crc-table {
  border-collapse: collapse;
  margin-bottom: 1rem;
}

.crc-table td {
  text-align: center;
  padding: 0.25rem 0.5rem;
}

.crc-table-top {
  border-bottom: 1px solid black;
}

.crc-table-left {
  border-right: 1px solid black;
}