/* Micromodal.js Styles */
.modal {
  display: none;
}

.modal.is-open {
  display: block;
}

.modal[aria-hidden="false"] .modal__overlay {
  animation: mmfadeIn .3s cubic-bezier(0.0, 0.0, 0.2, 1);
}

.modal[aria-hidden="false"] .modal__container {
  animation: mmslideIn .3s cubic-bezier(0, 0, .2, 1);
}

.modal[aria-hidden="true"] .modal__overlay {
  animation: mmfadeOut .3s cubic-bezier(0.0, 0.0, 0.2, 1);
}

.modal[aria-hidden="true"] .modal__container {
  animation: mmslideOut .3s cubic-bezier(0, 0, .2, 1);
}

.modal__overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 9999;
}

.modal__container {
  background-color: #fff;
  padding: 0;
  max-width: 900px;
  max-height: 80vh;
  width: 90%;
  border-radius: 0;
  box-sizing: border-box;
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.modal__header {
  position: relative;
  padding: 30px 25px 0 25px;
  flex-shrink: 0;
}

.modal__title {
  position: relative;
  color: #3b9c39;
  padding-bottom: 34px;
  margin: 0;
  font-size: 24px;
  font-weight: 600;
  line-height: 1;
}

.modal__title::before {
  content: "";
  position: absolute;
  left: -25px;
  bottom: 0;
  width: calc(100% + 50px);
  border: 1.5px solid #3b9c39;
}

.modal__close {
  position: absolute;
  top: 30px;
  right: 25px;
  background: transparent;
  border: 0;
  font-size: 24px;
  cursor: pointer;
  width: 30px;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #666;
  transition: color 0.2s;
}

.modal__close:hover {
  color: #3b9c39;
}

.modal__close::before {
  content: "×";
  font-size: 32px;
  line-height: 1;
}

.modal__content {
  padding: 0 25px;
  overflow-y: auto;
  overflow-x: hidden;
  flex-grow: 1;
}

.modal__footer {
  padding: 20px 32px;
  background: #fff;
  border-top: 1px solid #3b9c39;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-shrink: 0;
}

/* Micromodal animations */
@keyframes mmfadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes mmfadeOut {
  from { opacity: 1; }
  to { opacity: 0; }
}

@keyframes mmslideIn {
  from { transform: translateY(15%); }
  to { transform: translateY(0); }
}

@keyframes mmslideOut {
  from { transform: translateY(0); }
  to { transform: translateY(-10%); }
}

.brxe-madeneat-post-grid-with-filter.madeneat-post-grid-with-filter {
  width: 100%;
}

.madeneat-post-grid-filter-modal-content-context,
.madeneat-post-grid-filter-modal-content-location {
  display: flex;
  column-gap: 10px;
  align-items: center;
}

.madeneat-post-grid-with-filter,
div#brxe-xugnso {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.madeneat-post-grid-filter-content-item {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

#madeneat-post-filter-content {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  row-gap: 40px;
  column-gap: 25px;
}

.madeneat-post-grid-filter-content-item-row {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
  height: 100%;
  align-content: space-between;
}

.madeneat-post-grid-filter-content-item-row .featured-images {
  width: 100%;
  aspect-ratio: 688/566;
  overflow: hidden;
  border-radius: 15px;
  position: relative;
  margin-bottom: 25px;
}

.madeneat-post-grid-filter-content-item-row label.grant-label {
    position: absolute;
    background: #f05f28;
    font-size: 14px;
    color: #fff;
    font-weight: 600;
    padding: 5px 20px;
    border-radius: 10px;
    line-height: 18px;
    top: 10px;
    left: 10px;
}

.madeneat-post-grid-filter-content-item-row .featured-images img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  aspect-ratio: 688/566;
}

.madeneat-post-grid-filter-content-item-row .card-date {
  font-family: "Montserrat", sans-serif;
  font-size: 18px;
  font-weight: 400;
  display: block;
}

.madeneat-post-grid-filter-content-item-row .card-date label {
  font-weight: 600;
  color: #000;
  display: inline-block;
}

.madeneat-post-grid-filter-content-item-row .card-title {
  color: #3b9c39;
}

h4.madeneat-modal-title {
  position: relative;
  color: #3b9c39;
  padding-bottom: 34px;
  padding-left: 25px;
  padding-right: 25px;
}

h4.madeneat-modal-title::before {
  content: "";
  position: absolute;
  left: -25px;
  bottom: 0;
  width: calc(100% + 50px);
  border: 1.5px solid #3b9c39;
}

.green-button {
  color: var(--FRRR-Green, #3b9c39);
  text-align: center;

  /* Button */
  font-family: Degular;
  font-size: 21px;
  font-style: normal;
  font-weight: 500;
  line-height: normal;
  display: inline-flex;
  padding: 10px 40px 14px 40px;
  justify-content: center;
  align-items: center;
  gap: 10px;
  border-radius: 15px;
  border: 2px solid var(--FRRR-Green, #3b9c39);
}

.madeneat-post-grid-filter-top {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin: 40px 0 20px 0;
  padding: 0 0 0 0;
}

.madeneat-post-grid-filter-top-search-wrapper {
  display: flex;
  align-items: center;
  flex: 1 1 500px;
  max-width: 600px;
  border: 1px solid #3b9c39;
  border-radius: 15px;
  background: #fff;
  overflow: hidden;
  height: 53px;
  min-width: 700px;
  position: relative;
}

.madeneat-post-grid-filter-top-search {
  flex: 1 1 auto;
  border: none;
  outline: none;
  padding: 0 16px;
  font-size: 16px;
  height: 100%;
  background: transparent;
}

.madeneat-post-grid-filter-top-search-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  background: #3b9c39;
  height: 100%;
  width: 48px;
  border-radius: 0 20px 20px 0;
  margin-right: 0;
}

.madeneat-post-grid-filter-top-search-icon img {
  width: 22px;
  height: 22px;
}

.madeneat-post-grid-filter-top-search-wrapper input:not([type="submit"]) {
  border: none;
}

.madeneat-post-grid-filter-search-button {
  border: 1.5px solid #3b9c39;
  background: #3b9c39;
  border-radius: 0;
  font-size: 16px;
  font-family: inherit;
  font-weight: 500;
  padding: 0 24px;
  height: 53px;
  margin-left: 10px;
  display: flex;
  align-items: center;
  transition: background 0.2s, color 0.2s;
  cursor: pointer;
  position: absolute;
  right: 0;
  top: 0;
  background-image: url("../../assets/images/Filter.svg");
  background-size: 22px;
  background-position: center;
  background-repeat: no-repeat;
}

.madeneat-post-grid-filter-top-button {
  border: 1px solid #3b9c39;
  background: #fff;
  color: #3b9c39;
  border-radius: 15px;
  font-size: 16px;
  font-family: inherit;
  font-weight: 500;
  padding: 0 24px;
  height: 53px;
  margin-left: 10px;
  display: flex;
  align-items: center;
  transition: background 0.2s, color 0.2s;
  cursor: pointer;
}

.madeneat-post-grid-filter-top-button:first-of-type {
  background: #3b9c39;
  color: #fff;
  border: 1.5px solid #3b9c39;
  margin-left: 0;
}

.madeneat-2-column-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  row-gap: 16px;
}

.madeneat-4-column-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  row-gap: 16px;
}

.madeneat-location-h4 {
  display: flex;
  font-size: 18px;
  font-weight: 600;
  font-family: "Montserrat";
  line-height: 27px;
  padding-bottom: 14px;
  padding-top: 24px;
}

.madeneat-grant-focus-h4 {
  display: flex;
  font-size: 18px;
  font-weight: 600;
  font-family: "Montserrat";
  line-height: 27px;
  padding-bottom: 14px;
  padding-top: 24px;
  border-top: 1.5px solid #a5a5a5;
  margin-top: 24px;
}

/* Remove old modal styles */
.madeneat-post-grid-filter-modal {
  display: none;
}

.madeneat-post-grid-filter-modal.show:before {
  display: none;
}

.madeneat-post-grid-filter-modal.show {
  display: none;
}

.madeneat-post-grid-filter-modal-wrapper {
  display: none;
}

.madeneat-post-grid-filter-modal-content {
  height: auto;
  overflow-y: visible;
  overflow-x: visible;
  padding-bottom: 20px;
}

.madeneat-post-grid-filter-modal-footer {
  display: none;
}

/* Button styles for the new modal structure */
#madeneat-clear-filters-button.madeneat-post-grid-filter-modal-button {
  background: none;
  color: #222;
  border: none;
  font-size: 18px;
  font-weight: 500;
  box-shadow: none;
  border-radius: 0;
  padding: 0;
  min-width: unset;
  height: auto;
  cursor: pointer;
}

#madeneat-refine-button.madeneat-post-grid-filter-modal-button {
  background: #3b9c39;
  color: #fff;
  border: none;
  border-radius: 12px;
  font-size: 18px;
  font-weight: 500;
  min-width: 136px;
  height: 52px;
  padding: 0 32px;
  box-shadow: none;
  cursor: pointer;
  transition: background 0.2s, color 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
}

#madeneat-refine-button.madeneat-post-grid-filter-modal-button:hover {
  background: #318a32;
}

/* Loading spinner */
.madeneat-loading-spinner {
  display: none;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
}

.madeneat-loading-spinner.show {
  display: flex;
}

.madeneat-loading-spinner::after {
  content: "";
  display: block;
  width: 48px;
  height: 48px;
  border: 4px solid #3b9c39;
  border-radius: 50%;
  border-top-color: transparent;
  animation: madeneat-spin 0.8s linear infinite;
}

.madeneat-post-grid-filter-content-item-row .content-wrapper {
  display: flex;
  flex-direction: column;
  row-gap: 10px;
}

.madeneat-end-of-list {
    text-align: center;
    font-size: 18px;
    font-weight: 500;
    color: #3b9c39;
}

@keyframes madeneat-spin {
  0% {
    transform: rotate(0deg);
  }
  100% {
    transform: rotate(360deg);
  }
}

/* CSS Break points */

@media screen and (max-width: 480px) {
  .madeneat-2-column-grid,
  .madeneat-4-column-grid,
  #madeneat-post-filter-content {
    grid-template-columns: repeat(1, 1fr);
  }

  .madeneat-post-grid-filter-top-search-wrapper {
    min-width: 100%;
    max-height: 53px;
  }

  .madeneat-post-grid-filter-top-search-wrapper {
    min-width: 100%;
    max-height: 53px;
  }

  .madeneat-post-grid-filter-top-search-icon {
    border-radius: 0 20px 20px 0;
  }  

  .madeneat-post-grid-filter-top-search-icon,
  .madeneat-post-grid-filter-top-search-wrapper input:not([type="submit"]) {
    height: 53px;
  }

  #madeneat-show-modal-button.madeneat-post-grid-filter-top-button {
    max-width: 100%;
    min-width: 100% !important;
  }
}

@media screen and (max-width: 768px) and (min-width: 480px) {
  .madeneat-2-column-grid,
  .madeneat-4-column-grid,
  #madeneat-post-filter-content {
    grid-template-columns: repeat(2, 1fr);
  }

  .madeneat-post-grid-filter-top-search-wrapper {
    min-width: 100%;
    max-height: 53px;
  }

  .madeneat-post-grid-filter-top-search-icon {
    border-radius: 0 20px 20px 0;
  }  

  .madeneat-post-grid-filter-top-search-icon,
  .madeneat-post-grid-filter-top-search-wrapper input:not([type="submit"]) {
    height: 53px;
  }

  #madeneat-show-modal-button.madeneat-post-grid-filter-top-button {
    max-width: 100%;
    min-width: 100% !important;
  }
}

@media screen and (max-width: 1024px) and (min-width: 768px) {
  .madeneat-2-column-grid,
  .madeneat-4-column-grid,
  #madeneat-post-filter-content {
    grid-template-columns: repeat(2, 1fr);
  }

  .madeneat-post-grid-filter-top-search-wrapper {
    min-width: 100%;
    max-height: 53px;
  }

  .madeneat-post-grid-filter-top-search-wrapper {
    min-width: 100%;
    max-height: 53px;
  }

  .madeneat-post-grid-filter-top-search-icon {
    border-radius: 0 20px 20px 0;
  }  

  .madeneat-post-grid-filter-top-search-icon,
  .madeneat-post-grid-filter-top-search-wrapper input:not([type="submit"]) {
    height: 53px;
  }

  #madeneat-show-modal-button.madeneat-post-grid-filter-top-button {
    max-width: 100%;
    min-width: 100% !important;
  }
}

@media (max-width: 768px) {
  .madeneat-post-grid-filter-top {
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
  }
  .madeneat-post-grid-filter-top-search-wrapper {
    max-width: 100%;
  }
  .madeneat-post-grid-filter-top-button {
    width: 100%;
    justify-content: center;
    margin-left: 0;
  }
}

.madeneat-checkbox-grid-filter {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}

.madeneat-post-grid-filter-modal-content-location,
.madeneat-post-grid-filter-modal-content-context {
  position: relative;
  display: flex;
  align-items: center;
  gap: 16px;
  min-height: 25px;
}

.madeneat-checkbox-grid-filter + label {
  position: relative;
  padding-left: 42px;
  cursor: pointer;
  font-size: 18px;
  line-height: 1;
  color: #222;
  display: flex;
  align-items: center;
  user-select: none;
}

.madeneat-checkbox-grid-filter + label:before {
  content: "";
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 25px;
  height: 25px;
  border: 2px solid #3b9c39;
  border-radius: 5px;
  background: #fff;
  box-sizing: border-box;
  transition: border-color 0.2s;
}

.madeneat-checkbox-grid-filter:checked + label:after {
  content: "";
  position: absolute;
  left: 5.5px;
  top: 2px;
  width: 13.75px;
  height: 10.96px;
  border-left: 2.5px solid #3b9c39;
  border-bottom: 2.5px solid #3b9c39;
  transform: rotate(-45deg);
  border-radius: 1.5px;
}

.madeneat-checkbox-grid-filter:focus + label:before {
  outline: none;
  outline-offset: 0;
}

#madeneat-show-modal-button.madeneat-post-grid-filter-top-button {
  position: relative;
  background: #fff;
  color: #f05f28;
  border: 2px solid #f05f28;
  border-radius: 15px;
  font-size: 21px;
  font-weight: 500;
  min-width: 392px;
  height: 52px;
  padding-left: 56px;
  padding-right: 24px;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  background-image: url("../../assets/images/Filter-orange.svg");
  background-repeat: no-repeat;
  background-position: 20px center;
  background-size: 28px 28px;
  transition: background 0.2s, color 0.2s, border-color 0.2s;
  cursor: pointer;
  text-align: left;
}

#madeneat-show-modal-button.madeneat-post-grid-filter-top-button:hover {
  background-color: #f05f28;
  color: #ffffff;
  background-image: url("../../assets/images/Filter.svg");
}

.madeneat-scroll-to-load-more {
  opacity: 0;
  pointer-events: none;
}

.madeneat-scroll-to-load-more.show {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin: 32px 0 0 0;
  font-size: 18px;
  color: #3b9c39;
  font-weight: 500;
  width: 100%;
  text-align: center;
  opacity: 1;
  transition: opacity 0.2s;
}

.madeneat-scroll-to-load-more.show .arrow-down-anim {
  width: 32px;
  height: 32px;
  display: inline-block;
  animation: madeneat-bounce 1.2s infinite;
}
@keyframes madeneat-bounce {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(12px); }
}

.grant-filter-button-level-1.active,
.grant-filter-button-level-2.active {
  background-color: #3f8ce6 !important;
  color: #fff !important;
  border: 2px solid #3f8ce6;
}

/* Responsive styles for Micromodal */
@media screen and (max-width: 768px) {
  .modal__container {
    width: 95%;
    max-height: 90vh;
    margin: 20px;
  }
  
  .modal__header {
    padding: 20px 20px 0 20px;
  }
  
  .modal__title {
    font-size: 20px;
    padding-bottom: 20px;
  }
  
  .modal__title::before {
    left: -20px;
    width: calc(100% + 40px);
  }
  
  .modal__close {
    top: 20px;
    right: 20px;
  }
  
  .modal__content {
    padding: 0 20px;
    max-height: 50vh;
  }
  
  .modal__footer {
    padding: 15px 20px;
    flex-direction: column;
    gap: 15px;
    align-items: stretch;
  }
  
  #madeneat-refine-button.madeneat-post-grid-filter-modal-button {
    width: 100%;
    min-width: unset;
  }
  
  #madeneat-clear-filters-button.madeneat-post-grid-filter-modal-button {
    text-align: center;
  }
}

.madeneat-post-grid-filter-content-item p.card-subtitle {
    display: -webkit-box;
    -webkit-line-clamp: 4;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

@media screen and (max-width: 480px) {
  .modal__container {
    width: 98%;
    margin: 10px;
  }
  
  .modal__header {
    padding: 15px 15px 0 15px;
  }
  
  .modal__title {
    font-size: 18px;
    padding-bottom: 15px;
  }
  
  .modal__title::before {
    left: -15px;
    width: calc(100% + 30px);
  }
  
  .modal__close {
    top: 15px;
    right: 15px;
  }
  
  .modal__content {
    padding: 0 15px;
    max-height: 45vh;
  }
  
  .modal__footer {
    padding: 15px;
  }

  #madeneat-show-modal-button.madeneat-post-grid-filter-top-button {
    height: auto;
    min-height: 52px;
    padding-top: 10px;
    padding-bottom: 10px;
  }
}
