.faq-header,
.faq-list {
  background: var(--sjm-color-surface);
}

.faq-header__inner,
.faq-list__inner,
.faq-footer__inner {
  box-sizing: border-box;
  width: 100%;
  max-width: 70rem;
  margin-inline: auto;
  padding-inline: 1.5rem;
}

.faq-header__inner {
  padding-top: 2.25rem;
}

.faq-header__title {
  margin: 0 0 2.75rem;
  color: var(--sjm-color-text);
  font-family: var(--sjm-font-sans);
  font-size: clamp(1.875rem, 4vw, 3rem);
  font-weight: 700;
  line-height: 1.08;
  text-wrap: pretty;
}

.faq-header__description {
  max-width: 56.25rem;
  margin-bottom: 1.375rem;
  color: #333;
  font-size: 1.0625rem;
  line-height: 1.75;
  text-wrap: pretty;
}

.faq-header__description > * {
  margin: 0;
}

.faq-header__meta {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin: 0 0 2.5rem;
  color: var(--sjm-color-text-muted);
  font-size: 0.6875rem;
  letter-spacing: 0.16em;
  line-height: 1.5;
  text-transform: uppercase;
}

.faq-header__meta > span {
  width: 1.75rem;
  height: 1px;
  flex: 0 0 1.75rem;
  background: var(--sjm-color-line-strong);
}

.faq-list__inner {
  padding-bottom: 0;
}

/* Keep the section rule inside the content column rather than across the
 * full-width section box. */
.faq-list__inner::before {
  display: block;
  width: 100%;
  border-top: 1px solid var(--sjm-color-line-strong);
  content: '';
}

.faq-list .views-row {
  border-bottom: 1px solid #d8d8d5;
}

.faq-list__question {
  display: flex;
  width: 100%;
  align-items: flex-start;
  gap: 1.5rem;
  border: 0;
  padding: 1.625rem 0.25rem;
  background: transparent;
  color: #333;
  cursor: pointer;
  font-family: var(--sjm-font-sans);
  font-size: clamp(1.1875rem, 2.3vw, 1.5625rem);
  font-weight: 700;
  line-height: 1.32;
  text-align: left;
}

.faq-list__question[aria-expanded="true"] {
  color: var(--sjm-color-text);
}

.faq-list__question-text {
  min-width: 0;
  flex: 1 1 auto;
}

.faq-list__question-text > * {
  margin: 0;
  text-align: left !important;
  text-justify: auto !important;
}

.faq-list__chevron {
  display: inline-flex;
  width: 1.375rem;
  height: 1.375rem;
  flex: 0 0 auto;
  align-items: center;
  justify-content: center;
  margin-top: 0.25rem;
  color: #9a9a97;
  transition:
    transform 0.25s ease,
    color 0.25s ease;
}

.faq-list__question[aria-expanded="true"] .faq-list__chevron {
  color: var(--sjm-color-text);
  transform: rotate(180deg);
}

.faq-list__chevron svg {
  width: 100%;
  height: 100%;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.6;
}

.faq-list__answer {
  padding: 0 2.75rem 2.125rem 0.125rem;
}

.faq-list__answer > * {
  margin: 0 0 1rem;
  color: #444;
  font-size: 1.09375rem;
  line-height: 1.85;
  text-wrap: pretty;
  text-align: left !important;
  text-justify: auto !important;
}

.faq-list__answer > :last-child {
  margin-bottom: 0;
}

.faq-list__answer a {
  border-bottom: 1px solid currentColor;
  color: var(--sjm-color-accent);
  text-decoration: none;
}

.faq-footer {
  margin: 4rem auto;
}

.faq-footer__outer {
  box-sizing: border-box;
  width: 100%;
  max-width: 70rem;
  margin-inline: auto;
  padding-inline: 1.5rem;
}

.faq-footer__inner {
  box-sizing: border-box;
  width: 100%;
  padding: 2.75rem 2.5rem 2.875rem;
  background: var(--sjm-color-text);
  color: var(--sjm-color-surface);
}

.faq-footer__title {
  margin: 0 0 0.875rem;
  color: inherit;
  font-family: var(--sjm-font-sans);
  font-size: clamp(1.5rem, 3vw, 2rem);
  font-weight: 700;
  line-height: 1.15;
}

.faq-footer__description {
  max-width: 36.25rem;
  margin-bottom: 1.75rem;
  color: #cfcfcc;
  font-size: 1.0625rem;
  line-height: 1.75;
  text-wrap: pretty;
}

.faq-footer__description > * {
  margin: 0;
}

.faq-footer__action a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 3.125rem;
  border: 1px solid var(--sjm-color-surface);
  padding: 0.9375rem 1.875rem;
  background: var(--sjm-color-surface);
  color: var(--sjm-color-text);
  font-size: 0.875rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-decoration: none;
  text-transform: uppercase;
}

.faq-footer__action a:hover {
  background: transparent;
  color: var(--sjm-color-surface);
}

@media (max-width: 47.9375rem) {
  .faq-header__inner,
  .faq-list__inner,
  .faq-footer__outer {
    padding-inline: var(--sjm-mobile-gutter);
  }

  .site-content .faq-header__title {
    font-size: var(--sjm-mobile-detail-h1) !important;
    line-height: 1.1 !important;
  }

  .faq-header__description,
  .faq-header__description > *,
  .faq-footer__description,
  .faq-footer__description > * {
    font-size: var(--sjm-mobile-body) !important;
    line-height: 1.62 !important;
  }

  .faq-header__meta {
    font-size: var(--sjm-mobile-label);
  }

  .site-content .faq-footer__title {
    font-size: var(--sjm-mobile-body) !important;
    line-height: 1.15 !important;
  }

  .faq-footer__description,
  .faq-footer__description > * {
    font-size: var(--sjm-mobile-body) !important;
    line-height: 1.62 !important;
  }

  .faq-footer__action a {
    min-height: var(--sjm-mobile-action-height);
    font-size: var(--sjm-mobile-label) !important;
  }

  .site-content .faq-list__question,
  .site-content .faq-list__question-text,
  .site-content .faq-list__question-text p {
    /* The FAQ prototype specifies a 22px question at mobile widths.
     * --sjm-mobile-form-control is fluid and resolves to ~17px at 414px. */
    font-size: 22px !important;
  }

  .faq-list__answer {
    padding-right: 0.125rem;
  }
}
