/**
 * @file
 * Minimal structural styles for FAQ accordion.
 */
/* Spacing between FAQ groups */
.view-faq .item-list:not(:first-child) {
  padding-top: var(--space-xl);
}

.item-list .group-title {
  margin: 0 0 var(--space-lg);
}

/* TUI box: one flat framed panel per item, both schemes. */
.accordion-item {
  background-color: transparent;
  border: 1px solid var(--color-border-medium);
  border-radius: var(--radius-lg);
}

.accordion-item:not(:last-of-type) {
  margin-bottom: var(--space-md);
}

.accordion-header {
  margin: 0;
  line-height: var(--leading-tight);
  /* Card-title scale, like the other card headings. */
  font-size: var(--font-size-lg);
}

.accordion-title {
  font-weight: 700;
}

.accordion-trigger {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  /* Grid rhythm: half a row / two character cells. */
  padding: calc(var(--row) / 2) 2ch;
  cursor: pointer;
  border: 0;
  background: none;
  text-align: left;
  font: inherit;
  color: inherit;
}

.accordion-chevron {
  flex-shrink: 0;
  transform: rotate(180deg);
  margin-left: 2ch;
  transition: transform 0.25s ease-in-out;
}

.accordion-item.active .accordion-chevron {
  transform: rotate(0deg);
}

.accordion-content {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.25s ease-in-out;
}

.accordion-item.active .accordion-content {
  max-height: 40rem;
}

.accordion-body {
  padding: 0 2ch calc(var(--row) / 2);
  /* Reading text scale for the answers. */
  font-size: var(--font-size-md);
}

.accordion-body p:last-of-type {
  margin: 0;
}

/* Responsive */
@media (max-width: 768px) {
  .accordion-chevron {
    width: 1rem;
    height: 1rem;
  }
}
