/* Questions (/questions). A warm-paper editorial page between the dark masthead and a dark close: a large Source
   Serif intro, then five categories on a reading column with a quiet index beside them. Archivo for the index,
   categories, questions and answers. Forge appears only where something is happening: the open row, the row under
   the pointer, the category you are reading. Everything here is scoped to .qx-*; nothing reaches another page. */

/* Paper ground, with the darker reading tokens the homepage's paper section uses. */
.qx-paper {
  --muted: #5E5B55;
  --text: #2C2C2B;
  --line: #D9D4CA;
  --line-strong: #B9B3A8;
  background: var(--paper);
  color: var(--ink);
  color-scheme: light;
}
.qx-paper ::selection { background: var(--ink); color: var(--paper); }
.qx-paper :focus-visible { outline-color: var(--ink); }

.qx-n { font-family: var(--sans); font-weight: 500; letter-spacing: 0.06em; font-variant-numeric: tabular-nums; color: var(--muted); }

/* Intro ----------------------------------------------------------------------------------------------- */
.qx-intro-in {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  column-gap: var(--col-gap);
  padding-block: clamp(3.5rem, 11vh, 8rem) clamp(3rem, 8vh, 5.5rem);
}
.qx-intro-in > * { grid-column: 1 / -1; }
.qx-eyebrow { font-family: var(--sans); font-size: 0.8125rem; font-weight: 500; line-height: 1.4; letter-spacing: 0.14em; color: var(--muted); }
.qx-intro h1 {
  max-width: 9.5em;
  margin-top: clamp(1.25rem, 3vh, 2rem);
  font-family: var(--serif);
  font-weight: 360;
  font-optical-sizing: none;
  font-variation-settings: "opsz" 44;
  font-size: clamp(2.75rem, 1.2rem + 5vw, 6.25rem);
  line-height: 1.02;
  letter-spacing: -0.022em;
  color: var(--ink);
  text-wrap: balance;
}
.qx-lead {
  max-width: 28rem;
  margin-top: 1.5rem;
  font-family: var(--sans);
  font-size: clamp(1.0625rem, 1rem + 0.25vw, 1.1875rem);
  line-height: 1.55;
  color: var(--text);
  text-wrap: pretty;
}

@media (min-width: 64em) {
  .qx-eyebrow { grid-row: 1; }
  .qx-intro h1 { grid-row: 2; grid-column: 1 / span 8; }
  .qx-lead { grid-row: 2; grid-column: 9 / -1; align-self: end; margin: 0 0 0.75rem; }
}

/* Body: the index and the reading column ------------------------------------------------------------- */
.qx-body {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  column-gap: var(--col-gap);
  padding-block: clamp(3rem, 8vh, 5rem) clamp(5rem, 14vh, 9rem);
  /* the rule sits on the content width, not across the gutters */
  background: linear-gradient(var(--line), var(--line)) top center / calc(100% - 2 * var(--gutter)) 1px no-repeat;
}
.qx-groups { grid-column: 1 / -1; min-width: 0; }

.qx-index { display: none; }

@media (min-width: 64em) {
  .qx-index { display: block; grid-column: 1 / span 3; position: sticky; top: calc(var(--header-h) + 2.75rem); align-self: start; }
  .qx-groups { grid-column: 5 / -1; }
}

.qx-index ol { display: grid; }
.qx-index a {
  position: relative;
  display: flex;
  align-items: baseline;
  gap: 0.875rem;
  padding-block: 0.5rem;
  font-family: var(--sans);
  font-size: 0.9375rem;
  font-weight: 450;
  line-height: 1.35;
  color: var(--muted);
  text-decoration: none;
}
.qx-index .qx-n { flex: none; min-width: 1.25rem; font-size: 0.75rem; }
.qx-index a:hover, .qx-index a[aria-current="true"] { color: var(--ink); }
/* the category you are reading carries the sprag */
.qx-index a::before {
  content: "";
  position: absolute;
  left: -1.125rem;
  top: 50%;
  width: 0.1875rem;
  height: 0.75rem;
  margin-top: -0.375rem;
  background: var(--forge);
  transform: skewX(-30deg);
  opacity: 0;
}
.qx-index a[aria-current="true"]::before { opacity: 1; }
.qx-index a:focus-visible { outline-offset: 2px; }

.qx-ask {
  margin-top: 2.25rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--line);
  font-family: var(--sans);
  font-size: 0.875rem;
  line-height: 1.6;
  color: var(--muted);
}
.qx-ask a, .qx-a a { color: var(--ink); text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 0.22em; text-decoration-color: var(--line-strong); }
.qx-ask a:hover, .qx-a a:hover { text-decoration-color: var(--forge); }

@media (prefers-reduced-motion: no-preference) {
  .qx-index a { transition: color 0.2s; }
  .qx-index a::before { transition: opacity 0.2s; }
  .qx-ask a, .qx-a a { transition: text-decoration-color 0.2s; }
}

/* Categories ---------------------------------------------------------------------------------------------- */
.qx-group { scroll-margin-top: calc(var(--header-h) + 2rem); }
.qx-group + .qx-group { margin-top: clamp(4rem, 10vh, 6.5rem); }
.qx-group h2 {
  display: flex;
  align-items: baseline;
  gap: 0.875rem;
  padding-bottom: 1.375rem;
  font-family: var(--sans);
  font-size: clamp(1.375rem, 1.1rem + 0.75vw, 1.875rem);
  font-weight: 500;
  line-height: 1.2;
  letter-spacing: -0.012em;
  color: var(--ink);
}
.qx-group h2 .qx-n { font-size: 0.8125rem; transform: translateY(-0.2em); }

/* Rows ------------------------------------------------------------------------------------------------------ */
.qx-item { border-top: 1px solid var(--line); scroll-margin-top: calc(var(--header-h) + 2rem); }
.qx-item:last-child { border-bottom: 1px solid var(--line); }

.qx-item summary {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 2rem;
  padding-block: 1.375rem;
  list-style: none;
  cursor: pointer;
  font-family: var(--sans);
  font-size: clamp(1.0625rem, 1rem + 0.14vw, 1.125rem);
  font-weight: 450;
  line-height: 1.4;
  color: var(--ink);
  -webkit-tap-highlight-color: transparent;
}
.qx-item summary::-webkit-details-marker { display: none; }
.qx-item summary::marker { content: ""; }
.qx-item summary:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; border-radius: 2px; }
.qx-q { max-width: 40rem; text-wrap: pretty; }

/* A thin plus that folds into a minus. Forge when the row is open or under the pointer. */
.qx-icon { position: relative; flex: none; width: 0.875rem; height: 0.875rem; margin-top: 0.38em; color: var(--muted); }
.qx-icon::before,
.qx-icon::after { content: ""; position: absolute; left: 0; top: 50%; width: 100%; height: 1.5px; margin-top: -0.75px; background: currentColor; }
.qx-icon::after { transform: rotate(90deg); }
.qx-item summary:hover .qx-icon,
.qx-item[open] .qx-icon { color: var(--forge); }
.qx-item[open] .qx-icon::after { transform: rotate(0deg); }

@media (prefers-reduced-motion: no-preference) {
  .qx-icon { transition: color 0.2s; }
  .qx-icon::after { transition: transform 0.32s cubic-bezier(.2, .7, .2, 1); }
}

.qx-a p {
  max-width: 38rem;
  padding: 0 1.5rem 1.75rem 0;
  font-family: var(--sans);
  font-size: 1.03125rem;
  line-height: 1.65;
  color: var(--text);
  text-wrap: pretty;
}

@media (min-width: 48em) {
  .qx-a p { padding-right: 3rem; }
}

/* Close ----------------------------------------------------------------------------------------------------- */
.qx-close { background: var(--night); }
.qx-close-in {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  column-gap: var(--col-gap);
  row-gap: 1.75rem;
  padding-block: clamp(5rem, 14vh, 9rem);
}
.qx-close-in > * { grid-column: 1 / -1; }
.qx-close h2 {
  max-width: 11em;
  font-family: var(--serif);
  font-weight: 360;
  font-optical-sizing: none;
  font-variation-settings: "opsz" 44;
  font-size: clamp(2.25rem, 1.2rem + 3.4vw, 4.5rem);
  line-height: 1.04;
  letter-spacing: -0.02em;
  color: var(--paper);
  text-wrap: balance;
}
.qx-close-body { max-width: 30rem; }
.qx-close-body > p:first-child { font-family: var(--sans); font-size: clamp(1.0625rem, 1rem + 0.25vw, 1.1875rem); line-height: 1.55; color: var(--text); text-wrap: pretty; }
.qx-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 0.75rem 1.75rem; margin-top: 2rem; }
.qx-mail { margin-top: 1.5rem; font-family: var(--sans); font-size: 0.875rem; line-height: 1.5; color: var(--muted); }
.qx-mail a { color: var(--steel); text-decoration-thickness: 1px; text-underline-offset: 0.22em; text-decoration-color: var(--line-strong); }
.qx-mail a:hover { text-decoration-color: var(--steel); }

@media (min-width: 64em) {
  .qx-close h2 { grid-column: 1 / span 6; }
  .qx-close-body { grid-column: 8 / -1; align-self: end; }
}

@media print {
  .qx-index, .qx-close { display: none; }
}

/* Design system alignment (Oct 22, desktop polish): the shared scale from styles.css, so nothing here outshouts the
   homepage. The page title takes the display size, the dark close the shared closing size and padding, and the
   paper body ends on the shared section padding. Layout, rows and interactions are unchanged. */
.qx-intro h1 { font-size: var(--t-display); }
.qx-body { padding-bottom: var(--sp-section); }
.qx-close-in { padding-block: var(--sp-close); }
.qx-close h2 { font-size: var(--t-close); font-variation-settings: "opsz" 40; line-height: 1.08; letter-spacing: -0.014em; }
