/* Theme playbook: evidence numbers and the event guide on theme-detail.html.
   Uses the theme pages' own palette (ink #0d253d, violet #533afd). */


/* Chapter 1: evidence dashboard */
#themeEvidenceSection { padding-block: clamp(64px, 6vw, 90px); background: #eff1f3; }
#themeEvidenceSection .theme-detail-heading h2 > span { display: block; color: inherit; }
.tpb-metric-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; }
.tpb-metric-card { position: relative; display: flex; flex-direction: column; min-width: 0; min-height: 365px; padding: 28px; overflow: hidden; border: 1px solid rgba(255,255,255,.8); border-radius: 30px; background: #fff; color: #222725; }
.tpb-metric-card > * { position: relative; z-index: 1; }
.tpb-metric-card header h3 { margin: 0; color: #242926; font-size: 19px; font-weight: 500; line-height: 1.25; letter-spacing: -.025em; }
.tpb-metric-card header p { margin: 6px 0 0; color: #707970; font-size: 13px; line-height: 1.5; }
.tpb-metric-value { display: block; margin: 22px 0 13px; color: #272c29; font-size: clamp(62px, 6vw, 84px); font-weight: 500; line-height: .98; letter-spacing: -.065em; font-variant-numeric: tabular-nums; }
.tpb-metric-main { margin-top: auto; }
.tpb-metric-main p { max-width: 265px; margin: 0 0 16px; color: #707970; font-size: 13px; line-height: 1.55; }
.tpb-metric-track { flex: 0 0 auto; height: 8px; margin: 0 0 21px; overflow: hidden; border-radius: 8px; background: #f0eff4; }
.tpb-metric-track > span { display: block; height: 100%; border-radius: inherit; background: #7758d5; }
.tpb-metric-source { margin-top: auto; padding-top: 12px; color: #707970; font-size: 10px; font-weight: 500; letter-spacing: .075em; line-height: 1.4; text-transform: uppercase; }
.tpb-metric-pill { display: inline-flex; align-self: start; margin-top: 20px; padding: 6px 10px; border-radius: 999px; background: #f0ebfc; color: #795bd0; font-size: 10px; font-weight: 500; }
.tpb-formal-card .tpb-metric-value { margin-block: 15px 18px; font-size: 76px; }
.tpb-formal-visual { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; margin: 0 0 8px; }
.tpb-dot-matrix { display: grid; flex: 0 0 auto; grid-template-columns: repeat(10, 9px); gap: 5px; }
.tpb-dot-matrix i { width: 9px; height: 9px; border-radius: 50%; background: #eae7f1; }
.tpb-dot-matrix i.is-filled { background: #7758d5; }
.tpb-formal-visual > span { color: #707970; font-size: 11px; }
.tpb-medium-value { margin-block: 18px 0; font-size: 58px; }
.tpb-compare-chart { margin-top: auto; padding: 27px 0 0; }
.tpb-compare-grid { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 18px; }
.tpb-compare-column { display: flex; flex-direction: column; align-items: center; gap: 9px; min-width: 0; }
.tpb-compare-space { position: relative; display: flex; align-items: end; justify-content: center; width: 100%; height: 92px; border-bottom: 1px solid #f0edf5; }
.tpb-compare-bar { position: relative; display: block; width: min(100%, 43px); border-radius: 9px 9px 0 0; background: #7657d5; }
.tpb-compare-bar.is-light { background: #d3c7ef; }
.tpb-compare-bar.is-amber { background: #ebb771; }
.tpb-compare-bar b { position: absolute; top: -19px; left: 50%; transform: translateX(-50%); color: #766e89; font-size: 10px; font-weight: 500; white-space: nowrap; }
.tpb-compare-column small { color: #707970; font-size: 10px; line-height: 1.4; text-align: center; }
.tpb-dual-values { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; margin-top: 18px; }
.tpb-dual-values strong { display: block; color: #272c29; font-size: 36px; font-weight: 500; line-height: 1; letter-spacing: -.055em; }
.tpb-dual-values span { display: flex; align-items: center; gap: 6px; margin-top: 7px; color: #707970; font-size: 11px; }
.tpb-dual-values i { display: inline-block; width: 6px; height: 6px; border-radius: 50%; }
.tpb-dual-values i.is-purple { background: #7657d5; }
.tpb-dual-values i.is-amber { background: #e8a34e; }
.tpb-dual-rings, .tpb-single-ring { position: relative; flex: 0 0 auto; width: 164px; height: 164px; margin: 8px auto 0; }
.tpb-dual-rings { width: 154px; height: 154px; }
.tpb-dual-rings svg, .tpb-single-ring svg { display: block; width: 100%; height: 100%; }
.tpb-ring-track, .tpb-ring-value { fill: none; stroke-width: 12; }
.tpb-ring-track { stroke: #f4f4f4; }
.tpb-ring-value { stroke-linecap: round; }
.tpb-dual-rings > span { position: absolute; inset: 0; display: grid; align-content: center; justify-content: center; color: #707970; font-size: 10px; line-height: 1.4; text-align: center; }
.tpb-single-ring { width: 178px; height: 178px; margin: 12px auto 0; }
.tpb-single-ring > strong { position: absolute; inset: 0; display: grid; place-items: center; color: #2a2e2b; font-size: 42px; font-weight: 500; letter-spacing: -.055em; }
.tpb-metric-caption { margin: 4px 0 9px; color: #707970; font-size: 12px; line-height: 1.5; text-align: center; }
.tpb-rank-value { display: flex; align-items: baseline; gap: 13px; margin: 18px 0 24px; }
.tpb-rank-value > strong { color: #272c29; font-size: 77px; font-weight: 500; line-height: 1; letter-spacing: -.06em; }
.tpb-rank-value sup { position: relative; top: -1.7em; font-size: 18px; letter-spacing: -.03em; }
.tpb-rank-value > span { color: #707970; font-size: 28px; font-weight: 400; letter-spacing: -.04em; }
.tpb-rank-dots { display: grid; grid-template-columns: repeat(23, minmax(0,1fr)); gap: 4px; max-width: 265px; }
.tpb-rank-dots i { width: 100%; aspect-ratio: 1; border-radius: 2px; background: #f0edf6; }
.tpb-rank-dots i.is-current { background: #7657d5; box-shadow: 0 0 0 2px #dfd5f5; }
.tpb-rank-change { display: flex; align-items: center; gap: 14px; margin: auto 0 0; padding-top: 20px; color: #797485; font-size: 13px; }
.tpb-rank-change > span { display: flex; align-items: baseline; gap: 6px; }
.tpb-rank-change small { color: #707970; font-size: 9px; }
.tpb-rank-change i { color: #b5abbf; font-style: normal; }
.tpb-cost-value { display: grid; gap: 3px; margin-top: 25px; font-size: clamp(38px, 4vw, 53px); line-height: 1.05; }
.tpb-cost-value small { color: #707970; font-size: 20px; letter-spacing: -.02em; }
.tpb-cost-caption { position: relative; z-index: 1; margin: 6px 0 20px; color: #707970; font-size: 13px; line-height: 1.6; }
.tpb-cost-card > .tpb-cost-art { position: absolute; z-index: 0; right: 10px; bottom: 36px; width: 115px; height: 92px; color: #e8e1f4; }
.tpb-training-mix { display: grid; gap: 11px; margin: 23px 0 0; }
.tpb-mix-row { display: grid; grid-template-columns: 84px minmax(0,1fr) 36px; align-items: center; gap: 10px; }
.tpb-mix-row > span { color: #707970; font-size: 10px; line-height: 1.4; }
.tpb-mix-row > b { color: #777584; font-size: 10px; font-weight: 500; text-align: right; }
.tpb-mix-track { height: 7px; overflow: hidden; border-radius: 7px; background: #f5f3f8; }
.tpb-mix-track > i { display: block; height: 100%; border-radius: inherit; background: #b2a0e3; }
.tpb-mix-track > i.is-none { background: #7758d5; }
.tpb-mix-track > i.is-a { background: #a58bdf; }
.tpb-mix-track > i.is-b { background: #b8a7e5; }
.tpb-mix-track > i.is-c { background: #c7bcea; }
.tpb-mix-track > i.is-formal { background: #e8b568; }
.tpb-mix-track > i.is-d { background: #d2c9e7; }
.tpb-survey-note { margin: 14px 0 4px; color: #707970; font-size: 10px; line-height: 1.5; }

.tpb-source { margin: 22px 0 0; color: #64748d; font-size: 13px; line-height: 1.6; }
.tpb-source a { color: #533afd; font-weight: 550; white-space: nowrap; }

/* A genuine empty state until constituency events are available. */
.theme-events-empty.theme-events-coming { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 0; min-height: 290px; padding: 48px 24px; border: 1px solid #e5e8ef; border-radius: 26px; background: #f8f9fc; text-align: center; }
.theme-event-empty-icon { display: grid; place-items: center; width: 68px; height: 68px; margin-bottom: 22px; border: 1px solid #e1dcf8; border-radius: 22px; background: #f0ecfc; color: #8b77c4; }
.theme-event-empty-icon svg { display: block; width: 34px; height: 34px; }
.theme-events-coming h3 { margin: 0 0 10px; color: #23374c; font-size: clamp(22px, 2.2vw, 28px); font-weight: 500; line-height: 1.25; letter-spacing: -.03em; }
.theme-events-coming p { max-width: 420px; margin: 0; color: #718095; font-size: 14px; line-height: 1.65; }

/* Anna's events for this theme, until a programme is announced. */
.tpb-anna-section { background: #f6f8fb; }
.tpb-anna-section .theme-detail-heading h2 > span { color: #8b94a3; }
.tpb-anna-empty { display: flex; flex-direction: column; align-items: center; justify-content: center; min-height: 340px; padding: 48px 28px; border-radius: 24px; background: #232326; text-align: center; }
.tpb-anna-meta { display: flex; flex-wrap: wrap; justify-content: center; gap: 9px; margin: 0 0 16px; color: #b8b8bb; font-size: 13px; line-height: 1.5; }
.tpb-anna-empty h3 { max-width: 680px; margin: 0; color: #fff; font-size: clamp(23px, 2.3vw, 30px); font-weight: 500; line-height: 1.2; letter-spacing: -.025em; }
.tpb-anna-description { max-width: 580px; margin: 18px 0 0; color: #b8b8bb; font-size: 15px; line-height: 1.65; }
.tpb-anna-status { display: inline-flex; align-items: center; justify-content: center; min-height: 42px; margin-top: 24px; padding: 9px 22px; border: 1px solid #6f6f75; border-radius: 999px; color: #e5e5e7; font-size: 14px; font-weight: 550; }

@media (max-width: 1000px) {
  .tpb-metric-grid { grid-template-columns: repeat(2, minmax(0,1fr)); }
}
@media (max-width: 640px) {
  .tpb-metric-grid { grid-template-columns: minmax(0,1fr); gap: 14px; }
  .tpb-metric-card { min-height: 340px; padding: 26px; border-radius: 28px; }
  .tpb-metric-value { font-size: 78px; }
  .tpb-medium-value { font-size: 58px; }
  .tpb-cost-value { font-size: 49px; }
  .tpb-source a { white-space: normal; }
}
@media (max-width: 360px) {
  .tpb-metric-card { padding: 22px; }
  .tpb-metric-card header h3 { font-size: 18px; }
  .tpb-metric-value { font-size: 68px; }
  .tpb-medium-value { font-size: 54px; }
  .tpb-cost-value { font-size: 44px; }
  .tpb-mix-row { grid-template-columns: 76px minmax(0,1fr) 32px; gap: 7px; }
}

/* One heading hierarchy across all November chapters. */
#plannedTheme.tpb-november {
  --tpb-heading-size: 2.8rem;
}
#plannedTheme.tpb-november :is(.theme-detail-heading, .theme-resource-heading, .theme-sdg-showcase-head) {
  align-items: flex-start;
  gap: 32px;
  margin-bottom: 32px;
}
#plannedTheme.tpb-november :is(.theme-detail-heading, .theme-resource-heading, .theme-sdg-showcase-head) > div {
  min-width: 0;
  max-width: 780px;
}
#plannedTheme.tpb-november :is(.theme-detail-heading, .theme-resource-heading, .theme-sdg-showcase-head) h2 {
  display: block;
  max-width: 780px;
  margin: 14px 0 0;
  color: #0d253d;
  font-size: var(--tpb-heading-size) !important;
  font-weight: 400;
  line-height: 1.15 !important;
  letter-spacing: -.035em;
  text-wrap: balance;
}
#plannedTheme.tpb-november .theme-resource-heading h2 { color: #fff; }
#plannedTheme.tpb-november .theme-sdg-showcase-head h2 span { display: block; width: auto; color: inherit; }
#plannedTheme.tpb-november :is(.kicker, #plannedSdgLabel) {
  font-size: 12px;
  font-weight: 650;
  line-height: 1.5;
  letter-spacing: .11em;
  text-transform: uppercase;
}
#plannedTheme.tpb-november .theme-sdg-showcase-label { margin: 0; }
#plannedTheme.tpb-november :is(.theme-detail-heading, .theme-resource-heading) > p {
  flex: 0 1 300px;
  max-width: 300px;
  margin: 0;
  font-size: 14px;
  line-height: 1.65;
  text-align: left;
}
@media (max-width: 1000px) {
  #plannedTheme.tpb-november :is(.theme-detail-heading, .theme-resource-heading) {
    display: flex;
    flex-direction: column;
    gap: 18px;
  }
  #plannedTheme.tpb-november :is(.theme-detail-heading, .theme-resource-heading) > p {
    flex-basis: auto;
    max-width: 440px;
  }
}
@media (max-width: 640px) {
  #plannedTheme.tpb-november { --tpb-heading-size: 2rem; }
  #plannedTheme.tpb-november :is(.theme-detail-heading, .theme-resource-heading, .theme-sdg-showcase-head) {
    gap: 18px;
    margin-bottom: 26px;
  }
}
