/* ===== RESET ===== */

/* http://meyerweb.com/eric/tools/css/reset/
   v2.0 | 20110126
   License: none (public domain)
*/

html, body, div, span, iframe,
h1, h2, h3, h4, h5, h6, p, pre, a,
fieldset, form, label, legend,
aside, header, main, nav {
	margin: 0;
	padding: 0;
	border: 0;
	font-size: 100%;
	font: inherit;
	vertical-align: baseline;
}

aside, header, main, nav {
	display: block;
}

ol, ul {
	list-style: none;
    margin: 0;
    padding: 0;
}


/* ===== FONTS ===== */

@font-face {
    font-family: "Graphik";
    src: url(https://media.cq.com/fonts/graphik/Graphik-Regular-Web.woff) format('woff');
    font-weight: 400;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: "Graphik";
    src: url(https://media.cq.com/fonts/graphik/Graphik-Medium-Web.woff) format('woff');
    font-weight: 500;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: "Graphik";
    src: url(https://media.cq.com/fonts/graphik/Graphik-Semibold-Web.woff) format('woff');
    font-weight: 600;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: "Graphik";
    src: url(https://media.cq.com/fonts/graphik/Graphik-Bold-Web.woff) format('woff');
    font-weight: 700;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: "Lyon Text";
    src: url(https://media.cq.com/fonts/lyon/LyonText-Semibold-Web.woff) format('woff');
    font-weight: 600;
    font-style: normal;
    font-display: swap;
}


/* ===== SETUP ===== */

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

body {
  --color-accent: #005383;
  --font-sans: Graphik, Helvetica, Arial, sans-serif;
  --font-serif: "Lyon Text", Georgia, Garamond, serif;

  color: #333;
  font-family: Graphik, Helvetica, Arial, sans-serif;
  font-family: var(--font-sans);
  font-size-adjust: none;
  font-size: 0.875em;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: geometricPrecision;
  -webkit-text-size-adjust: 100%;
  -ms-text-size-adjust: 100%;
}

@media only screen and (min-width: 40.625em) {
  body {
    font-size: 1em;
  }
}

.container {
  --grid-max-width: 43.125em;
  --grid-gap: 1.875em;

  margin: 0 auto;
  max-width: 70em;
  width: 90%;
}

.is-invisible {
  clip: rect(1px 1px 1px 1px);
  clip: rect(1px, 1px, 1px, 1px);
  clip-path: inset(1px, 1px, 1px, 1px);
  color: transparent;
  height: 1px;
  overflow: hidden;
  position: absolute;
  width: 1px;
}


/* ===== TEXT ===== */

.nowrap {
  white-space: nowrap;
}

.page-title {
  font-size: 3.25em;
  font-weight: 700;
}

.page-subtitle {
  color: #5E6366;
  font-family: "Lyon Text", Georgia, Garamond, serif;
  font-family: var(--font-serif);
  font-size: 1.625em;
  font-weight: 600;
  line-height: 1.4;
  margin-top: 1em;
}

.newsletter-name {
  font-size: 1.25em;
  font-weight: 700;
  line-height: 1.1;
}

.newsletter-frequency {
  font-size: 0.875em;
  font-weight: 600;
  line-height: 1.3;
  margin-top: 0.25em;
}

.newsletter-description {
  font-size: 1em;
  line-height: 1.375;
  margin-top: 0.75em;
}

#newsletter-opt-out .newsletter-name,
#newsletter-opt-out .newsletter-description {
  display: inline;
  font-size: 1.143em;
  margin: 0;
}

@media only screen and (min-width: 40.625em) {
  #newsletter-opt-out .newsletter-name,
  #newsletter-opt-out .newsletter-description {
    font-size: 1em;
  }
}

#newsletter-opt-out .newsletter-name::after {
  content: ":";
}

@media screen and (-ms-high-contrast: active), (-ms-high-contrast: none) {
  #newsletter-opt-out .newsletter-name::after {
    content: ": ";
    white-space: pre;
  }
}

.field--text__label {
  display: block;
  font-size: 0.875em;
  font-weight: 500;
  line-height: 1.2;
  margin-bottom: 0.25em;
}


/* ===== HEADER ===== */

header {
  text-align: center;
}

header + #newsletter-opt-in {
  margin-top: 3.75em;
  margin-top: calc(var(--grid-gap) * 2);
}

header + #newsletter-opt-out {
  margin-top: 1.875em;
  margin-top: var(--grid-gap);
}


/* ===== FORM ===== */

form {
  margin: 0 auto;
  max-width: 43.125em;
  max-width: var(--grid-max-width);
  width: 100%;
}

#newsletter-opt-in .newsletter__choices {
  /*~ IE11 ~*/
  display: -ms-grid;
  -ms-grid-column-align: stretch;
  -ms-grid-columns: 1fr;
  -ms-grid-row-align: stretch;
  -ms-grid-rows: auto auto;

  /*~ Else ~*/
  --grid-column-min-width: calc((var(--grid-max-width) / 2) - var(--grid-gap));
  align-items: stretch;
  display: grid;
  grid-gap: var(--grid-gap);
  grid-template-columns: repeat(auto-fit, minmax(var(--grid-column-min-width), 1fr));
  justify-items: stretch;
}

.newsletter__choice:nth-child(1) {
  -ms-grid-column: 1;
  -ms-grid-row: 1;
}

.newsletter__choice:nth-child(2) {
  -ms-grid-column: 2;
  -ms-grid-row: 1;
}

.newsletter__choice:nth-child(3) {
  -ms-grid-column: 1;
  -ms-grid-row: 2;
}

.newsletter__choice:nth-child(4) {
  -ms-grid-column: 2;
  -ms-grid-row: 2;
}

.newsletter__choice:nth-child(5) {
  -ms-grid-column: 1;
  -ms-grid-row: 3;
}

.newsletter__choice:nth-child(6) {
  -ms-grid-column: 2;
  -ms-grid-row: 3;
}

@media only screen and (min-width: 50em) and (-ms-high-contrast: active), (min-width: 50em) and (-ms-high-contrast: none) {
  #newsletter-opt-in .newsletter__choices {
    /*~ IE11 ~*/
    -ms-grid-columns: 20.625em 22.5em; /* 330px 330px+margin */
  }

  #newsletter-opt-in .newsletter__choice:nth-child(even) {
    margin-left: 1.875em;
  }

  #newsletter-opt-in .newsletter__choice:nth-child(n+3) {
    margin-top: 1.875em;
  }
}

@supports (display: grid) {
  .newsletter__choice:nth-child(even) {
    margin-left: 0;
  }

  .newsletter__choice:nth-child(n+3) {
    margin-top: 0;
  }

  #newsletter-opt-out .newsletter__choice + .newsletter__choice {
    margin-top: 1em;
  }
}

#newsletter-opt-in .newsletter__choice label {
  background-color: #F5F5F5;
  padding: 1em 2.5em 1.75em 1em;
}

#newsletter-opt-out .newsletter__choice label {
  padding: 0.5em 0;
}

.newsletter__choice label {
  align-items: flex-start;
  cursor: pointer;
  display: flex;
  /* height: 100%; height fix for when not embedded */
  font-size: 1em;
}

.newsletter__choice label::before {
  background-color: currentColor;
  background-repeat: no-repeat;
  background-image: url('./checkmark.svg');
  background-position: center center;
  background-size: auto 55%;
  border-radius: 50%;
  border-color: #767676;
  border-style: solid;
  border-width: 1px;
  color: #fff;
  content: "";
  flex: 0 0 1.5em;
  height: 1.5em;
  outline: 1px solid transparent;
  width: 1.5em;
}

.newsletter__choice input:disabled + label {
  cursor: default;
}

.newsletter__choice input:checked + label::before {
  background-color: currentColor;
  border-color: currentColor;
  color: #005383;
  color: var(--color-accent);
}

.newsletter__choice input:focus + label {
  outline: -webkit-focus-ring-color auto 5px;
}

#newsletter-opt-in .choice__label-text {
  margin-left: 1em;
}

#newsletter-opt-out .choice__label-text {
  line-height: 1.3;
  padding-right: 1em;
  margin-left: 0.5em;
  margin-top: 0.1em;
}

#form__section--email,
#form__section--comments {
  margin-top: 2.8125em;
  margin-top: calc(var(--grid-gap) * 1.5);
}

.fields__container {
  align-items: stretch;
  display: flex;
}

.field--email,
.field--textarea {
  -webkit-appearance: none;
  appearance: none;
  border: 1px solid #C8CCD1;
  -webkit-border-radius: 0;
  -moz-border-radius: 0;
  border-radius: 0;
  -webkit-box-shadow: none;
  -moz-box-shadow: none;
  box-shadow: none;
  color: #333;
  display: block;
  font-family: inherit;
  font-size: 0.875em;
  font-weight: 400;
  margin: 0;
  padding-left: 1em;
  padding-right: 1em;
}

.field--email {
  flex: 2 2 80%;
  padding-bottom: 0.5em;
  padding-top: 0.5em;
}

.field--textarea {
  height: 8em;
  line-height: 1.8;
  -ms-overflow-style: none;
  padding-bottom: 1em;
  padding-top: 1em;
  resize: none;
  width: 100%;
}

::-webkit-input-placeholder {
  color: #848484;
  font-family: inherit;
  font-size: 1em;
  font-weight: 500;
  opacity: 1;
}

::-moz-placeholder {
  color: #848484;
  font-family: inherit;
  font-size: 1em;
  font-weight: 500;
  opacity: 1;
}

:-ms-input-placeholder {
  color: #848484;
  font-family: inherit;
  font-size: 1em;
  font-weight: 500;
  opacity: 1;
}

button[type="submit"] {
  -webkit-appearance: none;
  appearance: none;
  background-color: #005383;
  background-color: var(--color-accent);
  border: none;
  color: #fff;
  cursor: pointer;
  flex: 1 1 20%;
  font-family: inherit;
  font-size: 1em;
  font-weight: 700;
  line-height: 1;
  margin: 0;
  padding: 0.9em 1em;
  white-space: nowrap;
}


/* ===== RESPONSE (CONFIRMATION) ===== */

#response {
  margin-top: 2.8125em;
  margin-top: calc(var(--grid-gap) * 1.5);
  text-align: center;
}

.response__title {
  font-size: 1.25em;
  font-weight: 600;
}

.response__subtitle {
  line-height: 1.5;
  margin-top: 0.75em;
}
