/* CSS Reset - https://www.joshwcomeau.com/css/custom-css-reset/ */
/* 1. Use a more-intuitive box-sizing model */
*, *::before, *::after {
  box-sizing: border-box;
}

/* 2. Remove default margin */
* {
  margin: 0;
}

/* 3. Enable keyword animations */
@media (prefers-reduced-motion: no-preference) {
  html {
    interpolate-size: allow-keywords;
  }
}

body {
  /* 4. Add accessible line-height */
  line-height: 1.5;
  /* 5. Improve text rendering */
  -webkit-font-smoothing: antialiased;
}

/* 6. Improve media defaults */
img, picture, video, canvas, svg {
  display: block;
  max-width: 100%;
}

/* 7. Inherit fonts for form controls */
input, button, textarea, select {
  font: inherit;
}

/* 8. Avoid text overflows */
p, h1, h2, h3, h4, h5, h6 {
  overflow-wrap: break-word;
}

/* 9. Improve line wrapping */
p {
  text-wrap: pretty;
}
h1, h2, h3, h4, h5, h6 {
  text-wrap: balance;
}

/*
  10. Create a root stacking context
*/
#root, #__next {
  isolation: isolate;
}

/* variables */

:root {
  --page-margin: 1rem;
}

/* global styles */

html {
  font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;
  background-color:ghostwhite;
  color: rgba(0,0,0,0.9);
}

a {
  color: inherit;
}


/* component styles */

.header {

  display: flex;
  align-items: baseline;
  justify-content: space-between;
  padding: var(--page-margin);
  padding-bottom: 0;
  @media (max-width:512px) {
    flex-direction: column;
    gap: 0.5rem;
  }

  .masthead {
    .logo {
      color: inherit;
      font-weight: 700;
      text-decoration: none;
    }
    .tagline {
      font-size: 0.875rem;
      margin-top: -0.25rem;
      @media (max-width: 512px){
        display: none;
      }
    }
  }

  .nav {
    display: flex;
    gap: 1rem;
    list-style-type: none;
    padding: 0;

    .nav-current {
      a {
        opacity: 1;
      }
    }

    a {
      text-decoration: none;
      opacity: 0.5;
    }

  }

}

.content {
  padding: var(--page-margin);
}

.post-preview {
  padding: 1rem 0;
  border-bottom: 1px solid rgba(0,0,0,0.1);
}

.post-template .post,
.page-template .post {
  margin-top: 5rem;
  @media (max-width:512px){
    margin-top: 1rem;
  }
}

.post {

  .feature-image {
    margin-bottom: 1rem;
  }

  .editor-content {

    p {
      /*text-align: justify;
      hyphens: auto;
      hyphenate-limit-chars: 10 3 4;*/
    }

    &>p:not(:first-child):not(*:not(p) + p) {
      text-indent: 4ch;
    }

    &>p:has(+ ul),
    &>p:has(+ ol) {
      text-indent: 0 !important;
      margin-top: 1rem;
    }

    &>p + ul,
    &>p + ol {
      margin-top: 1rem;
      margin-bottom: 1rem;
    }

    h2 {
      font-size: 1.125rem;
      line-height: 1.1;
      margin-top: 1rem;
      margin-bottom: 0.375rem;
      text-wrap: balance;
    }

    h3 {
      font-size: 1rem;
      line-height: 1.1;
      margin-top: 1rem;
      margin-bottom: 0.375rem;
      text-transform: uppercase;
      opacity: 0.75;
      text-wrap: balance;
    }

    blockquote {
      border-left: 4px solid rgba(0,0,0,0.25);
      margin: 1rem 0;
      padding: 1rem;
      font-family: Georgia, 'Times New Roman', Times, serif;
    }

    hr {
      border: 0;
      height: 0;
      margin: 2rem 0;
      border-top: 1px solid rgba(0, 0, 0, 0.1);
    }

    figcaption {
      text-align: center;
    }

    .kg-width-wide {
      position: relative;
      width: 85vw;
      min-width: 100%;
      margin: auto calc(50% - 50vw);
      transform: translateX(calc(50vw - 50%));
    }

    .kg-width-full {
      position: relative;
      width: 100vw;
      left: 50%;
      right: 50%;
      margin-left: -50vw;
      margin-right: -50vw;
    }

    .kg-image-card {
      margin-top: 1rem;
      margin-bottom: 1rem;
      img {
        height: auto;
      }
      figcaption {
        margin-top: 0.25rem;
      }
    }
    
  }

  /* for the custom-poetic.hbs post template. overrrides the indent for pages that aren't prose-heavy */
  &.poetic .editor-content {
    &>p:not(:first-child):not(*:not(p) + p) {
      text-indent: 0 !important;
    }
  }
}

.front-matter {

  margin-bottom: 1rem;

  .post-title {
    font-size: 1.25rem;
    line-height: 1.1;
    font-weight: 700;

    a {
      text-decoration: none;
    }

  }
}

.tags-list {
  margin-top: 0.5rem;

  .tag {
    display: inline-block;
    padding: 0.5rem 0.75rem;
    font-size: 0.875rem;
    line-height: 1;
    background-color: rgba(0,0,0,0.1);
    border-radius: 100px;
    text-decoration: none;
  }

}

.bio {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin: 2rem 0;

  img {
    width: 64px;
    height: 64px;
    border-radius: 100px;
  }

}

.container {
  max-width: 640px;
  margin: 0 auto;
}

.pagination {
  margin: 2rem 0;
  display: flex;
  justify-content: space-between;

  a {
    text-decoration: none;
  }

  .disabled {
    cursor: not-allowed;
    opacity: 0.15;
    user-select: none;
  }
}

.footer {
  text-align: center;
  padding: var(--page-margin);
}