@use "sass:math";

.actualites {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: flex-start;
  position: relative;
  margin-bottom: 50px;
  min-height: 40vh;
  gap: 50px;

  .list-article {
    display: flex;
    gap: 25px;
    flex-wrap: wrap;
    flex: 6;

    .card {
      flex: 2 1;
    }
  }

  .sidebar {
    flex: 2;

    .filter,
    .bloc {
      background-color: var(--front-secondary);
      padding: 20px;
    }

    .bloc {
      text-align: center;
      display: flex;
      flex-direction: column;
      gap: 20px;
      justify-content: center;
      align-items: center;

      p:first-child {
        font-size: 2rem;
      }
    }
  }

  @media (max-width: $tablet) {
    flex-direction: column-reverse;
    margin-top: 40px;

    .list-article {
      width: 100%;

      .card {
        max-width: none;

        .content {
          height: 280px;
        }
      }
    }
  }

  @media (max-width: $phone) {
    .list-article {
      width: 100%;

      .card {
        min-width: 250px;

        &:first-child {
          min-width: 250px;
        }

        .content {
          height: auto;
        }
      }
    }
  }
}

.sidebar {
  display: flex;
  flex-direction: column;
  gap: 25px;

  .sidebar-title {
    font-size: 2.2rem;
    font-weight: 500;
    margin-bottom: 15px;

    @media (max-width: $tablet) {
      margin-left: 15px;
    }
  }

  .share {
    background-color: var(--front-secondary);
    padding: 20px;

    .list-rs {
      display: flex;
      gap: 20px;

      &>* {
        width: 40px;
        height: 40px;
        display: flex;
        justify-content: center;
        align-items: center;
        color: var(--front-primary);
        background-color: white;
        font-size: 2rem;
        border-radius: 50%;

        img {
          max-width: 65%;
        }

        &:hover {
          cursor: pointer;
        }
      }

      @media (max-width: $tablet) {
        width: 100%;
        flex-direction: row;

        &>* {
          width: 30px;
          height: 30px;
        }
      }
    }
  }

  .others-article {
    background-color: var(--front-secondary);
    padding: 20px;

    .articles {
      display: flex;
      flex-direction: column;
      gap: 25px;

      .card {
        max-width: 100%;
        min-width: auto;

        .image {
          &::after {
            content: '';
            position: absolute;
            top: 0;
            bottom: 0;
            left: 0;
            width: 100%;
            height: 100%;
            opacity: .6;
            background-color: $primary;
            transition: all .25s;
          }
        }

        &:nth-child(even) {
          .image {
            &::after {
              background-color: $secondary;
            }
          }
        }

        .image:hover {
          cursor: pointer;

          &::after {
            opacity: .2;
          }
        }

        @media (max-width: $tablet) {
          width: 50%;
          max-width: none;
        }

        @media (max-width: $phone) {
          width: 100%;

          .content {
            text-align: left;

            .buttonContainer {
              justify-content: flex-start;
            }
          }
        }
      }
    }

    @media (max-width: $tablet) {
      min-width: 100%;

      .articles {
        flex-wrap: wrap;

        .blocActu {
          width: 100%;
          margin-bottom: 30px;
        }
      }
    }
  }
}


.article {
  text-align: left;
  display: flex;
  align-items: flex-start;
  gap: 25px;
  min-height: 30vh;
  width: 90vw;
  max-width: 1500px;
  margin: 50px auto;

  &>div:first-child {
    flex: 2;
  }

  &>div:last-child {
    flex: 5;

    @media (max-width: $phone) {
      margin: 0;
      width: 100%;
      flex-wrap: wrap;
    }

    .bloc-intern {
      max-width: 50%;
    }
  }

  @media (max-width: 768px) {
    flex-direction: column-reverse;
    align-items: stretch;
    margin-bottom: 50px;

    &>div:first-child,
    &>div:last-child {
      flex: auto;
      width: 100%;

      .bloc-intern {
        max-width: 100%;

        .content-intern {
          width: 100%;
        }
      }
    }
  }
}