/* theme.css — design tokens matching the Streamlit app's theme + custom accents.
   Streamlit theme: primary #EE2D4E, bg #FFFFFF, secondaryBg #F0F2F6, text #262730.
   Fonts: Streamlit 1.50 declares `font-family:"Source Sans"` (sans) and
   `font-family:"Source Code Pro"` (mono), each weight 100 900. */

/* Streamlit's exact fonts, self-hosted (byte-identical woff2 to what Streamlit 1.50
   bundles → verified by MD5), so no external/Google Fonts dependency. Family names,
   weight ranges and the --font stack below all mirror Streamlit's own CSS. */
@font-face {
  font-family: "Source Sans";
  src: url("../lib/fonts/SourceSansVF-Upright.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Source Sans";
  src: url("../lib/fonts/SourceSansVF-Italic.woff2") format("woff2");
  font-weight: 100 900;
  font-style: italic;
  font-display: swap;
}
/* Monospace for st.code()-style blocks (matrix-steps panel). */
@font-face {
  font-family: "Source Code Pro";
  src: url("../lib/fonts/SourceCodeVF-Upright.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Source Code Pro";
  src: url("../lib/fonts/SourceCodeVF-Italic.woff2") format("woff2");
  font-weight: 100 900;
  font-style: italic;
  font-display: swap;
}

:root {
  /* Streamlit theme */
  --primary: #ee2d4e;
  --primary-hover: #d92845;
  --bg: #ffffff;
  --secondary-bg: #f0f2f6;
  --text: #262730;
  --text-muted: #808495;
  --border: rgba(49, 51, 63, 0.2);
  --border-strong: rgba(49, 51, 63, 0.4);

  /* App custom accents (from the source CSS) */
  --blue: #2a60a3;        /* headers / sidebar text */
  --red: #ee2d4e;         /* accents / slider */
  --purple: #6c60a0;      /* trend page title */
  --info-bg: #e6f3ff;     /* info boxes */
  --info-border: #b6d4fe;
  --info-text: #0054a3;
  --slider-track: #e0e0e0;

  /* CI band colors (Plotly) */
  --ci-cyan: #63cadb;
  --ci-blue: #2a60a3;
  --ci-red: #ee2d4e;

  /* Typography & shape — exactly Streamlit 1.50's stacks. */
  --font: "Source Sans", sans-serif;
  --font-mono: "Source Code Pro", monospace;
  --radius: 0.5rem;
  --radius-sm: 0.25rem;
  --shadow-focus: 0 0 0 1px var(--primary);
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

a {
  color: var(--blue);
}

h1,
h2,
h3,
h4,
h5,
h6 {
  font-weight: 600;
  line-height: 1.2;
  margin: 0 0 0.5rem 0;
  color: var(--text);
}
/* Markdown heading scale, matching Streamlit (measured): h3 1.75rem (28px),
   h4 1.5rem (24px), h5 1.25rem (20px), h6 1rem. Needed for raw <h4>/<h5> in
   rich content (e.g. the methodology); class headings (.app-title/.step-header/
   .subhead/.chart-heading) override where appropriate. */
h3 {
  font-size: 1.75rem;
}
h4 {
  font-size: 1.5rem;
}
h5 {
  font-size: 1.25rem;
}
h6 {
  font-size: 1rem;
}

/* Hide heading anchor icons (matches source) */
h1 a,
h2 a,
h3 a,
h4 a,
h5 a,
h6 a {
  display: none !important;
}

p {
  margin: 0 0 0.75rem 0;
}

/* Lists in rendered (richText) i18n content: methodology, intro, info boxes */
ul,
ol {
  margin: 0.5rem 0 0.85rem 1.5rem;
  padding: 0;
}
li {
  margin-bottom: 0.3rem;
  line-height: 1.5;
}

hr {
  border: none;
  border-top: 1px solid var(--border);
  /* Streamlit st.divider / hr = 32px top+bottom margin (measured). */
  margin: 2em 0;
}

.muted {
  color: var(--text-muted);
}

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