/**
 * Polyh: FAQ — layout skeleton only.
 *
 * Every colour here is a neutral placeholder that a widget control overrides
 * via {{WRAPPER}}, so the same widget sits on a white section and on an ink
 * one without forking the markup. Nothing brand-specific belongs in this file.
 */

.polyh-faq {
  --polyh-faq-rule: rgba(0, 0, 0, .12);
}

.polyh-faq__heading {
  margin: 0 0 1.6rem;
}

.polyh-faq .faq-grid {
  border: 1px solid var(--polyh-faq-rule);
  border-radius: 10px;
  overflow: hidden;
}

.polyh-faq .faq-item {
  border-bottom: 1px solid var(--polyh-faq-rule);
}

.polyh-faq .faq-item:last-child {
  border-bottom: none;
}

/* The question heading is structural only — it must not inherit a heading's
   size/margins from the theme, or every FAQ row becomes a display-size block. */
.polyh-faq .faq-h {
  margin: 0;
  padding: 0;
  font: inherit;
  color: inherit;
  letter-spacing: inherit;
  text-transform: none;
}

.polyh-faq .faq-q {
  width: 100%;
  margin: 0;
  background: none;
  border: none;
  cursor: pointer;
  padding: 1.1rem 1.5rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  text-align: left;
  font: inherit;
  font-weight: 600;
  color: inherit;
  /* 44px minimum touch target (Apple HIG 44pt / Material 48dp) even if a
     control shrinks the padding. */
  min-height: 44px;
  transition: background .18s ease, color .18s ease;
}

.polyh-faq .faq-q__text {
  flex: 1;
}

/* Keyboard focus only. A mouse click must not paint a ring, or the control
   reads as stuck-selected after every tap. */
.polyh-faq .faq-q:focus-visible {
  outline: 2px solid currentColor;
  outline-offset: -3px;
}

/* Caret drawn in CSS: no glyph, so no font dependency and no encoding risk
   on the round trip through WordPress. Rotates 180deg when the row is open. */
.polyh-faq .faq-chevron {
  flex-shrink: 0;
  width: 0;
  height: 0;
  border-left: .32em solid transparent;
  border-right: .32em solid transparent;
  border-top: .38em solid currentColor;
  transition: transform .25s ease;
}

.polyh-faq .faq-q.open .faq-chevron {
  transform: rotate(180deg);
}

.polyh-faq .faq-a {
  padding: 0 1.5rem 1.4rem;
  line-height: 1.7;
}

/* `hidden` is the single source of truth for visibility, so a JS failure
   leaves the answers collapsed rather than half-styled. The attribute
   selector has to be stated because the rule above sets a display. */
.polyh-faq .faq-a[hidden] {
  display: none;
}

.polyh-faq .faq-a > :first-child {
  margin-top: 0;
}

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

@media (max-width: 560px) {
  .polyh-faq .faq-q {
    padding: 1rem 1.1rem;
  }
  .polyh-faq .faq-a {
    padding: 0 1.1rem 1.2rem;
  }
}

/* Someone who has asked for less motion still gets the state change, just
   without the sweep. */
@media (prefers-reduced-motion: reduce) {
  .polyh-faq .faq-chevron,
  .polyh-faq .faq-q {
    transition: none;
  }
}

/* The no-JS fallback is NOT here — it ships as a <noscript><style> block from
   the widget itself (same pattern as this site's header drawer). Putting it in
   this file would need a class that JS removes, which flashes every answer open
   on load before the script runs. noscript costs nothing when JS is on. */
