/* The questions on the front page. Each is a native `details`, so opening
   and closing is the browser's job and the list works before any script
   runs; `:open` turns the chevron over. */

@layer components {
  .home-faq {
    --home-bleed-background: var(--color-canvas);

    padding-block: 4.5rem;

    @media (width >= 768px) {
      padding-block: 6rem;
    }
  }

  /* The rows take the page's column, as every other section's cards do — a
     narrower list of its own would be the one section out of line. */
  .home-faq__list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    margin-block-start: 3rem;
  }

  .home-faq__item {
    background: var(--color-surface);
    border: 1px solid var(--color-border-subtle);
    border-radius: var(--radius-lg);
  }

  .home-faq__question {
    align-items: center;
    cursor: pointer;
    display: flex;
    font-size: 0.9375rem;
    font-weight: 700;
    gap: 1rem;
    justify-content: space-between;
    list-style: none;
    padding: 1rem 1.125rem;

    @media (width >= 768px) {
      font-size: 1rem;
      padding: 1.125rem 1.25rem;
    }
  }

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

  .home-faq__question:hover {
    color: var(--color-brand);
  }

  .home-faq__question:focus-visible {
    border-radius: var(--radius-lg);
    outline: 2px solid var(--color-brand);
    outline-offset: -2px;
  }

  .home-faq__chevron {
    color: var(--color-brand);
    flex-shrink: 0;
    transition: rotate 0.2s;
  }

  .home-faq__item[open] .home-faq__chevron {
    rotate: 180deg;
  }

  /* The row is as wide as the page; the answer inside it keeps a measure
     that can be read. */
  .home-faq__answer {
    color: var(--color-ink-secondary);
    font-size: 0.9375rem;
    line-height: 1.7;
    margin: 0;
    max-inline-size: 44rem;
    padding: 0 1.25rem 1.25rem;
  }
}
