/* Rank Math FAQ Accordion */
#rank-math-faq.rank-math-block {
  --faq-border: #e8e8ee;
  --faq-bg: #ffffff;
  --faq-q-bg: #f7f8fb;
  --faq-q-bg-hover: #eef1f7;
  --faq-text: #111827;
  --faq-muted: #4b5563;
  --faq-accent: #2563eb;
  --faq-radius: 12px;
  --faq-shadow: 0 8px 24px rgba(17, 24, 39, 0.08);
}

#rank-math-faq .rank-math-list {
  display: grid;
  gap: 12px;
}

#rank-math-faq .rank-math-list-item {
  background: var(--faq-bg);
  border: 1px solid var(--faq-border);
  border-radius: var(--faq-radius);
  box-shadow: var(--faq-shadow);
  overflow: hidden;
}

/* Question */
#rank-math-faq .rank-math-question {
  margin: 0;
  padding: 14px 44px 14px 16px; /* right space for icon */
  background: linear-gradient(180deg, var(--faq-q-bg), #fff);
  color: var(--faq-text);
  cursor: pointer;
  position: relative;
  font-size: 16px;
  line-height: 1.6;
  user-select: none;
}

#rank-math-faq .rank-math-question strong {
  font-weight: 700;
}

#rank-math-faq .rank-math-question:hover {
  background: var(--faq-q-bg-hover);
}

/* Focus (keyboard accessibility) */
#rank-math-faq .rank-math-question:focus {
  outline: none;
}
#rank-math-faq .rank-math-question:focus-visible {
  outline: 3px solid color-mix(in srgb, var(--faq-accent) 35%, transparent);
  outline-offset: 2px;
}

/* Chevron icon */
#rank-math-faq .rank-math-question::after {
  content: "";
  width: 10px;
  height: 10px;
  border-right: 2px solid var(--faq-muted);
  border-bottom: 2px solid var(--faq-muted);
  transform: rotate(45deg);
  position: absolute;
  right: 16px;
  top: 50%;
  margin-top: -6px;
  transition: transform 220ms ease, border-color 220ms ease;
}

#rank-math-faq .rank-math-list-item.is-open .rank-math-question::after {
  transform: rotate(-135deg);
  border-color: var(--faq-accent);
}

/* Answer wrapper: animated collapse */
#rank-math-faq .rank-math-answer {
  padding: 0 16px;
  color: var(--faq-muted);
  font-size: 15px;
  line-height: 1.9;
  max-height: 0;

  /* accordion animation technique */
  display: grid;
  grid-template-rows: 0fr;
  transition: grid-template-rows 260ms ease;
}

#rank-math-faq .rank-math-answer > * {
  overflow: hidden; /* needed for 0fr trick */
}

#rank-math-faq .rank-math-list-item.is-open .rank-math-answer {
  grid-template-rows: 1fr;
  max-height: fit-content;
}

/* Inner content spacing */
#rank-math-faq .rank-math-answer p {
  margin: 0;
  padding: 0 0 14px 0;
}

#rank-math-faq .rank-math-list-item.is-open .rank-math-answer {
  border-top: 1px solid var(--faq-border);
}

#rank-math-faq .rank-math-list-item.is-open .rank-math-question {
  background: #fff;
}

/* Optional: reduce motion */
@media (prefers-reduced-motion: reduce) {
  #rank-math-faq .rank-math-answer,
  #rank-math-faq .rank-math-question::after {
    transition: none !important;
  }
}
