/**
 * @file
 * MLT Modern — FAQ accordion.
 *
 * Click-to-expand FAQ items. Driven by JS toggling .mlt-faq__item--open;
 * the JS is in js/faq.js and uses no jQuery or framework.
 *
 * Accessibility: the question uses a <button> (handled in template), and
 * the answer panel has aria-hidden toggled by the JS. The visual + sign
 * rotates 45° to become a × when open.
 *
 * Markup:
 *   <div class="mlt-faq-list">
 *     <div class="mlt-faq__item">
 *       <button type="button" class="mlt-faq__q" aria-expanded="false">
 *         How long does a full rewire take?
 *       </button>
 *       <div class="mlt-faq__a">
 *         <p>For an average 3-bed semi, around 5-7 working days...</p>
 *       </div>
 *     </div>
 *     ...
 *   </div>
 */

.mlt-faq-list {
  max-width: 900px;
  margin: 0 auto;
}

.mlt-faq__item {
  background: #fff;
  border: 1px solid var(--mlt-border);
  border-radius: 8px;
  margin-bottom: 14px;
  overflow: hidden;
}

.mlt-faq__q {
  padding: 20px 24px;
  font-weight: 700;
  font-size: 17px;
  color: var(--mlt-text);
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  user-select: none;
  width: 100%;
  background: transparent;
  border: 0;
  text-align: left;
  font-family: inherit;
  line-height: 1.35;
  gap: 16px;
}

.mlt-faq__q::after {
  content: "+";
  font-size: 24px;
  color: var(--mlt-primary);
  font-weight: 700;
  transition: transform 0.2s;
  flex-shrink: 0;
}

.mlt-faq__item--open .mlt-faq__q::after {
  transform: rotate(45deg);
}

.mlt-faq__q:focus-visible {
  outline: 2px solid var(--mlt-primary);
  outline-offset: -2px;
}

.mlt-faq__a {
  padding: 0 24px;
  max-height: 0;
  overflow: hidden;
  color: var(--mlt-text-light);
  font-size: 16px;
  line-height: 1.65;
  transition: max-height 0.3s, padding 0.3s;
}

.mlt-faq__item--open .mlt-faq__a {
  padding: 0 24px 22px;
  /* 1000px chosen as a safe ceiling - tall enough for verbose FAQ answers. */
  max-height: 1000px;
}

.mlt-faq__a p {
  margin: 0 0 10px;
}

.mlt-faq__a p:last-child {
  margin-bottom: 0;
}
