/* ==========================================================================
   TechAbbot – frequently asked questions
   Markup: partials/faq.html (generated by tools/build-faq.js)
   Behaviour: js/faq.js

   Light blue-grey section. Questions are white accordion panels in two equal
   columns (one below 768px). The two columns are separate stacks, so opening
   an answer on one side never moves the other side.

   Without JavaScript (<html> has no .js class) every answer is shown.
   ========================================================================== */

.faq {
  padding-block: clamp(52px, 6.5vw, 96px);
  background: var(--c-bg-alt);
  border-top: 1px solid var(--c-border);
}

.faq__head {
  max-width: 820px;
  margin-inline: auto;
  text-align: center;
}

.faq__title {
  margin: 14px 0 0;
  font-size: clamp(1.625rem, 1.2rem + 1.9vw, 2.5rem);
  font-weight: 700;
  line-height: 1.18;
  letter-spacing: -0.02em;
  text-wrap: balance;
}

.faq__accent { color: var(--c-blue); }

@supports ((-webkit-background-clip: text) or (background-clip: text)) {
  .faq__accent {
    background: var(--gradient-logo);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-box-decoration-break: clone;
    box-decoration-break: clone;
    -webkit-text-fill-color: transparent;
  }
}

.faq__intro {
  max-width: 44em;
  margin: 16px auto 0;
  color: var(--c-text-muted);
  font-size: clamp(1rem, 0.96rem + 0.2vw, 1.0625rem);
  line-height: 1.6;
}

/* Columns ------------------------------------------------------------------- */

.faq__columns {
  display: grid;
  gap: 14px;
  margin-top: clamp(30px, 4vw, 48px);
}

.faq__column {
  display: grid;
  align-content: start;
  gap: 14px;
  min-width: 0;
}

/* Panel --------------------------------------------------------------------- */

.faq-item {
  border: 1px solid var(--c-border);
  border-radius: 14px;
  background: var(--c-bg);
  transition: border-color 220ms ease, box-shadow 220ms ease;
}

.faq-item:hover { border-color: #C3D5DF; }

.js .faq-item.is-open {
  border-color: rgba(11, 109, 145, 0.45);
  box-shadow: 0 16px 30px -24px rgba(11, 109, 145, 0.7);
}

.faq-item__heading { margin: 0; font: inherit; }

.faq-item__toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  width: 100%;
  min-height: 64px;
  margin: 0;
  padding: 14px clamp(16px, 2vw, 24px);
  border: 0;
  border-radius: 14px;
  background: none;
  color: var(--c-text);
  font: inherit;
  font-size: clamp(1rem, 0.96rem + 0.2vw, 1.0625rem);
  font-weight: 600;
  line-height: 1.4;
  text-align: left;
  cursor: pointer;
}

html:not(.js) .faq-item__toggle { cursor: default; }

.js .faq-item.is-open .faq-item__question { color: var(--c-blue); }

/* Plus that becomes a minus. */
.faq-item__icon {
  position: relative;
  flex: none;
  width: 30px;
  height: 30px;
  border: 1.500px solid var(--c-blue);
  border-radius: 50%;
  color: var(--c-blue);
  transition: background-color 220ms ease, color 220ms ease;
}

html:not(.js) .faq-item__icon { display: none; }

.faq-item__icon::before,
.faq-item__icon::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 12px;
  height: 2px;
  border-radius: 1px;
  background: currentColor;
  transform: translate(-50%, -50%);
  transition: transform 260ms ease;
}

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

.js .faq-item.is-open .faq-item__icon {
  background: var(--c-blue);
  color: #fff;
}

.js .faq-item.is-open .faq-item__icon::after { transform: translate(-50%, -50%) rotate(0deg); }

/* Answer: the row grows from 0 to its natural height. */
.faq-item__panel {
  display: grid;
  grid-template-rows: 1fr;
}

.js .faq-item__panel {
  grid-template-rows: 0fr;
  transition: grid-template-rows 300ms ease;
}

.js .faq-item.is-open .faq-item__panel { grid-template-rows: 1fr; }

.faq-item__answer {
  min-height: 0;
  overflow: hidden;
}

/* A closed answer is hidden from keyboard and screen readers once it has
   finished collapsing. */
.js .faq-item:not(.is-open) .faq-item__answer {
  visibility: hidden;
  transition: visibility 0s linear 300ms;
}

.faq-item__answer p {
  margin: 0;
  padding: 0 clamp(16px, 2vw, 24px) 20px;
  color: var(--c-text-muted);
  font-size: 0.9375rem;
  line-height: 1.65;
}

.faq-item__answer a {
  color: var(--c-blue);
  font-weight: 600;
  text-underline-offset: 3px;
  white-space: nowrap;
}

/* The accordion keeps its short transitions under reduced-motion settings,
   at the site owner's request; base.css would otherwise cut them. */
.js .faq-item__panel { transition-duration: 300ms !important; }
.js .faq-item__icon::before,
.js .faq-item__icon::after { transition-duration: 260ms !important; }

@media (min-width: 768px) {
  .faq__columns {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: clamp(14px, 2vw, 24px);
  }
}
