/**
 * PHC TOP Pro 2.0 – FAQ Accordion Component
 * Alternating orange/green accent, smooth height animation, fully accessible.
 *
 * @package PHC_TOP
 * 
 */

/* ── Wrapper ────────────────────────────────────────────────────────────────── */
.phc-faq-wrap {
  --phc-faq-accent: #ff915a;
  --phc-faq-bg:     rgba(255, 145, 90, .07);
  --phc-faq-border: rgba(255, 145, 90, .25);
  max-width: 860px;
  margin-left: auto;
  margin-right: auto;
}

/* ── Headings ───────────────────────────────────────────────────────────────── */
.phc-faq-heading {
  font-size: clamp(1.5rem, 4vw, 2.2rem);
  font-weight: 800;
  letter-spacing: -.03em;
  line-height: 1.15;
  text-align: center;
  margin: 0 0 .6rem;
}

.phc-faq-subheading {
  text-align: center;
  color: rgba(17, 24, 39, .55);
  font-size: clamp(.875rem, 2.2vw, 1rem);
  margin: 0 0 2.2rem;
}

/* ── List ───────────────────────────────────────────────────────────────────── */
.phc-faq-list {
  display: flex;
  flex-direction: column;
  gap: .75rem;
}

/* ── Item ───────────────────────────────────────────────────────────────────── */
.phc-faq-item {
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 14px;
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(0, 0, 0, .04);
  transition: box-shadow .2s ease, border-color .2s ease;
}

.phc-faq-item:hover {
  box-shadow: 0 4px 18px rgba(0, 0, 0, .08);
}

/* Alternating accent bar via nth-child */
.phc-faq-item:nth-child(odd)  { border-left: 3px solid #ff915a; }
.phc-faq-item:nth-child(even) { border-left: 3px solid #8bc38b; }

/* Open state */
.phc-faq-item--open {
  box-shadow: 0 6px 24px rgba(0, 0, 0, .09);
}

.phc-faq-item--open:nth-child(odd) {
  background: rgba(255, 145, 90, .04);
  border-color: rgba(255, 145, 90, .35);
}

.phc-faq-item--open:nth-child(even) {
  background: rgba(139, 195, 139, .05);
  border-color: rgba(139, 195, 139, .4);
}

/* ── Question button ─────────────────────────────────────────────────────────── */
.phc-faq-question {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.15rem 1.4rem;
  background: none;
  border: none;
  cursor: pointer;
  text-align: left;
  font-family: inherit;
  font-size: clamp(.9rem, 2.3vw, 1.02rem);
  font-weight: 700;
  color: #111827;
  line-height: 1.45;
  -webkit-tap-highlight-color: transparent;
}

.phc-faq-question:hover {
  color: var(--phc-faq-accent);
}

.phc-faq-question:focus-visible {
  outline: 2px solid var(--phc-faq-accent);
  outline-offset: -2px;
  border-radius: 12px;
}

.phc-faq-question-text {
  flex: 1;
}

/* ── Chevron ─────────────────────────────────────────────────────────────────── */
.phc-faq-chevron {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: rgba(17, 24, 39, .06);
  color: #6b7280;
  flex-shrink: 0;
  transition: transform .28s cubic-bezier(.4, 0, .2, 1),
              background .2s ease,
              color .2s ease;
}

.phc-faq-item--open .phc-faq-chevron {
  transform: rotate(180deg);
  background: var(--phc-faq-accent);
  color: #fff;
}

/* ── Answer panel ────────────────────────────────────────────────────────────── */
.phc-faq-answer {
  /* Height animation driven by JS via max-height + CSS transition */
  max-height: 0;
  overflow: hidden;
  transition: max-height .35s cubic-bezier(.4, 0, .2, 1);
}

.phc-faq-answer[hidden] {
  display: block !important; /* override UA hidden style so transition works */
  max-height: 0;
  visibility: hidden;
}

.phc-faq-item--open .phc-faq-answer {
  max-height: 2000px; /* large cap — actual height set by JS */
  visibility: visible;
}

.phc-faq-answer-inner {
  padding: .25rem 1.4rem 1.3rem;
  color: rgba(17, 24, 39, .65);
  font-size: clamp(.875rem, 2.2vw, .96rem);
  line-height: 1.75;
}

.phc-faq-answer-inner p:first-child { margin-top: 0; }
.phc-faq-answer-inner p:last-child  { margin-bottom: 0; }
.phc-faq-answer-inner a             { color: #ff915a; text-decoration: underline; }

/* ── Reduced-motion ──────────────────────────────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  .phc-faq-answer,
  .phc-faq-chevron { transition: none; }
}

/* ── Mobile ──────────────────────────────────────────────────────────────────── */
@media (max-width: 600px) {
  .phc-faq-question { padding: .95rem 1rem; }
  .phc-faq-answer-inner { padding: .2rem 1rem 1.1rem; }
}
