/* CRASA Digital Anchor Ecosystem — base layer.
 * Element defaults and the accessibility floor. Reads tokens.css only.
 */

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--c-cream);
  color: var(--c-charcoal);
  font-family: var(--f-body);
  font-size: var(--t-body-size);
  line-height: var(--t-body-line);
  overflow-wrap: break-word;
  -webkit-font-smoothing: antialiased;
}

img, svg, video { max-width: 100%; }
img, svg { display: block; }

h1, h2, h3, h4 {
  font-family: var(--f-head);
  color: var(--c-navy);
  margin: 0;
  text-wrap: balance;
}
h1 { font-size: var(--t-h1-size); line-height: var(--t-h1-line); font-weight: var(--t-h1-weight); letter-spacing: -.015em; }
h2 { font-size: var(--t-h2-size); line-height: var(--t-h2-line); font-weight: var(--t-h2-weight); letter-spacing: -.01em; }
h3 { font-size: var(--t-h3-size); line-height: var(--t-h3-line); font-weight: var(--t-h3-weight); }

p { margin: 0 0 var(--s-4); max-width: 66ch; }

a { color: var(--c-green-dark); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { color: var(--c-navy); }

/* Focus: a 2px ring at 2px offset on every interactive element, the same
   ring ui.css draws. Logo blue #7A90C8 is 3.16:1 on white but 2.81:1 on
   the green and blue tints and 2.44:1 on deep green, so the ring is blue
   ink #2F4F8F (7.97:1 on white, 7.09:1 or more on every tint). On a dark
   band (deep green #0B5F3E, where blue ink is 1.03:1) the band sets
   --focus-ring and --u-focus to white (7.72:1); the footer and the call
   to action band do so here, and any other dark band does the same with
   those two properties. Nothing in this platform removes the ring. */
:root { --focus-ring: var(--u-focus, var(--c-blue-ink, var(--c-navy))); }
:focus-visible { outline: 2px solid var(--focus-ring); outline-offset: 2px; }
footer, .u-cta, [data-surface-tone="dark"] { --focus-ring: var(--c-white); --u-focus: var(--c-white); }

table { border-collapse: collapse; }

/* Numeric values are Inter, tabular, right aligned. */
.c-num { font-family: var(--f-admin); font-variant-numeric: tabular-nums; }

/* Layout helpers ------------------------------------------------------- */

.c-page { max-width: var(--w-page); margin: 0 auto; padding-inline: var(--page-x); }
.c-page--reading { max-width: var(--w-reading); }
.c-section { padding-block: var(--section-y); }

/* Vertical rhythm for a column of prose. Space between a heading and the
   text under it is tighter than the space before the next heading, so the
   grouping is legible without rules or boxes. */
.c-stack > * { margin-bottom: 0; }
.c-stack > * + * { margin-top: var(--s-4); }
.c-stack > * + h2, .c-stack > * + h3 { margin-top: var(--s-7); }

.c-lead { font-size: var(--t-lead-size); line-height: var(--t-lead-line); max-width: 58ch; }
.c-small { font-size: var(--t-small-size); line-height: var(--t-small-line); color: var(--c-slate); }
.c-list { margin: 0; padding-left: 20px; display: flex; flex-direction: column; gap: var(--s-3); max-width: 74ch; }

/* Every flex wrapper that must shrink carries min-width:0. Layout invariant 1. */
.c-shrink { min-width: 0; }
.c-fixed { flex: none; }
.c-truncate { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* Skip link. Opens every page, per the accessibility specification. */
.c-skip {
  position: absolute;
  left: var(--s-4);
  top: var(--s-4);
  z-index: 100;
  transform: translateY(calc(-100% - var(--s-6)));
  background: var(--c-navy);
  color: var(--c-white);
  font-size: var(--t-small-size);
  font-weight: 600;
  padding: 12px 16px;
  border-radius: var(--r-sm);
  text-decoration: none;
  transition: transform 150ms var(--ease-in);
}
.c-skip:focus { transform: translateY(0); color: var(--c-white); }

/* Screen-reader-only text, for labels that must exist but not be drawn. */
/* Select. Screen 01 draws select, choice, upload and search as one
   component set; this is the select.

   It had been defined three times — once on the map, once on the homepage
   comparison, once in the back office — with the same values written out
   each time. Three definitions of one control is how the fourth one ends up
   different, so it lives here with .c-input and the others reference it.

   --r-xs, because CLAUDE.md puts --r-xs on inputs. 44px minimum, because a
   control smaller than that is a control a thumb misses. */
.c-select {
  min-height: 44px;
  min-width: 0;
  /*
   * Never a flex item that grows, and never one with a basis.
   *
   * .c-map-region__select carried "flex: 1 1 260px", written when the
   * select sat directly in a row container. It was later wrapped in a
   * column-flex field so its label could sit above it, and in a column the
   * main axis is vertical: 260px stopped being a width and became a height,
   * and flex-grow took it past that to the height of the row. Every select
   * in the members section rendered about 200px tall.
   *
   * The component now refuses both by default, so a container rule has to
   * say so explicitly to change it, and saying so on the wrong axis is
   * visible immediately rather than in a screenshot a week later.
   */
  flex: 0 0 auto;
  padding: var(--s-2) var(--s-3);
  font-family: var(--f-body);
  font-size: 15px;
  color: var(--c-charcoal);
  background: var(--c-white);
  border: 1px solid var(--c-border);
  border-radius: var(--r-xs);
}
.c-select:focus-visible { outline: 2px solid var(--focus-ring); outline-offset: 2px; }
.c-select:disabled { color: var(--c-disabled); background: var(--c-cream); cursor: not-allowed; }

/*
 * The open option list, always, whatever the control sits on.
 *
 * A select on a navy band takes a navy ground and white text, which is
 * right for the closed control and wrong for the menu: an <option> inherits
 * the select's background, so the list rendered charcoal on navy and only
 * the row the operating system highlighted could be read.
 *
 * Setting colour and background on the option itself fixes it. Native
 * option styling is barely controllable, but these two properties are
 * honoured in Chrome, Firefox and Edge, and they are the two that matter.
 * They live here rather than beside the dark-ground override so that every
 * select on the platform gets them, including ones written after this and
 * ones that move onto a dark ground later.
 */
.c-select option,
.c-select optgroup {
  color: var(--c-charcoal);
  background: var(--c-white);
}
.c-select option:disabled { color: var(--c-disabled); }

.c-sr {
  position: absolute;
  width: 1px; height: 1px;
  margin: -1px; padding: 0;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

/* Notices -------------------------------------------------------------- */
/* Four tones only. Green for validated, amber for pending, red for errors,
   navy for information. A notice is not a badge. */

.c-notice {
  display: flex;
  gap: var(--s-3);
  border-radius: var(--r-sm);
  padding: var(--s-4);
  font-size: var(--t-small-size);
  line-height: 1.55;
}
.c-notice__icon { flex: none; margin-top: 1px; }
.c-notice__title { font-weight: 600; font-size: 16px; }
.c-notice__body { margin-top: 3px; }
.c-notice__body p:last-child { margin-bottom: 0; }
.c-notice { max-width: 80ch; }

.c-notice--info    { background: var(--c-cream); border: 1px solid var(--c-sand); border-left: 4px solid var(--c-navy); }
.c-notice--info .c-notice__title { color: var(--c-navy); }
.c-notice--success { background: var(--c-green-light); border: 1px solid var(--c-green-mid); border-left: 4px solid var(--c-green-dark); }
.c-notice--success .c-notice__title { color: var(--c-green-dark); }
.c-notice--pending { background: var(--c-amber-light); border: 1px solid var(--c-amber-mid); border-left: 4px solid var(--c-amber); }
.c-notice--pending .c-notice__title, .c-notice--pending .c-notice__body { color: var(--c-amber-dark); }
.c-notice--error   { background: var(--c-red-light); border: 1px solid var(--c-red-mid); border-left: 4px solid var(--c-red); }
.c-notice--error .c-notice__title { color: var(--c-red); }
.c-notice--error .c-notice__body { color: var(--c-red-dark); }

/* Motion --------------------------------------------------------------- */
/* Reduced motion removes travel, not feedback. Colour and opacity
   transitions stay, so every state change remains visible. */

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto !important; }
  *, *::before, *::after {
    animation-duration: .01ms !important;
    animation-delay: 0s !important;
    animation-iteration-count: 1 !important;
    scroll-behavior: auto !important;
  }
  /* Movement goes; colour and opacity changes stay, so a state change is
     still seen. Transforms (lift, slide, rise) finish at once. */
  *, *::before, *::after { transition-property: color, background-color, border-color, opacity, outline-color !important; }
  .c-skip, .c-drawer { transition: none !important; }
  /* Content a reveal script would fade in is shown as it is. */
  [data-reveal], .is-reveal, .k-reveal { opacity: 1 !important; transform: none !important; }
}

/* Print ---------------------------------------------------------------- */

@page { margin: 12mm; }

@media print {
  html, body { background: var(--c-white); }
  * { -webkit-print-color-adjust: exact !important; print-color-adjust: exact !important; }
  .c-header, .c-skip, .c-drawer, .c-header__toggle { display: none !important; }
  a[href] { text-decoration: underline; }
  section, figure, li, tr { break-inside: avoid; }
  h1, h2, h3 { break-after: avoid; }
  thead { display: table-header-group; }
}

/* Show password (public/js/password.js), 14 October 2026. The field keeps
   its full width; the eye sits inside its right edge. */
.c-pw { position: relative; display: block; }
.c-pw > input { width: 100%; padding-right: 48px; }
.c-pw__toggle {
  position: absolute; top: 50%; right: 4px; transform: translateY(-50%);
  width: 40px; height: 40px; display: inline-flex; align-items: center; justify-content: center;
  border: 0; border-radius: var(--r-sm); background: transparent; color: inherit; cursor: pointer;
}
.c-pw__toggle:hover { background: rgba(0, 0, 0, .06); }
.c-pw__toggle:focus-visible { outline: 2px solid var(--focus-ring); outline-offset: 2px; }
