@use "sass:math";
@use "colors";
@use "fonts";
@use "mixins" as *;

/*

VARIABLES
===============================================================================

*/
$gutter: 10px;
$padding: $gutter;
$max-width: 500px;
$max-height: math.div($max-width, 2);
$avatar-width: 256px;

/*

COLORS
===============================================================================

*/
$fg: white;
$link-color: lighten(colors.$green-600, 15%);
$link-color-hover: lighten(colors.$green-600, 25%);

:root {
  font: {
    size: 14pt;
    family: "Linux Libertine", "Times New Roman", Times, serif;
  }
  line-height: 1.5;
}

body {
  background-color: #{colors.$bg};
  display: flex;
  flex-direction: column;
  gap: $gutter;
  align-items: center;

  @include breakpoint("md") {
    flex-direction: row;
    justify-content: center;
    height: 100vh;
  }
}

main {
  width: 100%;
  gap: $gutter;
  color: #{$fg};
  display: flex;
  flex-direction: column;

  @include breakpoint("md") {
    max-width: $max-width;
  }

  article {
    background: #{colors.$base-950};
    border-top: solid #{colors.$base-900};
    border-bottom: solid #{colors.$base-900};
    padding: 1em;
    font-size: 1rem;

    &:first-child {
      margin-top: 0;
    }

    @include breakpoint("md") {
      border: solid #{colors.$base-900};
      max-height: 400px;
      overflow: scroll;
      padding: 2em;
    }

    h1 {
      font-size: 2em;
      a {
        font-size: 0.5em;
      }
    }

    h2 {
      font-weight: bold;
    }

    *:not(li) + *:not(li) {
      margin-top: 1em;
    }

    ol,
    ul {
      all: revert;
      margin: #{$gutter} 0;
      padding-left: 1em;
    }
  }

  a {
    color: #{$link-color};
    text-decoration: underline #{$link-color} 2px;

    &:hover {
      color: #{$link-color-hover};
    }
  }
}

aside {
  margin-top: #{$gutter * 2};
  margin-bottom: #{$gutter * 2};
  width: #{$avatar-width};

  @include breakpoint("md") {
    margin-top: 0;
    margin-right: #{$gutter};
  }

  img {
    width: 100%;
    image-rendering: pixelated;
    max-width: #{$avatar-width};
  }
}

.entry-button {
  margin: auto;
  margin-bottom: #{$gutter};
  image-rendering: pixelated;
  font-size: 1.5em;
  font-weight: bold;

  &:hover {
    font-style: italic;
  }

  &::after {
    content: " >>";
    color: #525252;
    font-style: normal;
    text-decoration: underline #{colors.$bg} 2px;
  }

  @include breakpoint("md") {
    margin-right: 0;
  }
}
