/*
 * faq — the np/faq block.
 *
 * No CSS Module counterpart: the FAQ was added after the conversion, so the
 * rules are written directly against the design tokens rather than converted.
 *
 * The block renders inside `.np-content-blocks__content`, whose descendant
 * selectors (`… h2`, `… p`) would otherwise win on specificity — hence the
 * two-class selectors below rather than !important.
 */
.np-faq__faq {
  max-width: 920px;
  margin: 52px auto 12px;
}

.np-faq__faq .np-faq__heading {
  font-family: var(--font-head);
  font-size: 28px;
  font-weight: 600;
  color: var(--navy);
  line-height: 1.2;
  margin: 0 0 20px;
}

.np-faq__item {
  margin: 10px 0 0;
  overflow: hidden;
  border: 1px solid transparent;
  border-radius: 12px;
  background: #f4f6f5;
  transition: background-color 0.2s ease, border-color 0.2s ease;
}

.np-faq__item:first-of-type {
  margin-top: 0;
}

.np-faq__item[open] {
  border-color: var(--rule);
  background: #f8faf9;
}

.np-faq__question {
  position: relative;
  display: block;
  padding: 20px 56px 20px 24px;
  font-family: var(--font-head);
  font-size: 19px;
  font-weight: 600;
  color: var(--navy);
  line-height: 1.35;
  cursor: pointer;
  list-style: none;
  transition: color 0.2s;
}

/* Both spellings are needed: WebKit only honours the pseudo-element. */
.np-faq__question::-webkit-details-marker {
  display: none;
}

.np-faq__question::marker {
  content: "";
}

.np-faq__question:hover {
  color: var(--green2);
}

/*
 * The marker is drawn from two bars rather than set as a "+" glyph so it stays
 * optically centred at every font size and rotates cleanly into a "×".
 */
.np-faq__marker {
  position: absolute;
  top: 50%;
  right: 26px;
  width: 9px;
  height: 9px;
  border-right: 2px solid var(--green2);
  border-bottom: 2px solid var(--green2);
  flex-shrink: 0;
  transform: translateY(-70%) rotate(45deg);
  transition: transform 0.2s ease;
}

.np-faq__item[open] .np-faq__marker {
  transform: translateY(-25%) rotate(225deg);
}

.np-faq__faq .np-faq__answer p {
  max-width: 860px;
  color: var(--muted);
  font-size: 15px;
  line-height: 1.8;
  margin: 0;
  padding: 0 56px 24px 24px;
}

@media (prefers-reduced-motion: reduce) {
  .np-faq__marker {
    transition: none;
  }
}

@media (max-width: 700px) {
  .np-faq__faq {
    margin-top: 40px;
  }

  .np-faq__question {
    padding: 18px 48px 18px 18px;
    font-size: 18px;
  }

  .np-faq__faq .np-faq__answer p {
    padding: 0 18px 20px;
  }

  .np-faq__marker {
    right: 20px;
  }
}

/*
 * Yoast's FAQ block (`yoast/faq-block`), allowed in the inserter by
 * nanoprep_allowed_blocks(). Yoast ships its own markup and its own front-end
 * stylesheet, so these rules only restate the theme's type and colour over it —
 * two-class selectors so they win over Yoast's single-class rules and over
 * `.np-content-blocks__content p`, whichever stylesheet loads last.
 *
 * Yoast's block has no disclosure behaviour of its own, so assets/js/yoast-faq.js
 * rewrites each section into a button/panel pair and marks the block
 * `np-faq--enhanced`. The rules below cover both states: the plain list Yoast
 * ships (and what a reader with the script blocked sees) and the expandable
 * version, which reuses the NanoPrep FAQ block's marker and spacing.
 */
.schema-faq.wp-block-yoast-faq-block {
  max-width: 920px;
  margin: 52px auto 12px;
}

.schema-faq .schema-faq-section {
  margin: 10px 0 0;
  overflow: hidden;
  padding: 0;
  border: 1px solid transparent;
  border-radius: 12px;
  background: #f4f6f5;
  transition: background-color 0.2s ease, border-color 0.2s ease;
}

.schema-faq .schema-faq-section:first-child {
  margin-top: 0;
}

.schema-faq .schema-faq-section:focus-within {
  border-color: var(--rule);
  background: #f8faf9;
}

.schema-faq .schema-faq-question {
  display: block;
  margin-bottom: 8px;
  font-family: var(--font-head);
  font-size: 19px;
  font-weight: 600;
  color: var(--navy);
  line-height: 1.35;
}

.schema-faq .schema-faq-answer {
  max-width: 860px;
  margin: 0;
  padding: 0 56px 24px 24px;
  font-family: var(--font-body);
  font-size: 15px;
  color: var(--muted);
  line-height: 1.8;
}

@media (max-width: 700px) {
  .schema-faq.wp-block-yoast-faq-block {
    margin-top: 32px;
  }

  .schema-faq .schema-faq-question {
    font-size: 18px;
  }
}

/* Expanded by assets/js/yoast-faq.js — see the note above. */
.schema-faq.np-faq--enhanced .schema-faq-section {
  padding: 0;
}

.np-faq__toggle {
  position: relative;
  display: block;
  width: 100%;
  padding: 20px 56px 20px 24px;
  border: 0;
  background: transparent;
  text-align: left;
  cursor: pointer;
  transition: color 0.2s;
}

.np-faq__toggle .schema-faq-question {
  margin: 0;
}

.np-faq__toggle:hover .schema-faq-question {
  color: var(--green2);
}

.np-faq__toggle[aria-expanded="true"] .np-faq__marker {
  transform: translateY(-25%) rotate(225deg);
}

.schema-faq.np-faq--enhanced .schema-faq-answer {
  padding-bottom: 24px;
}

@media (max-width: 700px) {
  .np-faq__toggle {
    padding: 18px 48px 18px 18px;
  }

  .schema-faq .schema-faq-answer {
    padding: 0 18px 20px;
  }
}
