/* Quoi FAQ – Frontend Styles – Redesigned */

/* ── CSS Custom Properties (defaults, overridable via shortcode) ── */
.quoi-faq-list {
  --faq-title-size: 1.25rem;
  --faq-content-size: 0.95rem;
  --faq-arrow-width: 180px;
  --faq-toggle-size: 32px;
  max-width: 800px;
}

/* ── Item: Grid Layout (long-arrow left, title+content right) ── */
.quoi-faq-item {
  display: grid;
  grid-template-columns: var(--faq-arrow-width) 1fr;
  gap: 20px;
  margin-bottom: 32px;
  grid-template-areas:
    "arrow trigger"
    "arrow body";
}

/* ── Long Arrow (left, permanent, fixed width) ── */
.quoi-faq-long-arrow {
  grid-area: arrow;
  display: flex;
  align-items: flex-start;
}

.quoi-faq-long-arrow svg {
  width: 100%;
  height: auto;
  display: block;
}

/* ── Trigger Button (Astra theme overrides) ── */
.quoi-faq-trigger,
.quoi-faq-trigger:hover,
.quoi-faq-trigger:focus,
.quoi-faq-trigger:active,
.quoi-faq-trigger:visited {
  grid-area: trigger;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  background: none !important;
  background-color: transparent !important;
  border: none !important;
  box-shadow: none !important;
  padding: 0 !important;
  cursor: pointer;
  outline: none;
  color: inherit !important;
  text-decoration: none !important;
  -webkit-tap-highlight-color: transparent;
  border-radius: 0 !important;
  width: fit-content;
}

/* ── Title Box (contains title + toggle arrow) ── */
.quoi-faq-title-box {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  border: 1px solid #111;
  padding: 14px 36px;
  color: #111;
  font-size: var(--faq-title-size);
  background: transparent;
  transition: background 0.2s ease;
}

.quoi-faq-trigger:hover .quoi-faq-title-box {
  background: #f5f5f5;
}

/* ── Title Text ── */
.quoi-faq-title {
  display: inline;
  white-space: nowrap;
}

/* ── Toggle Arrow (small, right side, rotates) ── */
.quoi-faq-toggle-arrow {
  flex-shrink: 0;
  width: var(--faq-toggle-size);
  height: var(--faq-toggle-size);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.3s ease;
}

.quoi-faq-toggle-arrow svg {
  width: 100%;
  height: auto;
  display: block;
}

/* ── Toggle Arrow Rotation on Open ── */
.quoi-faq-trigger[aria-expanded="true"] .quoi-faq-toggle-arrow {
  transform: rotate(180deg);
}

/* ── Alternating Box Shapes ── */
.quoi-faq-item:nth-child(odd) .quoi-faq-title-box {
  border-radius: 0;
}

.quoi-faq-item:nth-child(even) .quoi-faq-title-box {
  border-radius: 50px;
}

/* ── Body (Content Container) ── */
.quoi-faq-body {
  grid-area: body;
  display: none;
}

.quoi-faq-body.is-open {
  display: block;
}

/* ── Content (appears below title) ── */
.quoi-faq-content {
  padding: 16px 0 8px;
  color: #111;
  font-size: var(--faq-content-size);
  line-height: 1.6;
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.35s ease;
}

.quoi-faq-body.is-open .quoi-faq-content {
  max-height: 1000px;
}

.quoi-faq-content p {
  margin: 0 0 1em;
}

.quoi-faq-content p:last-child {
  margin-bottom: 0;
}

/* ── Trigger Focus (keyboard only) ── */
.quoi-faq-trigger:focus-visible .quoi-faq-title-box {
  outline: 2px solid #111;
  outline-offset: 3px;
}

/* ── Reduced Motion ── */
@media (prefers-reduced-motion: reduce) {
  .quoi-faq-toggle-arrow,
  .quoi-faq-content {
    transition: none;
  }
}

/* ── Mobile: Smaller Arrow ── */
@media (max-width: 768px) {
  .quoi-faq-list {
    --faq-arrow-width: 120px;
  }

  .quoi-faq-item {
    gap: 16px;
  }

  .quoi-faq-title-box {
    padding: 12px 24px;
    font-size: calc(var(--faq-title-size) * 0.9);
    gap: 12px;
  }
}
