/* ==========================================================================
   Tunstall Product FAQ  —  [tunstall_faq]
   Pill-style FAQ accordion: two per row on desktop, one on mobile. Each pill
   expands to reveal its answer; the + icon rotates to an ×. Scoped under .tfaq.
   ========================================================================== */

.tfaq {
  --faq-pill: #eff0f2; /* pill background */
  --faq-icon-bg: #fff; /* icon circle */
  --faq-red: #ED1C29; /* icon */
  --faq-ink: #030303; /* question + answer text */
  --ease: cubic-bezier(0.22, 1, 0.36, 1);

  color: var(--faq-ink);
  font-family: 'Roboto', sans-serif;
}

.tfaq *,
.tfaq *::before,
.tfaq *::after {
  box-sizing: border-box;
}

/* --- Grid: two per row, row-first order ----------------------------------- */
.tfaq__grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: clamp(0.75rem, 1.5vw, 1.1rem);
  align-items: start; /* an expanded pill grows its own cell only */
}

/* --- Pill ----------------------------------------------------------------- */
.tfaq__item {
  background: var(--faq-pill);
  overflow: hidden;
  /* Stadium when closed (~half the row height); eases to a softer rectangle
     when open. Starting near the clamp point keeps the transition smooth
     instead of snapping at the end. */
  border-radius: 36px;
  transition: border-radius 0.35s var(--ease);
}
.tfaq__item.is-open {
  border-radius: 22px;
}

/* --- Question row --------------------------------------------------------- */
.tfaq__qwrap {
  margin: 0;
  font-size: inherit;
  font-weight: inherit;
}
.tfaq__q {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  width: 100%;
  padding: 0.65rem 0.65rem 0.65rem 1.5rem;
  border: 0;
  background: none;
  text-align: left;
  cursor: pointer;
  color: var(--faq-ink);
  font: inherit;
}
.tfaq__qtext {
  font-size: clamp(0.9rem, 0.82rem + 0.3vw, 1rem);
  font-weight: 700;
  line-height: 1.3;
  color: var(--faq-ink);
}
.tfaq__icon {
  flex: none;
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--faq-icon-bg);
  color: var(--faq-red);
}
.tfaq__icon svg {
  width: 20px;
  height: 20px;
  transition: transform 0.35s var(--ease);
}
.tfaq__item.is-open .tfaq__icon svg {
  transform: rotate(45deg); /* + -> × */
}

/* --- Answer panel (grid-rows 0fr -> 1fr; no JS height measuring) ----------- */
.tfaq__panel {
  display: grid;
  grid-template-rows: 0fr;
  transition: grid-template-rows 0.4s var(--ease);
}
.tfaq__item.is-open .tfaq__panel {
  grid-template-rows: 1fr;
}
.tfaq__panel-inner {
  overflow: hidden;
}
.tfaq__a {
  padding: 0.25rem 1.5rem 1.4rem;
  max-width: 56ch;
  color: var(--faq-ink);
}
.tfaq__a :is(p, ul, ol) {
  margin: 0 0 0.75rem;
}
.tfaq__a :is(p, ul, ol):last-child {
  margin-bottom: 0;
}

/* --- Focus ---------------------------------------------------------------- */
.tfaq__q:focus-visible {
  outline: 2px solid var(--faq-red);
  outline-offset: 3px;
  border-radius: 36px;
}

/* --- Responsive ----------------------------------------------------------- */
@media (max-width: 782px) {
  .tfaq__grid {
    grid-template-columns: 1fr;
  }
}

@media (prefers-reduced-motion: reduce) {
  .tfaq__item,
  .tfaq__panel,
  .tfaq__icon svg {
    transition: none;
  }
}
