/* Carbon Confido — FAQ page
   Loaded after type.css, site.css and pages.css. Only the accordion lives here. */

.faq { padding: var(--sy) 0; }   /* homepage section spacing */

/* ---------- Accordion ---------- */
.faq-list {
  --pad-x: 30px;         /* inner left/right padding of each row */
  --num-col: 73px;       /* number column; question + answer start after it */
  --bleed: 18px;         /* the open row's gray panel extends a little past the lines */
  --icon: 40px;
  list-style: none; margin: 0; padding: 0;   /* full content width, as the homepage sections */
}
.faq-item { position: relative; border-bottom: 1px solid #dcdcdc; transition: border-color .3s; }
/* gray rounded panel behind the open row */
.faq-item::before {
  content: ""; position: absolute; inset: 0 calc(-1 * var(--bleed)); z-index: -1;
  background: var(--gray-bg); border-radius: var(--radius);
  opacity: 0; transition: opacity .35s ease;
}
.faq-list { position: relative; isolation: isolate; }
.faq-item.is-open::before { opacity: 1; }
.faq-item.is-open,
.faq-item:has(+ .faq-item.is-open) { border-bottom-color: transparent; }   /* no line touching the gray panel */

.faq-q { margin: 0; font: inherit; }
.faq-btn {
  display: grid; grid-template-columns: var(--num-col) 1fr var(--icon); column-gap: 20px; align-items: center;
  width: 100%; padding: 28px var(--pad-x); margin: 0;
  background: none; border: 0; border-radius: var(--radius); cursor: pointer;
  font: inherit; color: var(--ink); text-align: left;
}
.faq-num, .faq-text { font-size: var(--fs-md); font-weight: 600; line-height: 1.4; }
.faq-num { font-variant-numeric: tabular-nums; }
.faq-btn:hover .faq-text { color: var(--green-dark); }

/* round "+" icon: filled pale green when closed, outlined "−" when open */
.faq-icon {
  position: relative; width: var(--icon); height: var(--icon); border-radius: 50%;
  background: var(--green-num); border: 1.5px solid transparent;
  transition: background-color .3s, border-color .3s, transform .3s;
}
.faq-icon::before, .faq-icon::after {
  content: ""; position: absolute; left: 50%; top: 50%; width: 18px; height: 2px; border-radius: 2px;
  background: var(--green); transform: translate(-50%, -50%);
  transition: transform .3s ease;
}
.faq-icon::after { transform: translate(-50%, -50%) rotate(90deg); }
.faq-btn:hover .faq-icon { background: #c3e09d; }
.faq-item.is-open .faq-icon { background: transparent; border-color: var(--green); }
.faq-item.is-open .faq-icon::after { transform: translate(-50%, -50%) rotate(0deg); }   /* vertical bar folds into "−" */

/* answer: aligned with the question text (padding sits on the paragraph so a collapsed
   answer can shrink to zero height) */
.faq-a p {
  padding: 0 calc(var(--pad-x) + var(--icon) + 60px) 50px calc(var(--pad-x) + var(--num-col) + 20px);
}
.faq-a p { font-size: var(--fs-body-sm); line-height: 1.6; }

/* Collapsing only once the script has run, so answers stay readable without JS.
   Smooth height via the grid 0fr → 1fr technique; visibility hides closed answers from screen readers. */
.faq-ready .faq-a {
  display: grid; grid-template-rows: 0fr; visibility: hidden;
  transition: grid-template-rows .45s cubic-bezier(.4,0,.2,1), visibility 0s linear .45s;
}
.faq-ready .faq-a > .faq-a-inner { overflow: hidden; min-height: 0; }
.faq-ready .is-open .faq-a {
  grid-template-rows: 1fr; visibility: visible;
  transition: grid-template-rows .45s cubic-bezier(.4,0,.2,1), visibility 0s;
}
@media (prefers-reduced-motion: reduce) {
  .faq-ready .faq-a, .faq-ready .is-open .faq-a, .faq-item::before, .faq-icon, .faq-icon::after { transition: none; }
}

/* =========================================================
   iPad (768 – 1099)
   ========================================================= */
@media (max-width: 1099px) {
  .faq-list { --pad-x: 24px; --num-col: 48px; --bleed: 12px; }
  .faq-a p { padding-right: calc(var(--pad-x) + var(--icon) + 20px); padding-bottom: 40px; }
}

/* =========================================================
   Mobile (< 768)
   ========================================================= */
@media (max-width: 767px) {
  .faq-list { --pad-x: 14px; --num-col: 26px; --bleed: 6px; --icon: 34px; }
  .faq-btn { column-gap: 12px; padding-block: 22px; align-items: start; }
  .faq-num, .faq-text { padding-top: 4px; }   /* line up with the icon on multi-line questions */
  .faq-icon::before, .faq-icon::after { width: 14px; }
  .faq-a p { padding: 0 var(--pad-x) 30px calc(var(--pad-x) + var(--num-col) + 12px); }
}
