/*
 * Shared system for dynamically-generated hub pages (pages assembled at
 * runtime outside the Astro content pipeline - today just /fixed-income/,
 * built by sif-nav-updater's FIM pipeline; reusable if a future hub, e.g.
 * gold/alternatives/savings-schemes, is built the same way).
 *
 * See samples/Meta investment navigation review/design_handoff_dynamic_pages/
 * README.md for the full spec. Consumes the --mi-* tokens already defined on
 * :root by header-nav.css (always loaded first, on every page that links
 * this file) rather than redefining any color - the two docs deliberately
 * share one token set (see that doc's closing section, "Relationship to the
 * header handoff"). Brand purple stays the site's real --mi-purple (#693BB8),
 * not the doc's mockup #5b21b6 - same call as header-nav.css, for the same
 * reason (see the plan file / conversation history).
 *
 * Linked from sif-nav-updater's fim_static_templates/base.html with a
 * hand-bumped ?v= cache-busting query param (that repo isn't part of the
 * Astro build, so it doesn't get the automatic content-hash versioning
 * SiteLayout.astro's own links get - bump the version by hand here and in
 * base.html whenever this file changes).
 */

.dh-band {
  width: 100%;
  /* style.css's bare `h1{}`/`h2{}` rules default to Playfair Display serif
     (only overridden inside `.content`, which these bands aren't) - the
     design doc explicitly bans serif anywhere on these pages (see doc §3,
     §11.14), so headings here use the same PT Sans stack as the header. */
  font-family: "PT Sans", Helvetica, Arial, sans-serif, -apple-system;
}
.dh-band h1, .dh-band h2, .dh-band h3, .dh-band h4 {
  font-family: inherit;
}
.dh-band__inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px;
}
@media (max-width: 767.98px) {
  .dh-band__inner {
    padding: 0 16px;
  }
}

.dh-visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
}

.dh-band--standard { padding: 64px 0; }
.dh-band--compact { padding: 40px 0; }
.dh-band--hero { padding: 56px 0 60px; }

/* Adjacent same-background bands collapse to one 64px gap instead of both
   paying full padding - see design doc §1. */
.dh-band--standard + .dh-band--standard,
.dh-band--tint + .dh-band--tint {
  padding-top: 0;
}

/* ---------- Typography ---------- */
.dh-h2 {
  font-size: 28px;
  font-weight: 600;
  color: var(--mi-ink);
  margin: 0 0 20px;
}
.dh-h3 {
  font-size: 19px;
  font-weight: 600;
  color: var(--mi-ink);
  margin: 0 0 6px;
}
.dh-h4 {
  font-size: 13px;
  font-weight: 600;
  color: var(--mi-grey-muted);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  margin: 0 0 12px;
}
.dh-body {
  font-size: 15px;
  color: var(--mi-grey-text);
  line-height: 1.55;
  text-align: left;
  text-wrap: pretty;
}
.dh-small {
  font-size: 13px;
  color: var(--mi-grey-muted);
}
.dh-stat {
  font-size: 34px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  color: var(--mi-ink);
}

/* ---------- Hero ---------- */
.dh-hero {
  background: var(--mi-purple);
  background-image: radial-gradient(120% 140% at 85% 0%, rgba(255,255,255,.08), transparent 60%);
  color: #fff;
}
.dh-hero__breadcrumb {
  font-size: 13px;
  color: rgba(255,255,255,.72);
  margin: 0 0 20px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  list-style: none;
  padding: 0;
}
.dh-hero__breadcrumb a {
  color: rgba(255,255,255,.72);
  text-decoration: none;
}
.dh-hero__breadcrumb a:hover {
  color: #fff;
}
.dh-hero__breadcrumb [aria-current="page"] {
  color: #fff;
}
.dh-hero__breadcrumb-sep {
  color: rgba(255,255,255,.4);
}
.dh-hero h1 {
  font-size: 44px;
  font-weight: 600;
  line-height: 1.12;
  letter-spacing: -0.02em;
  color: #fff;
  margin: 0 0 14px;
}
.dh-hero__standfirst {
  font-size: 17px;
  font-weight: 400;
  color: rgba(255,255,255,.88);
  max-width: 62ch;
  line-height: 1.5;
  margin: 0;
}
@media (max-width: 767.98px) {
  .dh-hero h1 { font-size: 34px; }
}
@media (max-width: 599.98px) {
  .dh-hero h1 { font-size: 30px; }
}

/* ---------- Category grid ---------- */
.dh-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 20px;
  align-items: stretch;
}
.dh-grid--lone {
  grid-template-columns: minmax(0, 380px);
}

.dh-card {
  display: flex;
  flex-direction: column;
  height: 100%;
  background: #fff;
  border: 1px solid var(--mi-border);
  border-radius: 10px;
  padding: 24px;
  box-shadow: 0 1px 2px rgba(26,24,32,.04);
  transition: border-color .15s ease;
}
.dh-card:hover {
  border-color: #d5cfe6;
}
.dh-card__icon {
  width: 24px;
  height: 24px;
  color: var(--mi-purple);
  stroke-width: 1.75;
  margin-bottom: 12px;
}
.dh-card__title {
  font-size: 19px;
  font-weight: 600;
  color: var(--mi-ink);
  margin: 0 0 8px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.dh-card__description {
  font-size: 15px;
  color: var(--mi-grey-text);
  line-height: 1.55;
  margin: 0 0 16px;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.dh-card__stat {
  margin-bottom: 16px;
}
.dh-card__stat-value {
  font-size: 34px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  color: var(--mi-ink);
  line-height: 1.1;
}
.dh-card__stat-label {
  font-size: 13px;
  color: var(--mi-grey-muted);
}
.dh-card__action {
  /* Pinned to bottom when no featured block follows. When one does,
     .dh-card__featured takes over that job instead (below) - otherwise
     both would claim the flex column's free space and get pushed apart. */
  margin-top: auto;
}
.dh-card__action:has(~ .dh-card__featured) {
  margin-top: 16px;
}
.dh-card__featured {
  margin-top: auto;
  padding-top: 16px;
  border-top: 1px solid var(--mi-strip-border);
}
.dh-card__featured-label {
  font-size: 13px;
  font-weight: 600;
  color: var(--mi-grey-muted);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  margin: 0 0 8px;
}
.dh-card__featured-rows {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.dh-featured-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 16px;
  padding: 11px 12px;
  border-radius: 6px;
  background: var(--mi-strip-bg);
  text-decoration: none;
}
.dh-featured-row__label {
  font-size: 14px;
  color: var(--mi-ink-body);
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.dh-featured-row__value {
  font-size: 14px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  color: var(--mi-ink);
  flex: none;
  white-space: nowrap;
}
.dh-card__featured-more {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 14px;
  font-weight: 600;
  color: var(--mi-purple);
  text-decoration: none;
  margin-top: 8px;
}
.dh-card__featured-more:hover {
  text-decoration: underline;
}

/* ---------- Buttons and links ---------- */
.dh-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 15px;
  font-weight: 600;
  color: #fff;
  background: var(--mi-purple);
  border-radius: 6px;
  padding: 11px 18px;
  text-decoration: none;
  border: none;
}
.dh-btn:hover {
  background: var(--mi-purple-dark);
  color: #fff;
}
.dh-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 15px;
  font-weight: 600;
  color: var(--mi-purple);
  text-decoration: none;
}
.dh-link:hover {
  text-decoration: underline;
}

/* ---------- Explainer band ---------- */
.dh-explainer {
  background: var(--mi-child-bg);
  border-top: 1px solid var(--mi-strip-border);
  border-bottom: 1px solid var(--mi-strip-border);
}
.dh-explainer__grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 32px;
  align-items: start;
}
.dh-explainer__icon {
  width: 22px;
  height: 22px;
  color: var(--mi-purple);
  stroke-width: 1.75;
  margin-bottom: 10px;
}
.dh-explainer__title {
  font-size: 16px;
  font-weight: 600;
  color: var(--mi-ink);
  margin: 0;
}
.dh-explainer__body {
  font-size: 14px;
  line-height: 1.55;
  color: var(--mi-grey-text);
  margin: 10px 0 0;
}

/* ---------- Deep-link row ---------- */
.dh-deeplinks {
  border-top: 1px solid var(--mi-strip-border);
}
.dh-deeplinks__row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 22px;
}
.dh-deeplinks__row a {
  font-size: 14px;
  color: var(--mi-ink-body);
  text-decoration: none;
}
.dh-deeplinks__row a:hover {
  color: var(--mi-purple);
}

/* ---------- Disclaimer ---------- */
.dh-disclaimer {
  padding: 24px 0 40px;
}
.dh-disclaimer p {
  font-size: 13px;
  line-height: 1.6;
  color: var(--mi-grey-muted);
  max-width: 90ch;
  margin: 0;
}
.dh-disclaimer strong {
  color: var(--mi-grey-text);
  font-weight: 600;
}

/* ---------- Focus ring (matches header-nav.css's rule) ---------- */
.dh-band :focus-visible {
  outline: 2px solid var(--mi-purple);
  outline-offset: 2px;
}

/* ---------- Responsive ---------- */
@media (max-width: 1199.98px) and (min-width: 900px) {
  .dh-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}
@media (max-width: 899.98px) and (min-width: 600px) {
  .dh-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .dh-hero { padding: 48px 0; }
  .dh-band--standard { padding: 48px 0; }
}
@media (max-width: 599.98px) {
  .dh-grid {
    grid-template-columns: 1fr;
  }
  .dh-band--standard { padding: 40px 0; }
  .dh-hero { padding: 40px 0; }
  .dh-hero h1 { font-size: 30px; }
  .dh-stat, .dh-card__stat-value { font-size: 28px; }
}
