@import 'variables';

.post-field {
  font-family: 'Roboto Mono', monospace !important;
}

.upload-form {
  margin: 1em 0;

  button[type="submit"] {
    display: none;
  }
}

.post--container {
  max-width: 100%;

  &.grid {
    margin: 0;
  }

  .grid--cell.is-flexible {
    flex-grow: 1;
    flex-shrink: 1;
    min-width: 0;
    width: 0;
  }
}

.badge.is-tag {
  margin: 0.1rem;
  max-width: 100%;
}

h1 .badge.is-tag.is-master-tag {
  position: relative;
  top: -0.4em;
}

.vote-button svg {
  font-size: 20px;
}

.post-list--meta {
  font-size: 14px;
}

.post-list--tags {
  max-width: 100%;
}

.post-list--title {
  font-size: 19px;
  width: 100%;

  a {
    display: inline-block;
    width: 100%;
    overflow-wrap: break-word;
  }

  del {
    background-color: transparent;
  }
}

.post-list--content {
  font-size: 14px;
  width: 100%;
  overflow-wrap: break-word;
}

.post--action-dialog {
  display: none;

  &.is-active {
    display: block;
  }

  label.form-element {
    margin: 0;
  }

  .form-caption {
    margin: 0;
    margin-top: 4px !important;

    p {
      margin: 0;
    }
  }
}

.js-close-box .widget--body {
  padding: 0.25em 0.5em;

  .grid--cell:first-child {
    padding-top: 0.6em;
  }
}

.post-preview {
  padding: 1em;
  border-bottom: 1px solid $muted-graphic;
  margin-bottom: 1em;

  width: 100%;
  overflow-wrap: break-word;

  * {
    max-width: 100%;
  }
}

.post-field.widget--body {
  margin: -1px -1px 3px -1px;
  border-radius: 0;
  width: calc(100% + 2px);

  + .widget--footer {
    border-top: none;
    align-items: center;
    margin: 0;

    &.mdhint {
      display: flex;
      flex-wrap: wrap;
      gap: 1em 0;
      justify-content: space-between;

      & > * {
        padding: 0;
      }
    }

    & > .draft-status {
      text-align: center;
      transition: opacity 0.5s ease-in-out;
    }
  }
}

.post--title {
  display: flex;
  align-items: center;
  flex-direction: column-reverse;

  .post--title-text {
    width: 100%;
  }

  del {
    background-color: transparent;
  }

  @media screen and (min-width: $screen-md) {
    flex-direction: row;

    & > .badge {
      margin-left: 0.5em;
      display: flex;
      align-items: center;

      & > i {
        margin-right: 0.2em;
      }
    }
  }
}

.post--tags {
  padding: 0.2em 0;
}

.post--meta {
  margin: 0.2em 0;

  .post-meta--post,
  .post-meta--user {
    padding: 0.5rem;
    border-radius: 5px;
    color: $muted-text;
    margin: 0.1em 0;

    @media screen and (min-width: $screen-md) {
      margin: 0;
    }
  }

  .post-meta--user {
    background: #EEE;
    align-self: flex-end;

    @media screen and (min-width: $screen-md) {
      align-self: flex-start;
    }
  }

  .post-meta--post {
    font-size: 0.9em;

    & > * {
      margin: 0.1em 0;
    }
  }
}

.post--container {
  display: flex;
  flex-direction: column;

  @media screen and (min-width: $screen-sm) {
    flex-direction: row;
  }
}

.post--votes {
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: center;

  @media screen and (min-width: $screen-sm) {
    flex-direction: column;
  }
}

.post--no-votes {
  font-size: 2em;
  color: $muted-text;
  font-weight: lighter;
}

.post--actions {
  .droppanel {
    max-width: 20em;
  }
}

.post--content {
  flex: 1;
  word-break: break-word;

  * {
    max-width: 100%;
  }

  @media screen and (min-width: $screen-sm) {
    max-width: calc(100% - 3em);
  }

}

.post--body p {
  width: 100%;
  overflow-x: auto;
  overflow-y: hidden;
  padding: 0 0 1px 0;
}

pre code.hljs {
  padding: unset !important;
}

.failed-validation {
  border: 2px solid #d21919 !important;
}

.js-thread-title {
  overflow-wrap: break-word;
}
