/*
  PERSONA PAGES (/for and /for/:slug). Page-scoped, loaded through content_for :head by
  personas/show; the hero, card, badge, window shot, tile and related list are the cataloged
  components, so only arrangement and reading comfort live here. Tokens only: no literal colours,
  no inline styles.

  The questions are editorial content: a two-column grid of answered blocks on a wide screen, one
  column below 64rem, each block the same shape (question, answer, where) so the rows align.
*/

.p-persona {
  --p-persona-measure: 68ch;
}

.p-persona-prose {
  margin: 0;
  color: var(--color-text);
  font-size: var(--text-base);
  line-height: var(--leading-normal);
}

/* The problem is plain prose with no card around it, so it is never an empty box beside the taller
   why-card. It takes the narrower column (5 of 12), the longer why-card the wider (7 of 12), and
   its heading and top edge line up with the card's header. One column below 64rem. */
.p-persona-pair {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: var(--space-6);
  align-items: start;
}

@media (min-width: 64rem) {
  .p-persona-pair {
    grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
    gap: var(--space-8);
  }
}

.p-persona-problem {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  padding: var(--space-4) 0;
}

.p-persona-problem__title {
  margin: 0;
  font-size: var(--text-lg);
}

.p-persona-shot {
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.p-persona-shot figcaption {
  color: var(--color-text-muted);
  font-size: var(--text-sm);
  line-height: var(--leading-snug);
}

.p-persona-qa-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 0 var(--space-8);
}

@media (min-width: 64rem) {
  .p-persona-qa-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

.p-persona-qa {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  padding: var(--space-5) 0;
  border-top: 1px solid var(--color-border);
}

.p-persona-qa:first-child {
  border-top: 0;
}

@media (min-width: 64rem) {
  .p-persona-qa:nth-child(2) {
    border-top: 0;
  }
}

.p-persona-qa__q {
  margin: 0;
  text-wrap: balance;
  color: var(--color-text-strong);
  font: var(--weight-semibold) var(--text-md)/var(--leading-snug) var(--font-display);
}

/* An odd last question spans both columns (question left, answer and where right) so the final row
   is never a lone half-width block beside empty space. */
@media (min-width: 64rem) {
  .p-persona-qa:last-child:nth-child(odd) {
    grid-column: 1 / -1;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    grid-template-rows: auto 1fr;
    gap: var(--space-2) var(--space-8);
  }

  .p-persona-qa:last-child:nth-child(odd) .p-persona-qa__q {
    grid-row: 1 / span 2;
  }

  .p-persona-qa:last-child:nth-child(odd) .p-persona-qa__a,
  .p-persona-qa:last-child:nth-child(odd) .p-persona-qa__where {
    grid-column: 2;
  }
}

.p-persona-qa__a {
  margin: 0;
  color: var(--color-text);
  font-size: var(--text-base);
  line-height: var(--leading-normal);
}

.p-persona-qa__where {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-2) var(--space-4);
  margin: 0;
  margin-top: auto;
  padding-top: var(--space-1);
  color: var(--color-text-muted);
  font-size: var(--text-sm);
}

.p-persona-qa__lock {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
}

.p-persona-why {
  display: grid;
  gap: var(--space-3);
  margin: 0;
  padding-left: var(--space-5);
  color: var(--color-text);
  line-height: var(--leading-normal);
}

/* The honest limit: a quiet full-width note. Its padding equals the card body's, so the text starts
   on the same edge as the card content above it, and the line length is held to a readable measure. */
.p-persona-scope {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  padding: var(--space-4) var(--space-5);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  background: var(--color-surface-sunken);
}

.p-persona-scope__title {
  margin: 0;
  color: var(--color-text-strong);
  font-size: var(--text-base);
}

.p-persona-scope__text {
  max-width: 100ch;
  margin: 0;
  color: var(--color-text-muted);
  font-size: var(--text-base);
  line-height: var(--leading-normal);
}

/* The index in a text-only hero: the page's own questions as anchor links to the answers below. */
.p-persona-index {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

.p-persona-index__title {
  margin: 0;
  color: var(--color-text-strong);
  font: var(--weight-semibold) var(--text-md)/var(--leading-snug) var(--font-display);
}

.p-persona-index__list {
  display: grid;
  gap: var(--space-3);
  margin: 0;
  padding-left: var(--space-5);
  line-height: var(--leading-snug);
}

.p-persona-index__link {
  font-weight: var(--weight-medium);
}

/* The other teams: compact tiles, three across from 64rem, two from 40rem, one on a phone. */
.p-persona-siblings {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: var(--space-3);
}

@media (min-width: 40rem) {
  .p-persona-siblings {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (min-width: 64rem) {
  .p-persona-siblings {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

.p-persona-cta {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: var(--space-4);
  padding: var(--space-10) var(--space-8);
  border-radius: var(--radius-xl);
  background: var(--color-surface-brand);
  color: var(--color-text-on-brand);
}

.p-persona-cta__title {
  margin: 0;
  color: inherit;
  font: var(--weight-semibold) var(--text-3xl)/var(--leading-tight) var(--font-display);
}

.p-persona-cta__body,
.p-persona-cta__offer {
  margin: 0;
  color: inherit;
  font-size: var(--text-base);
}

.p-persona-cta__offer {
  font-size: var(--text-sm);
}

.p-persona-cta__actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-4) var(--space-6);
}

.p-persona-cta__link {
  color: inherit;
  font-weight: var(--weight-semibold);
  text-decoration: underline;
  text-underline-offset: 0.2em;
}

.p-persona-hub-link {
  margin: var(--space-4) 0 0;
}

.p-persona-hub-title {
  margin: 0;
  color: var(--color-text-strong);
  font: var(--weight-semibold) var(--text-xl)/var(--leading-snug) var(--font-display);
}
