/* Base styles: accessibility foundations only. Branding comes later. */

html {
  font-size: 100%;
  /* Keep focused items clear of the banner and header when the page scrolls to them. */
  scroll-padding-top: 8rem;
}

body {
  margin: 0;
  color: #000;
  background: #fff;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  font-size: 1rem;
  line-height: 1.5;
}

header,
main,
footer,
.messages {
  padding: 1rem 1.5rem;
}

/* Visually hidden, but still read by screen readers. */
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

/* Skip link: hidden until it receives keyboard focus. */
.skip-link:not(:focus) {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

.skip-link:focus {
  position: fixed;
  top: 0.5rem;
  left: 0.5rem;
  z-index: 1000;
  padding: 0.75rem 1rem;
  color: #000;
  background: #fff;
  border: 0.125rem solid #000;
}

/* Clearly visible focus: a dark outline with a white ring, so it shows on any background. */
a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
summary:focus-visible,
[tabindex]:focus-visible {
  outline: 0.1875rem solid #000;
  outline-offset: 0.125rem;
  box-shadow: 0 0 0 0.3125rem #fff;
}

/* The main region is focused by the skip link; it is not an interactive control. */
main:focus {
  outline: none;
}

/* Minimum target size of 24px for controls. */
a,
button,
input[type="submit"],
input[type="button"],
input[type="reset"] {
  min-width: 1.5rem;
  min-height: 1.5rem;
}

button,
input[type="submit"],
input[type="button"],
input[type="reset"],
header a,
footer a {
  display: inline-block;
}

footer a {
  padding: 0.25rem 0.5rem;
}

.site-name {
  margin: 0;
  font-weight: bold;
}

.message {
  margin: 0.5rem 0;
  padding: 0.75rem 1rem;
  border: 0.125rem solid #000;
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
    scroll-behavior: auto !important;
  }
}
