/* ==========================================================================
   FAQ: the last section before the footer
   Heading and a contact prompt on the left, questions on the right.
   Each question is a native <details> element; name="faq" keeps one open at
   a time, so no JavaScript is needed.
   ========================================================================== */

.faq {
  display: grid;
  grid-template-columns: minmax(0, .8fr) minmax(0, 1.6fr);
  gap: 48px clamp(32px, 6vw, 96px);
  padding: var(--section-y) var(--gutter);
}

.faq__intro {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 24px;
}

.faq__intro .section-title {
  font-size: var(--heading-md);
}

.faq__lede {
  max-width: 340px;
  margin: 0;
  font-size: var(--text-lead);
  color: var(--color-muted);
}

.faq__list {
  border-bottom: 1px solid var(--color-ink);
}

/* ---- One question ---- */
.faq__item {
  border-top: 1px solid var(--color-ink);
  interpolate-size: allow-keywords;   /* lets the height animate to "auto" */
}

.faq__question {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 16px clamp(16px, 3vw, 40px);
  padding: 24px 0;
  list-style: none;
  cursor: pointer;
}

.faq__question::-webkit-details-marker {
  display: none;
}

.faq__num {
  font-family: var(--font-display);
  font-stretch: var(--stretch-display);
  font-weight: var(--weight-display);
  font-size: var(--text-num);
  line-height: 1;
  letter-spacing: .1em;
  color: var(--color-muted);
}

.faq__text {
  font-size: var(--text-xl);
  font-weight: 400;
  line-height: 1.3;
  transition: transform 200ms var(--ease);
}

/* Plus sign that becomes a minus when open */
.faq__toggle {
  position: relative;
  width: 44px;
  height: 44px;
  border: 1px solid var(--color-ink);
  border-radius: 50%;
  transition: background-color 160ms, color 160ms;
}

.faq__toggle::before,
.faq__toggle::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 14px;
  height: 1px;
  background: currentColor;
  transform: translate(-50%, -50%);
  transition: transform 300ms var(--ease);
}

.faq__toggle::after {
  transform: translate(-50%, -50%) rotate(90deg);
}

.faq__item[open] .faq__toggle {
  background: var(--color-ink);
  color: var(--color-paper);
}

.faq__item[open] .faq__toggle::after {
  transform: translate(-50%, -50%);
}

@media (hover: hover) and (pointer: fine) {
  .faq__item:not([open]) .faq__question:hover .faq__toggle { background: var(--color-stone); }
}

@media (hover: hover) and (pointer: fine) and (prefers-reduced-motion: no-preference) {
  html:not(.motion-off):not(.is-keyboard) .faq__question:hover .faq__text { transform: translateX(6px); }
}

/* Animated open/close. Browsers without ::details-content or
   interpolate-size simply open and close instantly. */
.faq__item::details-content {
  height: 0;
  overflow: clip;
  transition: height 450ms var(--ease), content-visibility 450ms allow-discrete;
}

.faq__item[open]::details-content {
  height: auto;
}

.faq__answer {
  max-width: 640px;
  margin: 0;
  padding: 0 0 28px;
  color: var(--color-muted);
}

.faq__item[open] .faq__answer {
  animation: faq-in 600ms var(--ease) both;
}

@keyframes faq-in {
  from { opacity: 0; transform: translateY(10px); }
}

@media (max-width: 900px) {
  .faq { grid-template-columns: 1fr; }
}

@media (max-width: 560px) {
  .faq__question { grid-template-columns: minmax(0, 1fr) auto; }
  .faq__num { display: none; }
}
