/*
 * 02 · Tokens and base. Everything lives under .cira-ir.
 * Colour, type and spacing values are taken from the CIRA corporate site
 * (src/styles/style.css + light.css); see c1-report.md for the mapping.
 */

.cira-ir {
  /* brand: light.css :root */
  --ci-burgundy: #703845;      /* exact logo burgundy */
  --ci-burgundy-hi: #8A4756;
  --ci-burgundy-deep: #5C2D39; /* corporate btn-solid hover */
  --ci-night: #402027;         /* deep section ground */
  --ci-panel: #512832;         /* raised card on dark */
  --ci-deep: #32191F;          /* footer + loader curtain */
  --ci-greige: #D9CDBE;        /* accent on dark surfaces */
  --ci-greige-hi: #EAE0D3;
  --ci-rose: #B0A294;
  /* paper and ink: style.css :root */
  --ci-paper: #F5EFE3;
  --ci-paper-2: #ECE3D2;
  --ci-card: #FFFDF8;          /* corporate news card / field ground */
  --ci-ink: #241419;
  --ci-ink-2: rgba(36, 20, 25, .76);
  --ci-ink-3: rgba(36, 20, 25, .64);
  --ci-line: rgba(36, 20, 25, .14);
  --ci-line-soft: rgba(36, 20, 25, .08);
  --ci-cream: #F3EADB;
  --ci-cream-2: rgba(243, 234, 219, .8);
  --ci-cream-3: rgba(243, 234, 219, .62);
  --ci-line-dark: rgba(243, 234, 219, .16);
  /* market colours, tuned to sit with burgundy (AA on paper and on night) */
  --ci-up: #2D6A4C;
  --ci-down: #A8372D;
  --ci-up-dark: #9BD6B5;
  --ci-down-dark: #F3A99D;
  --ci-err: #B0433C;           /* corporate .err */
  /* type */
  --ci-disp: 'Source Serif 4', Georgia, 'Times New Roman', serif;
  --ci-body: 'Albert Sans', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --ci-track: .34em;           /* corporate eyebrow tracking */
  /* motion: corporate easings */
  --ci-ease: cubic-bezier(.19, 1, .22, 1);
  --ci-ease-luxe: cubic-bezier(.65, .05, 0, 1);
  /* layout */
  --ci-wrap: min(92vw, 1240px);
  --ci-sec-y: clamp(64px, 8vw, 116px);
  --ci-radius: 20px;
  --ci-radius-sm: 12px;
  --ci-bar-h: 76px;

  font-family: var(--ci-body);
  font-size: 16px;
  line-height: 1.6;
  color: var(--ci-ink);
  background: var(--ci-paper);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  min-height: 100vh;
  overflow-x: clip;
}

.cira-ir[dir='rtl'] {
  /* The corporate site's Arabic pair: Cairo for display, IBM Plex Sans Arabic for text. */
  --ci-disp: 'Cairo', 'IBM Plex Sans Arabic', 'Albert Sans', system-ui, sans-serif;
  --ci-body: 'IBM Plex Sans Arabic', 'Albert Sans', system-ui, sans-serif;
  --ci-track: 0;
  line-height: 1.85;
}

/*
 * Arabic is never tracked: letter-spacing breaks the joins between letters. One rule zeroes it on
 * every element of an Arabic page, whatever a component rule asks for, so no eyebrow, button, tag
 * or table head can leak tracking into Arabic. A run the page itself marks left-to-right (a price,
 * a ticker, a chart, a figure) keeps the design's own spacing: it is Latin by construction.
 */
.cira-ir[dir='rtl'] :where(:not([dir='ltr'], [dir='ltr'] *)),
.cira-ir[dir='rtl'] :where(:not([dir='ltr'], [dir='ltr'] *))::before,
.cira-ir[dir='rtl'] :where(:not([dir='ltr'], [dir='ltr'] *))::after { letter-spacing: 0 !important; }

/* Tiny scoped reset */
.cira-ir *, .cira-ir *::before, .cira-ir *::after { box-sizing: border-box; }
.cira-ir :where(h1, h2, h3, h4, p, ul, ol, dl, dd, figure, blockquote, fieldset) { margin: 0; padding: 0; }
.cira-ir :where(ul, ol) { list-style: none; }
.cira-ir :where(img, svg, video) { display: block; max-width: 100%; }
.cira-ir :where(img) { height: auto; }
.cira-ir :where(a) { color: inherit; text-decoration: none; }
.cira-ir :where(button, input, select, textarea) { font: inherit; color: inherit; }
.cira-ir :where(button) { background: none; border: 0; cursor: pointer; padding: 0; }
.cira-ir :where(fieldset) { border: 0; min-width: 0; }
.cira-ir :where(table) { border-collapse: collapse; width: 100%; }
.cira-ir ::selection { background: var(--ci-burgundy); color: var(--ci-cream); }
.cira-ir [hidden] { display: none !important; }

/* Focus: one visible ring everywhere, burgundy on paper, greige on dark */
.cira-ir :focus-visible { outline: 2px solid var(--ci-burgundy); outline-offset: 3px; border-radius: 4px; }
.cira-ir :where(.ci-rail, .ci-phero, .ci-hhero, .ci-band, .ci-footer, .ci-sec-dark, .ci-spot-cover, .ci-404) :focus-visible { outline-color: var(--ci-greige); }
.cira-ir main:focus { outline: none; }

.cira-ir .ci-wrap { width: var(--ci-wrap); margin-inline: auto; }
.cira-ir .ci-narrow { max-width: 880px; }
.cira-ir .ci-narrow-wide { max-width: 1040px; }
.cira-ir .ci-sr {
  position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.cira-ir .ci-ico { width: 18px; height: 18px; flex: none; }
.cira-ir[dir='rtl'] .ci-flip { transform: scaleX(-1); }
.cira-ir .ci-rot { transform: rotate(180deg); }
.cira-ir[dir='rtl'] .ci-rot { transform: none; }
.cira-ir .ci-tnum, .cira-ir .ci-num { font-variant-numeric: tabular-nums lining-nums; }

/* Sections */
.cira-ir .ci-sec { padding-block: var(--ci-sec-y); position: relative; }
.cira-ir .ci-sec-tight { padding-block: clamp(40px, 5vw, 72px); }
.cira-ir .ci-sec + .ci-sec:not(.ci-sec-paper2):not(.ci-sec-dark):not(.ci-sec-card) { padding-top: 0; }
.cira-ir .ci-sec-paper2 { background: var(--ci-paper-2); }
.cira-ir .ci-sec-card { background: var(--ci-card); }
.cira-ir .ci-sec-dark { background: var(--ci-night); color: var(--ci-cream); overflow: hidden; }

/* Type utilities: corporate .eyebrow, .h-display, .lead */
.cira-ir .ci-eyebrow {
  display: flex; align-items: center; gap: 16px; margin-bottom: 22px;
  font-size: 11px; font-weight: 600; letter-spacing: var(--ci-track); text-transform: uppercase;
  color: var(--ci-burgundy);
}
.cira-ir .ci-eyebrow::before { content: ''; width: 44px; height: 1px; background: currentColor; opacity: .7; flex: none; }
.cira-ir .ci-eyebrow-dark { color: var(--ci-greige); }
.cira-ir[dir='rtl'] .ci-eyebrow { font-size: 14px; font-weight: 600; }

.cira-ir .ci-h2 {
  font-family: var(--ci-disp); font-weight: 500; font-size: clamp(30px, 3.4vw, 48px);
  line-height: 1.08; letter-spacing: -.01em; color: var(--ci-ink); text-wrap: balance;
}
.cira-ir .ci-sec-dark .ci-h2 { color: var(--ci-cream); }
.cira-ir .ci-h3 { font-family: var(--ci-disp); font-weight: 500; font-size: clamp(21px, 1.8vw, 26px); line-height: 1.2; color: var(--ci-ink); }
.cira-ir[dir='rtl'] .ci-h2 { line-height: 1.45; letter-spacing: 0; font-weight: 500; }
.cira-ir[dir='rtl'] .ci-h3 { line-height: 1.55; font-weight: 500; }
.cira-ir .ci-lead { font-size: clamp(17px, 1.35vw, 19px); color: var(--ci-ink-2); max-width: 60ch; }
.cira-ir .ci-note { font-size: 13px; color: var(--ci-ink-3); margin-top: 14px; max-width: 80ch; }

/* Links */
.cira-ir .ci-textlink {
  display: inline-flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 600;
  letter-spacing: .12em; text-transform: uppercase; color: var(--ci-burgundy); white-space: nowrap;
  border-bottom: 1px solid transparent; padding-block: 4px; transition: border-color .3s, gap .35s var(--ci-ease);
}
.cira-ir .ci-textlink:hover { border-bottom-color: currentColor; gap: 12px; }
.cira-ir .ci-textlink-dark { color: var(--ci-greige-hi); }
.cira-ir[dir='rtl'] .ci-textlink { letter-spacing: 0; font-size: 14px; }

/* Buttons: corporate .btn family (pill, uppercase, tracked) */
.cira-ir .ci-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  min-height: 48px; padding: 14px 28px; border-radius: 999px;
  font-size: 12.5px; font-weight: 600; letter-spacing: .14em; text-transform: uppercase; white-space: nowrap;
  border: 1px solid transparent;
  transition: background .35s, color .35s, border-color .35s, box-shadow .5s, transform .5s var(--ci-ease);
}
.cira-ir[dir='rtl'] .ci-btn { letter-spacing: 0; font-size: 14px; }
.cira-ir .ci-btn-solid { background: var(--ci-burgundy); color: #F6EFE3; }
.cira-ir .ci-btn-solid:hover { background: var(--ci-burgundy-deep); box-shadow: 0 12px 44px rgba(46, 21, 28, .3); }
.cira-ir .ci-btn-light { background: var(--ci-greige); color: var(--ci-ink); }
.cira-ir .ci-btn-light:hover { background: var(--ci-burgundy-deep); color: #F6EFE3; }
.cira-ir .ci-btn-ghost { border-color: rgba(243, 234, 219, .3); color: var(--ci-cream); }
.cira-ir .ci-btn-ghost:hover { border-color: var(--ci-greige); color: var(--ci-greige-hi); }
.cira-ir .ci-btn-ghost-ink { border-color: var(--ci-line); color: var(--ci-ink); }
.cira-ir .ci-btn-ghost-ink:hover { border-color: var(--ci-burgundy); color: var(--ci-burgundy); }
.cira-ir .ci-btn-pill { /* corporate .btn-ir */
  min-height: 40px; padding: 9px 20px; font-size: 11px; letter-spacing: .16em;
  border-color: rgba(31, 17, 22, .28); color: var(--ci-ink);
}
.cira-ir .ci-btn-pill:hover { background: var(--ci-burgundy); border-color: var(--ci-burgundy); color: #F6EFE3; }
.cira-ir .ci-btn .ci-ico { width: 16px; height: 16px; }

/* Tags and pills */
.cira-ir .ci-tag {
  display: inline-flex; align-items: center; padding: 3px 10px; border-radius: 999px;
  border: 1px solid rgba(112, 56, 69, .28); color: var(--ci-burgundy);
  font-size: 10.5px; font-weight: 600; letter-spacing: .14em; text-transform: uppercase; white-space: nowrap;
}
.cira-ir[dir='rtl'] .ci-tag { letter-spacing: 0; font-size: 12px; }
.cira-ir .ci-tag-q { border-color: var(--ci-line); color: var(--ci-ink-2); letter-spacing: .06em; }
.cira-ir .ci-tag-demo { background: #F6E7C8; border-color: #E2C68F; color: #6A4A12; margin-inline-start: 10px; }
.cira-ir .ci-tag-dark { background: rgba(246, 231, 200, .14); border-color: rgba(246, 231, 200, .4); color: #F6E7C8; }
.cira-ir .ci-pill { display: inline-block; padding: 2px 10px; border-radius: 999px; font-size: 12px; font-weight: 600; }
.cira-ir .ci-pill-buy { background: rgba(45, 106, 76, .1); color: var(--ci-up); }
.cira-ir .ci-pill-sell { background: rgba(168, 55, 45, .09); color: var(--ci-down); }

/* Market change */
.cira-ir .ci-chg { font-weight: 600; font-variant-numeric: tabular-nums; white-space: nowrap; }
.cira-ir .ci-chg-up, .cira-ir .ci-up { color: var(--ci-up); }
.cira-ir .ci-chg-down, .cira-ir .ci-down { color: var(--ci-down); }
.cira-ir .ci-chg-flat { color: var(--ci-ink-2); }

/* Segmented control */
.cira-ir .ci-seg { display: inline-flex; padding: 4px; gap: 2px; border-radius: 999px; background: var(--ci-card); border: 1px solid var(--ci-line); }
.cira-ir .ci-seg button {
  min-height: 34px; padding: 6px 14px; border-radius: 999px; font-size: 12.5px; font-weight: 600;
  color: var(--ci-ink-2); letter-spacing: .04em; transition: background .25s, color .25s;
}
.cira-ir .ci-seg button:hover { color: var(--ci-burgundy); }
.cira-ir .ci-seg button[aria-pressed='true'] { background: var(--ci-burgundy); color: #F6EFE3; }
.cira-ir .ci-seg-lg button { min-height: 40px; padding: 8px 20px; font-size: 13.5px; }
.cira-ir .ci-seg-dark { background: rgba(243, 234, 219, .08); border-color: var(--ci-line-dark); }
.cira-ir .ci-seg-dark button { color: var(--ci-cream-2); }
.cira-ir .ci-seg-dark button:hover { color: var(--ci-greige-hi); }
.cira-ir .ci-seg-dark button[aria-pressed='true'] { background: var(--ci-greige); color: var(--ci-ink); }

/* Fields: corporate .cf-field */
.cira-ir .ci-field { display: inline-flex; flex-direction: column; gap: 6px; min-width: 150px; }
.cira-ir .ci-field > span:first-child, .cira-ir .ci-ff label, .cira-ir .ci-form legend {
  font-size: 11px; font-weight: 600; letter-spacing: .2em; text-transform: uppercase; color: var(--ci-ink-2);
}
.cira-ir[dir='rtl'] .ci-field > span:first-child, .cira-ir[dir='rtl'] .ci-ff label, .cira-ir[dir='rtl'] .ci-form legend { letter-spacing: 0; font-size: 13px; }
.cira-ir .ci-field select, .cira-ir .ci-field input, .cira-ir .ci-ff input, .cira-ir .ci-ff select, .cira-ir .ci-ff textarea, .cira-ir .ci-calc-amount input {
  width: 100%; min-height: 48px; padding: 12px 16px; border-radius: var(--ci-radius-sm);
  border: 1px solid var(--ci-line); background: var(--ci-card); font-size: 15px; color: var(--ci-ink);
  transition: border-color .3s, box-shadow .3s;
}
.cira-ir select { appearance: none; padding-inline-end: 40px !important;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 10 6'%3E%3Cpath d='M1 1l4 4 4-4' fill='none' stroke='%23703845' stroke-width='1.5'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 16px center; background-size: 11px; }
.cira-ir[dir='rtl'] select { background-position: left 16px center; }
.cira-ir :where(input, select, textarea):focus { outline: none; border-color: var(--ci-burgundy) !important; box-shadow: 0 0 0 3px rgba(112, 56, 69, .14); }
.cira-ir [aria-invalid='true'] { border-color: var(--ci-err) !important; box-shadow: 0 0 0 3px rgba(176, 67, 60, .12); }
.cira-ir .ci-err { margin-top: 6px; color: var(--ci-err); font-size: 13.5px; }

/* Tables */
.cira-ir .ci-tablewrap { overflow-x: auto; -webkit-overflow-scrolling: touch; border-radius: var(--ci-radius); border: 1px solid var(--ci-line); background: var(--ci-card); }
.cira-ir .ci-table { font-size: 14.5px; }
.cira-ir .ci-table caption:not(.ci-sr) { caption-side: top; text-align: start; padding: 20px 22px 6px; font-family: var(--ci-disp); font-size: 19px; font-weight: 500; color: var(--ci-ink); }
.cira-ir .ci-table th, .cira-ir .ci-table td { padding: 14px 22px; text-align: start; border-bottom: 1px solid var(--ci-line-soft); vertical-align: top; }
.cira-ir .ci-table thead th {
  font-size: 11px; font-weight: 600; letter-spacing: .16em; text-transform: uppercase; color: var(--ci-ink-3);
  border-bottom: 1px solid var(--ci-line); white-space: nowrap; background: rgba(236, 227, 210, .45);
}
.cira-ir[dir='rtl'] .ci-table thead th { letter-spacing: 0; font-size: 13px; }
.cira-ir .ci-table tbody th { font-weight: 600; color: var(--ci-ink); }
.cira-ir .ci-table tbody tr:last-child > * { border-bottom: 0; }
.cira-ir .ci-table tbody tr:hover > * { background: rgba(112, 56, 69, .035); }
.cira-ir .ci-table .ci-num { text-align: end; font-variant-numeric: tabular-nums; white-space: nowrap; }

/* Empty state, stale note */
.cira-ir .ci-empty {
  display: flex; gap: 20px; align-items: flex-start; padding: clamp(24px, 3vw, 36px);
  border: 1px dashed rgba(112, 56, 69, .32); border-radius: var(--ci-radius); background: rgba(255, 253, 248, .6);
}
.cira-ir .ci-empty-ico { width: 52px; height: 52px; flex: none; display: grid; place-items: center; border-radius: 50%; background: rgba(112, 56, 69, .08); color: var(--ci-burgundy); }
.cira-ir .ci-empty-ico .ci-ico { width: 24px; height: 24px; }
.cira-ir .ci-empty-title { font-family: var(--ci-disp); font-size: 21px; font-weight: 500; line-height: 1.25; }
.cira-ir .ci-empty-body { margin-top: 6px; color: var(--ci-ink-2); max-width: 56ch; font-size: 15px; }
.cira-ir .ci-empty-act { margin-top: 18px; }
.cira-ir .ci-stale {
  display: inline-flex; align-items: center; gap: 10px; margin-top: 16px; padding: 8px 14px; border-radius: 10px;
  background: rgba(176, 162, 148, .18); color: var(--ci-ink-2); font-size: 13.5px;
}
.cira-ir .ci-stale .ci-ico { width: 16px; height: 16px; color: var(--ci-burgundy); }

/* Section head */
.cira-ir .ci-shead { display: flex; justify-content: space-between; align-items: flex-end; gap: 24px; margin-bottom: clamp(28px, 3.4vw, 48px); }

@media (prefers-reduced-motion: reduce) {
  .cira-ir *, .cira-ir *::before, .cira-ir *::after { transition-duration: .01ms !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; scroll-behavior: auto !important; }
}
