/* Defaults */
:root {
  --font-family: Avenir Next, Montserrat, Corbel, 'URW Gothic', source-sans-pro, sans-serif;
  --font-family-serif: 'Iowan Old Style', 'Palatino Linotype', 'URW Palladio L', P052, serif;
  --font-family-monospace: JetBrains Mono, Consolas, Menlo, Monaco, Andale Mono WT, Andale Mono, Lucida Console, Lucida Sans Typewriter, Noto Sans Mono, Bitstream Vera Sans Mono, Liberation Mono, Nimbus Mono L, Courier New, Courier, monospace;
}

/* Theme colors */
:root {
  --color-gray-20: #e5e5e5;
  --color-gray-40: #a3a3a3;
  --color-gray-50: #737373;
  --color-gray-60: #525252; 
  --color-gray-90: #171717;

  --light-accent-color: oklch(45% 0.105 189);
  --light-accent-color-hover: oklch(53% 0.105 189);
  --accent-color: var(--light-accent-color);
  --accent-color-hover: var(--light-accent-color-hover);

  --light-background-color: #fffbf0;
  --background-color: var(--light-background-color);
  --border: 1px dotted rgba(0, 0, 0, 0.2);

  --text-color: var(--color-gray-90);
  --text-color-link-active: var(--accent-color-hover);
  --text-color-link: var(--accent-color);
  --text-color-link-visited: var(--accent-color);

  --syntax-tab-size: 2;

  --header-height: 42px;
  --footer-height: 2.5rem;
  --footer-margin: 2rem;
  --wide-width: 1800px;
  --prose-width: 800px;
}

/* dark mode coming soon  */
@media (prefers-color-scheme: dark) {
  :root {
    --color-gray-20: #737373;
    --color-gray-40: #a3a3a3;
    --color-gray-50: #d4d4d4;
    --color-gray-60: #e5e5e5;
    --color-gray-90: #fafafa;

    --accent-color: oklch(70% 0.105 189);
    --accent-color-hover: oklch(80% 0.105 189);

    --background-color: #15202b;
    --border: 1px dotted rgba(255, 255, 255, 0.2);
  }
}

/* Global stylesheet */
* {
  box-sizing: border-box;
}

html,
body {
  padding: 0;
  margin: 0 auto;
  font-family: var(--font-family);
  color: var(--text-color);
  background-color: var(--background-color);
  font-size: 16px;
}
html {
  overflow-y: scroll;
  scrollbar-color: var(--light-accent-color) var(--background-color);
}

@media (min-width: 780px) {
  :root {
    --header-height: 48px;
  }
  html, body {
    font-size: 18px;
  }
}

/* https://www.a11yproject.com/posts/how-to-hide-content/ */
.visually-hidden {
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  height: 1px;
  overflow: hidden;
  position: absolute;
  white-space: nowrap;
  width: 1px;
}

p:last-child {
  margin-bottom: 0;
}
p {
  line-height: 1.5;
  margin: 1em 0 1.5em;
}
ul + p {
  margin-top: 1.5em;
}

ul {
  padding-left: 1em;
}

li {
  line-height: 1.5;
  margin-bottom: 0.5em;
}
iframe {
  border: var(--border);
}

a[href] {
  color: var(--text-color-link);
  text-underline-position: from-font;
  text-underline-offset: 1.5px;
  text-decoration-thickness: 1.25px;
  text-decoration-style: dotted;
  transition: 150ms ease all;
}
a[href]:visited {
  color: var(--text-color-link-visited);
}
a[href]:hover,
a[href]:active {
  color: var(--text-color-link-active);
  text-underline-offset: 4px;
}

main {
  padding-top: var(--header-height);
  min-height: calc(100vh - var(--footer-height) - var(--footer-margin));
}

/* CUSTOM ELEMENTS  */
jc-container {
  display: block;
  padding: 1rem;
  max-width: var(--wide-width);
  margin: 0 auto;
}
jc-container[width="prose"] {
  max-width: var(--prose-width);
  text-wrap: pretty;
}

@media (min-width: 600px) {
  jc-container {
    padding: 2rem;
  }
}

jc-center {
  display: flex;
  align-items: center;
  justify-content: center;
}

jc-gallery p {
  margin: 0.5rem 0;
}

jc-image-flex a, jc-image-flex img { 
  margin-bottom: 1rem;
}
@media (min-width: 400px) {
  jc-image-flex p {
    display: flex;
    gap: 0.5rem;
  }
  jc-image-flex a, jc-image-flex img {
    flex: 1;
    margin-bottom: 0;
  }
}

table {
  margin: 1em 0;
}
table td,
table th {
  padding-right: 1em;
}

hr {
  border-top: var(--border);
  border-bottom: 0;
}

pre,
code {
  font-family: var(--font-family-monospace);
}
pre:not([class*="language-"]) {
  margin: .5em 0;
  line-height: 1.375; /* 22px /16 */
  -moz-tab-size: var(--syntax-tab-size);
  -o-tab-size: var(--syntax-tab-size);
  tab-size: var(--syntax-tab-size);
  -webkit-hyphens: none;
  -ms-hyphens: none;
  hyphens: none;
  direction: ltr;
  text-align: left;
  white-space: pre;
  word-spacing: normal;
  word-break: normal;
}
code {
  word-break: break-word;
}

/* Header */
header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  position: fixed;
  z-index: 10;
  width: 100%;
  background-color: var(--background-color);
}
header nav {
  flex: 1;
  height: var(--header-height);
  padding-top: 1px;
  border-bottom: var(--border);
}

a.home-link {
  font-size: 0.8em;
  font-weight: 600;
  background: var(--light-accent-color);
  line-height: var(--header-height);
  width: var(--header-height);
  text-align: center;
  letter-spacing: 0.4px;
}
a.home-link:link:not(:hover) {
  text-decoration: none;
}
a.home-link[href], a.home-link[href]:visited {
  color: var(--light-background-color);
}
.nav-item a[href], .nav-item a[href]:visited {
  color: var(--color-gray-60);
}

/* Nav */
.nav {
  display: flex;
  padding: 0;
  margin: 0;
  list-style: none;
}
.nav-item {
  display: inline-block;
  margin-left: 1.25em;
  font-weight: 550;
  font-size: 0.7rem;
  letter-spacing: 0.2px;  
  text-transform: uppercase;
  line-height: calc(var(--header-height) - 2px);
}
.nav-item a[href]:not(:hover) {
  text-decoration: none;
  text-underline-offset: 3px;
}
.home-link:hover, .nav-item a[href]:hover {
  text-decoration-style: solid;
  text-decoration-thickness: 1px;
}
.nav a[href][aria-current="page"] {
  text-decoration-style: solid;
  text-decoration-line: underline;
  text-decoration-color: var(--color-gray-40);
}

footer {
  height: var(--footer-height);
  margin-top: var(--footer-margin);
  line-height: 1rem;
  padding: 0.75rem 1rem;
  font-size: 0.7rem;
  border-top: var(--border);
  color: var(--color-gray-60);
  display: flex;
}

footer .copyright {
  flex: 1;
}

footer ul {
  display: flex;
  list-style-type: none;
  padding: 0;
  margin: 0;
  gap: 0.5rem;
}

footer li a[href]:not(:hover), footer li a[href]:not(:hover):visited {
  color: var(--color-gray-60);
  text-decoration: none;
}

/* Posts list */
.postlist {
  list-style: none;
  padding: 0;
}
.postlist-item {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  margin-bottom: 1em;
}
.postlist-date {
  font-size: 0.8em;
  color: var(--color-gray-90);
}
.postlist-date {
  word-spacing: -0.5px;
}
.postlist-link {
  font-size: 1.15em;
  font-weight: 600;
  font-family: var(--font-family-serif);
  flex-basis: calc(100% - 1.5rem);
  text-decoration: none;
}
.postlist-item-active .postlist-link {
  font-weight: bold;
}

/* Tags */
.post-tag {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-transform: capitalize;
  font-style: italic;
}
.postlist-item > .post-tag {
  align-self: center;
}

/* Tags list */
.post-metadata {
  display: flex;
  flex-wrap: wrap;
  gap: .5em;
  list-style: none;
  padding: 0;
  font-size: 0.9rem;
}
.post-metadata time {
  color: var(--color-gray-50);
}
.post-metadata.tags {
  padding: 1em 0 0;
  margin: 3em 0 0;
  border-top: var(--border);
}
.links-nextprev {
  font-size: 0.85rem;
  list-style: none;
  padding: 0;
  font-style: italic;
}
.post-metadata.tags a, .links-nextprev a {
  text-decoration-thickness: 1px;
}

.footnotes {
  font-size: 90%;
}

/* Direct Links / Markdown Headers */
.header-anchor {
  font-style: normal;
  font-size: 1em;
  margin-left: .1em;
}
a[href].header-anchor,
a[href].header-anchor:visited {
  color: transparent;
}
a[href].header-anchor:focus,
:hover > a[href].header-anchor {
  color: #aaa;
}

h2 + .header-anchor {
  font-size: 1.5em;
}

img {
  max-width: 100%;
  height: auto;
  margin: 0 auto;
  display: block;
}

table {
  width: 100%;
}

h1, h2, h3, h4, h5, h6 {
  font-weight: 600;
  margin: 1.75em 0 0.5em;
  color: var(--accent-color);
  font-family: var(--font-family-serif);

}

h1 {
  font-family: var(--font-family-serif);
  margin-top: 1em;
  color: var(--accent-color);
  font-size: 1.75em;
}

h1.hero {
  font-size: 1.6em;
  font-weight: 400;
  color: var(--color-gray-60);
  line-height: 1.3;
  letter-spacing: -0.75px;
  max-width: calc(var(--prose-width) - 115px);
  margin: 2em 0;
}
h1.hero strong {
  font-weight: inherit;
  color: var(--accent-color);
}

@media (min-width: 600px) {
  h1 {
    font-size: 2em;
  }
  h1.hero {
    font-size: 1.78em;
  }
}


strong {
  font-weight: 600;
}

pre[class*="language-"] {
  margin: 1.5rem 0;
}
code, pre[class*="language-"] {
  font-size: 85%;
}

code strong {
  font-weight: inherit;
  color: var(--accent-color);
  font-size: 150%;
  font-family: var(--font-family);
}

p:has(.button) {
  margin: 1.5em 0;
}

a.button, a.button[href], a.button[href]:visited, button.button {
  background: var(--light-accent-color);
  color: var(--light-background-color);
  text-decoration: none;
  padding: 8px 12px;
  font-family: var(--font-family-monospace);
  font-size: 80%;
  display: inline-block;
  border: 0;
}

a.button:hover, a.button[href]:hover, a.button[href]:visited:hover, button.button:hover {
  background: var(--light-accent-color-hover);
}

.projects-list dt {
  margin: 0.5em 0;
  font-weight: 600;
  font-size: 1.1em;
  letter-spacing: 0.2px;
}
.projects-list dd {
  margin: 0 0 1.5em;
}
.projects-list p {
  margin: 0.25em 0;
}

@media print {
  html, body {
    background: #fff;
  }
  header, footer {
    display: none;
  }
  main {
    padding-top: 0;
  }
  jc-container {
    padding: 0;
  }
}