/* ============================================================ *
 * CSS tokens
 * ============================================================ */
:root {
  --color-base-black: #111827;
  --color-cta-blue: #0c1950;
  --color-light-gray: #bababa;
  --color-link-blue: #0b66c1;
  --color-link-light-blue: #268cf3;
  --color-secondary-header-blue: #182b44;
  --color-error-red: #a80000;
  --color-white: #fff;
}

/* ============================================================ *
 * Shout out to Andy Bell and his (more) Modern CSS Reset
 * https://piccalil.li/blog/a-more-modern-css-reset/
 * ============================================================ */

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

/* Prevent font size inflation */
html {
  -moz-text-size-adjust: none;
  -webkit-text-size-adjust: none;
  text-size-adjust: none;
}

/* Remove default margin in favour of better control in authored CSS */
body,
h1,
h2,
h3,
h4,
p,
figure,
blockquote,
dl,
dd {
  margin-block-end: 0;
}

/* Remove list styles on ul, ol elements with a list role, which suggests default styling will be removed */
ul[role="list"],
ol[role="list"] {
  list-style: none;
}

/* Set core body defaults */
body {
  min-height: 100vh;
  line-height: 1.5;
}

/* Set shorter line heights on headings and interactive elements */
h1,
h2,
h3,
h4,
button,
input,
label {
  line-height: 1.1;
}

/* Balance text wrapping on headings */
h1,
h2,
h3,
h4 {
  text-wrap: balance;
}

/* A elements that don't have a class get default styles */
a:not([class]) {
  text-decoration-skip-ink: auto;
  color: currentColor;
}

/* Make images easier to work with */
img,
picture {
  max-width: 100%;
  display: block;
}

/* Inherit fonts for inputs and buttons */
input,
button,
textarea,
select {
  font: inherit;
}

/* Make sure textareas without a rows attribute are not tiny */
textarea:not([rows]) {
  min-height: 10em;
}

/* Anything that has been anchored to should have extra scroll margin */
:target {
  scroll-margin-block: 5ex;
}

/* ============================================================ *
 * Helpers
 * ============================================================ */
.hidden {
  display: none !important;
}

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

/* ============================================================ *
 * Typography
 * ============================================================ */
html,
body {
  margin: 0;
  min-width: 100vw;
  padding: 0;
}

body {
  color: var(--color-base-black);
  font-size: 100%;
}

h1,
h2,
h3,
h4,
h5,
h6 {
  margin-block-start: 0.25rem;
}

h1 {
  font-size: 3.75rem;
}

h2 {
  font-size: 2.25rem;
}

h3 {
  border-bottom: 4px solid var(--color-secondary-header-blue);
  font-size: 1.875rem;
  color: var(--color-secondary-header-blue);
  padding-block-end: 0.25rem;
}

h4 {
  font-size: 1.5rem;
}

h5 {
  font-size: 1.3125rem;
}

h6 {
  font-size: 1.125 rem;
}

p {
  max-width: 70ch;
}

a[href] {
  color: var(--color-link-blue);
}

a:focus:not(:focus-visible),
input:focus:not(:focus-visible),
textarea:focus:not(:focus-visible),
div[tabindex="-1"]:focus:not(:focus-visible) {
  outline: 0;
}

a:focus-visible,
input:focus-visible,
textarea:focus-visible,
div[tabindex="-1"]:focus-visible {
  outline: 4px solid var(--color-cta-blue);
  outline-offset: 4px;
}

ul,
ol {
  max-width: 60ch;
}

/* ============================================================ *
 * Layout
 * ============================================================ */
body {
  display: flex;
  flex-direction: column;
  font-family: Arial, Helvetica, sans-serif;
  margin: 0;
  min-height: 100vh;
}

header {
  align-items: center;
  background-color: var(--color-link-blue);
  display: -webkit-flex;
  display: flex;
  flex-direction: row;
  height: 10rem;
  justify-content: space-between;
  padding-inline: 2rem;
  width: 100%;
}

main {
  flex: 1;
  margin-block-start: 2.5rem;
  margin-inline: auto;
  max-width: 80ch;
  width: 100%;
}

footer {
  background-color: var(--color-base-black);
  color: var(--color-light-gray);
  display: flex;
  flex-direction: column;
  height: 12rem;
  justify-content: space-between;
  padding-block: 1rem 2rem;
  padding-inline: 2rem;
  width: 100%;
}

footer > div:first-of-type {
  text-align: center;
}

footer > div:last-of-type {
  text-align: right;
}

footer a[href] {
  color: var(--color-link-light-blue);
}

/* ============================================================ *
 * Forms
 * ============================================================ */
fieldset {
  border: none;
  margin: 0;
  padding-block: 0;
  padding-inline: 0;
}

legend {
  display: block;
  font-size: 1.125rem;
  padding-block: 0.5rem 0;
}

label {
  display: block;
  margin-block: 1.75rem 0.625rem;
  margin-inline-start: 0.125rem;
}

label[for="input-consent"] {
  align-items: center;
  display: flex;
  margin-inline-start: 0;
}

label.js-input-error {
  color: var(--color-error-red);
  font-weight: bold;
}

label.js-input-error + input[type="text"],
label.js-input-error + input[type="email"],
label.js-input-error + textarea {
  border: 2px solid var(--color-error-red);
}

label.js-input-error + input[type="text"]:focus,
label.js-input-error + input[type="email"]:focus,
textarea:focus {
  border-color: var(--color-cta-blue);
}

label.js-input-error span::after {
  content: ".";
  margin-inline-end: 0.325rem;
}

span[role="alert"] {
  display: block;
  font-weight: normal;
  line-height: 1.5;
}

input[type="text"],
input[type="email"],
input[type="submit"],
textarea {
  border: 2px solid var(--color-base-black);
  font-size: 1.125rem;
  margin-inline-start: 0.125rem;
  max-width: 50ch;
  padding-inline: 0.5rem;
  width: 75%;
}

input[type="text"],
input[type="email"] {
  height: 2.25rem;
}

input[type="text"]:focus,
input[type="email"]:focus,
textarea:focus {
  border-color: var(--color-cta-blue);
  border-radius: 0;
}

input[type="checkbox"] {
  accent-color: var(--color-cta-blue);
  margin-inline-end: 1rem;
  height: 2rem;
  width: 2rem;
}

input[type="checkbox"]:checked + span::after {
  content: "🚀";
  margin-inline-start: 0.25rem;
}

input[type="submit"] {
  border: none;
  background-color: var(--color-link-blue);
  border-radius: 6px;
  color: var(--color-white);
  cursor: pointer;
  display: block;
  margin-block-start: 2rem;
  padding-block: 0.625rem;
  padding-inline: 1.5rem;
  text-decoration: none;
  width: fit-content;
}

input[type="submit"]:hover,
input[type="submit"]:focus {
  background-color: var(--color-cta-blue);
}

input[type="submit"]:focus {
  outline: 4px solid var(--color-cta-blue);
  outline-offset: 2px;
}

div.cf-turnstile {
  margin-block: 3rem;
}

/* ============================================================ *
 * Layout - subsection
 * CTA
 * ============================================================ */
.cta {
  background: linear-gradient(
    90deg,
    var(--color-base-black) 65%,
    var(--color-cta-blue)
  );
  border: none;
  border-radius: 15px;
  color: white;
  margin-block-end: 1.5rem;
  min-height: 30rem;
  padding-block: 2rem;
  padding-inline: 4rem;
  position: relative;
  text-align: center;
}

.cta > * {
  background-blend-mode: multiply;

  position: relative;
  z-index: 2;
}

.cta-background-texture {
  background-blend-mode: hard-light;
  background: linear-gradient(
      270deg,
      var(--color-base-black) 65%,
      var(--color-secondary-header-blue)
    ),
    url("../imgs/courthouse.jpg");
  background-position: center;
  background-size: cover;
  border-radius: 15px 15px;
  bottom: 0;
  left: 0;
  opacity: 1;
  position: absolute;
  right: 0;
  top: 0;
  transform: scaleX(-1);
  z-index: 1;
}

.cta-text {
  font-size: 1.125rem;
  line-height: 1.625;
  margin-block-start: 2rem;
  margin-inline: auto;
  max-width: 65ch;
}

.cta-link[href] {
  border: 2px solid var(--color-white);
  background-color: var(--color-white);
  border-radius: 6px;
  color: var(--color-base-black);
  display: block;
  font-size: 1.125rem;
  font-weight: 700;
  margin-block-start: 2rem;
  margin-inline: auto;
  padding-block: 0.625rem;
  padding-inline: 1.5rem;
  position: relative;
  text-decoration: none;
  width: fit-content;
}

.cta-link[href]:hover,
.cta-link[href]:focus {
  background-color: var(--color-cta-blue);
  color: var(--color-white);
}

.cta-link[href]:focus {
  border: 2px solid var(--color-white);
  outline: none;
}

/* ============================================================ *
 * Layout - subsection
 * Copy blocks
 * ============================================================ */
.copy-block {
  padding-inline: 2rem 1rem;
  margin-block-end: 2.5rem;
}

.copy-block * + h3 {
  margin-block-start: 2rem;
}

.copy-block div[itemtype]:first-of-type {
  margin-block-start: 1rem;
}

@media only screen and (max-width: 37.5rem) {
  main {
    margin-block-start: 0;
  }

  .cta {
    border-radius: 0;
  }

  .cta-background-texture {
    border-radius: 0 0 15px 15px;
  }

  .copy-block {
    padding-inline: 2rem;
  }
}
