/* I lost control of this file, it looks like shit, also gigabloat, visit
 * simple.pelleha.nl for a non bloated version
 */

@import url("vars.css");
@import url("tables.css");

@font-face {
    font-family: 'EB Garamond';
    src: url('/fonts/EBGaramond-Regular.woff2') format('woff2');
    font-style: normal;
    font-weight: 400;
    font-display: swap;
}

@font-face {
    font-family: 'EB Garamond';
    src: url('/fonts/EBGaramond-Bold.woff2') format('woff2');
    font-weight: 700;
    font-style: normal;  /* or italic, if it is the italic cut */
    font-display: swap;
}

@font-face {
    font-family: 'EB Garamond';
    src: url('/fonts/EBGaramond-Italic.woff2') format('woff2');
    font-style: italic;
    font-weight: 400;
    font-display: swap;
}

body {
  display: flex;
  min-height: 100dvh;
  flex-direction: column;
  margin: 0;
  font-size: 1.33rem;
  background-color: var(--bg1);
  color: var(--fg1);
  font-family: 'EB Garamond';
  line-height: 1.3;

  -webkit-text-size-adjust: none;
  text-size-adjust: none;
}

header,
pre,
code {
  background-color: var(--navbg);
}

.navbar,
main,
.footer-content {
  width: 100%;
  max-width: 800px;
  margin: 0 auto;
  padding-left: 1em;
  padding-right: 1em;
  box-sizing: border-box;
}

h1, h2, h3, h4, h5, h6 {
    font-feature-settings: "smcp";
    font-weight: normal;
    margin-bottom: 0.25em;

}

strong, b {
  font-weight: 700; /* typical value for real bold */
}


.blogpost h1,
.blogpost h2,
.blogpost h3,
.blogpost h4,
.blogpost h5,
.blogpost h6 {
  font-feature-settings: normal;
  font-weight: normal;
  font-style: italic;
  padding-top: 0.55em;
  text-align: right;
}
.blogpost h1 {
    text-align: center;
    font-weight: normal;
}
.blogpost h3 {
    text-align: left;
    font-weight: normal;
}


main {
  flex: 1;
  padding-top: 2em;
  padding-bottom: 2em;
}

.footer-thingy{
    background-color: inherit;
    text-align: center;
}

.footer-content {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.7rem;
}

.title{
    font-feature-settings: "smcp";
    text-align: center;
    font-size: 3.3rem;
    margin-bottom: 0;
    margin-top: 0;
    line-height: 1em;
}
/* TODO: make title smaller for mobile devices */

.tagheading{
    font-feature-settings: "smcp";
    text-align: center;
    font-size: 4rem;
    margin-bottom: 1.5em;
    margin-top: 0;
    line-height: 1em;
}


.subtitle{
    text-align: center;
    font-style: oblique;
    margin-top: 0.3em;
}

.publishdate{
    font-size: 0.9em;
    text-align: center;
    color: var(--fg1);
    margin-bottom: 2em;
}

article {
  margin-bottom: 2em;
}


.metadata {
  margin: 1em 0;
}

.tags {
  list-style: none;
  display: inline-flex;
  gap: 0.5em;
  margin: 0;
  padding: 0;
}

.tags a {
  color: var(--fg2);
  text-decoration: none;
}

:is(h1, h2, h3, h4, h5, h6) .anchor {
  visibility: hidden;
}

:is(h1, h2, h3, h4, h5, h6):hover .anchor {
  visibility: visible;
}

p,
li {
  text-align: justify;
  hyphens: auto;
}

a {
    text-decoration: none;
}

main a{
  color: var(--fg1);
  text-decoration: underline dotted;
}

a:hover {
  text-decoration: underline;
}

pre code {
  padding: 0;
}

code {
  padding: 0.2em 0.3em;
  font-size: 0.9rem;
}


pre {
    display: inline-block;
    max-width: 100%;
}

hr {
  width: 50%;
  border: none;
  border-top: 3px double var(--fg1);
  overflow: visible;
  text-align: center;
  margin-top: 0.7em;
  margin-bottom: 0.5em;
}


pre,
.katex {
  overflow: auto;
}

figure {
  margin: 0;
}


/* wrapper draws the border ON TOP of the img, but stays low in stacking */
.imgwrap {
  position: relative;          /* no z-index here (=> no new stacking context) */
  display: block;              /* full width of parent; allows aspect-ratio calculation */
  z-index: 0;                  /* above the img, but easy to beat */
  margin-bottom: 1.5em;
}

.imgwrap::after {
  content: "";
  position: absolute;
  inset: 0;                    /* top/right/bottom/left: 0 */
  border: 3px solid var(--imgborder);
  pointer-events: none;        /* never blocks clicks */
  box-sizing: border-box;
  z-index: 0;                  /* above the img, but easy to beat */
}

.imgwrap img {
  display: block;
  width: 100%;
  height: auto;
  z-index: 0;                  /* above the img, but easy to beat */
}


figcaption {
  margin-top: 1em;
  color: var(--fg2);
  text-align: center;
}

main ul {
    list-style-type: "⟡ ";
}

/* tweak if you like */
:root { --par-indent: 2em; }

/* Apply to "plain" paragraphs only (no class attribute) */
p:not([class]) {
  margin-block: 0;              /* no space between paragraphs */
}

p.dropcappar{
  margin-block: 0;              /* no space between paragraphs */
}

/* Indent only when a plain <p> follows another plain <p> */
p:not([class]) + p:not([class]) {
  text-indent: var(--par-indent);
}

p.dropcappar + p:not([class]) {
  text-indent: var(--par-indent);
}

blockquote.prettyblock {
  font-style: italic;
  text-align: right;
  margin: auto;
  max-width: 60%;
}

blockquote p:not([class]) + p:not([class]) {
  text-indent: 0;
}

.prettyblock p {
    font-size: 0.9em;
    line-height: 1.1em;
    margin-block: 0.5em;
    text-align: left;
}

.twocol blockquote{
    max-width: 100%;
    padding: 0.5em;
}

@media (max-width: 760px) {
    blockquote.prettyblock{
      max-width: 90%;
  }
}

blockquote footer {
  margin-top: 0.5em;
  font-style: normal;
  padding-left: 1.5em; /* indent the source */
  text-align: center;
}

/* two-col stuff*/
.twocol {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
  align-items: start;
}


.twocol-left, .twocol-right {
  padding: 0;
}

/* On small screens, stack vertically */
@media (max-width: 768px) {
  .twocol {
    grid-template-columns: 1fr;
  }
}




/* Sidenote Stuff*/

/* We rely on a counter for sidenotes */
body {
    counter-reset: sidenote-counter;
}

/* Sidenotes and margin notes on larger screens */
.sidenote,
.marginnote {
    float: right;
    clear: right;
    margin-right: -50%;
    width: 40%;
    text-indent: 0em;
    margin-top: 0.3rem;
    margin-bottom: 0;
    font-size: 0.8em;
    line-height: 1.15;
    text-align: left;
    vertical-align: baseline;
    position: relative;
}


/* Increment sidenote counter for each sidenote-number element */
.sidenote-number {
    counter-increment: sidenote-counter;
}

/* Style counters */
.sidenote-number:after,
.sidenote:before {
    /* Adjust font-family as desired */
    font-family: "EB Garamond", serif;
    position: relative;
    vertical-align: baseline;
}

.sidenote-number:after {
    content: counter(sidenote-counter);
    font-size: 0.9rem;
    top: -0.5rem;
    left: 0.1rem;
}

.sidenote:before {
    content: counter(sidenote-counter) " ";
    font-size: 0.9rem;
    top: -0.3rem;
}

/* Sidenotes inside blockquotes need different positioning */
blockquote .sidenote,
blockquote .marginnote {
    margin-right: -82%;
    min-width: 59%;
    text-align: left;
}

/* Margin toggles for responsive behavior */
input.margin-toggle {
    display: none;
}

label.sidenote-number {
    display: inline;
}

/* By default, other margin toggles are hidden */
label.margin-toggle:not(.sidenote-number) {
    display: none;
}

/* Responsive adjustments for narrow screens */
@media (max-width: 1460px) {

    label.margin-toggle:not(.sidenote-number) {
        display: inline;
    }

    .sidenote,
    .marginnote {
        display: none;
    }

    .margin-toggle:checked + .sidenote,
    .margin-toggle:checked + .marginnote {
        display: block;
        float: left;
        left: 0.9rem;
        clear: both;
        width: 95%;
        margin: 1rem 2.5%;
        vertical-align: baseline;
        position: relative;
    }

    label {
        cursor: pointer;
    }
}

/* blog overview */
/* Container for the list */
.posts {
  display: grid;
  gap: 0;
}

/* One post row: image left, text right */
.post {
  display: grid;
  grid-template-columns: 16rem 1fr; /* image | text */
  grid-template-rows: auto auto auto 1fr;
  gap: 0.2rem 1.5em;
  align-items: start;
}

/* Thumbnail block */
.thumb {
  grid-row: 1 / -1;                 /* image spans all text rows */
  border: 2px solid var(--imgborder);
  justify-self: start;
  inline-size: 100%;
  max-inline-size: 16rem;
  aspect-ratio: 3 / 2;            /* consistent tiles; prevents CLS */
  overflow: clip;
  border-radius: 0;
  display: block;
}

.thumb > img {
  inline-size: 100%;
  block-size: 100%;
  object-fit: cover;
  display: block;
  border: none;
}

/* Typography */
.listtitle { margin: 0; line-height: 0.9; }
.listtitle a { text-decoration: none; color: inherit; }
.listtitle a:hover { text-decoration: underline; }

.meta { margin: 0; opacity: .7; font-size: 0.9em; }

.thoughtdate { margin: 0; margin-bottom: 0.5em; opacity: .7; font-size: 0.9em; text-align: center;}
.thought {
    max-width: 90%;
    margin: 1em auto 1em auto;
}
.excerpt { margin: .25rem 0 0; }

/* Mobile: stack image above text */
@media (max-width: 700px) {
  .post {
    grid-template-columns: 1fr;
    grid-template-rows: auto auto auto auto auto;
  }
  .listtitle { margin-top: 0.5em; line-height: 0.9; }
  .thumb {
    grid-row: 1;
    max-inline-size: none;
    aspect-ratio: 4 / 3;           /* a bit taller looks nicer on phones */
  }
   .thought { max-width: 95%;}
}


.clickable-element {
    display: inline-block;
    color: inherit; /* Inherit the text color */
    font-size: 1.5rem;
}

/* the boxes and stuff */

:root{
  --content-max: 72ch;     /* match your content width */
  --split-gap: 24px;
  --box-pad: 12px 14px;
  --box-border: 1px solid color-mix(in oklab, canvasText 12%, transparent);
}

/* The split wrapper sits above the article content */
.intro-split{
  display: grid;
  grid-template-columns: minmax(220px, 1fr) minmax(260px, 2fr);
  gap: 0 2em;
  align-items: start;
  margin: 0 auto 1.25rem;
  max-width: 100%;
}

.toc-box, .desc-box, .thoughts-list-box{
  border: var(--box-border);
  background: var(--navbg);
  padding: var(--box-pad);
  margin-bottom: 1em;
}

.thoughts-list-box {
  max-width: 100%;
}

/* ToC lists */
.toc, .toc ul{
  list-style: none;
  margin: 0;
  padding: 0;
}
.toc > li { margin: 6px 0; }
.toc ul { padding-left: 12px; margin-top: 4px; }
.toc a{
  text-decoration: none;
  line-height: 1.3;
  font-size: 1rem;
  color: inherit;
}
.toc a:hover{ text-decoration: underline; }

/* Hugo's default TOC styling */
#TableOfContents {
  list-style: none;
  margin: 0;
  padding: 0;
}

#TableOfContents > ul {
  list-style: none;
  margin: 0;
  padding: 0;
}

#TableOfContents ul {
  list-style: none;
  margin: 0;
  padding-left: 0;
  font-weight: bold;
}

#TableOfContents ul ul {
  padding-left: .5em;
  margin-top: 0.25em;
  font-weight: normal;
}

#TableOfContents ul ul ul {
  padding-left: 1em;
  font-weight: normal;
}

#TableOfContents li {
  margin: 0.5em 0;
}

#TableOfContents a {
  text-decoration: none;
  line-height: 1;
  font-size: 0.8em;
  color: inherit;
  display: block;
}

#TableOfContents a:hover {
  text-decoration: underline;
}

/* Mobile: stack, put summary first or second as you prefer */

/* Smooth anchor scrolling + header offset without JS */
html { scroll-behavior: smooth; }
:is(h1,h2,h3,h4,h5,h6){ scroll-margin-top: 80px; } /* adjust if you have a fixed header */

.toc-box{
  --toc-num-col: 1ch;            /* fixed number column: aligns all titles */
  --toc-gap: .6rem;
  background: var(--navbg);
  padding: 12px 14px;
}
.toc-toggle{ display:block; }
.toc-title{ cursor:pointer; font-weight:600; margin:0 0 .5rem; }
.toc-toggle > summary::-webkit-details-marker{ display:none; }

/* Thoughts navigation styling */
.thoughts-nav {
  list-style: none;
  margin: 0;
  padding: 0.5em;
}

.thoughts-nav li {
  display: flex;
  gap: 1rem;
  margin: 0.75rem 0;
  align-items: baseline;
}

.thought-date {
  font-size: 1rem;
  opacity: 0.7;
  flex-shrink: 0;
  font-feature-settings: "tnum";
}

.thoughts-nav a {
  text-decoration: underline;
  line-height: 1.3;
  font-size: 1.33rem;
  color: inherit;
  flex: 1;
}

.thoughts-nav a:hover {
  text-decoration: underline;
}

/* Hide dates on mobile */

/* Two column layout for thoughts on larger screens */

/* Recent posts navigation on homepage */
.recent-nav {
  display: block;
  list-style: none;
  margin-bottom: 2rem;
  margin-left: auto;
  margin-right: auto;
  padding: 0;
  width: fit-content;
}

.recent-nav li {
  display: flex;
  gap: 1rem;
  margin: 0.1rem 0;
  align-items: baseline;
  font-size: 1rem;
}

.recent-nav ul{
    margin-left: 0;
}

.recent-label {
  font-size: 1rem;
  opacity: 0.7;
  flex-shrink: 0;
  font-style: italic;
  min-width: 5rem;
  display: inline-block;
  padding-left: 2em;
}

.recent-nav a {
  text-decoration: none;
  line-height: 1.3;
  color: inherit;
  flex: 1;
}

.recent-nav a:hover {
  text-decoration: underline;
}

.spaced {
    padding-left:0.5rem;
    padding-right: 0.2rem;
}

/* Two column layout for recent posts on larger screens */
@media (min-width: 768px) {
  .left{justify-self: left;}
  .center{justify-self: center;}
  .right{justify-self: right;}

   .recent-nav {
    display: grid;
    margin-left: 0;
    width: auto;
    margin-right:0;
    max-width: 100%;
    grid-template-columns: auto auto auto;
  }

  .recent-nav li {
    margin: 0.5rem 0;
    font-size: 1rem;
  }
  .recent-label{
    min-width: 0;
    padding-left: 0;
  }
}


  main.blogpost {
    position: relative;
  }

@media (max-width: 640px){
   h1 {
       font-size: 2rem;
   }
   hr{
       width: 70%;
   }
   main {
       font-size: 1.15rem;
   }

   .toc-box{
       display: none;
   }

   .thoughts-list-box{
      width: 300px;
      margin: 0 auto 1em;
   }

   .intro-split{
      grid-template-columns: 1fr;
   }

   .thought-date {
      display: none;
   }
}

@media (min-width: 768px) {
  .thoughts-nav {
    column-count: 2;
    column-gap: 2rem;
  }

  .thoughts-nav li {
    margin: 0;
    break-inside: avoid;
  }
  .thoughts-nav a{
    text-decoration: none;
  }
}
