@import '../constants/colors.scss';

body,
html {
  margin: 0;
  padding: 0;
}

#page-layout {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  width: 100%;
  background-color: #fff;

  > main {
    flex-grow: 1;
  }

  section.page-baseline {
    margin: 30px auto;
    text-align: left;

    h1 {
      font-size: 1.8rem;
      line-height: 2.8rem;
      margin: 10px 0 16px;
      color: $darkestGrey;

      @media only screen and (min-width: 1px) and (max-width: 600px) {
        font-size: 1.4rem;
        line-height: 1.9rem;
        margin: 12px 0 16px;

        color: $darkestGrey;
      }
    }
  }

  section.page-body-container {
    padding: 35px 0 60px;
    background: $lightGrey;
  }

  .default-grid {
    display: grid;
    grid-template-columns: 31% 31% 31%;
    grid-gap: 30px 3%;

    @media only screen and (min-width: 550px) and (max-width: 920px) {
      grid-template-columns: 48% 48%;
      grid-gap: 30px 4%;
    }

    @media only screen and (min-width: 1px) and (max-width: 600px) {
      grid-template-columns: 100%;
      grid-gap: 30px 0%;
    }
  }

  .two-column-grid {
    display: grid;
    grid-template-columns: 49% 49%;
    grid-gap: 30px 2%;

    @media only screen and (min-width: 550px) and (max-width: 920px) {
      grid-template-columns: 48% 48%;
      grid-gap: 30px 4%;
    }

    @media only screen and (min-width: 1px) and (max-width: 600px) {
      grid-template-columns: 100%;
      grid-gap: 30px 0%;
    }
  }

  .left-column-grid {
    display: grid;
    grid-template-columns: 25% 72%;
    grid-gap: 20px 3%;

    @media only screen and (min-width: 1px) and (max-width: 920px) {
      grid-template-columns: 100%;
      grid-gap: 0 0;

      &.desktop-only {
        > .left-column {
          display: none;
        }
      }
    }
    .sticky-column {
      position: sticky;
      overflow: hidden;
      padding-bottom: 15px;
    }
  }
}

a.dont-apply-link-style {
  box-shadow: none;
}

.layout-center {
  display: flex;
  align-items: center;
  justify-content: center;

  &.vertical-margin {
    margin: 10px auto;
  }
}
.layout-right {
  display: flex;
  align-items: center;
  justify-content: flex-end;

  &.vertical-margin {
    margin: 10px auto;
  }
}
.layout-left {
  display: flex;
  align-items: center;
  justify-content: flex-start;

  &.vertical-margin {
    margin: 10px auto;
  }
}

.layout-space-between {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.cursor-pointer {
  cursor: pointer;
}

.text-wrapper {
  margin: 60px auto;

  @media only screen and (min-width: 1124px) {
    width: 780px;
  }

  @media only screen and (min-width: 768px) and (max-width: 1124px) {
    width: calc(100% - 100px);
  }

  @media only screen and (min-width: 550px) and (max-width: 768px) {
    width: calc(100% - 80px);
  }

  @media only screen and (min-width: 1px) and (max-width: 600px) {
    width: calc(100% - 50px);
  }
}

.text-style {
  font-size: 1.1rem;
  line-height: 1.6rem;
  color: $darkestGrey;

  img {
    width: 100%;
  }

  table {
    border-collapse: collapse;
    text-align: left;
    color: #081d35;
    width: 100%;

    @media only screen and (min-width: 1px) and (max-width: 600px) {
      max-width: 100%;
      overflow: auto;
      display: block;
    }

    tr td,
    th {
      padding: 5px;
      border-right: 1px solid $greyBlue;
      border-left: 1px solid $greyBlue;
      border-bottom: 1px solid $greyBlue;
      padding: 5px 8px;
    }

    thead {
      background-color: #f4f7fb;
      border-bottom: 3px double $greyBlue;
      border-top: 1px solid $greyBlue;
    }
  }

  h1 {
    font-size: 2.5rem;
    line-height: 3.4rem;
    margin: 50px 0;
    color: $darkGrey;
  }

  h2 {
    font-size: 1.8rem;
    line-height: 2.2rem;
    margin: 40px 0 20px;
    padding-bottom: 10px;
    border-bottom: 1px solid #eee;
    color: $darkestGrey;
  }

  h3 {
    font-size: 1.3rem;
    line-height: 1.9rem;
    margin: 25px 0 16px;
  }

  h4 {
    font-size: 1.2rem;
    line-height: 1.8rem;
    margin: 20px 0 16px;
  }

  p {
    font-size: 1.1rem;
    line-height: 1.8rem;
    margin: 20px 0 25px;

    br {
      margin-bottom: 15px;
    }

    ul {
      list-style: none;
    }
  }

  ul {
    list-style-type: none;
    // margin-left: 20px;

    li > p {
      margin: 0;
    }
  }

  pre {
    overflow-x: auto;
    color: #001a39;
    white-space: pre-wrap;
    font-family: monospace;
  }

  code {
    display: block;
    padding: 12px;
    color: #93a1a1;
    background: #073642;
    border-left: 10px solid #586e75;
    border-radius: 2px;
    overflow: auto;
  }

  tr code {
    display: initial;
    padding: 2px 5px;
    color: #93a1a1;
    background: #073642;
    border-left: 5px solid #586e75;
    border-radius: 2px;
    overflow: auto;
  }

  details {
    background-color: #eee;
    border-radius: 6px;
    padding: 10px 15px;
  }

  details > summary:after {
    content: '(Cliquez pour déplier)';
    font-style: italic;
    font-size: 0.9rem;
    margin-left: 15px;
    color: #777;
  }

  details[open] > summary:after {
    display: none;
  }
}

h1 {
  font-size: 2.8rem;
  line-height: 3.7rem;
  margin: 15px 0;
  color: $darkestGrey;
}

h2 {
  font-size: 1.5rem;
  line-height: 2.1rem;
  margin: 10px 0 16px;
  color: $darkestGrey;
}

h3 {
  font-size: 1.3rem;
  line-height: 1.9rem;
  margin: 12px 0 16px;
}

h4 {
  font-size: 1.2rem;
  line-height: 1.8rem;
  margin: 12px 0 16px;
}

@media only screen and (min-width: 1px) and (max-width: 600px) {
  h1 {
    font-size: 2.2rem;
    line-height: 3.1rem;
    margin: 12px 0 15px;
    color: $darkestGrey;
  }

  h2 {
    font-size: 1.4rem;
    line-height: 1.9rem;
    margin: 12px 0 16px;

    color: $darkestGrey;
  }

  h3 {
    font-size: 1.2rem;
    line-height: 1.9rem;
    margin: 12px 0 16px;
  }

  h4 {
    font-size: 1.1rem;
    line-height: 1.9rem;
    margin: 12px 0 16px;
  }
}

form {
  display: flex;
  flex-direction: column;

  > label {
    line-height: 18px;
    font-weight: 600;
    color: $darkestGrey;
    font-size: 1rem;
  }

  > input,
  > textarea {
    font-size: 1rem;
    margin: 5px 0 10px;
    width: auto;
    border: 2px solid #ccc;
    border-radius: 4px;
    padding: 10px;
    transition: border-color 300ms ease-in-out;
    font-family: 'Source Sans Pro', sans-serif;

    &:focus {
      border-color: $blue;
    }
    &:invalid {
      outline: none;
    }
  }
  > textarea {
    resize: none;
    height: 130px;
  }

  > div {
    display: flex;
    align-items: center;
    justify-content: flex-end;
  }
}

.highlight-info {
  border-left: 5px solid $blue;
  background-color: $lightBlue;
  color: $blue;
  padding: 1.5rem 2rem;
  display: flex;
  flex-direction: column;
  align-items: flex-end;

  > div,
  > p {
    width: 100%;
    margin-bottom: 10px;
  }
}

.highlight-warning {
  border-left: 5px solid $orange;
  background-color: $lightOrange;
  color: $darkOrange;
  padding: 1.5rem 2rem;
  display: flex;
  flex-direction: column;
  align-items: flex-end;

  > div,
  > p {
    width: 100%;
    margin-bottom: 10px;
  }
}
