@import url("reset.css");
@import url("color.css");
@import url("md-syntax.css");

/* New Computer Modern Font Faces */
@font-face {
  font-family: 'New CM';
  src: url('/NewCMMono10-Regular.otf') format('opentype');
  font-weight: 400;
  font-style: normal;
}

@font-face {
  font-family: 'New CM';
  src: url('/NewCMMono10-Bold.otf') format('opentype');
  font-weight: 700;
  font-style: normal;
}

@font-face {
  font-family: 'New CM';
  src: url('/NewCMMono10-Book.otf') format('opentype');
  font-weight: 300;
  font-style: normal;
}

@font-face {
  font-family: 'New CM';
  src: url('/NewCMMono10-Italic.otf') format('opentype');
  font-weight: 400;
  font-style: italic;
}

@font-face {
  font-family: 'New CM';
  src: url('/NewCMMono10-BoldOblique.otf') format('opentype');
  font-weight: 700;
  font-style: italic;
}

@font-face {
  font-family: 'New CM';
  src: url('/NewCMMono10-BookItalic.otf') format('opentype');
  font-weight: 300;
  font-style: italic;
}

html,
body {
  padding: 0;
  margin: 0;
  min-height: 100vh;
  min-height: -webkit-fill-available;
  height: 100%;
}

video {
  width: 100%;
  height: auto;
}

main {
  max-width: 60em;
  margin: 0 auto;
  padding-left: 4em;
  padding-right: 4em;
  padding-top: 3em;
  padding-bottom: 3em;
  font-family: "Recursive";
  font-variation-settings: "CASL" 1;
  color: var(--text-color);
}

h1 {
  font-size: 2rem;
}
h2 {
  font-size: 1.5rem;
}
h1,
h2,
h3,
h4,
h5,
h6 {
  margin-top: 0;
  margin-bottom: 0.5em;
}

header {
  margin-bottom: 2em;
  font-size: 1.5rem;
  font-variation-settings: "CASL" 1;
}

i,
em {
  font-variation-settings: "slnt" -15, "CRSV" 1, "wght" 350;
  font-style: italic;
}

pre > code {
  width: 100%;
  padding: 1em;
  display: block;
  white-space: pre-wrap;
  word-wrap: break-word;
}

code {
  background-color: light-dark(#f6f8fa, #151b23);
  width: 100%;
  color: var(--text-color);
  
  padding: 0.1em 0.3em;
  border-radius: 4px;
  box-sizing: border-box;
  font-family: "Recursive";
  font-variation-settings: "MONO" 1;
  font-weight: 400;
  border: 1px solid light-dark(rgba(0, 0, 0, 0.1), rgba(255, 255, 255, 0.1))
}

b,
strong {
  font-variation-settings: "wght" 600;
}

blockquote {
  margin: 0em;
  padding: 1em;
  background-color: var(--blockquote-bg);
  margin-top: 1em;
  margin-bottom: 1em;
  border-radius: 4px;
  & p {
    font-variation-settings: "CASL" 1;
    margin: 0;
  }
}

p {
  margin-top: 0;
  margin-bottom: 1.5em;
  font-size: 1.05rem;
  font-variation-settings: "wght" 350;
}

table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  margin-bottom: 1em;
  font-variation-settings: "casl" 0;
  th,
  td {
    padding: 0.5em;
    border: 1px solid var(--table-border);
  }

  th {
    background-color: var(--table-header-bg);
    font-weight: bold;
  }

  tr:nth-child(even) {
    background-color: var(--table-stripe-bg);
  }
}

a {
  font-variation-settings: "CASL" 0, "wght" 400;
  transition: font-variation-settings 0.2s ease;
  
  &:hover {
    font-variation-settings: "CASL" 1, "wght" 600;
  }
}



.dinkus {
  display: block;
  text-align: center;
  font-size: 1.1rem;
  margin-top: 2em;
  margin-bottom: 0em;
}

ol,
ul {
  padding-left: 0;
  margin-top: 0;
  font-size: 1rem;
  & li::marker {
    color: var(--text-secondary);
  }
  & a {
    text-decoration: none;
    &:hover {
      text-decoration: underline;
    }
  }
}

img {
  display: block;
  margin: 0 auto;
}

@media (max-width: 600px) {
  main {
    padding: 1.5em;
  }
  header {
    margin-bottom: 1em;
  }
  ol, ul {
    list-style-position: inside;
    /* Add hanging indent for wrapped text */
    text-indent: -1.2em;
    padding-left: 1.2em;
  }
}

/* Some conditional spacing */
table:not(:has(+ p)) {
  margin-bottom: 2em;
}

p:has(+ ul) {
  margin-bottom: 0.5em;
}
p:has(+ ol) {
  margin-bottom: 0.5em;
}
p:has(+ md-syntax) {
  margin-bottom: 0em;
}

/* Post media styling */
.post img,
.post video {
  border-radius: 4px;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
  display: block;
  max-width: 100%;
}

/* Markdown / Marked */
[data-footnote-ref] {
  font-variation-settings: "CASL" 1;
  text-decoration: none;
}
[data-footnote-ref]::before {
  content: '[';
}

[data-footnote-ref]::after {
  content: ']';
}
