/* Featured topic hubs: scoped to generated topic pages. */
.topic-page main {
  padding-bottom: 8px;
}

.topic-page .seo-hero {
  position: relative;
  min-height: 320px;
  padding: clamp(34px, 5vw, 64px);
  overflow: hidden;
  background: linear-gradient(125deg, var(--blue-dark) 0%, var(--blue) 72%, #2e6aa6 100%);
  box-shadow: var(--ds-shadows-panel);
}

.topic-page .seo-hero::after {
  position: absolute;
  right: -70px;
  bottom: -135px;
  width: 330px;
  height: 330px;
  border: 46px solid rgba(255, 255, 255, 0.08);
  border-radius: 50%;
  content: "";
}

.topic-page .seo-hero > * {
  position: relative;
  z-index: 1;
}

.topic-page .topic-feature-hero {
  display: grid;
  min-height: 0;
  padding: 0;
  grid-template-columns: minmax(0, 2fr) minmax(0, 3fr);
  align-items: stretch;
}

.topic-page .topic-feature-hero::after {
  display: none;
}

.topic-feature-hero .topic-hero-copy {
  display: flex;
  min-width: 0;
  padding: clamp(30px, 3.5vw, 46px);
  flex-direction: column;
  justify-content: center;
}

.topic-feature-hero .topic-eyebrow {
  align-self: flex-start;
}

.topic-feature-hero h1 {
  max-width: 17em;
  font-size: clamp(30px, 2.6vw, 34px);
  line-height: 1.28;
  text-wrap: balance;
}

.topic-feature-hero p {
  max-width: 520px;
  font-size: 15px;
  line-height: 1.7;
}

.topic-feature-hero figure {
  position: relative;
  min-height: 0;
  margin: 0;
  aspect-ratio: 16 / 9;
  overflow: hidden;
}

.topic-feature-hero img,
.topic-hub-thumb img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.topic-feature-hero figcaption {
  position: absolute;
  right: 12px;
  bottom: 12px;
  padding: 5px 8px;
  color: #fff;
  background: rgba(7, 21, 41, 0.72);
  border-radius: 4px;
  font-size: 10px;
}

.topic-page .topic-eyebrow,
.topic-kicker {
  color: var(--blue-dark);
  background: var(--focus-accent);
  border-radius: 0;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.13em;
}

.topic-hub-intro {
  display: grid;
  margin: 24px 0;
  padding: 28px 30px;
  grid-template-columns: minmax(0, 1fr) minmax(300px, 0.7fr);
  align-items: end;
  gap: 28px;
  color: #fff;
  background: var(--blue-dark);
  border-radius: var(--ds-radii-medium);
}

.topic-hub-intro--compact {
  padding: 0;
  grid-template-columns: minmax(0, 2fr) minmax(0, 3fr);
  align-items: stretch;
  gap: 0;
  overflow: hidden;
}

.topic-hub-intro--compact h1 {
  max-width: 17em;
  font-size: clamp(30px, 2.6vw, 34px);
  text-wrap: balance;
}

.topic-hub-copy {
  display: flex;
  min-width: 0;
  padding: clamp(30px, 3.5vw, 46px);
  flex-direction: column;
  justify-content: center;
}

.topic-hub-copy .topic-kicker {
  align-self: flex-start;
}

.topic-hub-copy p {
  max-width: 520px;
  margin-top: 14px;
  font-size: 15px;
  line-height: 1.7;
}

.topic-hub-thumb {
  min-height: 0;
  height: auto;
  margin: 0;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  border-radius: 0;
}

.topic-kicker {
  display: inline-flex;
  margin-bottom: 13px;
  padding: 6px 10px;
}

.topic-hub-intro h1 {
  margin: 0;
  max-width: 760px;
  color: #fff;
  font-size: clamp(28px, 3.1vw, 42px);
  font-weight: 400;
  line-height: 1.25;
}

.topic-hub-intro p {
  margin: 0;
  color: rgba(255, 255, 255, 0.82);
  font-size: 16px;
  line-height: 1.75;
}

.topic-stat-grid {
  display: grid;
  margin: 0 0 24px;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--ds-radii-medium);
  overflow: hidden;
}

.topic-stat {
  min-width: 0;
  padding: 22px 24px;
  border-right: 1px solid var(--line);
}

.topic-stat:last-child {
  border-right: 0;
}

.topic-stat strong,
.topic-stat span,
.topic-stat small {
  display: block;
}

.topic-stat strong {
  color: var(--blue);
  font-size: clamp(28px, 3vw, 42px);
  font-weight: 400;
  line-height: 1;
}

.topic-stat span {
  margin-top: 9px;
  color: var(--ink);
  font-size: 15px;
}

.topic-stat small {
  margin-top: 6px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
}

.topic-feature-heading > span {
  color: var(--focus-accent);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.14em;
}

.topic-feature-section {
  margin: 24px 0;
  padding: clamp(24px, 3.5vw, 42px);
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--ds-radii-medium);
}

.topic-feature-heading {
  display: grid;
  margin-bottom: 26px;
  grid-template-columns: minmax(130px, 0.28fr) minmax(0, 1fr);
  gap: 28px;
  align-items: start;
}

.topic-feature-heading > span {
  padding-top: 8px;
  color: var(--blue);
}

.topic-feature-heading h2 {
  margin: 0;
  color: var(--blue-dark);
  font-size: clamp(26px, 3vw, 38px);
  font-weight: 400;
  line-height: 1.25;
}

.topic-feature-heading p {
  max-width: 760px;
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 15px;
  line-height: 1.7;
}

.topic-feature-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.topic-feature-grid:has(.topic-feature-card:nth-child(4)) {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.topic-feature-card {
  display: flex;
  min-width: 0;
  min-height: 230px;
  padding: 22px;
  flex-direction: column;
  color: var(--ink);
  background: var(--soft);
  border-top: 4px solid var(--blue);
  transition: transform var(--ds-motion-fast) var(--ds-motion-ease), box-shadow var(--ds-motion-fast) var(--ds-motion-ease), background-color var(--ds-motion-fast) var(--ds-motion-ease);
}

a.topic-feature-card:hover,
a.topic-feature-card:focus-visible {
  color: var(--ink);
  background: #fff;
  box-shadow: var(--ds-shadows-card);
  transform: translateY(-3px);
}

a.topic-feature-card:focus-visible {
  outline: 3px solid rgba(36, 85, 144, 0.28);
  outline-offset: 2px;
}

.topic-feature-label {
  color: var(--blue);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
}

.topic-feature-card h3 {
  margin: 18px 0 10px;
  color: var(--blue-dark);
  font-size: 21px;
  font-weight: 400;
  line-height: 1.4;
}

.topic-feature-card p {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.7;
}

.topic-feature-action {
  display: flex;
  margin-top: auto;
  padding-top: 22px;
  align-items: center;
  justify-content: space-between;
  color: var(--blue);
  font-size: 13px;
}

.topic-feature-action b {
  font-size: 20px;
  font-weight: 400;
}

.topic-page .external-source-panel {
  margin: 24px 0;
  padding: clamp(24px, 3.5vw, 40px);
}

.topic-page .external-source-panel .seo-link-list {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.topic-page .external-source-panel .seo-link-list a {
  min-height: 92px;
  flex-direction: column;
  justify-content: center;
}

.topic-page .external-source-panel .seo-link-list span {
  white-space: normal;
}

.topic-related {
  display: grid;
  margin: 24px 0;
  padding: 20px 22px;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 28px;
  align-items: center;
  background: var(--blue);
  border-radius: var(--ds-radii-medium);
}

.topic-related > span {
  color: var(--focus-accent);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.12em;
}

.topic-related > div {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.topic-related a {
  min-width: 0;
  padding: 7px 18px;
  color: #fff;
  border-left: 1px solid rgba(255, 255, 255, 0.25);
}

.topic-related strong,
.topic-related a span {
  display: block;
}

/* One editorial type scale for every generated public subpage. */
.topic-page main :where(
  .topic-feature-heading h2,
  .seo-card h2,
  .match-data-heading h2,
  .directory-heading h2
) {
  font-size: 26px;
  font-weight: 400;
  line-height: 1.3;
}

.topic-page main :where(.topic-feature-card h3, .match-data-card h3) {
  font-size: 20px;
  font-weight: 400;
  line-height: 1.4;
}

.topic-page main :where(
  .topic-feature-heading p,
  .topic-feature-card p,
  .seo-card p,
  .seo-card li,
  .directory-intro
) {
  font-size: 15px;
  line-height: 1.7;
}

.topic-page main :where(.topic-hero-actions a, .topic-feature-action, .seo-link-list a) {
  font-size: 14px;
}

.topic-related strong {
  overflow: hidden;
  font-size: 15px;
  font-weight: 400;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.topic-related a span {
  margin-top: 4px;
  color: rgba(255, 255, 255, 0.7);
  font-size: 12px;
}

@media (max-width: 980px) {
  .topic-hub-intro--compact {
    grid-template-columns: minmax(0, 2fr) minmax(0, 3fr);
  }

  .topic-hub-intro--compact .topic-hub-thumb {
    grid-column: auto;
    grid-row: auto;
  }

  .topic-feature-grid:has(.topic-feature-card:nth-child(4)),
  .topic-page .external-source-panel .seo-link-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 680px) {
  .topic-page .seo-hero {
    min-height: 0;
    margin: 14px auto;
    padding: 28px 22px;
  }

  .topic-page .seo-hero h1 {
    font-size: 28px;
  }

  .topic-page .seo-hero p {
    font-size: 15px;
    line-height: 1.7;
  }

  .topic-page .topic-feature-hero {
    padding: 0;
    grid-template-columns: 1fr;
  }

  .topic-feature-hero .topic-hero-copy {
    padding: 25px 22px 27px;
  }

  .topic-feature-hero figure {
    min-height: 0;
  }

  .topic-feature-hero img {
    height: auto;
    aspect-ratio: 16 / 9;
  }

  .topic-hub-intro {
    margin: 14px 0;
    padding: 22px;
    grid-template-columns: 1fr;
    align-items: start;
    gap: 14px;
  }

  .topic-hub-intro--compact {
    padding: 0;
    grid-template-columns: 1fr;
    gap: 0;
  }

  .topic-hub-copy {
    padding: 25px 22px 27px;
  }

  .topic-hub-intro h1 {
    font-size: 28px;
  }

  .topic-hub-intro--compact > p,
  .topic-hub-intro--compact .topic-hub-thumb {
    grid-column: auto;
    grid-row: auto;
  }

  .topic-hub-thumb {
    width: 100%;
    height: auto;
  }

  .topic-hub-thumb img {
    height: auto;
    aspect-ratio: 16 / 9;
  }

  .topic-stat-grid {
    margin-bottom: 14px;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .topic-stat {
    padding: 17px 15px;
    border-bottom: 1px solid var(--line);
  }

  .topic-stat:nth-child(2n) {
    border-right: 0;
  }

  .topic-stat:nth-last-child(-n + 2) {
    border-bottom: 0;
  }

  .topic-stat strong {
    font-size: 30px;
  }

  .topic-page main :where(
    .topic-feature-heading h2,
    .seo-card h2,
    .match-data-heading h2,
    .directory-heading h2
  ) {
    font-size: 24px;
  }

  .topic-page main :where(.topic-feature-card h3, .match-data-card h3) {
    font-size: 19px;
  }

  .topic-feature-section {
    margin: 14px 0;
    padding: 22px 14px 14px;
  }

  .topic-feature-heading {
    margin-bottom: 18px;
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .topic-feature-heading > span {
    padding-top: 0;
  }

  .topic-feature-heading h2 {
    font-size: 27px;
  }

  .topic-feature-grid,
  .topic-feature-grid:has(.topic-feature-card:nth-child(4)),
  .topic-page .external-source-panel .seo-link-list {
    grid-template-columns: 1fr;
  }

  .topic-feature-card {
    min-height: 0;
    padding: 19px;
  }

  .topic-feature-action {
    padding-top: 18px;
  }

  .topic-page .external-source-panel {
    margin: 14px 0;
    padding: 22px 14px;
  }

  .topic-related {
    margin: 14px 0;
    padding: 20px;
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .topic-related > div {
    grid-template-columns: 1fr;
  }

  .topic-related a {
    padding: 12px 0;
    border-top: 1px solid rgba(255, 255, 255, 0.22);
    border-left: 0;
  }

  .topic-related strong {
    white-space: normal;
  }
}
