/* Q&A page — load ../styles.css first for shared reset and .nav structure. */

body.page-qa {
  background: #fbf7ef;
  min-height: 100vh;
  --qa-title-reveal-delay: 0.38s;
  --qa-title-reveal-duration: 1.4s;
}

/* Same bar as home when scrolled: no hero behind nav here, so keep green from load */
body.page-qa .nav {
  background: #414F39;
}

.qa-main {
  --qa-side: clamp(1.5rem, 5vw, 3.5rem);
  --qa-inner: calc(min(75rem, 100vw) - 2 * var(--qa-side));
  --qa-gap: clamp(2.5rem, 7vw, 5.5rem);
  max-width: 75rem;
  margin: 0 auto;
  padding-top: calc(clamp(9rem, 14vh, 18rem));
  padding-bottom: max(5.5rem, env(safe-area-inset-bottom, 0px));
  padding-left: max(var(--qa-side), env(safe-area-inset-left, 0px));
  padding-right: max(var(--qa-side), env(safe-area-inset-right, 0px));
  box-sizing: border-box;
}

.qa-layout {
  display: grid;
  grid-template-columns: minmax(0, 0.42fr) minmax(0, 0.58fr);
  gap: var(--qa-gap);
  align-items: start;
}

@media (min-width: 64.0625rem) {
  .qa-layout {
    display: block;
    /* Reserve the left column + gap so the list doesn’t sit under the fixed title */
    padding-left: calc(var(--qa-inner) * 0.42 + var(--qa-gap));
    box-sizing: border-box;
  }

  /* Title stays in the viewport; list scrolls beside it */
  .qa-heading-col {
    position: fixed;
    top: 50vh;
    transform: translateY(-50%);
    left: max(var(--qa-side), calc((100vw - 75rem) / 2 + var(--qa-side)));
    width: calc(var(--qa-inner) * 0.42);
    max-width: calc(var(--qa-inner) * 0.42);
    z-index: 2;
  }
}

@media (max-width: 64rem) {
  .qa-layout {
    grid-template-columns: 1fr;
    gap: 3.5rem;
    padding-left: 0;
  }

  .qa-heading-col {
    position: static;
    width: auto;
    max-width: none;
    left: auto;
  }
}

.qa-page-title {
  font-family: "Instrument Serif", serif;
  text-transform: uppercase;
  font-size: clamp(2.35rem, 5.2vw, 5rem);
  font-weight: 400;
  line-height: 1.08;
  letter-spacing: -0.02em;
  margin: 0;
  color: #1a1a1a;
}

/* Title scroll-in (script.js + [data-home-reveal], same feel as home / Our Story) */
body.page-qa .qa-page-title[data-home-reveal] {
  opacity: 0;
  transform: translateY(1.35rem);
  transition:
    opacity var(--qa-title-reveal-duration) cubic-bezier(0.22, 1, 0.36, 1),
    transform var(--qa-title-reveal-duration) cubic-bezier(0.22, 1, 0.36, 1);
  will-change: opacity, transform;
}

body.page-qa .qa-page-title[data-home-reveal].is-visible {
  opacity: 1;
  transform: translateY(0);
  will-change: auto;
  transition-delay: var(--qa-title-reveal-delay);
}

.qa-page-lede {
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 0.68rem;
  line-height: 1.75;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  margin: 1.75rem 0 0;
  max-width: 22rem;
  color: rgba(26, 26, 26, 0.72);
}

.qa-list-col {
  border-top: 1px solid #1a1a1a;
}

.qa-item {
  border-bottom: 1px solid #1a1a1a;
}

.qa-item:last-child {
  border-bottom: none;
}

.qa-summary {
  list-style: none;
  cursor: pointer;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1.5rem;
  padding: 2rem 0 2rem;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}

.qa-summary::-webkit-details-marker {
  display: none;
}

.qa-summary::marker {
  content: "";
}

.qa-summary::after {
  content: "+";
  flex-shrink: 0;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 1.15rem;
  font-weight: 300;
  line-height: 1;
  margin-top: 0.2em;
  color: #1a1a1a;
  transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.25s ease;
  opacity: 0.85;
}

.qa-item[open] .qa-summary::after {
  content: "\2212";
  font-size: 1.05rem;
  margin-top: 0.25em;
}

.qa-summary:hover::after {
  opacity: 1;
}

.qa-summary:focus {
  outline: none;
}

.qa-summary:focus-visible {
  outline: 2px solid #1a1a1a;
  outline-offset: 4px;
}

.qa-q {
  font-family: "Aboreto", serif;
  font-size: clamp(1.3rem, 3.2vw, 1.3rem);
  font-weight: 400;
  text-transform: none;
  letter-spacing: 0.02em;
  margin: 0;
  color: #1a1a1a;
  line-height: 1.25;
  text-align: left;
  transition: color 0.3s ease;
}

.qa-item[open] .qa-q {
  color: rgba(26, 26, 26, 0.88);
}

/* Height open/close is animated by accordion.js (native <details> hides content in a way that blocks CSS-only transitions). */
.qa-body {
  display: block;
}

.qa-body-inner {
  overflow: hidden;
}

.qa-a {
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 0.75rem;
  line-height: 2;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  margin: 0;
  padding: 0 0 1.5rem;
  max-width: 38rem;
  color: rgba(26, 26, 26, 0.78);
  text-align: left;
  opacity: 0;
  transform: translateY(-0.4rem);
  transition:
    opacity 0.4s ease 0.06s,
    transform 0.45s cubic-bezier(0.4, 0, 0.2, 1) 0.06s;
}

.qa-item[open] .qa-a {
  opacity: 1;
  transform: translateY(0);
}

@media (prefers-reduced-motion: reduce) {
  body.page-qa .qa-page-title[data-home-reveal] {
    opacity: 1;
    transform: none;
    transition: none;
    will-change: auto;
  }

  body.page-qa .qa-page-title[data-home-reveal].is-visible {
    transition-delay: 0s;
  }

  .qa-a {
    transition: none;
    transform: none;
  }

  .qa-item:not([open]) .qa-a {
    opacity: 0;
  }

  .qa-item[open] .qa-a {
    opacity: 1;
  }

  .qa-q {
    transition: none;
  }

  .qa-item[open] .qa-q {
    color: #1a1a1a;
  }

  .qa-summary::after {
    transition: none;
  }
}

.qa-a a {
  color: #1a1a1a;
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-thickness: 1px;
  transition: opacity 0.2s;
}

.qa-a a:hover {
  opacity: 0.65;
}

@media (max-width: 36rem) {
  .qa-main {
    padding-top: clamp(6.75rem, 22vw, 10rem);
  }

  .qa-page-title {
    margin-top: 2rem;
    font-size: clamp(3.25rem, 11.5vw, 3.45rem);
  }

  .qa-layout {
    gap: clamp(2.25rem, 6vw, 3.5rem);
  }

  .qa-summary {
    gap: 1rem;
    padding: 1.5rem 0;
  }

  .qa-q {
    font-size: clamp(1.05rem, 4vw, 1.2rem);
  }
}
