/* P3 STUDIO — Stage 87 (1 Oct): /contact/'s questions, "Questions about your
   project". Loaded by /contact/ alone, after site.css. The look is Andrea's
   "Contact Q&A Look" (1 Oct); where it and the site differ, the site's own
   components win: .section, the seams, .h-section, .body-copy and the tokens.

   THE BAND. The People / Whole-home cream (#EFE8DC), ink text, under the sage
   of .ct-flow. It is an ordinary seam host and seam above: site.css gives it
   the seam paddings (--seam-pt / --seam-pb, at (0,2,0), so nothing here sets
   a vertical padding), the curve in its div.seam (.s3) and the still pose
   under reduced motion. The footer below it now hosts .s4 and reads the cream
   as its --prev-bg (set on the footer's own style attribute in the markup,
   where every page sets it: an inline value outranks any rule in this file).

   STATES. contact-qa.js marks the section data-qa-ready once it has collapsed the
   answers and applied the switch. Until then (and always, without
   JavaScript) every answer shows and the switch is hidden. */

/* .ct-flow is no longer the last band: its straight fade into the canvas
   footer (shown only where mask images are unsupported; site.css already
   hides it everywhere else) would now fade sage to black over the cream */
.ct-flow::after { display: none; }

/* the coppers and the card's ink tints. The open state (the chevron's circle,
   the border) is the mock-up's #9A5A24; the link line's text is one step
   darker, #874F1F, because #9A5A24 text reads 4.1:1 on the card (3.9:1
   hovered), under AA's 4.5:1 (Andrea, 1 Oct: the darker link only) */
.ct-qa {
  --sec-bg: #EFE8DC; --sec-fg: var(--ink); --prev-bg: #A7B2A6;
  text-align: center;
  --qa-copper: #9A5A24;
  --qa-link: #874F1F;
  --qa-tint: rgba(43, 31, 30, 0.045);
  --qa-tint-hi: rgba(43, 31, 30, 0.07);
  --qa-line: rgba(43, 31, 30, 0.14);
  --qa-dur: 300ms;
}

.ct-qa .h-section { margin-bottom: var(--intra-gap); }
.ct-qa .qa-intro { color: rgba(43, 31, 30, 0.72); margin: 0 auto; }
/* the instruction is only true once the answers can be opened */
.ct-qa:not([data-qa-ready]) .qa-intro { display: none; }

/* ---- the switch: three options on one pill track, a solid ink pill that
   slides to the chosen one (transform only); the labels never move ---- */
.qa-switch-wrap { display: none; margin-top: 1.6rem; }
.ct-qa[data-qa-ready] .qa-switch-wrap { display: block; }
.qa-switch {
  position: relative;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  max-width: 600px;
  margin: 0 auto;
  padding: 5px;
  border-radius: var(--radius-pill);
  background: var(--qa-tint);
  box-shadow: inset 0 0 0 1px var(--qa-line);
}
.qa-ind {
  position: absolute;
  top: 5px; left: 5px;
  width: calc((100% - 10px) / 3);
  height: calc(100% - 10px);
  border-radius: var(--radius-pill);
  background: var(--ink);
  transform: translateX(calc(var(--i, 0) * 100%));
  transition: transform var(--qa-dur) var(--ease);
  pointer-events: none;
}
.qa-tab {
  position: relative;            /* above the pill */
  min-height: 46px;
  padding: 0 10px;
  border: 0;
  border-radius: var(--radius-pill);
  background: none;
  color: var(--ink);
  font: 500 clamp(0.9rem, 2.6vw, 1rem)/1.2 'Instrument Sans', 'Schibsted Grotesk', sans-serif;
  letter-spacing: -0.005em;
  white-space: nowrap;
  cursor: pointer;
  transition: color var(--qa-dur) var(--ease);
}
.qa-tab[aria-selected="true"] { color: var(--cream); }
.qa-tab:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }
/* phone: the three stack in a rounded track and the pill slides down */
@media (max-width: 520px) {
  .qa-switch {
    grid-template-columns: 1fr;
    grid-auto-rows: 1fr;
    max-width: 340px;
    border-radius: 24px;
  }
  .qa-ind {
    width: calc(100% - 10px);
    height: calc((100% - 10px) / 3);
    transform: translateY(calc(var(--i, 0) * 100%));
  }
  .qa-tab { font-size: 1rem; }
}

/* ---- the list: cards that clearly read as tappable ---- */
.qa-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-width: 780px;
  margin: 1.75rem auto 0;
  text-align: left;
}
.qa-card {
  display: block;
  border: 1px solid var(--qa-line);
  border-radius: 16px;
  background: var(--qa-tint);
  transition: transform 0.2s var(--ease), background-color 0.2s var(--ease), border-color 0.2s var(--ease);
}
.qa-card[hidden] { display: none; }
.qa-h { font: inherit; }
.qa-q {
  display: flex;
  align-items: center;
  gap: 16px;
  width: 100%;
  min-height: 64px;
  padding: 13px 13px 13px 20px;
  border: 0;
  border-radius: 15px;
  background: none;
  color: var(--ink);
  text-align: left;
  font: 500 clamp(1.02rem, 0.96rem + 0.3vw, 1.18rem)/1.35 'Instrument Sans', 'Schibsted Grotesk', sans-serif;
  letter-spacing: -0.005em;
  cursor: default;               /* inert until the script runs */
}
.ct-qa[data-qa-ready] .qa-q { cursor: pointer; }
.qa-qt { flex: 1 1 auto; min-width: 0; overflow-wrap: anywhere; }
.qa-ico {
  flex: none;
  display: none;                 /* without the script a card does not open or close */
  align-items: center; justify-content: center;
  width: 38px; height: 38px;
  border-radius: 50%;
  border: 1px solid rgba(43, 31, 30, 0.22);
  color: var(--ink);
  transition: background-color var(--qa-dur) var(--ease), border-color var(--qa-dur) var(--ease), color var(--qa-dur) var(--ease);
}
.qa-ico svg { width: 20px; height: 20px; transition: transform var(--qa-dur) var(--ease); }
.ct-qa[data-qa-ready] .qa-ico { display: inline-flex; }
/* the focus ring on the whole card, the button being its top row */
.qa-q:focus-visible { outline: 2px solid var(--ink); outline-offset: -2px; }
@supports selector(:has(*)) {
  .qa-q:focus-visible { outline: none; }
  .qa-card:has(.qa-q:focus-visible) { outline: 2px solid var(--ink); outline-offset: 2px; }
}

/* the answer, inside the same card: grid rows 0fr -> 1fr. Closed it is
   visibility: hidden as well, so its link is out of the Tab order and the
   reading order; visibility switches at the END of a close and at the START
   of an open, so the slide is seen both ways */
.qa-a { display: grid; grid-template-rows: 1fr; }
.qa-clip { min-height: 0; overflow: hidden; }
.qa-body { padding: 0 20px 20px; }
.qa-body p {
  max-width: 62ch;
  font-size: 1.02rem;
  line-height: 1.65;
  color: rgba(43, 31, 30, 0.72);
}
.qa-body .qa-more { margin-top: 0.75rem; }
.qa-more a {
  color: var(--qa-link);
  font-weight: 600;
  text-decoration: none;
  border-bottom: 1px solid currentColor;
  padding-bottom: 1px;
}

.ct-qa[data-qa-ready] .qa-a {
  grid-template-rows: 0fr;
  visibility: hidden;
  transition: grid-template-rows var(--qa-dur) var(--ease), visibility 0s linear var(--qa-dur);
}
.ct-qa[data-qa-ready] .qa-clip { opacity: 0; transition: opacity var(--qa-dur) var(--ease); }
.ct-qa[data-qa-ready] .qa-card.open .qa-a {
  grid-template-rows: 1fr;
  visibility: visible;
  transition: grid-template-rows var(--qa-dur) var(--ease), visibility 0s linear 0s;
}
.ct-qa[data-qa-ready] .qa-card.open .qa-clip { opacity: 1; }
.qa-card.open { border-color: rgba(154, 90, 36, 0.5); }
.qa-card.open .qa-ico { background: var(--qa-copper); border-color: var(--qa-copper); color: var(--cream); }
.qa-card.open .qa-ico svg { transform: rotate(180deg); }

/* hover, pointer devices only: a 1px lift, a slightly deeper tint, the
   border warming toward the copper */
@media (hover: hover) and (pointer: fine) {
  .ct-qa[data-qa-ready] .qa-card:hover {
    transform: translateY(-1px);
    background: var(--qa-tint-hi);
    border-color: rgba(154, 90, 36, 0.38);
  }
  .ct-qa[data-qa-ready] .qa-card.open:hover { border-color: rgba(154, 90, 36, 0.6); }
}

/* ---- the close of the section ---- */
.qa-close {
  max-width: 62ch;
  margin: 2.2rem auto 0;
  font-size: clamp(1rem, 4.2vw, 1.1rem);
  line-height: 1.6;
  color: rgba(43, 31, 30, 0.88);
}
.qa-close a {
  color: var(--ink);
  font-weight: 500;
  text-decoration: none;
  border-bottom: 1px solid rgba(43, 31, 30, 0.45);
  white-space: nowrap;
}
.qa-close a:hover { border-color: var(--ink); }
.qa-more a:focus-visible, .qa-close a:focus-visible { outline: 2px solid var(--ink); outline-offset: 3px; border-radius: 2px; }
.qa-checked {
  margin-top: 0.9rem;
  font-size: 0.78rem;
  line-height: 1.5;
  color: rgba(43, 31, 30, 0.7);
}

/* reduced motion: no slide, fade or lift; open, close and the switch are
   instant (the seams stand still through site.css) */
@media (prefers-reduced-motion: reduce) {
  .qa-ind, .qa-tab, .qa-card, .qa-ico, .qa-ico svg,
  .ct-qa[data-qa-ready] .qa-a, .ct-qa[data-qa-ready] .qa-card.open .qa-a,
  .ct-qa[data-qa-ready] .qa-clip { transition: none; }
  .ct-qa[data-qa-ready] .qa-card:hover { transform: none; }
}
