.fg-projects__list {
  list-style: none;
  margin: 30px 0 40px;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  column-gap: 20px;
  row-gap: 30px;
}

.fg-projects__item {
  margin: 0 !important;
  padding: 0 !important;
  list-style: none;
}

.fg-projects__card {
  position: relative;
  display: flex;
  align-items: flex-end;
  height: 100%;
  min-height: 360px;
  border-radius: 10px;
  overflow: hidden;
  background-color: #e75e5f;
  background-size: cover;
  background-position: center;
}

.fg-projects__card::after {
  content: "";
  position: absolute;
  inset: 20% 0 0 0;
  background: linear-gradient(0deg, rgba(0, 0, 0, 0.8) 0%, rgba(0, 0, 0, 0) 100%);
  pointer-events: none;
}

.fg-projects__content {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 15px;
  width: 100%;
  padding: 30px;
}

.fg-projects__title {
  margin: 0;
  color: #fff;
  font-family: "Jost", "Poppins", sans-serif;
  font-size: 1.5rem;
  font-weight: 400;
  line-height: 1.4;
}

.fg-projects__actions {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 20px;
  padding-top: 10px;
}

.fg-projects .fg-projects__card .fg-projects__more,
.fg-projects .fg-projects__card .fg-projects__more:hover,
.fg-projects .fg-projects__card .fg-projects__more:focus {
  display: inline-block;
  padding: 0 0 9px;
  border: 0;
  border-bottom: 1px solid #fff;
  border-radius: 0;
  background: none;
  color: #fff;
  cursor: pointer;
  font-family: "Jost", "Poppins", sans-serif;
  font-size: 0.75rem;
  font-style: normal;
  font-weight: 600;
  line-height: normal;
  letter-spacing: 1.44px;
  text-decoration: none;
  text-transform: uppercase;
}

.fg-projects__btn {
  display: inline-block;
  padding: 12px 22px;
  border: 1px solid #25884f;
  border-radius: 30px;
  background-color: #25884f;
  color: #fff;
  font-family: "Jost", "Poppins", sans-serif;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 1.2px;
  text-decoration: none;
  text-transform: uppercase;
  transition: opacity 0.3s ease-in-out;
}

.fg-projects__btn:hover,
.fg-projects__btn:focus {
  color: #fff;
  opacity: 0.85;
}

.fg-projects__pagination ul {
  display: flex;
  justify-content: center;
  gap: 30px;
  margin: 0 0 30px;
  padding: 20px 0;
  list-style: none;
}

.fg-projects__pagination li {
  margin: 0 !important;
  padding: 0 !important;
}

.fg-projects__pagination .page-numbers {
  font-size: 0.75rem;
  letter-spacing: 1.2px;
  text-decoration: none;
}

.fg-projects__pagination .current {
  color: #25884f;
  font-weight: 600;
}

/* Pop-up */
.fg-projects-modal[hidden] {
  display: none;
}

.fg-projects-modal {
  position: fixed;
  inset: 0;
  z-index: 99999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.fg-projects-modal__overlay {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
}

.fg-projects-modal__dialog {
  position: relative;
  display: grid;
  grid-template-columns: 1fr 1fr;
  width: 100%;
  max-width: 960px;
  max-height: 90vh;
  overflow: hidden;
  border-radius: 10px;
  background: #fff;
}

.fg-projects-modal__image {
  min-height: 360px;
  background-color: #e75e5f;
  background-size: cover;
  background-position: center;
}

.fg-projects-modal__body {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 20px;
  padding: 80px 30px 40px;
  overflow-y: auto;
}

/* Centrage vertical sans couper le contenu quand il déborde */
.fg-projects-modal__body > :first-child {
  margin-top: auto;
}

.fg-projects-modal__body > :last-child {
  margin-bottom: auto;
}

.fg-projects-modal__title {
  margin: 0;
  font-family: "Jost", "Poppins", sans-serif;
  font-size: 1.75rem;
  line-height: 1.3;
}

.fg-projects-modal__description > :first-child {
  margin-top: 0;
}

.fg-projects-modal__description > :last-child {
  margin-bottom: 0;
}

.fg-projects-modal .fg-projects-modal__close {
  position: absolute;
  top: 15px;
  right: 15px;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  min-width: 0;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: #fff !important;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
  color: #000;
  cursor: pointer;
  line-height: 1;
}

.fg-projects-modal .fg-projects-modal__close .fg-projects-modal__close-icon {
  position: relative;
  display: block;
  width: 16px;
  height: 16px;
}

.fg-projects-modal .fg-projects-modal__close .fg-projects-modal__close-icon::before,
.fg-projects-modal .fg-projects-modal__close .fg-projects-modal__close-icon::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 0;
  width: 100%;
  height: 2px;
  border-radius: 2px;
  background-color: #000;
}

.fg-projects-modal .fg-projects-modal__close .fg-projects-modal__close-icon::before {
  transform: translateY(-50%) rotate(45deg);
}

.fg-projects-modal .fg-projects-modal__close .fg-projects-modal__close-icon::after {
  transform: translateY(-50%) rotate(-45deg);
}

body.fg-projects-modal-open {
  overflow: hidden;
}

@media (max-width: 1024px) {
  .fg-projects__list {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 767px) {
  .fg-projects__list {
    grid-template-columns: 1fr;
  }

  .fg-projects-modal__dialog {
    grid-template-columns: 1fr;
    grid-template-rows: 200px 1fr;
    overflow-y: auto;
  }

  .fg-projects-modal__image {
    min-height: 200px;
  }
}
