@import '../../partials/variables';
@import '../../partials/colors';
@import '../../lib/functions';
@import '../../elements/button/';

.post {
  display: flex;
  flex-direction: column;
  align-items: center;
  position: relative;

  width: 35%;

  @media (max-width: $wqhd-breakpoint) {
    width: 50%;
  }

  @media (max-width: $mobile-breakpoint) {
    width: 100%;
    height: 100%;

    margin: 0;
  }

  height: max-content;

  margin: 2% auto 5% auto;
  padding: 0 0 20px 0;

  overflow-y: auto;

  background-color: var(--background-color);

  border-radius: 0.25em;
  cursor: initial;


  &__container {
    width: 90%;
  }

  &__header {
    display: flex;
    flex-direction: column;
    align-items: center;

    position: sticky;
    top: 0;

    background-color: var(--background-color);
  }

  &__actions {
    display: flex;
    justify-content: flex-end;
    width: 100%;

    padding: 20px 0;
    gap: 20px;

    @media (max-width: $mobile-breakpoint) {
      justify-content: space-between;
      flex-direction: row-reverse;

      gap: 0;
    }
  }

  &__heading {
    display: flex;
    flex-direction: column;
    padding: 20px 0 10px 0;

    @media (min-width: $hd-breakpoint) {
      width: 80%;
    }

    @media (max-width: $hd-breakpoint) {
      width: 100%;
      padding: 0;
    }
  }

  &__title {
    font-size: map-deep-get($post, "header-font-size");

    &--read {
      text-decoration: line-through;
    }
  }

  &__date {
    font-size: small;
  }

  &__author {
    font-size: small;
  }

  &__rule, &__category {
    & a {
      color: var(--font-color);
    }
  }

  &__body {
    display:flex;
    flex-direction: column;

    padding: 10px 0 30px 0;

    @media (min-width: $hd-breakpoint) {
      width: 72%;
    }

    @media (max-width: $hd-breakpoint) {
      width: 90%;
      padding: 0;
    }

    & p {
      padding: 10px 0;
    }

    & h1, h2, h3 {
      margin: 20px 0 5px 0;
    }

    & img, video {
      padding: 10px 0;

      width: max-content;
      max-width: 100%;
    }

    & ul, ol {
      list-style-position: inside;
    }
  }

  &__close-button {
    background-color: var(--info-color);
    color: $white;

    & i {
      padding: 0 $fa-padding 0 0;
    }
  }

  &__meta {
    display: flex;
    flex-direction: row;
    align-items: center;

    margin: 15px 0;
    gap: 10px;

    @media (max-width: $hd-breakpoint) {
      flex-wrap: wrap;
    }
  }

  &__text, &__buttons {
    display: flex;
    flex-direction: inherit;
    align-items: inherit;
    gap: inherit;
  }

  &__text {
    @media (max-width: $hd-breakpoint) {
      flex: 100%;
    }
  }

  &__buttons {
    @media (max-width: $hd-breakpoint) {
      flex-wrap: inherit;
    }
  }

  &__link {
    @media (max-width: $tablet-breakpoint) {
      @include button;

      background-color: var(--info-color);
      color: $white;
      width: 100px;
    }
  }

  &__save {
    @media (max-width: $tablet-breakpoint) {
      @include button;

      background-color: var(--confirm-color);
      color: $white;
      width: 100px;
    }
  }
}
