/*
 * Media query constants:
 *   content-width: 860px + 96px = 956px (why?)
 *   main-gap: 2rem = 32px
 *   main content breakpoint = 956 + 32 + 32 = 1020px 
 *   article list breakpoint: 464px
 */

* {
  box-sizing: border-box;
}

body {
  /* display: flex;
  flex-direction: column; */
  margin: 0;
  min-height: 100vh;
  align-items: center;

  --body-font-family: "Inter", system-ui, sans-serif;
  --header-font-family: "Inter", system-ui, sans-serif;
  --content-width: calc(860px + 96px);
  --border-width: 1px;

  /* --primary-color: #070ff4;
  --text-color: white; */

  /* --bg-color: #000b1f;
  --primary-color: #53a3ff;
  --text-color: #53a3ff;
  --link-color: var(--text-color); */

  --bg-color: #27272a; /* Zinc 800 */
  --primary-color: #6366f1; /* Indigo 500 */
  --text-color: #f4f4f5; /* Zinc 100 */
  --header-text-color: #a5b4fc; /* Indigo 300 */
  --secondary-text-color: #a1a1aa; /* Zinc 400 */
  --link-color: var(--text-color);

  --surface-color: white;
  --text-on-surface-color: var(--bg-color);
  --link-on-surface-color: var(--text-on-surface-color);

  --main-gap: 2rem;

  color: var(--text-color);
  background-color: var(--bg-color);

  font: 400 1.25em/1.5 var(--body-font-family);
  /* font-family: var(--body-font-family); */

  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

body[theme="blue"] {
  --bg-color: #232946;
  --primary-color: #b8c1ec;
  --text-color: #b8c1ec;
  --header-text-color: #fffffe;
}

body[theme="sand"] {
  --bg-color: #fef6e4;
  --primary-color: #172c66;
  --text-color: #172c66;
  --header-text-color: #001858;
  --surface-color: #f3d2c1;
  --accent-color: #f582ae;
}

body {
  --playground-tab-bar-background: var(--bg-color);
  --playground-preview-toolbar-background: var(--bg-color);
  --playground-border: solid 1px var(--text-color);
  --playground-highlight-color: var(--text-color);
  --playground-bar-height: 48px;  
  --playground-code-font-size: 16px;
  --playground-tab-bar-font-size: 16px;
  /* --playground-tab-bar-indicator-color: var(--accent-color); */
}

playground-tab-bar, playground-preview {
  font-family: inherit;
  border: var(--playground-border);
}
playground-preview {
  background-color: rgba(255, 255, 255, 0.5);
}

playground-preview::part(preview-toolbar) {
  display: none;
}

body > header {
  color: var(--text-color);
  position: sticky;
  top: 0;
  z-index: 1000;
  background-color: var(--bg-color);
  display: flex;
  flex-direction: column;
  align-self: stretch;
  font-weight: 600;
  font-family: var(--header-font-family);
  border-bottom: solid var(--border-width) currentcolor;
  padding: 1.5rem max((100% - var(--content-width)) / 2, var(--main-gap));

  h2 {
    font-size: 1.25rem;
    font-weight: normal;
    margin: 0;
  }

  a {
    text-decoration: none;
  }

  a:hover {
    text-decoration: underline;
    /* opacity: 50%; */
  }
}

/* header {
  color: var(--header-text-color);
} */

section.title {
  display: flex;
  flex-direction: column;
  justify-content: center;
  flex: 1;
  text-align: center;
  margin: 96px 0;
  padding: 0 max((100% - var(--content-width)) / 2, var(--main-gap));
  color: var(--header-text-color);

  h1 {
    /* font-display: fallback; */
    line-height: 1em;
    margin: 0;
    font-size: 5rem;
    /* text-transform: lowercase; */
    /* text-shadow:
    -1px -1px 0 #ffffff4f,  
    1px -1px 0 #ffffff4f,
    -1px 1px 0 #ffffff4f,
      1px 1px 0 #ffffff4f; */
    /* -webkit-text-stroke: 3px white; */

    a {
      text-decoration: none;
    }
  }
}

/* section.title h1  */

a {
  color: inherit;
  text-decoration-thickness: 3px;
  text-decoration-color: var(--link-color);
}

a:hover {
  /* text-decoration: underline; */
  text-decoration-thickness: 4px;
  text-decoration-color: currentColor;
  color: inherit;
}

/* #site-icon {
  display: inline-flex;
  content: 'JF';
  border: solid var(--border-width) var(--text-color);
  background: var(--text-color);
  color: var(--bg-color);
  width: 1.75em;
  height: 1.75em;
  border-radius: calc(1.75em / 2);
  align-items: center;
  justify-content: center;
  padding: 0 8px;
  margin-right: 8px;
} */

nav > ul {
  display: inline-flex;
  list-style: none;
  align-items: baseline;
  /* font-size: 0.875em; */
  /* border-bottom: solid var(--border-width) currentcolor; */
  text-transform: lowercase;
  /* padding: 16px 4px; */
  padding: 0;
  margin: 0;
  gap: var(--main-gap);
}

div.logo {
  border-radius: 50%;
  width: 48px;
  height: 48px;
  background-color: var(--text-color);
  color: var(--bg-color);
  text-transform: none;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* nav > ul > li:not(:last-child)::after {
  height: 36px;
  content: '|';
} */

/* nav > ul a:hover {
  background-color: rgba(0, 0, 0, 0.5);
  border-color: currentcolor;
  opacity: 1;
} */

/* nav > ul a svg {
  fill: currentcolor;
  vertical-align: middle;
} */

main {
  padding: 1.5rem max((100% - var(--content-width)) / 2, var(--main-gap));

  @media(width <= 464px) {
    padding: 1.5rem 1rem;
  }

  /* max-width: var(--content-width); */
  /* margin: 48px 24px; */
  /* padding: 48px;
  background: white;
  border-radius: 16px; */
}

footer {
  height: 4em;
}

section.article-list {
  display: flex;
  flex-wrap: wrap;
  gap: var(--main-gap);
  justify-content: center;

  a {
    display: block;
    margin: 0;
    padding: 0;
    text-decoration: none;
    /* min-width: 400px;
    max-width: calc(50% - 16px); */
    max-width: calc((var(--content-width) - var(--main-gap)) / 2);
  }

  a:hover > article::before {
    content: " ";
    position: absolute;
    top: calc(5 * var(--border-width));
    left: calc(5 * var(--border-width));
    width: 100%;
    height: 100%;
    background: var(--text-color);
    z-index: -1;
  }

  a > article {
    position: relative;
    display: flex;
    flex-direction: column;
    /* background: white; */
    /* color: var(--primary-color); */
    border: solid var(--border-width) var(--text-color);
    background: var(--bg-color);
    /* border-radius: 16px; */
    /* overflow: clip; */
    /* margin-bottom: 24px; */
    /* margin: 16px; */
    /* padding: 32px; */
    box-sizing: content-box;
    height: 100%;

    img {
      /* width: calc(100% + 32px); */
      /* position: relative; */
      width: 100%;
      aspect-ratio: 16 / 9;
      object-fit: cover;
      /* margin: -16px -16px 0 -16px; */
      /* box-sizing: border-box; */
      /* filter: grayscale(100%);
      mix-blend-mode: luminosity; */
      margin: 0;
      border-bottom: solid 1px var(--text-color);
    }

    header {
      display: flex;
      flex-direction: column;
      /* margin: 16px 0; */
      /* border-left: solid 4px var(--text-color); */
      border-bottom: solid 1px var(--text-color);
      /* padding-left: 16px; */
      /* padding: 0.5em 1em; */
      /* color: var(--header-text-color); */

      h2 {
        margin: 0;
        padding: 1rem;
        font-size: 1.6rem;
        border-bottom: solid var(--border-width) var(--text-color);
      }

      .byline {
        display: flex;
        font-size: 1rem;
      
        span {
          padding: .75rem 1rem;
          display: flex;
          flex-wrap: wrap;
          gap: 1rem;
          vertical-align: baseline;
        }
      
        span:not(:last-child) {
          border-right: solid var(--border-width) var(--text-color);
        }

        .tag-chip {
          padding: 6px 12px;
          font-size: 0.75rem;
          vertical-align: middle;
        }
      }
    }

    .post-excerpt {
      /* color: var(--secondary-text-color); */
      padding: 1em;
    }
  }
}

h1,
h2,
h3,
h4,
h5,
h6 {
  font-family: var(--header-font-family);
  color: var(--header-text-color);
}

body.page main h1.title {
  text-align: center;
}

body.post {
  main {
    /* background: white;
  color: var(--text-on-surface-color); */
    /* padding: 48px;
  border-radius: 16px;
  margin: 48px; */
    margin-top: 48px;

    @media(width <= 464px) {
      padding: 1.5rem 0;

      article.post-content {
        header {
          img {
            border-width: var(--border-width) 0 0 0;
          }
          .title {
            border-width: 0 0 var(--border-width) 0;
          }
          .byline {
            border-left: none;
            margin-right: -1px;
          }
        }
        div.content {
          border-width: 0 0 var(--border-width) 0 !important;
        }
      }
    }
        
    article.post-content {      
      /* border: solid var(--border-width) var(--text-color); */
      /* padding: 0 2em; */

      display: flex;
      flex-direction: column;

      header {
        display: flex;
        flex-direction: column;

        img {
          border: solid var(--text-color);
          /* border-width: var(--border-width) 0 0 0; */
          border-width: var(--border-width) var(--border-width) 0 var(--border-width);
        }

      }

      div.content {
        position: relative;
        padding: 2rem;
        border: solid var(--text-color);
        /* border-width: 0 0 var(--border-width) 0; */
        border-width: 0 var(--border-width) var(--border-width) var(--border-width);
      }

      p > img {
        text-align: center;
        display: block;
        margin: auto;
        background: white;
        border: solid var(--border-width) var(--text-color);
        /* border-width: var(--border-width) calc(var(--border-width) * 2) calc(var(--border-width) * 2) var(--border-width); */
      }
    }
  }

  header img {
    width: 100%;
    aspect-ratio: 16 / 9;
    object-fit: cover;
    border-bottom: solid var(--border-width) var(--text-color);
    /* margin: 0 -2em; */
  }

  .title {
    padding: 2rem;
    border: solid var(--border-width) var(--text-color);
  }

  .byline {
    display: flex;
    flex-wrap: wrap;
    /* border-bottom: solid var(--border-width) var(--text-color); */
    border-left: solid var(--border-width) var(--text-color);
  
    span {
      padding: 1rem 2rem;
      display: flex;
      flex-wrap: wrap;
      gap: 1rem;
      vertical-align: middle;
      align-content: center;
      border: solid var(--text-color);
      border-width: 0 var(--border-width) var(--border-width) 0;
      flex: auto;
    }
  
    span:not(:last-child) {
      border-right: solid var(--border-width) var(--text-color);
    }
  }

  h1 {
    font-size: 4rem;
    line-height: 1.25;
    margin: 0;

    @media(width <= 1020px) {
      font-size: 3rem;
    }

    @media(width <= 464px) {
      font-size: 2rem;
    }
  }

  h2 {
    display: flex;
    flex-direction: column;
    margin-top: 48px;
    gap: 8px;
    /* width: fit-content; */
    /* color: var(--header-text-color); */
  }
}



/* header::after {
  content: '';
  position: absolute;
  top: 16px;
  left: 16px;
  right: -16px;
  bottom: -16px;
  border: solid 1px black;
} */

/* .header-cover {
  position: absolute;
  width: 100%;
  height: 100%;
  left: 0;
  top: 0;
  background: no-repeat scroll center center/cover #000;
  animation: 0.5s ease-in forwards fadein;
  opacity: 0.9;
} */

/* .header-cover::after {
  position: absolute;
  width: 100%;
  height: 12em;
  left: 0;
  bottom: 0;
  z-index: 8;
  content: "";
  background: linear-gradient(
    to bottom,
    rgba(0, 0, 0, 0) 0%,
    rgba(0, 0, 0, 0.5) 100%
  );
} */

/* header.home .header-content,
header.tag .header-content {
  text-align: right;
}
*/

/* .header-content {
  max-width: var(--content-width);
} */

/* Home Page */

header.home {
  padding: 3em 0.5em 1em;
  background: transparent;
  border: solid 1px black;
  text-shadow: none;
  color: black;
  margin-bottom: 2em;
  /* padding: 9em 0 10em; */
}

header.home h1 {
  font-size: 3em;
}

header.home .description {
  font-size: 1.5em;
  margin: 0.25em auto;
  line-height: 1.5em;
}

/* .header-image-frame {
  background-image: repeating-linear-gradient(
    45deg,
    currentcolor 0%,
    currentcolor 0.5%,
    transparent 0.5%,
    transparent 1.5%
  );
  padding: 0 8px 8px 0;
}

.header-image-frame:hover {
  background-image: repeating-linear-gradient(
    45deg,
    transparent 0%,
    transparent 1%,
    currentcolor 1%,
    currentcolor 1.5%
  );
} */

/* .post-title {
  position: relative;
  z-index: 10;
  margin: 0 0 .25em;
  font-weight: 700;
} */

.post-title a {
  text-decoration: none;
}

.post-title a:hover {
  text-decoration: underline;
}

/* .post-meta {
  position: relative;
  z-index: 10;
  display: block;
  margin-bottom: 1.334em;
  font-family: var(--header-font-family);
  font-size: 0.75em;
  font-weight: 400;
  line-height: 1.334em;
  color: #8a9199;
} */

.post-meta a {
  text-decoration: none;
  color: inherit;
}

.post-meta a:hover {
  text-decoration: underline;
}

/* header.post .post-meta {
  color: #fff;
  opacity: 0.8;
} */

#home-button {
  position: fixed;
  top: 0;
  margin: 1em;
  z-index: 200;
}

a.button,
.tag-chip {
  display: inline-block;
  font-family: var(--header-font-family);
  border: solid var(--border-width) currentColor;
  text-decoration: none;
  padding: 8px 16px;
  font-size: 0.75em;
  font-weight: 500;
  line-height: 1.334em;
  white-space: nowrap;
}

a.tag-chip {
  color: var(--link-color);
}

a.tag-chip:hover {
  background: var(--text-color);
  color: var(--bg-color);
}

blockquote {
  margin: 0 0 2em;
  padding: 1em;
  box-sizing: border-box;
  border-left: 0.25em solid var(--accent-color);
  font-style: italic;
  font-weight: 400;
  color: var(--header-text-color);
  background: var(--surface-color);
}

blockquote p:last-child {
  margin-bottom: 0;
}

blockquote p {
  margin: 0 0 1em;
}

/* pre {
  margin: 0 0 2em !important;
}

code[class*="language-"],
pre[class*="language-"] {
  font-size: 0.9em !important;
}

pre[class*="language-"] {
  position: relative;
  max-width: 50%;
  width: 50%;
} */

bluesky-likes img {
	block-size: 1em;
	vertical-align: -0.16em;
}
