.content-width {
  width: 900px !important;
}

#banner {
  background-color: var(--dblue);
  height: 60vh;
  max-height: 1000px;
  min-height: 650px;
  position: relative;
}

#banner::before {
  content: '';
  background-color: var(--dblue);
  position: absolute;
  inset: 0;
  /* background-image set inline per-request via template */
  background-size: cover;
  background-position: center;
  opacity: 0;
  transition: opacity 0.3s;
  z-index: 0;
}

#banner.bg-loaded::before {
  opacity: 0.2;
}

#banner-content {
  z-index: 2;
  height: 100%;
}

#banner-content h1 {
  font-size: 3rem;
  font-weight: 400;
}

.cbc-insights {
  font-weight: 600;
}

.insights-pill {
  font-size: 12px;
  padding: 8px 16px;
  border-radius: 100px;
}

#insights-pill-left {
  background-color: var(--yel);
  font-weight: 600;
}

#banner-search-wrapper {
  height: 100%;
}

.topic-pill {
  padding: 6px 12px;
  font-size: 14px;
  border-radius: 100px;
  border: 1px solid white;
  background-color: rgba(255, 255, 255, 0.10);
  cursor: pointer;
  color: white;
  transition: .3s all;
  text-decoration: none;
}

.topic-pill:hover {
  background-color: white;
  color: var(--dblue);
  transform: translateY(-2px);
}

#topic-listing-wrapper, .all-topics-title-wrapper {
  width: 80vw;
  max-width: 1500px;
}

#topic-listing-categories {
  width: 220px;
  flex-shrink: 0;
  border-right: 1px solid var(--lgrey);
}

#cat-select {
  display: none;
}

.topic-listing-cat {
  text-align: left;
  border: none;
  background-color: white;
  padding: 8px 12px;
  font-weight: 400;
  color: var(--dblue);
  border-left: 3px solid white;
  transition: all .3s;
}

.topic-listing-cat:hover {
  font-weight: 500;
  background-color: var(--highlight-blue);
}

.topic-listing-cat.active {
  background-color: var(--dblue);
  color: white;
  border-left: 3px solid var(--yel);
}

#topic-listing-tab-wrapper {
  border-bottom: 1px solid var(--lgrey);
}

#tab-select {
  display: none;
  width: auto;
}

.topic-listing-tab {
  padding: 12px;
  padding-top: 0px;
  color: #004964aa;
  font-weight: 400;
  background-color: transparent;
  border: none;
  border-bottom: 3px solid white;
  transition: all .2s, border .2s ease;
}

.topic-listing-tab:hover {
  color: black;
  font-weight: 400;
}

.topic-listing-tab.active {
  color: var(--dblue);
  font-weight: 600;
  border-bottom: 3px solid #004964;
}

/* ── Topic grid ──────────────────────────────────────────────────────────── */

.topic-listing-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 1.25rem;
}

.topic-card-link {
  display: flex;
  flex-direction: column;
  text-decoration: none;
  color: inherit;
  border-radius: 0px;
  overflow: hidden;
  transition: box-shadow .2s, transform .2s;
  position: relative;
  height: 280px;
}

.topic-card-link:hover {
  box-shadow: 0 4px 16px rgba(0, 73, 100, 0.12);
  transform: translateY(-2px);
  color: inherit;
}

.topic-card-c1 {
  position: absolute;
  top: 0px;
  left: 0px;
  z-index: 1;
  font-size: 11px;
  font-weight: 600;
  background-color: var(--yel);
  color: var(--dblue);
  padding: 4px 10px;
  border-radius: 0px;
}

.topic-card-img {
  width: 100%;
  flex: 1 1 0;
  min-height: 0;
  object-fit: cover;
  display: block;
  background-color: var(--highlight-blue);
  opacity: 0;
  transition: opacity 0.3s;
}

.topic-card-img.loaded {
  opacity: 1;
}

.topic-card-footer {
  padding: 16px;
  display: flex;
  flex-direction: column;
  background-color: var(--dblue);
  color: white;
  gap: 4px;
}

.topic-card-title {
  font-size: 18px;
  font-weight: 600;
  color: white;
  line-height: 1.3;
}

.topic-card-meta {
  font-size: 12px;
  color: rgba(255, 255, 255, 0.67);
}

.form-select {
  font-size: 16px;
}

.show-more-btn {
  font-size: 16px;
}

/* ── Responsive ──────────────────────────────────────────────────────────── */

@media (max-width: 920px) {
  .content-width {
    width: 100% !important;
    padding: 0 20px !important;
  }
}

@media (max-width: 850px) {
  #banner {
    min-height: unset;
    height: fit-content;
    padding-top: 0 !important;
  }

  #banner-content {
    flex-direction: column !important;
    padding-top: 110px;
    justify-content: space-around !important;
    min-height: unset;
    height: fit-content;
    width: 100vw;
    gap: 2rem !important;
  }

  #banner-text {
    flex: unset;
  }

  #banner-content h1 {
    font-size: 2rem;
  }

  #banner-search-wrapper {
    justify-content: flex-start !important;
    padding-bottom: 64px;
  }

  #banner-topic-pills {
    display: none;
  }
  #topic-listing-wrapper {
    flex-direction: column !important;
    gap: 2rem !important;
    padding: 36px !important;
    padding-top: 0px !important;
    width: unset;
  }

  #topic-listing-categories {
    border: none;
    width: 100%;
  }

  #topic-listing-categories .text-muted {
    display: none;
  }
  #topic-listing-cat-wrapper {
    display: none !important;
  }

  #cat-select {
    display: block !important;
    width: 100%;
  }
  #cat-select .form-select {
    width: 100%;
  }
}

@media (max-width: 550px) {

  #topic-listing-wrapper {
    gap: 1rem !important;
  }

  #topic-listing-categories {
    width: auto;
    border-right: none;
  }

  #topic-listing-tab-wrapper {
    display: none !important;
  }

  #tab-select {
    display: block !important;
    width: 100%;
  }

}

@media (max-width: 375px) {
  .search-input {
    font-size: 20px;
  }

  .search-input-group .bi {
    font-size: 20px;
  }
}
