/* AIO SEO Harsh v2 – FAQ Front-End CSS */

.aioseoh-faq {
  /* Palette — works on any background color */
  --fq-acc:     #6c63ff;
  --fq-bg:      #ffffff;
  --fq-surf:    #f7f8fc;
  --fq-bdr:     #e5e7ef;
  --fq-txt:     #1a1d27;       /* question text — always dark on light bg */
  --fq-txt-a:   #374151;       /* answer text */
  --fq-muted:   #6b7280;
  --fq-num-bg:  #ede9fe;
  --fq-num-c:   #5a52e0;
  --fq-open-bg: #faf9ff;
  --fq-hover:   #f3f2ff;
  --fq-r:       10px;

  font-family: inherit;
  margin: 2.5em 0;
  background: var(--fq-bg);
  border: 1px solid var(--fq-bdr);
  border-radius: var(--fq-r);
  overflow: hidden;
  box-shadow: 0 4px 24px rgba(108, 99, 255, .08);
}

/* ── Header bar ── */
.aioseoh-faq__hd {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 22px;
  background: var(--fq-surf);
  border-bottom: 1px solid var(--fq-bdr);
  gap: 12px;
}
.aioseoh-faq__hd-left {
  display: flex;
  align-items: center;
  gap: 10px;
}
.aioseoh-faq__icon-wrap {
  width: 32px;
  height: 32px;
  background: var(--fq-num-bg);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  color: var(--fq-acc);
}
.aioseoh-faq__icon-wrap svg { width: 18px; height: 18px; }

.aioseoh-faq__title {
  font-size: 1.1em;
  font-weight: 700;
  margin: 0;
  padding: 0;
  color: var(--fq-txt);    /* always dark — never white on white */
  line-height: 1.3;
  border: none;
  background: none;
}
.aioseoh-faq__badge {
  background: var(--fq-num-bg);
  color: var(--fq-num-c);
  font-size: 11px;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: 99px;
  white-space: nowrap;
  flex-shrink: 0;
}

/* ── List ── */
.aioseoh-faq__list {
  padding: 10px;
  display: flex;
  flex-direction: column;
  gap: 5px;
}

/* ── Item ── */
.aioseoh-faq__item {
  border: 1px solid var(--fq-bdr);
  border-radius: 8px;
  overflow: hidden;
  background: var(--fq-bg);
  transition: border-color .2s, box-shadow .2s;
}
.aioseoh-faq__item:has(.aioseoh-faq__btn[aria-expanded="true"]) {
  border-color: var(--fq-acc);
  box-shadow: 0 0 0 2px rgba(108, 99, 255, .1);
}

/* ── Question button
   THE CRITICAL FIX: every state has explicit color — no inheritance ── */
.aioseoh-faq__btn {
  width: 100%;
  background: var(--fq-bg);
  border: none;
  text-align: left;
  padding: 14px 16px;
  display: flex;
  align-items: center;
  gap: 12px;
  cursor: pointer;
  color: var(--fq-txt);        /* ← dark text always — never invisible */
  font-size: 0.95em;
  font-weight: 600;
  line-height: 1.5;
  transition: background .15s, color .15s;
}
.aioseoh-faq__btn:hover {
  background: var(--fq-hover);
  color: var(--fq-txt);        /* stays dark on hover */
}
.aioseoh-faq__btn[aria-expanded="true"] {
  background: var(--fq-open-bg);
  color: var(--fq-acc);        /* accent purple when open — always visible */
  border-bottom: 1px solid var(--fq-bdr);
}

/* ── Number badge ── */
.afaq-num {
  min-width: 26px;
  height: 26px;
  border-radius: 6px;
  background: var(--fq-num-bg);
  color: var(--fq-num-c);
  font-size: 11px;
  font-weight: 800;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: background .15s, color .15s;
}
.aioseoh-faq__btn[aria-expanded="true"] .afaq-num {
  background: var(--fq-acc);
  color: #fff;
}

/* ── Question text ── */
.afaq-q { flex: 1; }

/* ── Chevron ── */
.afaq-arrow {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
  color: var(--fq-muted);
  display: flex;
  align-items: center;
  transition: transform .25s, color .15s;
}
.afaq-arrow svg { width: 100%; height: 100%; display: block; }
.aioseoh-faq__btn[aria-expanded="true"] .afaq-arrow {
  transform: rotate(180deg);
  color: var(--fq-acc);
}

/* ── Answer panel ── */
.aioseoh-faq__ans {
  overflow: hidden;
  max-height: 0;
  padding: 0 16px 0 54px;
  background: var(--fq-open-bg);
  transition: max-height .3s ease, padding .2s;
}
.aioseoh-faq__ans:not([hidden]) {
  max-height: 1000px;
  padding: 12px 20px 18px 54px;
}
.aioseoh-faq__ans p {
  margin: 0;
  font-size: 0.9em;
  line-height: 1.85;
  color: var(--fq-txt-a);      /* always a readable dark grey */
}

/* ── Footer ── */
.aioseoh-faq__foot {
  padding: 10px 22px;
  background: var(--fq-surf);
  border-top: 1px solid var(--fq-bdr);
  font-size: 11px;
  color: var(--fq-muted);
  text-align: right;
}

/* ── Dark-mode aware — if theme wraps content in dark ── */
@media (prefers-color-scheme: dark) {
  .aioseoh-faq {
    --fq-bg:      #1a1d27;
    --fq-surf:    #21253a;
    --fq-bdr:     #2e3350;
    --fq-txt:     #e2e8f0;
    --fq-txt-a:   #c8d0e0;
    --fq-muted:   #8892a4;
    --fq-num-bg:  rgba(108,99,255,.18);
    --fq-num-c:   #a89cff;
    --fq-open-bg: rgba(108,99,255,.06);
    --fq-hover:   rgba(108,99,255,.09);
  }
}

/* ── Responsive ── */
@media (max-width: 600px) {
  .aioseoh-faq__hd  { padding: 14px 16px; }
  .aioseoh-faq__btn { padding: 12px 14px; font-size: 0.88em; }
  .aioseoh-faq__ans:not([hidden]) { padding: 10px 14px 14px; }
  .afaq-num { display: none; }
}
