/* FAQs page only. Loaded after site.css. */

.faq-hero__lede {
  max-width: var(--measure-hero);
}

/* --------------------------------------------------------------- layout */

.faq-layout {
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr);
  gap: 56px;
  align-items: start;
  max-width: var(--page-max);
  margin: 0 auto;
  padding-left: 32px;
  padding-right: 32px;
}

/* ------------------------------------------------------------ category rail */

.faq-rail {
  position: sticky;
  top: 100px;
  display: grid;
  gap: 16px;
}

/* The search field filters entries that are already on the page, so it is
 * meaningless without JS. faqs.js reveals it. */
.faq-search {
  display: grid;
  gap: 8px;
}

.faq-search[hidden] {
  display: none;
}

.faq-search__label {
  font-size: 12px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.faq-search__input {
  height: 40px;
  width: 100%;
}

.faq-rail__heading {
  margin-top: 8px;
  font-family: var(--font-display);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--navy-800);
}

.faq-rail__list {
  list-style: none;
  display: grid;
  gap: 2px;
}

/* Real anchors, so the rail works with JS off. With JS they also filter. */
.faq-rail__link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 44px;
  padding: 11px 14px;
  border-left: 3px solid transparent;
  border-radius: 0 var(--radius) var(--radius) 0;
  font-size: 14px;
  line-height: 1.4;
  color: var(--navy-800);
  transition:
    background var(--dur-micro) ease,
    color var(--dur-micro) ease;
}

.faq-rail__link:hover {
  background: var(--grey-100);
  color: var(--primary);
  text-decoration: none;
}

.faq-rail__link[aria-current='true'] {
  background: var(--grey-100);
  border-left-color: var(--primary);
  color: var(--primary);
}

.faq-rail__count {
  flex: 0 0 auto;
  font-size: 12px;
  color: var(--text-muted);
}

/* -------------------------------------------------------- question list */

.faq-list {
  display: grid;
  gap: 32px;
}

.faq-count {
  font-size: 14px;
  color: var(--text-secondary);
}

.faq-count[hidden] {
  display: none;
}

/* Gap is the 12px between accordions; the title carries the extra 4px so the
 * heading sits 16px clear of the first question, as designed. */
.faq-group {
  display: grid;
  gap: 12px;
  scroll-margin-top: 96px;
}

.faq-group[hidden] {
  display: none;
}

.faq-group__title {
  margin-bottom: 4px;
  font-family: var(--font-display);
  font-size: 24px;
  font-weight: 600;
  line-height: 1.3;
  color: var(--navy-800);
}

/* -------------------------------------------------------------- accordion */

/* Each question is its own link target (/faqs/#what-is-the-tpn-program), so it
 * needs the same clearance under the sticky header that .faq-group gets. A bit
 * more than the group's 96px: a question is landed on directly rather than as
 * the top of a section, so it sits clear of the header rather than tight to
 * it. Works with JS off too - this is the native fragment scroll. */
.faq {
  background: #fff;
  border: 1px solid var(--border-default);
  border-radius: var(--radius);
  scroll-margin-top: 120px;
}

.faq[hidden] {
  display: none;
}

.faq__q {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  padding: 18px 22px;
  font-size: 16px;
  font-weight: 500;
  line-height: 1.45;
  color: var(--navy-800);
  cursor: pointer;
  list-style: none;
}

/* Safari still paints the disclosure triangle without this. */
.faq__q::-webkit-details-marker {
  display: none;
}

.faq__chev {
  flex: 0 0 auto;
  font-size: 22px;
  color: var(--primary);
  transition: transform var(--dur-micro) ease;
}

.faq[open] .faq__chev {
  transform: rotate(180deg);
}

/* The answer's own inset, not a band. Written as block/inline padding rather
 * than the shorthand because check 14 scans the first 400 characters after a
 * <section> for a <div> and takes it for the band's inner wrapper - inside a
 * .faq-group that lands on this element, four levels down inside the
 * accordion, which the check's own rule ("everything deeper is a component")
 * says it should not. Same four numbers, same rendering. */
.faq__a {
  display: grid;
  gap: 12px;
  padding: 18px 22px 22px;
  border-top: 1px solid var(--border-subtle);
}

.faq__a p {
  font-size: 16px;
  line-height: 1.7;
  color: var(--text-body);
  text-wrap: pretty;
}

.faq__list {
  list-style: none;
  display: grid;
  gap: 8px;
}

.faq__list li {
  display: flex;
  gap: 12px;
  font-size: 16px;
  line-height: 1.6;
  color: var(--text-body);
}

.faq__bullet {
  flex: 0 0 auto;
  margin-top: 3px;
  font-size: 18px;
  color: var(--gold-500);
}

/* ---------------------------------------------------------------- webinar */

.faq-webinar {
  display: grid;
  gap: 16px;
  margin-top: 12px;
  padding: 32px;
  background: var(--grey-100);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius);
}

.faq-webinar__note {
  font-size: 15px;
  color: var(--text-body);
}

/* ------------------------------------------------------------ breakpoints */

@media (max-width: 960px) {
  .faq-layout {
    grid-template-columns: 1fr;
    gap: 40px;
  }

  .faq-rail {
    position: static;
  }
}

@media (max-width: 640px) {
  .faq-layout {
    padding-left: 20px;
    padding-right: 20px;
  }

  .faq-webinar {
    padding: 24px 20px;
  }
}
