.reason-bento__wrapper {
  max-width: 1200px;
  margin-left: auto;
  margin-right: auto;
  padding-left: 1rem;
  padding-right: 1rem;
}

.reason-bento__header {
  padding-top: 1rem;
  padding-bottom: 1rem;
}

.reason-bento__header aside p {
  font-size: 15px;
  margin-bottom: 1rem;
}

/* For tablet landscape up */
@media (min-width: 900px) {
  .reason-bento__header aside p {
    text-align: center;
  }
}

.reason-bento__header h2 {
  font-size: 30px;
  letter-spacing: -0.5px;
  line-height: 1.1;
  margin-bottom: 1rem;
}

/* For tablet landscape up */
@media (min-width: 900px) {
  .reason-bento__header h2 {
    font-size: 36px;
    text-align: center;
  }
}

.reason-bento__grid {
  display: block;
}

/* For tablet landscape up */
@media (min-width: 900px) {
  .reason-bento__grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr); /* 4 columns */
    grid-template-rows: repeat(2, auto); /* 2 rows */
    gap: 16px; /* Space between grid items */
  }
}

/* For desktop up */
@media (min-width: 1200px) {
  .reason-bento__grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr); /* 4 columns */
    grid-template-rows: repeat(2, auto); /* 2 rows */
    gap: 16px; /* Space between grid items */
  }
}

/* REASON BENTO ITEM */
.reason-bento-item {
  border-radius: 10px;
  position: relative;
  margin-bottom: 2rem;
  height: 300px;
}

/* For tablet landscape up */
@media (min-width: 900px) {
  .reason-bento-item {
    margin-bottom: 0;
    height: inherit;
  }
}

/* First column items */
.reason-bento-item.item1 {
  grid-column: 1 / 2; /* Start at column 1, end before column 2 */
  grid-row: 1 / 2; /* First row */
}

.reason-bento-item.item5 {
  grid-column: 1 / 2; /* Start at column 1, end before column 2 */
  grid-row: 2 / 3; /* Second row */
}

/* Second column item */
.reason-bento-item.item2 {
  grid-column: 2 / 3; /* Start at column 2, end before column 3 */
  grid-row: 1 / 3; /* Span across both rows */
}

/* For tablet landscape up */
@media (min-width: 900px) {
  .reason-bento-item.item2 {
    height: 500px;
  }
}

/* Third column item */
.reason-bento-item.item3 {
  grid-column: 3 / 4; /* Start at column 3, end before column 4 */
  grid-row: 1 / 3; /* Span across both rows */
}

/* For tablet landscape up */
@media (min-width: 900px) {
  .reason-bento-item.item3 {
    height: 500px;
  }
}

/* Fourth column items */
.reason-bento-item.item4 {
  grid-column: 4 / 5; /* Start at column 4, end before column 5 */
  grid-row: 1 / 2; /* First row */
}

.reason-bento-item.item6 {
  grid-column: 4 / 5; /* Start at column 4, end before column 5 */
  grid-row: 2 / 3; /* Second row */
}

.reason-bento-item aside {
  z-index: 2;
  position: absolute;
  width: 100%;
  height: 100%;
  background: linear-gradient(to bottom, #154734, transparent 50%);
  border-radius: 10px;
}

/* For tablet landscape up */
@media (min-width: 900px) {
  .reason-bento-item.item2 aside,
  .reason-bento-item.item3 aside {
    background: linear-gradient(to bottom, #154734, transparent, #154734);
  }
}

.reason-bento-item figure {
  position: absolute;
  z-index: 1;
  width: 100%;
  height: 100%;
}

.reason-bento-item figure img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 10px;
}

.reason-bento-item section {
  position: relative;
  z-index: 3;
  padding: 1rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  height: 100%;
}

.reason-bento-item section header h3 {
  color: var(--white);
  font-size: 20px;
  font-family: var(--body-font-family);
  font-weight: bold;
  line-height: 1.3;
  max-width: 300px;
  padding-top: 1rem;
}

/* For tablet landscape up */
@media (min-width: 900px) {
  .reason-bento-item section header h3 {
    font-size: 18px;
  }
}

.reason-bento-item section footer p {
  display: none;
  color: var(--white);
}

/* For tablet landscape up */
@media (min-width: 900px) {
  .reason-bento-item section footer p {
    display: block;
  }
}

/* REASON BENTO MODAL */
/* Modal Background */
.reason-bento__modal-background {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5); /* Dark overlay */
  z-index: 10;
  opacity: 0;
  transition: opacity 0.3s ease;
  visibility: hidden;
  overflow-y: auto; /* Allows scrolling if the modal content is taller than the viewport */
}

.reason-bento__modal-background.is-active {
  display: block;
  opacity: 1;
  visibility: visible;
}

/* Modal Content */
.reason-bento-modal {
  display: none;
  position: relative;
  margin: 40px auto;
  background: white;
  z-index: 20;
  max-width: 600px;
  width: 90%;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
  opacity: 0;
  transition: opacity 0.3s ease;
  visibility: hidden;
  border-radius: 8px;
  max-height: calc(100% - 80px); /* Ensures the modal doesn't exceed the viewport height */
  overflow-y: auto; /* Allows the content inside the modal to scroll if necessary */
}

.reason-bento-modal.is-active {
  display: block;
  opacity: 1;
  visibility: visible;
}

/* Modal Figure */
.reason-bento-modal figure {
  aspect-ratio: 16 / 9;
}

.reason-bento-modal figure img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-top-left-radius: 10px;
  border-top-right-radius: 10px;
}

.reason-bento-modal section {
  padding: 1rem;
}

/* For tablet landscape up */
@media (min-width: 900px) {
  .reason-bento-modal section {
    padding: 2rem;
  }
}

.reason-bento-modal section h3 {
  font-size: 22px;
  letter-spacing: -0.5px;
  font-weight: bold;
  margin-bottom: 1rem;
}

/* For tablet landscape up */
@media (min-width: 900px) {
  .reason-bento-modal section h3 {
    font-size: 28px;
  }
}

/* Modal Button */
.reason-bento-modal .button--primary {
  margin-top: 2rem;
}