/* The question-mark accordion: the questions of a puzzles-by-post subscription on a white page, between thin rules.
   In the margin of each question a question mark in pencil; the open one is an exclamation mark in ink. */
:root {
  --page: #ffffff;          /* the page */
  --ink: #16181d;           /* the questions */
  --answer: #50555e;        /* the answers */
  --rule: #e4e4e0;          /* between two questions */
  --pencil: #878d97;        /* the question marks */
  --pen: #2443e6;           /* the exclamation mark */
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  overflow-x: clip;
}

body {
  min-height: 100svh;
  background: var(--page);
  color: var(--ink);
  font-family: 'Schibsted Grotesk Variable', system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
}

.stage {
  min-height: 100svh;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  place-items: center;
  padding: 40px 16px;
}

/* the script gives the list a fixed height, with room for the longest answer: its top never moves */
.faq {
  --mark: 32px;             /* the height of a question mark */
  --gutter: 64px;           /* the margin the marks stand in */
  width: min(560px, 100%);
}

/* ---------------------------------------------------------------- one question */
.faq__item {
  position: relative;
  border-top: 1px solid var(--rule);
}

.faq__item:last-child {
  border-bottom: 1px solid var(--rule);
}

.faq__head {
  margin: 0;
  font: inherit;
}

.faq__q {
  display: block;
  width: 100%;
  padding: 24px var(--gutter) 24px 0;
  border: 0;
  border-radius: 12px;
  background: none;
  color: inherit;
  font: inherit;
  font-size: 20px;
  font-weight: 600;
  line-height: 28px;
  letter-spacing: -0.012em;
  text-align: left;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}

.faq__q:focus-visible {
  outline: none;
}

.faq__text {
  display: inline-block;
  border-radius: 8px;
  transform-origin: 0 50%;
  transition: transform 0.16s cubic-bezier(0.23, 1, 0.32, 1);
}

/* the keyboard ring hugs the question; its question mark leans in as under the mouse */
.faq__q:focus-visible .faq__text {
  outline: 2px solid var(--pen);
  outline-offset: 6px;
}

.faq__q:active .faq__text {
  transform: scale(0.985);
}

/* the answer: its height is the drop of the exclamation mark's dot, set by the script */
.faq__a {
  overflow: hidden;
}

.faq__inner {
  padding: 0 var(--gutter) 28px 0;
}

.faq__a p {
  margin: 0;
  max-width: 46ch;
  color: var(--answer);
  font-size: 16px;
  line-height: 1.6;
}

/* ---------------------------------------------------------------- the mark in the margin (drawn by the script) */
.faq__mark {
  --o: 0;                   /* 0 a question mark in pencil, 1 an exclamation mark in ink */
  --hv: 0;                  /* the mouse over it */
  position: absolute;
  top: 0;
  right: 0;
  width: var(--gutter);
  height: 100%;
  overflow: visible;
  pointer-events: none;
  color: color-mix(in srgb, var(--ink) calc(var(--hv) * 70%), color-mix(in srgb, var(--pen) calc(var(--o) * 100%), var(--pencil)));
}

.faq__stroke,
.faq__dot {
  fill: currentColor;
}

@media (max-width: 520px) {
  .faq {
    --mark: 28px;
    --gutter: 48px;
  }

  .faq__q {
    padding-block: 20px;
    font-size: 18px;
    line-height: 24px;
  }

  .faq__inner {
    padding-bottom: 24px;
  }

  .faq__a p {
    font-size: 15.5px;
  }
}
