/*
 * Foundations: design tokens, reset, base elements and page layout.
 * Components live in components.css, which is loaded after this file.
 *
 * The scale is deliberately large: the smallest text is 19px and the smallest
 * tappable thing is 56px square, so nothing depends on precise aim or sharp eyes.
 */

:root {
  --colour-black: #212b32;
  --colour-white: #ffffff;
  --colour-blue: #005eb8;
  --colour-blue-dark: #003087;
  --colour-green: #007f3b;
  --colour-green-dark: #00401e;
  --colour-red: #d5281b;
  --colour-yellow: #ffeb3b;
  --colour-grey: #4c6272;
  --colour-grey-light: #d8dde0;
  --colour-grey-pale: #f0f4f5;

  --space-xs: 0.5rem;
  --space-s: 0.75rem;
  --space-m: 1rem;
  --space-l: 1.5rem;
  --space-xl: 2rem;
  --space-xxl: 3rem;

  --gutter: 1rem;
  --measure: 38rem;
  --touch-target: 3.5rem;
  --radius: 0.25rem;
  --border: 0.125rem;
}

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

body,
h1,
h2,
h3,
p,
ul,
ol,
figure {
  margin: 0;
}

ul,
ol {
  padding-left: var(--space-l);
}

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

input,
button,
label {
  font: inherit;
}

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

body {
  display: flex;
  flex-direction: column;
  min-height: 100dvh;
  background-color: var(--colour-white);
  color: var(--colour-black);
  font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
  font-size: 1.1875rem;
  line-height: 1.5;
}

@media (min-width: 40em) {
  body {
    font-size: 1.3125rem;
  }
}

h1 {
  margin-bottom: var(--space-l);
  font-size: 1.75em;
  line-height: 1.15;
}

h2 {
  margin-bottom: var(--space-s);
  font-size: 1.25em;
  line-height: 1.25;
}

h2:not(:first-child) {
  margin-top: var(--space-xl);
}

p,
ul,
ol {
  margin-bottom: var(--space-m);
}

li {
  margin-bottom: var(--space-xs);
}

a {
  color: var(--colour-blue);
  text-decoration: underline;
  text-decoration-thickness: 0.0625rem;
  text-underline-offset: 0.125em;
}

a:hover {
  text-decoration-thickness: 0.1875rem;
}

/*
 * One focus treatment for everything: a black-on-yellow block that survives
 * cataracts, glare and Windows high contrast mode alike.
 */
:focus-visible {
  outline: var(--border) solid transparent;
  background-color: var(--colour-yellow);
  box-shadow: 0 0 0 var(--space-xs) var(--colour-yellow), 0 var(--space-xs) 0 var(--space-xs) var(--colour-black);
  color: var(--colour-black);
  text-decoration: none;
}

/* The service banner: a fixed point of reference at the top of every page. */
.banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-m);
  padding: var(--space-m) var(--gutter);
  background-color: var(--colour-blue);
  color: var(--colour-white);
  font-size: 1.125em;
  font-weight: bold;
}

/* A quiet secondary control sitting on the banner. */
.banner__action {
  padding: 0;
  border: 0;
  background: none;
  color: inherit;
  font: inherit;
  font-size: 0.875rem;
  text-decoration: underline;
  cursor: pointer;
}

/*
 * The page fills whatever height is left over, so a child with `margin-top:
 * auto` (the action bar) falls to the bottom of short pages instead of
 * floating mid-screen. Forms inherit the same behaviour: they wrap a whole
 * page rather than sit inside one.
 */
.page,
.page > form {
  display: flex;
  flex: 1;
  flex-direction: column;
}

.page {
  width: 100%;
  max-width: var(--measure);
  margin-inline: auto;
  padding: var(--space-xl) var(--gutter) 0;
}
