/* Impact: real-world impact (RWI) section with hover cards (#impact) */

.RWI-impact-group {
  padding: 150px 60px 0px;
  font-family: Montserrat,-apple-system, Roboto, Helvetica, sans-serif;
}

.RWI-impact-container {
  display: flex;
  gap: 20px;
}

.RWI-impact-sidebar {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  line-height: normal;
  width: 25%;
}

.RWI-sidebar-content {
  display: flex;
  margin-top: -7px;
  width: 100%;
  flex-direction: column;
  align-items: stretch;
}

.RWI-impact-title {
  color: var(--color-gray-700);
  font-size: 40px;
  font-weight: 600;
  align-self: start;
  margin: 0;
}

.RWI-impact-title-light {
  font-weight: 400;
}

/* Impact categories section */
.RWI-impact-categories {
  display: flex;
  margin-top: 40px;
  align-items: stretch;
  gap: 30px;
}

/* Color indicators container */
.RWI-color-indicators {
  border-color: rgba(112, 112, 112, 1);
  border-style: solid;
  border-width: 1px;
  padding: 3px 4px 10px;
}

/* Individual color indicators */
.RWI-indicator {
  display: flex;
  width: 8px;
  flex-shrink: 0;
  height: 52px;
}

.RWI-indicator-green {
  background-color: var(--color-teal-dark);
  margin-top: 4px;
}

.RWI-indicator-teal {
  background-color: rgba(60, 156, 159, 1);
  margin-top: 4px;
}

.RWI-indicator-cyan {
  background-color: rgba(44, 183, 188, 1);
  margin-top: 4px;
}

.RWI-category-list {
  display: flex;
  flex-direction: column;
  align-items: start;
  font-size: 14px;
  color: var(--color-gray-900);
  font-weight: 400;
  flex-grow: 1;
  flex-shrink: 0;
  flex-basis: 0;
  width: 20vw;
  list-style-type: none;
  /* labels follow the indicator bars: same top (border 1px + padding 3px), 52px rows, 4px apart */
  margin: 0;
  padding-top: 4px;
}

.RWI-category-item {
  width: 100%;
  display: flex;
  align-items: center;
  height: 52px;
  margin-top: 4px;
}

.RWI-category-resilience {
  z-index: 10;
}

.RWI-category-economic {
  align-self: stretch;
}

/* Main content area */
.RWI-impact-main {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  line-height: normal;
  width: 68%;
  margin-left: auto;
}

.RWI-main-content {
  flex-grow: 1;
}

/* Image container */
.RWI-impact-image {
  aspect-ratio: 4.55;
  object-fit: contain;
  object-position: center;
  width: 96%;
}

/* Description section */
.RWI-impact-description {
  margin-top: 100px;
  width: 983px;
  max-width: 100%;
}

.RWI-description-container {
  display: flex;
  gap: 20px;
}

/* Description text column */
.RWI-description-column {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  line-height: normal;
  width: 50%;
}

.RWI-description-text {
  color: var(--color-gray-900);
  font-size: 16px;
  line-height: 24px;
  font-weight: 400;
  margin: 0;
}

/* Quote column */
.RWI-quote-column {
  display: flex;
  align-items: flex-end;
  line-height: normal;
  width: 50%;
  margin-left: 20px;
  margin-bottom: 5px;
}

.RWI-impact-quote {
  display: table-cell;
  vertical-align: bottom;
  color: var(--color-gray-700);
  font-size: 25px;
  font-weight: 400;
  margin-bottom: 0;
  animation: rwi-quote-fade-in 1.5s ease-in-out 0.5s both;
}

@keyframes rwi-quote-fade-in {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

/* Bottom divider */
.RWI-content-divider {
  background-color: var(--color-gray-100);
  display: flex;
  margin-top: 50px;
  flex-shrink: 0;
  height: 5px;
}

.hovercard-category-container {
  display: flex;
  background-color: white;
  position: relative;
  left: auto;
  bottom: auto;
  width: 75vw;
}

.hovercard-category-container.resilience {
  display: none;
  /* Hide by default */
  width: 65vw;
  position: relative;
  top: 0;
  left: 0;
  background-color: white;
  z-index: 100;
}

.hovercard-category-container.economic {
  display: none;
  /* Hide by default */
  width: 65vw;
  position: relative;
  top: 0;
  left: 0;
  background-color: white;
  z-index: 100;
}

.hovercard-category-container.housing {
  display: none;
  /* Hide by default */
  width: 65vw;
  position: relative;
  top: 0;
  left: 0;
  background-color: white;
  z-index: 100;
}

.RWI-intro-content {
  display: block;
}

/* Panel switching (impact.js): one category panel or the intro is shown at a time */

.hovercard-category-container.is-visible {
  display: flex;
}

.RWI-intro-content.is-hidden {
  display: none;
}

/* Desktop: the intro and the three panels share one grid cell, so the section keeps the height
   of the tallest panel and hovering a category never moves the content below it. Below 992px
   categories are tapped and the panel expands in place. */

@media (min-width: 992px) {
  .RWI-main-content {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    align-items: start;
  }

  .RWI-main-content > .RWI-intro-content,
  .RWI-main-content > .hovercard-category-container {
    grid-area: 1 / 1;
  }

  .RWI-main-content > .hovercard-category-container,
  .RWI-main-content > .RWI-intro-content.is-hidden {
    display: flex;
    visibility: hidden;
  }

  .RWI-main-content > .RWI-intro-content.is-hidden {
    display: block;
  }

  .RWI-main-content > .hovercard-category-container.is-visible {
    visibility: visible;
  }
}

/* Hover state */

.hovercard-resilience-container {
  display: flex;
  width: 85%;
  max-width: 1302px;
  margin-left: 5%;
  margin-right: auto;
  position: relative;
  gap: 108px;
  z-index: 80;
}

/* Content section */
.hovercard-content-wrapper {
  flex: 1;
  padding: 70px 0 0;
  position: relative;
}

.hovercard-accent-marker {
  width: 9px;
  height: 10px;
  position: absolute;
  top: 70px;
  background-color: var(--color-teal-dark);
}

.hovercard-section-title {
  color: var(--color-gray-800);
  font-family: "Montserrat", sans-serif;
  font-size: 32px;
  font-weight: 300;
  margin-top: 25px;
  margin-bottom: 40px;
  max-width: 370px;
}

.hovercard-section-description {
  color: var(--color-gray-900);
  font-family: "Montserrat", sans-serif;
  font-size: 16px;
  font-weight: 400;
  max-width: 587px;
  margin-bottom: 60px;
}

.hovercard-see-more-link {
  display: flex;
  align-items: center;
  gap: 8px;
  color: #afafaf;
  font-family: "Montserrat", sans-serif;
  font-size: 14px;
  font-weight: 400;
  cursor: pointer;
  text-decoration: none;
  transition: color 0.3s ease;
}

.hovercard-see-more-link:hover,
.hovercard-see-more-link:focus {
  color: var(--color-gray-800);
}

.hovercard-see-more-link:hover .hovercard-arrow-icon path,
.hovercard-see-more-link:hover .hovercard-line-icon path,
.hovercard-see-more-link:focus .hovercard-arrow-icon path,
.hovercard-see-more-link:focus .hovercard-line-icon path {
  stroke: var(--color-gray-800);
  transition: stroke 0.3s ease;
}

.hovercard-see-more-link:focus {
  outline: 2px solid var(--color-teal-dark);
  outline-offset: 2px;
}

.hovercard-arrow-icon,
.hovercard-line-icon {
  transition: transform 0.3s ease;
}

.hovercard-see-more-link:hover .hovercard-arrow-icon,
.hovercard-see-more-link:focus .hovercard-arrow-icon {
  transform: translateX(3px);
}

.hovercard-divider-top {
  width: 100%;
  height: 5px;
  position: absolute;
  top: 40px;
  background-color: var(--color-gray-100);
  z-index: 80;
}

.hovercard-divider-bottom {
  width: 100%;
  height: 5px;
  position: absolute;
  top: auto;
  bottom: 140px;
  z-index: 80;
  margin-top: auto;
  margin-bottom: -100px;
  background-color: var(--color-gray-100);
}

/* Image section */
.hovercard-image-wrapper {
  width: 300px;
  height: 600px;
  flex-shrink: 0;
}

.hovercard-meeting-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

@media (max-width: 991px) {
  .RWI-description-container {
    flex-direction: column;
    gap: 2px;
  }

  .RWI-description-column {
    width: 100%;
    padding: 0;
  }

  .RWI-impact-group {
    height: unset;
    padding-left: 60px;
    padding-right: 0;
    padding-top: 20px;
  }

  /* The category list fills the space beside the indicator bars, so the tapped item's
     focus outline stays on screen */
  .RWI-category-item {
    width: 100%;
    box-sizing: border-box;
    padding-left: 6px;
  }

  .RWI-impact-container {
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    margin-top: 0;
  }

  .RWI-impact-sidebar {
    width: 100%;
  }

  .RWI-sidebar-content {
    margin-top: 0px;
  }

  .RWI-impact-title {
    font-size: 30px;
  }

  .RWI-impact-categories {
    margin-top: 25px;
    margin-right: 20px;
    gap: 16px;
  }

  .RWI-category-list {
    width: auto;
    min-width: 0;
    flex-shrink: 1;
  }

  .RWI-category-economic {
    margin-right: 10px;
  }

  .RWI-impact-main {
    width: 100%;
    margin-left: 0;
  }

  .RWI-main-content {
    max-width: 100%;
    margin-top: 40px;
  }

  .RWI-impact-image {
    max-width: 100%;
  }

  .RWI-impact-description {
    margin-top: 40px;
  }

  .RWI-description-text {
    margin-top: 0px;
    padding-right: 10px;
  }

  .RWI-quote-column {
    width: 100%;
    margin-left: 0;
  }

  .RWI-impact-quote {
    margin-top: 40px;
    font-size: 18px;
  }

  .RWI-content-divider {
    max-width: 100%;
    margin-top: 20px;
  }

  .hovercard-resilience-container {
    flex-direction: column;
    width: 100%;
    gap: 40px;
  }

  .hovercard-content-wrapper {
    padding: 40px 20px;
  }

  .hovercard-image-wrapper {
    width: 100%;
    height: 400px;
  }

  .hovercard-section-title {
    font-size: 24px;
    margin-top: 50px;
  }

  .hovercard-accent-marker {
    left: 23px;
  }

  .hovercard-divider-bottom {
    bottom: 215px;
  }
}

@media (max-width: 350px) {
  .RWI-quote-column {
    margin-bottom: 0;
  }

  .RWI-impact-group {
    padding-top: 0px;
    padding-left: 50px;
  }

  .RWI-impact-image {
    max-width: 90%;
  }
}
