/* ** Reset from 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 */
*:not(dialog) { margin: 0; }
/* 3. Enable keyword animations */
@media (prefers-reduced-motion: no-preference) { html { interpolate-size: allow-keywords; } }
/* 4. Add accessible line-height */
body { line-height: 1.5; }
/* 5. Improve text rendering (only for high dpi...?) */
/*body { -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; }

/* my own stuff */
html { overscroll-behavior-y: none; }
p, ul { margin-bottom: 1.5rem; &:last-child { margin-bottom: 0; } }
iframe { border: none; display: block; }

/* https://chrisnager.github.io/ungrid is convenient */
@media (min-width: 30em) {
  .row { width: 100%; display: table; table-layout: fixed; border-spacing: 10px 0; }
  .col { display: table-cell; }
}

body {
  max-width: 720px;
  padding: 0 20px;
  margin: 0 auto;
  font-family: sans-serif;
  font-size: 1.125rem;
  line-height: 1.4;
  background: #FBFBFB;

  min-height: 100dvh;
  display: flex;
  flex-direction: column;
}

a {
  color: #444;
  &:hover { color: #666; }
  /*text-decoration: none;*/
}

header {
  display: flex;
  /*flex-direction: column;*/
  align-items: center;
  margin-top: 10px;

  @media (max-width: 980px) {
    flex-direction: column;
  }

  a {
    text-decoration: none;
  }

  h1 {
    margin-bottom: 0;
    margin-top: 0;
    text-transform: uppercase;
    font-size: 3rem;
    font-family: Arial Rounded MT Bold, Arial, sans-serif;
    font-weight: 800;
    letter-spacing: -1px;
    color: #FFEB3B;
    -webkit-text-stroke: 3px black;
    paint-order: stroke fill;
    position: relative;

    &::after {
      content: 'slipstream';
      text-transform: uppercase;
      position: absolute;
      left: 4px;
      top: 4px;
      z-index: -1;
      background-color: black;
      background-clip: text;
      -webkit-background-clip: text;
      -webkit-text-fill-color: black;
      -webkit-text-stroke: 1px black;
      paint-order: stroke fill;
    }
  }
  p { margin: 0; }
  nav {
    margin-left: 26px;
    display: flex;
    justify-content: center;
    align-items: center;

    a {
      color: black;
      background: white;
      padding: 4px 8px;
      border-radius: 3px;
      border: 1px solid black;
      font-size: 0.8rem;
      position: relative;

      &:hover {
        background: #FFEB3B;
        color: #333;
      }

      &::after {
        position: absolute;
        box-sizing: content-box;
        content: ' ';
        left: 1px;
        top: 1px;
        z-index: -1;
        background-color: black;
        border-radius: 3px;
        border: 1px solid black;
        width: 100%;
        height: 100%;
      }
    }
    p {
      margin-bottom: 0;
    }
  }
}

main {
  padding: 2rem 2px;
  > .title {
    margin: 0;
    margin-bottom: 1.6rem;
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    .post-date {
      font-family: monospace;
      flex-shrink: 0;
      font-size: 0.9rem;
    }
  }
  p {
    margin-top: 0;
  }
  mark {
    background-color: #FFEB3B;
  }
}

.muted { color: #AAA; }

#upvote-form {
  grid-column: 1;
  margin-top: 20px;
  justify-self: start;
  border: 1px solid black;
  border-radius: 3px;
  background: white;
  color: black;
  padding: 4px 8px;
  position: relative;

  .upvote-button { color: black !important; }
  .upvote-button:disabled { color: black !important; }
  &:has(.upvote-button:disabled) { background: #FFEB3B !important; }

  &::after {
    position: absolute;
    box-sizing: content-box;
    content: ' ';
    left: 1px;
    top: 1px;
    z-index: -1;
    background-color: black;
    border-radius: 3px;
    border: 1px solid black;
    width: 100%;
    height: 100%;
  }
}

ul#post-list {
  padding: unset;
  margin: unset;
  margin-bottom: 1.5rem;
  > li {
    display: flex;
    flex-direction: row-reverse;
    justify-content: space-between;
    align-items: baseline;
    column-gap: .375em;
    margin: 0;
    margin-bottom: 0.5rem;
    border: 1px solid black;
    border-radius: 3px;
    background: white;
    padding: 1rem 1.2rem;
    position: relative;

    &::after {
      position: absolute;
      content: ' ';
      box-sizing: content-box;
      left: 1px;
      top: 1px;
      z-index: -1;
      background-color: black;
      border-radius: 3px;
      border: 1px solid black;
      width: 100%;
      height: 100%;
    }

    a {
      color: black;
      text-decoration: none;
      font-size: 1.2rem;
    }
    .post-date {
      white-space: nowrap;
      font-family: monospace;
      margin-left: 16px;
      color: #666;
      font-size: 0.9rem;
    }
  }
}

footer {
  color: #888;
  display: flex;
  justify-content: center;
  margin-top: auto;
  padding: 6px 0;

  a {
    color: #555;
    &:hover { color: #999; }
  }
}
