@import "colors.less";
@import "vars.less";
@import "base.less";

body {
  background: @darker-grey;
}

.page-nav {
  text-align: right;

  ul {
    margin: 0;
    padding: 0;
  }

  li {
    line-height: 18px;
  }

  a.self {
    color: white;
  }
}

.post-meta {
  color: @light-grey;

  a {
    color: inherit;
    text-decoration: none;
    border-bottom: 1px solid @offest-white;

    &:hover {
      color: @blue-primary;
      border-color: @blue-primary;
    }
  }
}

.post-content {
  font-size: 18px;

  display: flex;
  flex-direction: column;
  align-items: center;

  blockquote, dl, h1, h2, h3, h4, h5, h6, ol, p, pre, ul {
    // prevent centering; intended only for full-width images
    min-width: 100%;
  }

  h1, h2, h3, h4, h5, h6 {
    // font-family: inherit;
  }

  h1 {
    margin-top: 1.5em;
  }

  h3 {
    font-size: initial;
  }

  p:first-child {
    font-size: 1.25em;
    line-height: 1.5em;
  }

  a {
    color: inherit;
    text-decoration: none;
    border-bottom: 1px solid @blue-primary;

    &:hover {
      color: @blue-primary;
    }
  }
}

.post-title {
  margin: 0;

  a {
    text-decoration: none;
    color: @darker-grey;
  }
}

.posts-title {
  border-top: 4px solid @darker-grey;
  padding-top: 10px;
}

.posts {
  .post {
    margin-bottom: 4em;
  }

  .post-title {
    margin-top: 0;
  }

  .post-header {
    margin-bottom: 1em;
  }

  .post-title {
    border: 0;
    padding: 0;
  }
}

.post-template {
  .post-header {
    margin-bottom: 2em;
  }

  .post-title {
    font-size: 40px;
  }
}

.pagination {
  margin-top: 2em;
}

.author-image {
  width: 24px;
  height: 24px;
  border-radius: 12px;
  vertical-align: middle;
  margin-top: -1px;
  margin-right: 4px;
}

h1 .author-image {
  width: 40px;
  height: 40px;
  border-radius: 20px;
  margin-top: -5px;
}

.posts .author-image {
  width: 20px;
  height: 20px;
  margin-right: 2px;
  margin-top: 0;
}

.kg-image-card {
  margin: 2em 0;

  &.kg-width-wide {
    max-width: 48em !important;
    min-width: 100%;
    width: 75vw;
  }

  &.kg-width-full {
    max-width: none;
    width: 98vw; // hack: avoid scrollbar
    margin-top: 2em;
  }
}

.kg-gallery-card {
  margin: 0 0 2em;
  max-width: 48em !important;
  min-width: 100%;
  width: 75vw;
}

.kg-image-card, .kg-gallery-card {
  img {
    max-width: 100%;
  }

  figcaption {
    color: @light-grey;
    text-align: center;
    max-width: 32em;
    margin: auto;
    font-size: 0.9em;
    line-height: 1.25em;
    padding: 0.66666em 0;
  }

  .kg-image-full + figcaption {
    margin-bottom: 1.33333em;
  }
}

.kg-gallery-container {
  display: flex;
  flex-direction: column;
}

.kg-gallery-row {
  display: flex;
  flex-direction: row;
  justify-content: center;
}

.kg-gallery-image img {
  display: block;
  margin: 0;
  width: 100%;
  height: 100%;
}

.kg-gallery-row:not(:first-of-type) {
  margin: 0.75em 0 0 0;
}

.kg-gallery-image:not(:first-of-type) {
  margin: 0 0 0 0.75em;
}

.kg-embed-card {
  margin: 0 0 2em;

  > * {
    margin-left: auto;
    margin-right: auto;
  }
}

.kg-code-card {
  min-width: 100%;
  margin: 0 0 2em;
}

.kg-code-card pre {
  margin: 0;
}

.kg-bookmark-card {
  width: 100%;
  position: relative;
}

.kg-bookmark-container {
  display: flex;
  flex-wrap: wrap;
  flex-direction: row-reverse;
  color: currentColor;
  font-family: inherit;
  text-decoration: none;
  border: 1px solid rgba(0, 0, 0, 0.1);
}

.kg-bookmark-container:hover {
  text-decoration: none;
}

.kg-bookmark-content {
  flex-basis: 0;
  flex-grow: 999;
  padding: 20px;
  order: 1;
}

.kg-bookmark-title {
  font-weight: 600;
}

.kg-bookmark-metadata,
.kg-bookmark-description {
  margin-top: .5em;
}

.kg-bookmark-metadata {
  align-items: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.kg-bookmark-description {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow: hidden;
}

.kg-bookmark-icon {
  display: inline-block;
  width: 1em;
  height: 1em;
  vertical-align: text-bottom;
  margin-right: .5em;
  margin-bottom: .05em;
}

.kg-bookmark-thumbnail {
  display: flex;
  flex-basis: 24rem;
  flex-grow: 1;
}

.kg-bookmark-thumbnail img {
  max-width: 100%;
  height: auto;
  vertical-align: bottom;
  object-fit: cover;
}

.kg-bookmark-author {
  white-space: nowrap;
  text-overflow: ellipsis;
  overflow: hidden;
}

.kg-bookmark-publisher::before {
  content: "•";
  margin: 0 .5em;
}
