/* A shared editorial palette. Market gain/loss colours retain their meaning. */
:root {
  --ed-amber: #8b5416;
  --ed-amber-surface: #f8edda;
  --ed-violet: #684392;
  --ed-violet-surface: #f0eaf7;
  --ed-teal: #176d69;
  --ed-teal-surface: #e5f1ed;
  --ed-rose: #954e65;
  --ed-rose-surface: #f8eaf0;
  --ed-card: #fffdf8;
  --ed-shadow: 0 20px 60px rgb(49 39 21 / 8%);
}
html[data-theme="dark"] {
  --ed-amber: #efcc8b;
  --ed-amber-surface: #352d21;
  --ed-violet: #d1b8ed;
  --ed-violet-surface: #2d2638;
  --ed-teal: #a3d9ce;
  --ed-teal-surface: #203632;
  --ed-rose: #edb5c7;
  --ed-rose-surface: #38272f;
  --ed-card: #202823;
  --ed-shadow: 0 20px 60px rgb(0 0 0 / 18%);
}

/* Hero: one clear message, an honest worked example, two useful next steps. */
main > .hero {
  grid-template-columns: minmax(0, 1fr) minmax(390px, 1fr);
  gap: clamp(32px, 5vw, 76px);
  padding-block: 52px 64px;
  align-items: center;
}
.hero .hero-copy {
  min-width: 0;
  padding: 20px 0;
  position: relative;
  isolation: isolate;
}
.hero .hero-copy::before {
  content: "";
  position: absolute;
  inset: -12px -18px;
  z-index: -1;
  border-radius: 28px;
  background: color-mix(in srgb, var(--paper) 94%, transparent);
}
.hero .hero-copy > .eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border: 1px solid color-mix(in srgb, var(--ed-amber) 28%, var(--paper));
  border-radius: 999px;
  background: var(--ed-amber-surface);
  color: var(--ed-amber);
  font-size: 10px;
  line-height: 1.4;
  letter-spacing: 1.4px;
  max-width: 100%;
}
.hero .hero-copy > .eyebrow .tiny-square {
  flex: 0 0 6px;
  margin: 0;
  background: currentColor;
  border-radius: 50%;
}
.hero .hero-copy h1 {
  margin: 24px 0;
  font-size: clamp(48px, 5.7vw, 79px);
  letter-spacing: -0.065em;
  line-height: 1.04;
  font-weight: 500;
}
.hero .hero-copy h1 em {
  font-family: var(--serif);
  color: var(--brand);
  letter-spacing: -0.06em;
  font-weight: 400;
}
.hero .hero-description {
  max-width: 470px;
  font-size: clamp(16px, 1.5vw, 18px);
  line-height: 1.75;
  margin-bottom: 26px;
}
.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}
.hero-actions .button {
  min-height: 48px;
  gap: 15px;
  font-size: 13px;
  padding: 14px 21px;
}
html .hero .hero-secondary {
  background: var(--ed-violet-surface);
  color: var(--ed-violet);
  border-color: color-mix(in srgb, var(--ed-violet) 32%, var(--paper));
}
html .hero .hero-secondary:hover {
  background: var(--ed-violet);
  color: var(--paper);
}
.hero .hero-small {
  font-size: 12px;
  margin-top: 14px;
}
.hero-assurance {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 24px;
  margin-block: 28px 22px;
  padding-top: 20px;
  border-top: 1px solid var(--line);
  font-size: 12px;
  color: var(--muted);
}
.hero-assurance > span {
  display: inline-flex;
  align-items: center;
  gap: 7px;
}
.hero-assurance svg {
  color: var(--ed-teal);
  flex: 0 0 18px;
}
.hero-dashboard {
  min-width: 0;
  position: relative;
}
.hero-dashboard::before {
  content: "";
  position: absolute;
  inset: -26px -24px 12px;
  border-radius: 44px;
  z-index: -1;
  background:
    radial-gradient(
      ellipse at 12% 18%,
      var(--ed-amber-surface),
      transparent 68%
    ),
    radial-gradient(
      ellipse at 90% 78%,
      var(--ed-violet-surface),
      transparent 72%
    );
}
html .hero .hero-dashboard .hero-example {
  overflow: hidden;
  border: 1px solid color-mix(in srgb, var(--ed-amber) 28%, var(--paper));
  border-radius: 24px;
  background: var(--ed-card);
  box-shadow: var(--ed-shadow);
  backdrop-filter: none;
}
.hero .example-top {
  padding: 20px 24px 16px;
  align-items: center;
  border-bottom: 1px solid var(--line);
  color: var(--ed-amber);
  letter-spacing: 1.4px;
}
.hero-example-number {
  font-variant-numeric: tabular-nums;
  padding: 4px 8px;
  border-radius: 6px;
  background: var(--ed-amber-surface);
}
html .hero .hero-dashboard .hero-example .quick-chart {
  --blue: var(--ed-violet);
  --teal: var(--ed-teal);
  --coral: var(--ed-amber);
  --chart-ink: var(--ink);
  background: transparent;
  padding: 22px 24px 18px;
  border-radius: 0;
  color: var(--ink);
}
.hero .chart-story {
  margin-bottom: 24px;
  gap: 14px;
}
.hero .chart-story img {
  padding: 8px;
  background: var(--ed-amber-surface);
  border-radius: 16px;
  width: 60px;
  height: 60px;
}
.hero .chart-story p {
  margin-top: 5px;
  font-size: 18px;
}
.hero .chart-kicker {
  color: var(--ed-amber);
}
.hero .price-columns {
  --label-h: 44px;
  gap: 18px;
}
.hero .chart-number {
  font-size: clamp(24px, 2.5vw, 33px);
  font-variant-numeric: tabular-nums;
  letter-spacing: -1px;
}
.hero .price-bar {
  border-radius: 9px 9px 0 0;
  background-image: linear-gradient(
    135deg,
    rgb(255 255 255 / 14%),
    transparent
  );
  margin-top: 9px;
}
.hero .price-columns .chart-label {
  height: 44px;
  font-size: 11px;
  line-height: 1.4;
}
.hero .chart-message {
  border-color: var(--line);
  padding-top: 14px;
  margin-top: 10px;
  font-size: 14px;
}
html .hero .quick-chart figcaption {
  margin-top: 9px;
  font-size: 11px;
  color: var(--muted);
}
.hero .example-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  padding: 16px 24px;
  margin: 0;
  border-top: 1px solid var(--line);
  background: var(--ed-amber-surface);
}
.hero .example-bottom .eyebrow {
  font-size: 9px;
  color: var(--ed-amber);
}
.hero .example-bottom p {
  margin: 6px 0 0;
  font-size: 22px;
  color: var(--ink);
}
.hero .example-bottom a {
  max-width: 150px;
  font-size: 11px;
  color: var(--ed-amber);
}
.hero-quick-links {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-top: 14px;
}
.hero-quick-links a {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 15px 14px;
  border: 1px solid color-mix(in srgb, var(--ed-violet) 25%, var(--paper));
  border-radius: 16px;
  background: var(--ed-violet-surface);
  color: var(--ed-violet);
  font-size: 12px;
  line-height: 1.4;
  text-decoration: none;
  min-width: 0;
}
.hero-quick-links a:nth-child(2) {
  color: var(--ed-teal);
  background: var(--ed-teal-surface);
  border-color: color-mix(in srgb, var(--ed-teal) 25%, var(--paper));
}
.hero-quick-links a > span:last-child {
  margin-left: auto;
}
.hero-quick-links a:hover {
  text-decoration: underline;
}
.hero-link-icon {
  flex: 0 0 24px;
  display: flex;
}

/* Carry the colour system through the home page and the site's core tools. */
.section-heading .eyebrow {
  color: var(--ed-violet);
}
.latest-list {
  gap: 12px;
  border-top: 0;
}
.latest-list a {
  padding: 20px 22px;
  background: var(--ed-card);
  border: 1px solid var(--line);
  border-left: 3px solid var(--ed-violet);
  border-radius: 4px 14px 14px 4px;
  gap: 9px;
}
.latest-list li:nth-child(3n + 2) a {
  border-left-color: var(--ed-amber);
}
.latest-list li:nth-child(3n) a {
  border-left-color: var(--ed-teal);
}
.latest-list li:first-child a {
  background: var(--ed-violet-surface);
}
.latest-list .latest-title {
  font-size: 20px;
}
.guide-card .card-meta {
  color: var(--ed-violet);
}
html:root .tools-section .tool-card {
  background: var(--ed-amber-surface);
  border-top-color: var(--ed-amber);
}
html:root .tools-section .tool-card:nth-child(2) {
  background: var(--ed-rose-surface);
  border-top-color: var(--ed-rose);
}
html:root .tools-section .tool-card:nth-child(3) {
  background: var(--ed-violet-surface);
  border-top-color: var(--ed-violet);
}
html:root .tools-section .tool-card:nth-child(4) {
  background: var(--ed-teal-surface);
  border-top-color: var(--ed-teal);
}
html:root .tools-section .tool-card:nth-child(5) {
  background: var(--ed-card);
  border-top-color: var(--ed-amber);
}
.learning-feature .learning-method {
  background: var(--ed-violet-surface);
}
.learning-method .learning-step {
  border-color: var(--ed-violet);
  color: var(--ed-violet);
}
.article-head > .eyebrow,
.article-head .eyebrow > .meta-divider {
  color: var(--ed-violet);
}
.cic-app .cic-form {
  border-top: 3px solid var(--ed-violet);
}
.platform-details {
  border-color: color-mix(in srgb, var(--ed-violet) 35%, var(--line));
}
html:root .market-chart-links {
  background-color: var(--ed-teal-surface);
}
html:root .market-load-prompt {
  background-color: var(--ed-card);
}

@media (max-width: 1000px) {
  main > .hero {
    gap: 32px;
  }
  .hero .hero-copy h1 {
    font-size: 58px;
  }
}
@media (max-width: 900px) {
  main > .hero {
    grid-template-columns: minmax(0, 1fr);
    padding-block: 32px 48px;
  }
  .hero .hero-copy {
    padding: 0;
  }
  .hero .hero-copy h1 {
    font-size: clamp(44px, 8vw, 64px);
    max-width: 650px;
  }
  .hero .hero-description {
    max-width: 600px;
  }
  .hero-dashboard {
    width: 100%;
    max-width: 650px;
    margin-inline: auto;
  }
  .hero .chart-number {
    font-size: clamp(24px, 4.5vw, 33px);
  }
}
@media (max-width: 480px) {
  .hero-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .hero-actions .button {
    padding: 12px 10px;
    gap: 6px;
    font-size: 12px;
  }
  .hero .hero-copy > .eyebrow {
    font-size: 9px;
    letter-spacing: 1px;
  }
  .hero .hero-copy h1 {
    font-size: clamp(40px, 11vw, 52px);
  }
  .hero .example-top {
    padding: 16px 18px 12px;
    font-size: 9px;
  }
  html .hero .hero-dashboard .hero-example .quick-chart {
    padding: 18px 16px;
  }
  .hero .chart-story img {
    width: 48px;
    height: 48px;
    padding: 6px;
    border-radius: 12px;
  }
  .hero .chart-story p {
    font-size: 16px;
  }
  .hero .chart-kicker {
    font-size: 9px;
  }
  .hero .chart-number {
    font-size: clamp(20px, 6vw, 27px);
    letter-spacing: -0.8px;
  }
  .hero .price-columns {
    gap: 10px;
  }
  .hero .example-bottom {
    padding: 16px 18px;
  }
  .hero .example-bottom p {
    font-size: 21px;
  }
  .hero-quick-links a {
    flex-wrap: wrap;
    padding: 14px;
  }
  .hero-quick-links a > span:nth-child(2) {
    order: 3;
    flex: 0 0 100%;
  }
  .hero-dashboard::before {
    inset-inline: -8px;
  }
  .latest-list a {
    padding: 18px;
  }
}
@media print {
  .hero-dashboard::before {
    display: none;
  }
  html .hero .hero-dashboard .hero-example {
    box-shadow: none;
  }
}

/* Featured entry in the home hero (src/featured-home.mjs). */
.hero-election {
  display: flex;
  align-items: center;
  gap: 12px;
  max-width: 520px;
  margin-top: 18px;
  padding: 12px 16px;
  border: 1px solid color-mix(in srgb, var(--ed-rose) 30%, var(--paper));
  border-radius: 14px;
  background: var(--ed-rose-surface);
  color: var(--ink);
  font-size: 14px;
  line-height: 1.45;
  text-decoration: none;
}
.hero-election:hover,
.hero-election:focus-visible {
  border-color: var(--ed-rose);
}
.hero-election-tag {
  flex: 0 0 auto;
  padding: 4px 9px;
  border-radius: 999px;
  background: var(--ed-rose);
  color: var(--paper);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.6px;
  text-transform: uppercase;
}
.hero-election-text {
  flex: 1 1 auto;
  font-weight: 600;
}
/* On a phone the date goes on its own line, so the text keeps the width. */
@media (max-width: 560px) {
  .hero-election {
    flex-wrap: wrap;
  }
  .hero-election-text {
    flex-basis: calc(100% - 32px);
  }
}

/* Report themes (src/article-themes.mjs): what a report is about, as a
   coloured label with an icon. --theme is the theme's colour; everything
   else is mixed from it, so both colour schemes follow. */
.theme-trading {
  --theme: #3a4aa3;
}
.theme-stocks {
  --theme: #2465ad;
}
.theme-gold {
  --theme: #8a6410;
}
.theme-debt {
  --theme: #a8432e;
}
.theme-ai {
  --theme: #684392;
}
.theme-rates {
  --theme: #176d69;
}
.theme-public {
  --theme: #4a5a78;
}
.theme-elections {
  --theme: #954e65;
}
.theme-saving {
  --theme: #2f7a3d;
}
.theme-household {
  --theme: #9a5a1c;
}
html[data-theme="dark"] .theme-trading {
  --theme: #b3bdf5;
}
html[data-theme="dark"] .theme-stocks {
  --theme: #9cc6f0;
}
html[data-theme="dark"] .theme-gold {
  --theme: #e6c878;
}
html[data-theme="dark"] .theme-debt {
  --theme: #f0a694;
}
html[data-theme="dark"] .theme-ai {
  --theme: #d1b8ed;
}
html[data-theme="dark"] .theme-rates {
  --theme: #a3d9ce;
}
html[data-theme="dark"] .theme-public {
  --theme: #b9c6de;
}
html[data-theme="dark"] .theme-elections {
  --theme: #edb5c7;
}
html[data-theme="dark"] .theme-saving {
  --theme: #a7d6ae;
}
html[data-theme="dark"] .theme-household {
  --theme: #efc391;
}
.theme-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 10px 3px 8px;
  border: 1px solid color-mix(in srgb, var(--theme) 35%, transparent);
  border-radius: 999px;
  background: color-mix(in srgb, var(--theme) 10%, transparent);
  color: var(--theme);
  font-family: Arial, Helvetica, sans-serif;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.6px;
  line-height: 1.5;
  text-transform: uppercase;
  white-space: nowrap;
  vertical-align: middle;
}
.theme-chip .theme-icon {
  flex: none;
}
/* The report's headline block: a band of the theme's colour, its icon large
   and faint behind the headline, and the short answer in the same colour. */
.article-head[class*="theme-"] {
  position: relative;
  margin-top: 8px;
  padding: 30px 28px 32px;
  border-top: 5px solid var(--theme);
  border-radius: 0 0 18px 18px;
  background: linear-gradient(
    180deg,
    color-mix(in srgb, var(--theme) 9%, transparent),
    transparent 260px
  );
  overflow: hidden;
}
.article-head[class*="theme-"] > * {
  position: relative;
}
.article-head .theme-mark {
  position: absolute;
  top: 18px;
  right: 18px;
  color: var(--theme);
  opacity: 0.13;
  pointer-events: none;
}
.article-head .theme-mark .theme-icon {
  display: block;
  stroke-width: 1.1;
}
.article-head[class*="theme-"] > .eyebrow,
.article-head[class*="theme-"] .eyebrow > .meta-divider {
  color: var(--theme);
}
.article-head[class*="theme-"] .short-answer {
  border-left-color: var(--theme);
  background: color-mix(in srgb, var(--theme) 9%, var(--paper));
}
.article-head[class*="theme-"] .short-answer strong {
  color: var(--theme);
}
.article-layout[class*="theme-"] .article-summary .eyebrow,
.article-layout[class*="theme-"] .article-end .eyebrow {
  color: var(--theme);
}
.article-layout[class*="theme-"] .article-body h2 {
  padding-left: 14px;
  border-left: 4px solid var(--theme);
}
.article-layout[class*="theme-"] .article-body > p a,
.article-layout[class*="theme-"] .article-body li a {
  text-decoration-color: var(--theme);
}
.article-layout[class*="theme-"] .data-chart {
  border-top: 3px solid var(--theme);
}
/* Home: each of the newest reports takes its theme's colour. */
.latest-list li[class*="theme-"] a {
  border-left-color: var(--theme);
}
.latest-list li[class*="theme-"]:first-child a {
  background: color-mix(in srgb, var(--theme) 9%, var(--ed-card));
}
.latest-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
}
/* Report cards and the Topics list. */
.guide-card[class*="theme-"] {
  border-top: 3px solid var(--theme);
}
.guide-card[class*="theme-"] .card-meta {
  color: var(--theme);
  align-items: center;
}
.theme-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0 0 6px;
}
.theme-dot {
  display: inline-block;
  width: 9px;
  height: 9px;
  margin-right: 9px;
  border-radius: 50%;
  background: var(--theme, var(--line));
}
@media (max-width: 760px) {
  .article-head[class*="theme-"] {
    padding: 22px 16px 24px;
    border-radius: 0 0 14px 14px;
  }
  .article-head .theme-mark .theme-icon {
    width: 84px;
    height: 84px;
  }
}
@media print {
  .article-head .theme-mark {
    display: none;
  }
}
