* {
  margin: 0;
  padding: 0;
  list-style: none;
  text-decoration: none;
  box-sizing: border-box;
}

body {
  font-family: "Open Sans", sans-serif;
  line-height: 1.6;
  background-color: #222222;
  color: #e0e0e0;
}

.container {
  width: 85%;
  max-width: 1800px;
  margin: 0 auto;
}

section {
  margin-top: 2rem;
}

a {
  color: #ffffff;
}

h1 {
  font-size: 1.4rem;
}

h3 {
  font-size: 1.1rem;
}

img {
  display: block;
  width: 100%;
  object-fit: cover;
}

/**----------           ----------*/
/**----------   NAVBAR  ----------*/
/**----------           ----------*/
nav {
  background-color: #222222;
  width: 100%;
  height: 4.5rem;
  position: fixed;
  top: 0;
  box-shadow: 0 1rem 1rem rgb(255, 254, 254, 0.2);
}

nav button {
  display: inline-block;
  font-size: 1.5rem;
  background: transparent;
  color: #ffffff;
  border: 0;
  cursor: pointer;
}

.nav_container {
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: relative;
}

.nav_logo {
  font-weight: 600;
  font-size: 1.2rem;
  color: #ffffff;
}

.nav_items {
  position: absolute;
  flex-direction: column;
  top: 100%;
  right: -5%;
  width: 12rem;
  align-items: flex-start;
  justify-content: center;
  gap: 0;
  display: none;
  z-index: 1000;
}

.nav_items li {
  width: 100%;
  height: 4.5rem;
  display: flex;
  align-items: center;
  box-shadow: 0 1rem 1rem rgb(255, 254, 254, 0.2);
  background: #222222;
  border-top: 1px solid #ffffff;
  animation: animateDropdown 1s 0s ease forwards;
  opacity: 0;
}

.nav_items li a {
  color: #ffffff;
  border-radius: 0;
  width: 100%;
  height: 100%;
  padding: 0 2rem;
  display: flex;
  align-items: center;
}

.nav_profile {
  position: relative;
  cursor: pointer;
  width: 100%;
}

.nav_profile ul {
  width: 100%;
  position: absolute;
  top: 100%;
  display: flex;
  flex-direction: column;
  visibility: hidden;
  opacity: 0;
  transition: all 300ms ease;
}

.nav_profile ul li a {
  display: block;
  width: 100%;
  padding: 1.3rem 2rem;
}

.nav_profile ul li:last-child a {
  background-color: #ff4c4c;
}

.nav_profile:hover > ul {
  visibility: visible;
  opacity: 1;
}

.nav_profile_avatar {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding-left: 2rem;
}
.avatar {
  display: flex;
  align-items: center;
  gap: 1rem;
  width: 2.5rem;
  height: 2.5rem;
  overflow: hidden;
  border-radius: 50%;
  border: 0.2rem solid #ffffff;
}

.nav_profile_avatar span {
  color: #ffffff;
  font-size: 0.8rem;
}

#close_nav-btn {
  display: none;
}

@keyframes animateDropdown {
  0% {
    transform: rotateX(90deg);
  }
  100% {
    transform: rotateX(0);
    opacity: 1;
  }
}

/**----------          ----------*/
/**----------   TOAST  ----------*/
/**----------          ----------*/
.toast {
  position: fixed;
  top: 6rem;
  left: 50%;
  transform: translateX(-50%);
  width: 70%;
  max-width: 15rem;
  background-color: #2c2c2c;
  color: #fff;
  padding: 1rem;
  border-radius: 0.5rem;
  box-shadow: 0 0.5rem 1rem rgb(255, 254, 254, 0.2);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.5s ease-in-out, visibility 0.5s ease-in-out;
}

.toast-show {
  opacity: 1;
  visibility: visible;
}

.toast_progress-bar {
  position: absolute;
  bottom: 0;
  left: 0;
  height: 0.15rem;
  background-color: #ff4c4c;
  width: 100%;
  transform: scaleX(0);
  transform-origin: left;
}

/**----------                    ----------*/
/**----------   CATEGORY BUTTON  ----------*/
/**----------                    ----------*/
.category_button {
  background: #ff4c4c;
  color: #ffffff;
  display: inline-block;
  padding: 0.5rem 1rem;
  border-radius: 0.5rem;
  font-weight: 600;
  font-size: 0.8rem;
  margin: 0.2rem;
}

.category_button:hover {
  color: #ff4c4c;
  background-color: #ffffff;
  cursor: pointer;
}

.buttons_container {
  margin: 0 auto;
  text-align: center;
}

/**----------               ----------*/
/**----------   MAIN POST   ----------*/
/**----------               ----------*/
.main_post {
  margin-top: 6rem;
}

.main_post .post_thumbnail {
  height: fit-content;
  margin: 1rem auto;
}

/**----------           ----------*/
/**----------   POSTS   ----------*/
/**----------           ----------*/
.posts h1 {
  margin: 6rem 0 2rem;
  padding: 1rem;
}

.post {
  margin-bottom: 2rem;
}

.post_thumbnail {
  border-radius: 10% 25%;
  border: 0.4rem solid #ff4c4c;
  overflow: hidden;
  margin-bottom: 1rem;
}

.post:hover .post_thumbnail img {
  filter: saturate(0);
  transition: filter 500ms ease;
}

.post_title {
  margin: 1rem 0;
}

.post_body img {
  width: auto;
}

.post_author {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-top: 1rem;
}

.post_author-avatar {
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 0.8rem;
  overflow: hidden;
}

.text_truncate {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 5;
  line-clamp: 5;
  overflow: hidden;
}

.category_header {
  padding: 1.5rem 0 1rem 0;
}

.pagination {
  width: 10%;
  display: flex;
  justify-content: space-between;
  margin: 2rem auto;
}

/**----------              ----------*/
/**----------  SINGLEPOST  ----------*/
/**----------              ----------*/
.singlepost {
  margin: 6rem 0 2rem;
}

.singlepost_container {
  width: 85%;
  background: transparent;
  padding: 0;
}

.singlepost_thumbnail {
  margin: 1.5rem 0 1rem;
}

.singlepost_container p {
  margin-top: 1rem;
  line-height: 1.7;
}

.singlepost_content img {
  width: auto;
}

.singlepost_edit_btn {
  font-size: 1rem;
  color: green;
  margin-left: 1rem;
  padding-top: 0.5rem;
}

.singlepost_title {
  display: flex;
  align-items: center;
}

.image {
  display: flex;
  justify-content: center;
}

.image-style-align-left {
  float: left;
  margin: 1rem 1rem 0 0;
}
.image-style-align-right {
  float: right;
  margin: 0.5rem;
}
.image-style-block-align-left {
  justify-content: flex-start;
  margin-top: 0.5rem;
}
.image-style-block-align-right {
  justify-content: flex-end;
  margin-top: 0.5rem;
}

.singlepost hr {
  width: 80%;
  margin: 4rem auto 2rem;
  height: 30px;
  border-style: solid;
  border-color: #ff4c4c;
  border-width: 1px 0 0 0;
  border-radius: 20px;
  &:before {
    display: block;
    content: "";
    height: 30px;
    margin-top: -31px;
    border-style: solid;
    border-color: #ff4c4c;
    border-width: 0 0 2px 0;
    border-radius: 20px;
  }
}

.comments_container h2 {
  font-size: 1.3rem;
  margin-bottom: 1rem;
}

.comments {
  margin-bottom: 3rem;
}

.comments_container textarea {
  height: 10rem;
}

.comments_buttons button {
  background: transparent;
  border: none;
  cursor: pointer;
}

/**----------            ----------*/
/**----------   FOOTER   ----------*/
/**----------            ----------*/
footer {
  width: 100%;
  background-color: #222222;
  padding: 3rem 0;
  border-top: 1px solid #ffffff;
}

.footer_socials {
  margin: 0 auto;
  width: fit-content;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1.2rem;
}

.footer_socials a {
  background-color: #ff4c4c;
  border-radius: 50%;
  width: 2.3rem;
  height: 2.3rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

.footer_socials a:hover {
  background-color: #ffffff;
  color: #ff4c4c;
}

/**----------           ----------*/
/**----------  BUTTONS  ----------*/
/**----------           ----------*/
.btn {
  display: inline-block;
  width: fit-content;
  padding: 0.6rem 1.2rem;
  background-color: #ff4c4c;
  border-radius: 0.5rem;
  cursor: pointer;
  border: none;
  color: #ffffff;
}

.sm {
  padding: 0.3rem 0.7rem;
  font-size: 0.8rem;
}

.danger {
  background: red;
}

.btn:hover {
  background: #ffffff;
  color: #ff4c4c;
}

/**----------                ----------*/
/**----------   SEARCH BAR   ----------*/
/**----------                ----------*/
.search_bar {
  margin-top: 7rem;
}

.search_container {
  width: 80%;
  background: #ff4c4c;
  display: flex;
  flex-direction: row;
  justify-content: space-between;
  overflow: hidden;
  padding: 0.4rem 1rem;
  border-radius: 0.5rem;
  color: #ffffff;
}

.search_container > div {
  width: 100%;
  display: flex;
  align-items: center;
}

.search_bar input {
  margin-left: 0.7rem;
  padding: 0.5rem;
  width: 100%;
  background: transparent;
  color: #ffffff;
  border: none;
}

.search_bar input::placeholder {
  color: #ffffff;
  padding-left: 0.5rem;
}

.btn_search {
  border: 1px solid #ffffff;
  padding: 0.6rem 0.5rem;
}

/**----------         ----------*/
/**----------  FORMS  ----------*/
/**----------         ----------*/
.form_section {
  margin-top: 8rem;
  height: 100vh;
  padding: 0.5rem;
}

.form_container {
  width: 90%;
}

.alert_message {
  padding: 0.3rem 1.4rem;
  border-radius: 0.5rem;
  margin: 1rem 0;
  width: fit-content;
}

.error {
  background-color: red;
  color: #e0e0e0;
}

.success {
  background: green;
  color: #e0e0e0;
}

form {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.form_control {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

input,
textarea,
select {
  padding: 0.8rem 1.4rem;
  background: #e0e0e0;
  border-radius: 0.5rem;
  color: black;
  resize: none;
}

input::placeholder,
textarea::placeholder {
  color: grey;
}

.form_section small {
  display: block;
  margin-top: 1rem;
}
.form_section small a {
  color: #ff4c4c;
}

.edit_user_pseudo {
  margin: 2rem 0;
}

.delete_form {
  display: flex;
  gap: 1rem;
}

.form_register {
  margin: 1rem auto;
  width: 80%;
}

.register_title {
  display: flex;
  gap: 1rem;
  align-items: center;
  position: relative;
}

.register_requirements {
  position: relative;
  background-color: #ff4c4c;
  padding: 0.5rem;
  font-size: 0.8rem;
  border-radius: 10px;
  visibility: hidden;
}

.fa-circle-question:hover + .register_requirements {
  visibility: visible;
}

/**----------               ----------*/
/**----------   DASHBOARD   ----------*/
/**----------               ----------*/
.dashboard_container {
  padding: 2rem;
  margin: 5rem 0;
  background-color: transparent;
  width: fit-content;
  position: static;
}

.dashboard_add {
  width: 100%;
  display: flex;
  gap: 1rem;
  align-items: center;
}

#sortForm {
  width: 100%;
  margin-top: 2rem;
  align-items: flex-end;
}

#sortForm select {
  padding: 0.2rem;
  width: fit-content;
}

.dashboard_add a {
  font-size: 1.5rem;
  margin-right: 1.5rem;
}

.dashboard main table {
  width: 100%;
  text-align: left;
  margin-right: 2rem;
}

.dashboard main table thead {
  display: none;
}

.dashboard main table tr {
  display: flex;
  align-items: center;
  border-bottom: 1px solid #ffffff;
  padding: 1rem 0;
}

.dashboard main table td {
  width: 30%;
  border-bottom: none;
  padding: 0.8rem;
}

.dashboard main table td img {
  width: 75%;
  margin: 0 auto;
}

.dashboard main table tr:nth-child(even) {
  background: black;
}

.dashboard_btn {
  text-align: center;
}

.dashboard_avatar {
  display: none;
}

.dashboard aside {
  position: absolute;
  box-shadow: 2rem 0 4rem rgba(0, 0, 0, 0.4);
  display: none;
  top: 11.5%;
  left: 0;
  height: 100vh;
  transition: all 300ms ease;
  background-color: #ff4c4c;
}

.dashboard aside a {
  display: flex;
  gap: 1rem;
  align-items: center;
  padding: 1.6rem;
}

.dashboard aside a h5 {
  display: inline-block;
}

.dashboard aside ul li:not(:last-child) a {
  border-bottom: 1px solid #222222;
}

.dashboard aside a.active {
  background-color: #222222;
}

.dashboard .sidebar_toggle {
  display: inline-block;
  position: fixed;
  right: 0;
  bottom: 4rem;
  z-index: 1;
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 50% 0 0 50%;
  font-size: 1.3rem;
  cursor: pointer;
}

.dashboard_profile_container {
  width: 100%;
  margin: 8rem auto 6rem auto;
}

.dashboard_profile_container main {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.dashboard_profile_container form {
  width: 80%;
  padding: 1rem;
}

.dashboard_profile .alert_message {
  margin: 1rem 2rem;
  padding: 1rem;
}

#close_sidebar {
  display: none;
}

#error_container {
  margin: 8rem 2rem 8rem;
}

/**----------                            ----------*/
/**----------   MEDIA QUERIES (TABLET)   ----------*/
/**----------                            ----------*/
@media screen and (min-width: 768px) {
  .container {
    width: 88%;
  }

  h1 {
    font-size: 2rem;
  }

  h2 {
    font-size: 1.7rem;
  }

  h3 {
    font-size: 1.2rem;
  }

  h5 {
    font-size: 0.8rem;
  }

  /**----------           ----------*/
  /**----------   TOAST   ----------*/
  /**----------           ----------*/
  .toast {
    top: 90%;
    left: 80%;
  }

  /**----------               ----------*/
  /**----------   MAIN POST   ----------*/
  /**----------               ----------*/
  .main_post {
    margin-top: 8rem;
  }

  .main_container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 3rem;
  }

  .main_post .post_thumbnail {
    margin: auto 0;
  }

  /**----------           ----------*/
  /**----------   POSTS   ----------*/
  /**----------           ----------*/
  .posts {
    margin-top: 4rem;
  }

  .posts h1 {
    padding: 1rem 2rem;
  }

  .posts_container {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem 3rem;
    margin-bottom: 3rem;
  }

  .post .post_thumbnail {
    height: 35%;
  }

  .post_title {
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 1;
    line-clamp: 1;
    overflow: hidden;
  }

  .category_posts_container {
    padding-left: 2rem;
  }

  .pagination {
    width: 5%;
  }

  /**----------                 ----------*/
  /**----------   SINGLE POST   ----------*/
  /**----------                 ----------*/
  .singlepost_container {
    background-color: #2c2c2c;
    padding: 1rem 2rem 2rem;
    margin: 8rem auto 4rem;
  }

  .singlepost_container h1 {
    font-size: 1.7rem;
  }

  .singlepost_content {
    margin-top: 2rem;
  }

  .comments {
    margin-left: 1rem;
  }

  /**----------               ----------*/
  /**----------   SEARCHBAR   ----------*/
  /**----------               ----------*/
  .search_container {
    width: 60%;
  }

  /**----------         ----------*/
  /**----------  FORMS  ----------*/
  /**----------         ----------*/
  .form_section {
    padding: 3rem;
    margin-bottom: 8rem;
  }

  .form_control {
    width: fit-content;
  }

  .form_register {
    width: 60%;
    margin: 1rem 1rem;
  }

  /**----------             ----------*/
  /**----------  DASHBOARD  ----------*/
  /**----------             ----------*/
  .dashboard {
    margin: 6rem 0;
  }

  .dashboard_container {
    display: grid;
    grid-template-columns: 4.5rem auto;
    gap: 3rem;
    background: transparent;
    width: 100%;
  }

  .dashboard_avatar {
    display: table-cell;
  }

  .dashboard aside {
    display: block;
    position: static;
    height: fit-content;
    transition: none;
  }

  .dashboard aside ul li a h5 {
    display: none;
  }

  .dashboard_profile {
    width: 100%;
  }

  .dashboard_profile_container form {
    width: 60%;
  }

  .dashboard_profile_container h2 {
    margin-left: 5rem;
  }

  .dashboard_profile .alert_message {
    margin: 1rem auto;
  }
  .sidebar_toggle {
    display: none !important;
  }
}

/**----------                             ----------*/
/**----------   MEDIA QUERIES (DESKTOP)   ----------*/
/**----------                             ----------*/
@media screen and (min-width: 1024px) {
  h1 {
    font-size: 2.5rem;
    margin: 1rem 0;
  }

  h2 {
    font-size: 1.7rem;
    margin: 1rem 0;
  }

  h3 {
    font-size: 1.1rem;
    margin: 0.8rem 0 0.5rem;
  }
  section {
    margin-top: 3rem;
  }

  .container {
    width: 75%;
  }

  /**----------            ----------*/
  /**----------   NAVBAR   ----------*/
  /**----------            ----------*/
  nav button {
    display: none;
  }

  .nav_items {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 4rem;
    width: auto;
    position: static;
  }

  .nav_items li {
    display: block;
    width: auto;
    height: auto;
    box-shadow: none;
    border: none;
    opacity: 1;
  }

  .nav_items li a {
    padding: 0;
  }

  .nav_profile ul {
    top: 140%;
    right: 30%;
  }

  .nav_profile .avatar {
    margin: 0;
  }

  .nav_profile_avatar {
    padding: 0;
  }

  .nav_profile ul li {
    width: 10rem;
    border-top: 1px solid #ffffff;
    font-size: 0.9rem;
  }
  .nav_profile ul li a {
    padding: 1.4rem 1.4rem;
  }

  /**----------           ----------*/
  /**----------   TOAST   ----------*/
  /**----------           ----------*/
  .toast {
    left: 86%;
  }

  /**----------               ----------*/
  /**----------   MAIN POST   ----------*/
  /**----------               ----------*/
  .main_post {
    margin-bottom: 3rem;
  }

  .post_info {
    margin: auto 0;
  }

  .main_container {
    gap: 4rem;
  }

  #main_post_thumbnail {
    max-height: 25rem;
  }

  /**----------           ----------*/
  /**----------   POSTS   ----------*/
  /**----------           ----------*/
  .posts {
    margin-top: 4rem;
  }

  .posts_container {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem 5rem;
  }

  .post {
    margin-bottom: 1rem;
  }

  .post .post_thumbnail {
    height: 33%;
  }

  /**----------                 ----------*/
  /**----------   SINGLEPOSTS   ----------*/
  /**----------                 ----------*/
  .singlepost_container {
    width: 60%;
  }
  .singlepost_thumbnail img {
    width: 60%;
    margin: 0 auto;
  }

  /**----------                ----------*/
  /**----------   SEARCH BAR   ----------*/
  /**----------                ----------*/
  .search_container {
    width: 30rem;
  }

  /**----------           ----------*/
  /**----------   FORMS   ----------*/
  /**----------           ----------*/
  .form_container {
    width: 40%;
  }

  /**----------               ----------*/
  /**----------   DASHBOARD   ----------*/
  /**----------               ----------*/
  .dashboard_container {
    grid-template-columns: 14rem auto;
    gap: 1rem;
    padding: 2rem;
    width: 90%;
    margin: 8rem auto 0;
    background-color: #2c2c2c;
  }

  .dashboard_container main {
    margin-left: 1.5rem;
  }

  .dashboard_container main table thead {
    display: table-header-group;
  }

  .dashboard_container main table tr {
    display: table-row;
    border: none;
  }

  .dashboard main table td img {
    width: 50%;
  }

  .dashboard_container main table thead tr th {
    background-color: #ff4c4c;
    padding: 0.8rem;
  }

  .dashboard_container main table tr td {
    border-bottom: 1px solid #ffffff;
    width: 20%;
  }

  .dashboard aside ul li a h5 {
    display: block;
  }

  .dashboard_profile_container {
    height: 100vh;
  }

  #sortForm {
    margin: 0 0 1rem 0;
  }
}

@media screen and (min-width: 1300px) {
  .dashboard_container {
    width: 75%;
  }

  .posts h1 {
    padding-left: 9rem;
  }

  .posts_container {
    grid-template-columns: repeat(3, 1fr);
  }

  .post .post_thumbnail {
    height: 32%;
  }

  .dashboard_profile_container h2 {
    margin-left: 10rem;
  }

  .dashboard_profile_container main {
    align-items: flex-start;
  }

  .dashboard_profile_container form {
    width: 30%;
    margin-left: 12rem;
  }

  .toast {
    left: 90%;
  }
}

@media screen and (min-width: 1440px) {
  .posts_container {
    grid-template-columns: repeat(4, 1fr);
    gap: 1rem 4rem;
  }
  .post .post_thumbnail {
    height: 28%;
  }
}
@media screen and (min-width: 1800px) {
  .posts_container {
    grid-template-columns: repeat(5, 1fr);
    gap: 1rem 4rem;
  }
}
