/* The home's FAQ (site/_questions), after bfolio's: on a pale band, the title and a button on the
   left, the questions on the right in white rounded rows, each with a plus that turns to a minus
   when it opens. Native <details>. */
@layer components {
  .questions {
    display: grid;
    gap: var(--block-space-double) calc(var(--inline-space) * 6);
    margin: calc(var(--block-space) * 4) var(--bleed) 0;
    padding: clamp(3rem, 10vh, 6rem) var(--site-edge);
    background: color-mix(in srgb, var(--color-text) 5%, var(--color-bg)); /* grey enough for the white rows to read */

    @media (min-width: 52rem) { grid-template-columns: minmax(0, 1fr) minmax(0, 1.6fr); align-items: start; }
  }

  .questions__head {
    display: flex;
    flex-direction: column;
    gap: var(--block-space-double);

    & p { margin: 0; }
  }

  .questions .questions__head h2 { /* beats .site-page h2 */
    margin: 0;
    font-size: clamp(2.5rem, 1.25rem + 4vw, 4.5rem);
    font-weight: 700;
    line-height: 1;
    letter-spacing: -0.04em;
    text-transform: uppercase;
  }

  .questions__list { display: flex; flex-direction: column; gap: var(--block-space); }

  .questions__item {
    background: var(--color-bg-raised);
    border-radius: var(--radius-large);

    & summary {
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: var(--inline-space-double);
      padding: calc(var(--block-space) * 1.25) calc(var(--inline-space) * 3);
      font-size: var(--text-medium);
      font-weight: 600;
      cursor: pointer;
      list-style: none;
      border-radius: inherit;

      &::-webkit-details-marker { display: none; }

      /* The plus: two bars; the upright one folds away when the item opens. */
      &::after {
        content: "";
        flex: none;
        inline-size: 0.9rem;
        aspect-ratio: 1;
        background:
          linear-gradient(currentColor 0 0) center / 100% 2px no-repeat,
          linear-gradient(currentColor 0 0) center / 2px 100% no-repeat;
        transition: background-size var(--transition);
      }
    }

    &[open] summary::after { background-size: 100% 2px, 2px 0; }

    & p {
      max-inline-size: none;
      margin: 0;
      padding: 0 calc(var(--inline-space) * 3) calc(var(--block-space) * 1.5);
      line-height: 1.6;
      color: var(--color-subtle);
    }
  }
}
