/* Shared components with fixed class names. Page tickets reuse these and
   do not restyle them; page CSS only lays out what is specific to the page.
   Figma node ids are given so the source can be checked. The README section
   "Building a page" shows the markup for each. */

/* ── Layout: container and sections ────────────────────────────────────── */

/* Content column: 1200 px wide at desktop (x = 120 in the 1440 frame), 20 px side padding at 390. */
.container {
  width: 100%;
  max-width: calc(var(--content-width) + 2 * var(--gutter));
  margin-inline: auto;
  padding-inline: var(--gutter);
}

/* Sections alternate white and beige (#1 rule 5). Pick the modifier per Figma. */
.section {
  padding-block: var(--section-space);
  background: var(--color-bg-surface);
}
.section--beige {
  background: var(--color-bg-canvas);
}

/* Vertical rhythm: children of a .stack sit --stack-space apart (default 32 px,
   the gap between a section heading and its content). */
.stack > * + * {
  margin-top: var(--stack-space, var(--space-xl));
}

/* ── Eyebrow (15:74): short gold line + uppercase label above a page heading ── */
.eyebrow {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  color: var(--color-text-accent);
  font: var(--text-eyebrow);
  letter-spacing: var(--tracking-eyebrow);
  text-transform: uppercase;
}
.eyebrow::before {
  content: '';
  flex: none;
  width: 48px;
  height: 1.5px;
  background: var(--color-border-accent);
}

/* ── Section heading (15:77): gold line + H2 + optional description ──────── */
/* Phones (M01): no line, the heading takes the full width. */
.section-heading {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  row-gap: var(--space-xs);
  max-width: 800px;
}
.section-heading > p,
.section-heading > .section-heading__description {
  font: var(--text-body);
  color: var(--color-text-secondary);
}
@media (min-width: 768px) {
  .section-heading {
    grid-template-columns: 54px minmax(0, 1fr);
    column-gap: var(--space-lg);
  }
  .section-heading::before {
    content: '';
    grid-row: 1;
    align-self: start;
    width: 54px;
    height: 1.5px;
    /* Centre the line on the first line of the H2 (font size × line height ÷ 2). */
    margin-top: calc(var(--size-h2) * 1.15 / 2);
    background: var(--color-border-accent);
  }
  .section-heading > * {
    grid-column: 2;
  }
}

/* ── Buttons (14:187): primary / secondary / text / light, M and small ──── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: var(--space-sm);
  padding: var(--space-sm) var(--space-lg);
  border: 1px solid transparent;
  border-radius: var(--radius-md);
  font: var(--text-button);
  text-decoration: none;
  text-align: center;
  cursor: pointer;
  transition: background-color 0.15s ease;
}
.btn--primary {
  background: var(--color-bg-brand);
  color: var(--color-text-on-brand);
}
.btn--primary:hover {
  background: var(--color-bg-brand-hover);
}
.btn--secondary {
  background: var(--color-bg-surface);
  border-color: var(--color-border-strong);
  color: var(--color-text-primary);
}
.btn--secondary:hover {
  background: var(--color-bg-canvas);
}
.btn--text {
  background: transparent;
  color: var(--color-text-primary);
}
.btn--text:hover {
  background: var(--color-bg-subtle);
}
/* Light: on dark or coloured surfaces (Get started band, journey cards). */
.btn--light {
  background: var(--color-bg-surface);
  color: var(--color-text-primary);
}
.btn--light:hover {
  background: var(--color-bg-canvas);
}
.btn--small {
  padding: var(--space-xs) var(--space-md);
  font: var(--text-button-small);
}
.btn:disabled,
.btn[aria-disabled='true'] {
  background: var(--color-bg-disabled);
  color: var(--color-text-disabled);
  cursor: not-allowed;
}
.btn--secondary:disabled,
.btn--secondary[aria-disabled='true'] {
  border-color: var(--color-border-strong);
}
/* Arrow: show it when the button leads onward (Figma rule). */
.btn--arrow::after {
  content: '';
  flex: none;
  width: 18px;
  height: 18px;
  background: currentColor;
  -webkit-mask: var(--icon-arrow) center / contain no-repeat;
  mask: var(--icon-arrow) center / contain no-repeat;
}
.btn--small.btn--arrow::after {
  width: 16px;
  height: 16px;
}
:root {
  --icon-arrow: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 18 18' fill='none' stroke='black' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M3.75 9H14.25M9.75 13.5L14.25 9L9.75 4.5'/%3E%3C/svg%3E");
}

/* A row of buttons; stacks full width on phones (M07 pattern 5). */
.button-row {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  gap: var(--space-sm);
}
@media (max-width: 767.98px) {
  .button-row {
    flex-direction: column;
    align-items: stretch;
  }
}

/* ── Cards (#1 rule 3): white or beige, border, radius, soft shadow ────── */
.card {
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
  min-width: 0;
  padding: var(--space-xl);
  background: var(--color-bg-surface);
  border: 1px solid var(--color-card-border);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-card);
}
.card--beige {
  background: var(--color-bg-canvas);
}
/* Journey cards use radius 16 (ruling 4 on #1). */
.card--journey {
  border-radius: var(--radius-card-journey);
  overflow: hidden;
}
@media (max-width: 767.98px) {
  .card {
    padding: var(--space-lg);
  }
}

/* Cards side by side always have equal height: put them in a .card-row.
   Columns: 1 on phones, 2 from 768, the --cols count from 1024 (default 3). */
.card-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: var(--space-lg);
  align-items: stretch;
}
@media (min-width: 768px) {
  .card-row {
    grid-template-columns: repeat(min(2, var(--cols, 3)), minmax(0, 1fr));
  }
}
@media (min-width: 1024px) {
  .card-row {
    grid-template-columns: repeat(var(--cols, 3), minmax(0, 1fr));
  }
}
/* Small cards (KPIs, icons, chips) go two per row on phones (M07 pattern 2). */
@media (max-width: 767.98px) {
  .card-row--small {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: var(--space-sm);
  }
}

/* ── Journey colours: only on journey content (#1 rule 2) ──────────────── */
.journey--carbon {
  --journey-colour: var(--color-journey-carbon);
}
.journey--enterprise {
  --journey-colour: var(--color-journey-enterprise);
}
.journey--public {
  --journey-colour: var(--color-journey-public);
}
/* A journey-coloured surface: gold heading text, light body text. */
.journey-surface {
  background: var(--journey-colour);
  color: var(--color-text-on-journey);
}
.journey-surface :is(h2, h3, h4, .journey-surface__title) {
  color: var(--color-text-gold);
}

/* ── Chips (617:2378): pill links or labels, e.g. priority areas in a journey ── */
.chip-list {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-xs);
  padding: 0;
  list-style: none;
}
.chip {
  display: inline-flex;
  align-items: center;
  max-width: 100%;
  padding: 6px var(--space-sm);
  background: var(--color-bg-canvas);
  border: 1px solid var(--color-card-divider);
  border-radius: var(--radius-full);
  color: var(--color-text-primary);
  font: var(--text-small);
  text-decoration: none;
}
a.chip:hover {
  border-color: var(--color-card-border);
  background: var(--color-bg-surface);
}

/* ── Info note (781:4128): «i» icon + small muted text ─────────────────── */
.info-note {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  max-width: 100%;
  color: var(--color-note-text);
  font: var(--text-small);
}
.info-note::before {
  content: 'i';
  flex: none;
  display: grid;
  place-items: center;
  width: 18px;
  height: 18px;
  margin-top: 1px;
  border: 1.25px solid var(--color-note-icon);
  border-radius: var(--radius-full);
  color: var(--color-note-icon);
  font: 600 11px / 1 var(--font-sans);
}

/* ── Wayfinding band (617:858): breadcrumb under the header on inner pages ── */
.wayfinding {
  background: var(--color-wayfinding-bg);
  color: var(--color-wayfinding-text);
  font: var(--text-small);
}
.wayfinding ol {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 2px 10px;
  margin: 0;
  padding: 14px 0;
  list-style: none;
}
.wayfinding li:first-child {
  font-weight: 600;
}
.wayfinding a {
  color: inherit;
  text-decoration: none;
}
.wayfinding a:hover {
  text-decoration: underline;
}
.wayfinding [aria-current='page'] {
  color: var(--color-text-muted);
}
@media (max-width: 767.98px) {
  .wayfinding ol {
    padding: 12px 0;
  }
}

/* ── Icon circle (15:106): sage = projects/steps, sky = funding, peach = current/public ── */
.icon-circle {
  display: inline-grid;
  place-items: center;
  flex: none;
  width: 48px;
  height: 48px;
  border-radius: var(--radius-full);
  background: var(--color-accent-sage);
  color: var(--color-icon-brand);
}
.icon-circle--sky {
  background: var(--color-accent-sky);
  color: var(--color-text-link);
}
.icon-circle--peach {
  background: var(--color-accent-peach);
  color: var(--color-icon-accent);
}
.icon-circle svg {
  width: 24px;
  height: 24px;
}
