.bi-container {
  max-width: 1176px;
  margin: 0 auto;
  padding: 0 20px;
}

/* --------------------------------- Hero ---------------------------------- */

.bi-hero {
  background: #e5dece;
}

.bi-hero-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 40px 20px 56px;
  text-align: center;
}

.bi-hero-image {
  width: 210px;
  height: 140px;
  object-fit: contain;
  margin-bottom: 24px;
}

.bi-hero-heading {
  margin: 0;
  color: #000;
  font-family: "Vanilla Bold";
  font-size: 64px;
  font-weight: 400;
  line-height: 1;
  text-transform: uppercase;
}

/* ==========================================================================
   Insights hub listing (knowledgehub.cshtml - Bridging + Residential Insights)
   Figma PRECISE "Bridging insights":
     Desktop 6191:35951 (1280) | Tablet 6205:64806 (768) | Mobile 6205:65101 (320)
   Everything below is scoped to .bi-tabs-section / .bi-results-section, which
   only the hub templates render, so article/detail pages are unaffected.
   ========================================================================== */

/* Hub content width: 1168px on desktop (Figma x 52-1219). */
.bi-tabs-section .bi-container,
.bi-results-section .bi-container {
  max-width: 1208px;
  padding: 0 20px;
}

/* ------------------------------ Tabs / search ----------------------------- */

.bi-tabs-section {
  background: #fff;
}

.bi-tabs-bar {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  flex-wrap: nowrap;
  gap: 31px;
  padding: 30px 0 0; /* hero to tabs */
}

.bi-tabs {
  display: flex;
  position: relative;
  flex-wrap: nowrap;
  flex: 1 1 auto;
  min-width: 0;
  margin-left: calc(-1 * var(--bi-tab-inset, 20px));
  --bi-tab-inset: 20px;
}

/* Full-width hairline under the tabs (Figma "Line 238"). */
.bi-tabs::after {
  content: "";
  position: absolute;
  left: var(--bi-tab-inset, 20px);
  right: 0;
  bottom: 0;
  height: 1px;
  background: rgba(40, 40, 38, 0.15);
}

.bi-tab {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  position: relative;
  height: 48px;
  padding: 0 20px;
  border: 0;
  background: none;
  color: #282826;
  opacity: 0.5;
  font-family: "Inter-Regular";
  font-size: 16px;
  white-space: nowrap;
  cursor: pointer;
}

.bi-tab.is-active {
  opacity: 1;
  color: #000;
  font-family: "Inter-Bold";
  font-weight: 700;
}

/* Active underline runs from the label to the tab's right edge (Figma "Line 237"). */
.bi-tab.is-active::after {
  content: "";
  position: absolute;
  left: var(--bi-tab-inset, 20px);
  right: 0;
  bottom: 0;
  height: 2px;
  background: #282826;
  z-index: 1;
}

.bi-tabs-actions {
  display: flex;
  align-items: center;
  flex: 0 0 auto;
  flex-wrap: nowrap;
  gap: 30px;
}

.bi-search {
  display: flex;
  align-items: center;
  height: 48px;
  padding: 0;
  background: #f2efec;
  border: 0.5px solid transparent;
}

.bi-search[data-open="true"] {
  border-color: #000;
}

.bi-search-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 55px;
  height: 48px;
  padding: 0;
  border: 0;
  background: none;
  cursor: pointer;
}

.bi-search-input {
  width: 0;
  height: 48px;
  padding: 0;
  border: 0;
  overflow: hidden;
  background: none;
  color: #282826;
  font-family: "Inter-Regular";
  font-size: 16px;
  transition: width 0.15s ease, padding 0.15s ease;
  -webkit-appearance: none;
  appearance: none;
}

.bi-search-input::-webkit-search-cancel-button,
.bi-search-input::-webkit-search-decoration {
  -webkit-appearance: none;
  appearance: none;
  display: none;
}

.bi-search[data-open="true"] .bi-search-input {
  width: 200px;
  padding: 0 8px;
  overflow: visible;
}

.bi-search-input:focus,
.bi-search-input:focus-visible,
.bi-search-btn:focus,
.bi-search-btn:focus-visible,
.bi-search-clear:focus,
.bi-search-clear:focus-visible {
  outline: none;
}

.bi-search-clear {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 48px;
  padding: 0;
  border: 0;
  background: none;
  cursor: pointer;
}

.bi-search-clear[hidden] {
  display: none;
}

.bi-back-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 198px;
  height: 48px;
  padding: 14px 20px;
  border: 1px solid #000;
  color: #030303;
  font-family: "Inter-Medium";
  font-size: 16px;
  text-transform: uppercase;
  text-decoration: none;
  white-space: nowrap;
}

.bi-back-btn:hover,
.bi-back-btn:focus-visible {
  background: #f2efec;
}

/* ----------------------------- Results section ---------------------------- */

.bi-results-section {
  background: #fff;
  padding: 50px 0 80px; /* 50px below the tabs line, 80px above the footer */
}

.bi-empty-state {
  margin: 0 0 50px;
  padding: 24px;
  background: #f2efec;
  color: #282826;
  font-family: "Inter-Regular";
  font-size: 16px;
  text-align: center;
}

.bi-empty-state[hidden] {
  display: none;
}

.bi-tag {
  display: inline-flex;
  align-items: center;
  align-self: flex-start;
  flex: none;
  height: 32px;
  padding: 10px 20px;
  margin: 0 0 30px;
  background: #fff;
  color: #000;
  font-family: "Inter-Bold";
  font-size: 14px;
  font-weight: 700;
  line-height: 1.32;
  text-transform: uppercase;
  white-space: nowrap;
}

.bi-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  align-self: flex-start;
  flex: none;
  min-width: 207px;
  height: 48px;
  padding: 14px 48px;
  margin-top: auto;
  background: #282826;
  color: #fff;
  font-family: "Inter-Bold";
  font-size: 20px;
  font-weight: 700;
  line-height: normal;
  text-decoration: none;
  white-space: nowrap;
}

.bi-btn:hover,
.bi-btn:focus-visible {
  background: #000;
  color: #fff;
}

/* --------------------------------- Featured -------------------------------- */
/* Desktop: 513px image + 654px panel, 342px tall. */

.bi-featured {
  display: flex;
  min-height: 342px;
  margin-bottom: 50px;
  background: #f2efec;
}

.bi-featured[hidden] {
  display: none;
}

.bi-featured-media {
  flex: 0 0 44%;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  background: #e5dece;
  color: #282826;
}

.bi-featured-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.bi-featured-body {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  padding: 42px 52px;
}

.bi-featured-body .bi-tag {
  margin-bottom: 40px;
}

.bi-featured-title {
  margin: 0 0 20px;
  color: #282826;
  font-family: "Inter-SemiBold";
  font-size: 28px;
  font-weight: 600;
  line-height: normal;
}

.bi-featured-text {
  margin: 0 0 40px;
  max-width: 506px;
  color: #282826;
  font-family: "Inter-Medium";
  font-size: 18px;
  font-weight: 500;
  line-height: normal;
}

/* ----------------------------------- Grid ---------------------------------- */
/* Desktop: two columns, 50px gaps; each card is a 244px image beside the text panel. */

.bi-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 50px;
}

.bi-card {
  display: flex;
  flex-direction: row;
  min-height: 294px;
  background: #f2efec;
}

.bi-card-media {
  flex: 0 0 244px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  background: #e5dece;
  color: #282826;
}

.bi-card-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.bi-card-media-icon {
  width: 32px;
  height: 32px;
}

.bi-card-body {
  display: flex;
  flex: 1 1 auto;
  min-width: 0;
  flex-direction: column;
  align-items: flex-start;
  padding: 30px 20px 30px 34px;
}

.bi-card-title {
  margin: 0 0 10px;
  color: #282826;
  font-family: "Inter-SemiBold";
  font-size: 20px;
  font-weight: 600;
  line-height: normal;
}

.bi-card-text {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3; /* Figma truncates long summaries with an ellipsis */
  overflow: hidden;
  margin: 0 0 30px;
  color: #282826;
  font-family: "Inter-Regular";
  font-size: 16px;
  line-height: normal;
}

/* -------------------------------- Pagination -------------------------------- */
/* Desktop only: 48px squares, 20px apart, 80px below the grid. */

.bi-pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 20px;
  margin-top: 80px;
}

.bi-pagination[hidden] {
  display: none;
}

.bi-page-arrow {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  padding: 0;
  border: 0;
  background: #fff;
  color: #282826;
  cursor: pointer;
}

.bi-page-arrow:disabled {
  opacity: 0.35;
  cursor: default;
}

.bi-page-numbers {
  display: flex;
  gap: 20px;
}

.bi-page-number,
.bi-page-number-ellipsis {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  padding: 0;
  border: 0.5px solid #282826;
  background: #fff;
  color: #282826;
  opacity: 0.5;
  font-family: "Inter-SemiBold";
  font-size: 18px;
  font-weight: 600;
  line-height: 1;
}

.bi-page-number {
  cursor: pointer;
}

.bi-page-number:hover,
.bi-page-number:focus-visible {
  opacity: 1;
}

.bi-page-number.is-active {
  border-color: #282826;
  background: #282826;
  color: #f2efec;
  opacity: 1;
  cursor: default;
}

.bi-load-more-wrap {
  display: none;
  margin-top: 80px;
  text-align: center;
}

.bi-load-more-wrap[hidden] {
  display: none;
}

.bi-load-more {
  height: 48px;
  padding: 14px 48px;
  border: 0;
  background: none;
  color: #030303;
  font-family: "Inter-Medium";
  font-size: 20px;
  font-weight: 500;
  line-height: normal;
  text-decoration: underline;
  text-underline-position: from-font;
  cursor: pointer;
}

/* ================================= Tablet ================================== */
/* Figma 768: 30px gutters, featured 291px image + panel (370px tall),
   cards stacked (150px image), 43px gaps, "Load more" instead of pagination. */

@media (max-width: 1024px) {
  .bi-tabs-section .bi-container,
  .bi-results-section .bi-container {
    padding: 0 30px;
  }

  .bi-back-btn {
    display: none;
  }

  .bi-tabs-bar {
    position: relative;
  }

  .bi-search[data-open="true"] {
    position: absolute;
    right: 0;
    bottom: 0;
    height: 48px;
    z-index: 2;
  }

  .bi-search[data-open="true"] .bi-search-input {
    width: 146px;
  }

  .bi-featured {
    min-height: 370px;
    margin-bottom: 43px;
  }

  .bi-featured-media {
    flex-basis: 41.3%;
  }

  .bi-featured-body {
    padding: 42px 50px;
  }

  .bi-grid {
    gap: 43px;
  }

  .bi-card {
    flex-direction: column;
    min-height: 0;
  }

  .bi-card-media {
    flex: 0 0 150px;
  }

  .bi-card-body {
    padding: 35px 34px 34px;
  }

  .bi-card-body .bi-tag {
    margin-bottom: 20px;
  }

  /* Pagination is desktop-only; tablet/mobile append via "Load more". */
  .bi-pagination {
    display: none !important;
  }

  .bi-load-more-wrap {
    display: block;
  }

  .bi-results-section {
    padding-bottom: 50px;
  }
}

/* ================================= Mobile =================================== */
/* Figma 320: 17px gutters, full-width search bar under the tabs, no featured
   story, one column of cards (100px image), full-width buttons, 30px gaps. */

@media (max-width: 767px) {
  .bi-tabs-section .bi-container,
  .bi-results-section .bi-container {
    padding: 0 17px;
  }

  .bi-tabs-bar {
    flex-direction: column;
    align-items: stretch;
    gap: 20px;
  }

  .bi-tabs {
    flex: none;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    margin-right: -17px; /* tabs scroll off the right edge, as in Figma */
  }

  .bi-tabs::-webkit-scrollbar {
    display: none;
  }

  .bi-tabs-actions {
    justify-content: stretch;
  }

  .bi-search,
  .bi-search[data-open="true"] {
    position: static;
    width: 100%;
    height: 40px;
    transform: none;
  }

  .bi-search-btn,
  .bi-search-clear {
    height: 40px;
  }

  .bi-search-btn {
    width: 48px;
  }

  .bi-search-input,
  .bi-search[data-open="true"] .bi-search-input {
    flex: 1 1 auto;
    width: auto;
    height: 40px;
    padding: 0 8px;
    overflow: visible;
  }

  .bi-results-section {
    padding: 30px 0 50px;
  }

  .bi-featured {
    display: none !important;
  }

  .bi-grid {
    grid-template-columns: 1fr;
    gap: 30px;
  }

  .bi-card-media {
    flex-basis: 100px;
  }

  .bi-card-body {
    padding: 20px 22px;
  }

  .bi-card-title {
    margin-bottom: 15px;
    font-size: 16px;
  }

  .bi-btn {
    width: 100%;
    min-width: 0;
    padding: 14px 24px;
  }

  .bi-load-more-wrap {
    margin-top: 30px;
  }
}

.bi-detail-main {
  background: #fff;
  padding: 40px 0 64px;
}

.bi-detail-container {
  max-width: 828px;
  margin: 0 auto;
  padding: 0 20px;
}

/* ------------------------------- Breadcrumb ------------------------------- */

.bi-detail-crumbs {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin: 0 0 32px;
  font-family: "Inter-Regular";
  font-size: 14px;
  color: #282826;
}

.bi-detail-crumb-link {
  color: #282826;
  text-decoration: none;
}

.bi-detail-crumb-link:hover,
.bi-detail-crumb-link:focus-visible {
  text-decoration: underline;
}

.bi-detail-crumb-sep {
  display: inline-flex;
  align-items: center;
  color: #282826;
  opacity: 0.6;
}

.bi-detail-crumb-current {
  font-family: "Inter-SemiBold";
  font-weight: 600;
}

/* --------------------------------- Article head ---------------------------------- */

.bi-detail-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 16px;
  margin: 0 0 16px;
}

.bi-detail-tag {
  display: inline-flex;
  align-items: center;
  height: 32px;
  padding: 10px 20px;
  background: #e5dece;
  color: #000;
  font-family: "Inter-Bold";
  font-size: 14px;
  font-weight: 700;
  line-height: 1.32;
  text-transform: uppercase;
}

.bi-detail-byline {
  color: #000;
  font-family: "Inter-Regular";
  font-size: 14px;
}

.bi-detail-title {
  margin: 0 0 40px;
  color: #282826;
  font-family: "Inter-SemiBold";
  font-size: 28px;
  font-weight: 600;
  line-height: 1.25;
}

/* --------------------------------- Article body ---------------------------------- */

.bi-detail-heading {
  margin: 0 0 15px;
  color: #282826;
  font-family: "Inter-Medium";
  font-size: 28px;
  font-weight: 500;
}

.bi-detail-text {
  margin: 0 0 15px;
  color: #282826;
  font-family: "Inter-Regular";
  font-size: 16px;
  line-height: 1.4;
}

.bi-detail-body {
  margin-bottom: 64px;
}

.bi-detail-body > :last-child {
  margin-bottom: 0;
}

.bi-detail-media-embeds {
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin-bottom: 64px;
}

.bi-detail-media-embed--video {
  display: block;
  width: 560px;
  /* Keeps the 560x315 size on desktop but stops it overflowing/causing
     horizontal scroll on narrow screens - shrinks proportionally instead
     of clipping or squashing the video. */
  max-width: 100%;
  aspect-ratio: 560 / 315;
  height: auto;
}

.bi-detail-media-embed--audio {
  display: block;
  width: 100%;
  max-width: 400px;
}

.bi-detail-list {
  margin: 0 0 15px;
  padding-left: 20px;
  color: #282826;
  font-family: "Inter-Regular";
  font-size: 16px;
  line-height: 1.4;
}

.bi-detail-list li {
  margin-bottom: 10px;
}

.bi-detail-list li:last-child {
  margin-bottom: 0;
}

/* ------------------------------- Why it worked ------------------------------- */

.bi-why-section {
  margin-bottom: 64px;
}

.bi-why-list {
  display: flex;
  flex-direction: column;
  gap: 24px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.bi-why-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
}

.bi-why-icon {
  display: inline-flex;
  flex: 0 0 auto;
  margin-top: 3px;
  color: #282826;
}

.bi-why-item-title {
  margin: 0 0 5px;
  color: #282826;
  font-family: "Inter-Bold";
  font-size: 16px;
  font-weight: 700;
}

.bi-why-item-text {
  margin: 0;
  color: #282826;
  font-family: "Inter-Regular";
  font-size: 16px;
  line-height: 1.4;
}

/* ----------------------------------- CTA panel ----------------------------------- */

.bi-cta-panel {
  padding: 48px 24px;
  background: #f2efec;
  text-align: center;
}

.bi-cta-heading {
  margin: 0 0 16px;
  color: #282826;
  font-family: "Vanilla Bold";
  font-size: 48px;
  font-weight: 400;
  text-transform: uppercase;
}

.bi-cta-text {
  margin: 0;
  color: #282826;
  font-family: "Inter-Regular";
  font-size: 16px;
  line-height: 1.4;
}

.bi-cta-text a {
  color: inherit;
  text-decoration: underline;
}

/* ================================= Tablet ================================== */


@media (max-width: 1024px) {
  .bi-detail-container {
    max-width: 632px;
    margin: 0 auto;
    padding: 0;
  }

  .bi-detail-title {
    font-size: 24px;
  }

  .bi-detail-heading {
    font-size: 24px;
  }
}

/* ================================= Mobile =================================== */

@media (max-width: 767px) {
  .bi-detail-main {
    padding: 32px 0 48px;
  }

  .bi-detail-container {
    max-width: none;
    padding: 0 20px;
  }

  .bi-detail-crumbs {
    display: none;
  }

  .bi-detail-title {
    font-size: 24px;
  }

  .bi-detail-heading {
    font-size: 20px;
  }

  .bi-detail-body,
  .bi-why-section {
    margin-bottom: 48px;
  }

  .bi-cta-heading {
    font-size: 32px;
  }
}
