@import '../variables';

.ltag__stackexchange--container {
  max-width: 620px;
  border: 1px solid var(--base-60);
  border-radius: 3px;
  box-shadow: $shadow;
  margin: 1.1em auto 1.3em;
  font-family: var(--ff-sans-serif);
  overflow: hidden;
  padding-top: 1rem;

  .ltag__stackexchange--title-container {
    border-bottom: 1px solid #eaecef;
    display: flex;
    flex-direction: column;

    header {
      display: flex;
      justify-content: space-between;
      .ltag__stackexchange--title {
        h1,
        .ltag__stackexchange--header {
          font-size: var(--fs-l);
          font-weight: var(--fw-normal);
          line-height: var(--lh-base);
          margin: 0em 0 0.5em;
          padding: 0 var(--su-3);

          .title-flare {
            background: $sky-blue;
            color: white;
            padding: 0px 7px;
            border-radius: 3px;
          }

          img {
            width: var(--su-7);
            display: inline-block;
            margin: 0 var(--su-2) 0 0;
            vertical-align: middle;
          }
        }
      }
      .ltag__stackexchange--post-metadata {
        font-size: 0.6em;
        span {
          display: inline-block;
          padding: 7px 6px;
          margin-left: 6px;
        }
      }
      .ltag__stackexchange--score-container {
        margin-right: 15px;
        display: flex;
        width: 50px;
        flex-direction: column;
        flex-wrap: nowrap;
        color: gray;
        font-size: 0.85em;
        align-self: center;
        img {
          position: initial;
          width: 16px;
          height: 16px;
          margin: var(--su-2) auto;
        }
        .ltag__stackexchange--score-number {
          width: 100%;
          height: 20px;
          text-align: center;
          padding-bottom: 10px;
          font-size: 0.8em;
        }
      }
    }
  }

  .ltag__stackexchange--body {
    padding: 1em 0.5em;
    max-height: calc(21vw + 165px);
    overflow: hidden;
    @media screen and (min-width: 430px) {
      max-height: calc(20vw + 153px);
    }
    @media screen and (min-width: 800px) {
      max-height: 310px;
    }

    h1,
    h2,
    h3,
    h4,
    h5,
    h6 {
      font-weight: 500 !important;
    }

    p {
      margin-top: 0px;
      padding: 0px;
      margin-bottom: 15px;
      font-size: 1.1rem;
    }

    code {
      border-radius: 3px;
      padding: 0.2em 5px 0px;
      margin: 0px;
      font-family: 'SFMono-Regular', Consolas, 'Liberation Mono', Menlo, Courier,
        monospace;
    }

    pre {
      width: 100%;
      margin: 0px;
      padding: 0.2em 0.6em;
      code {
        background-color: #f6f8fa;
        color: black;
        padding: 0em 0px 0px !important;
        line-height: 2em !important;
      }
    }

    .highlight pre,
    pre,
    pre code {
      overflow: auto;
      background-color: #f7f7f7;
      border-radius: 3px;
      box-sizing: border-box;
      color: black;
    }

    .highlight {
      font-size: 14px;
      margin-bottom: 16px;
      border-radius: 3px;
    }
  }

  .ltag__stackexchange--btn--container {
    padding: 0.1em 0 1.15em;
    z-index: var(--z-elevate);
    text-align: center;
    position: relative;
    box-shadow: 0 0 60px 42px var(--card-bg);
  }

  .ltag__stackexchange--btn {
    @extend .crayons-btn !optional;
    @extend .crayons-btn--secondary !optional;
    
    // A deprecated version of this liquid tag's HTML included a link _inside_ a button :-/
    // This `revert` is needed to make sure the button click still opens the content
    a {
      pointer-events: revert;
    }
  }
}
