/* "Behind the city": case-study opening and city block, Research Snapshots as upright bars, the three aims,
   Me / AI, then Sources and Limits. Spacing follows the case-study pages; no boxes, almost no lines. */
.rc-story { width: 100%; margin-top: var(--layout-section-gap); }
/* :where() keeps this reset weak, so the spacing rules below always win. */
:where(.rc-story) :where(p, h3, h4, ul, figure) { margin: 0; }
.rc-story .section-header { gap: 12px; }
.rc-story .section-header__text { max-width: 640px; color: var(--grey-200); }
.rc-story__part { margin-top: var(--layout-section-gap); }
.rc-story__part .section-header__text { color: var(--grey-450); }
.rc-story__after { max-width: 640px; margin-top: 48px; color: var(--grey-450); font-size: var(--text-body-m); line-height: var(--text-body-m-lh); }

/* --- Opening and city block: picture + text blocks --- */
.rc-story__hero { display: grid; gap: 32px; margin-top: 37px; }
.rc-story__city { margin-top: var(--layout-section-gap); }
.rc-story__visual img { display: block; width: 100%; height: auto; border-radius: var(--radius-lg); }
.rc-story__blocks { display: grid; gap: 24px; align-content: start; }
.rc-story__block-heading { color: var(--grey-300); font-family: var(--font-body); font-size: 18px; line-height: 26px; font-weight: 700; }
.rc-story__block-text { margin-top: 4px; color: var(--grey-450); font-size: 16px; line-height: 24px; }

/* --- Findings chart: shared --- */
.rc-chart { display: grid; gap: 28px; margin-top: 40px; padding: 0; list-style: none; }
.rc-chart__row { display: grid; align-items: center; column-gap: 24px; row-gap: 10px; }
.rc-chart__label { color: var(--grey-300); font-size: var(--text-body-m); line-height: var(--text-body-m-lh); }
.rc-chart__value { color: var(--blue-300); font-size: var(--text-body-m); line-height: var(--text-body-m-lh); font-weight: 700; white-space: nowrap; font-variant-numeric: tabular-nums; }
.rc-chart__track { display: block; width: 100%; height: 6px; border-radius: 3px; overflow: hidden; }
.rc-chart__bg { fill: var(--ink-700); }
.rc-chart__fill { fill: var(--blue-300); }

/* 3. Columns: bar on the left with its count right beside it, label underneath, all left-aligned */
.rc-chart { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 48px 24px; }
.rc-chart__row {
  grid-template-columns: 40px minmax(0, 1fr);
  grid-template-areas: "track value" "label label";
  grid-template-rows: 160px auto;
  align-content: start;
  align-items: start;
  column-gap: 20px;
  row-gap: 16px;
}
.rc-chart__track { grid-area: track; width: 40px; height: 160px; border-radius: 6px; }
.rc-chart__value { grid-area: value; align-self: end; justify-self: start; font-family: var(--font-display); font-size: 28px; line-height: 32px; font-weight: 600; }
.rc-chart__label { grid-area: label; justify-self: start; max-width: 180px; text-align: left; font-size: 16px; line-height: 22px; }

/* --- What a good rejection needs: room to read --- */
.rc-story__aim-list { display: grid; gap: 48px; margin-top: 56px; padding: 0; list-style: none; }
.rc-story__aim { padding-top: 32px; border-top: 2px solid var(--ink-700); }
.rc-story__aim-name { color: var(--blue-300); font-family: var(--font-display); font-size: 24px; line-height: 32px; font-weight: 600; }
.rc-story__aim-text { margin-top: 16px; color: var(--grey-200); font-size: var(--text-body-m); line-height: 28px; }
.rc-story__aim-why { margin-top: 24px; color: var(--grey-450); font-size: 16px; line-height: 24px; }

/* --- How I made it: Me / AI --- */
.rc-story__table { width: 100%; margin-top: 40px; border-collapse: collapse; text-align: left; }
.rc-story__table thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap; }
.rc-story__table tbody, .rc-story__table tr, .rc-story__table th, .rc-story__table td { display: block; }
.rc-story__table tbody tr + tr { margin-top: 28px; }
.rc-story__table tbody th { color: var(--grey-300); font-size: 18px; line-height: 26px; font-weight: 700; }
.rc-story__table tbody td { margin-top: 8px; color: var(--grey-450); font-size: 16px; line-height: 24px; }
.rc-story__table tbody td::before { content: attr(data-label); display: block; color: var(--blue-300); font-size: 14px; line-height: 20px; font-weight: 700; }

/* --- Sources (two columns) and Limits --- */
.rc-story__source-list { display: grid; gap: 14px; margin-top: 32px; padding: 0; list-style: none; color: var(--grey-450); font-size: 15px; line-height: 22px; }
.rc-story__limit-list { display: grid; gap: 14px; max-width: 760px; margin-top: 32px; padding-left: 20px; color: var(--grey-450); font-size: 16px; line-height: 24px; }
.rc-story__limit-list li::marker { color: var(--blue-300); }
.rc-story__link { display: inline-flex; align-items: center; min-height: 44px; margin-top: 16px; color: var(--white); font-size: 16px; font-weight: 700; text-decoration: underline; text-underline-offset: 4px; }
.rc-story__link:hover { color: var(--blue-300); }
.rc-story__link:focus-visible { outline: 2px solid var(--blue-300); outline-offset: 4px; border-radius: 4px; }

/* --- Tablet and up --- */
@media (min-width: 768px) {
  .rc-story__aim-list { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 40px; }
    .rc-chart { grid-template-columns: repeat(6, minmax(0, 1fr)); }
  .rc-chart__label { min-height: 44px; }
  .rc-story__source-list { grid-auto-flow: column; grid-template-columns: repeat(2, minmax(0, 1fr)); grid-template-rows: repeat(7, auto); column-gap: 48px; }

  .rc-story__table thead { position: static; width: auto; height: auto; overflow: visible; clip: auto; clip-path: none; white-space: normal; display: table-header-group; }
  .rc-story__table { display: table; table-layout: fixed; }
  .rc-story__table tbody { display: table-row-group; }
  .rc-story__table tr { display: table-row; }
  .rc-story__table th, .rc-story__table td { display: table-cell; vertical-align: top; }
  .rc-story__table tbody tr + tr { margin-top: 0; }
  .rc-story__table thead th { padding: 0 24px 8px 0; color: var(--blue-300); font-family: var(--font-display); font-size: 24px; line-height: 32px; font-weight: 600; }
  .rc-story__corner { width: 22%; }
  .rc-story__table tbody th, .rc-story__table tbody td { padding: 16px 24px 16px 0; }
  .rc-story__table tbody td { margin-top: 0; }
  .rc-story__table tbody td::before { content: none; }
}
@media (min-width: 768px) and (max-width: 1199px) {
  .rc-story__hero { gap: 48px; margin-top: 58.5px; }
  .rc-story__city { margin-top: var(--layout-section-gap); }
  .rc-story .section-header__text { max-width: none; }
}

/* --- Desktop: picture and text side by side, both exactly the same height --- */
@media (min-width: 1200px) {
  .rc-story .section-header { gap: 16px; }
  .rc-story__hero {
    grid-template-columns: minmax(0, 1fr) minmax(0, 480px);
    align-items: stretch;
    gap: 64px;
    margin-top: 56px;
  }
  .rc-story__city { margin-top: var(--layout-section-gap); }
  /* The picture fills the row; the blocks spread from its top edge to its bottom edge. */
  .rc-story__visual { display: flex; }
  .rc-story__visual img { height: 100%; min-height: 100%; object-fit: cover; }
  .rc-story__blocks { align-content: space-between; gap: 20px; }
  .rc-story__table { margin-top: 56px; }
  .rc-story__corner { width: 220px; }
    .rc-story__aim-list { gap: 56px; margin-top: 64px; }
}

@media (prefers-reduced-motion: reduce) {
  .rc-story * { transition: none !important; animation: none !important; }
}

/* Findings: the closing sentence is a takeaway, with its own small heading and space above. */
.rc-story__takeaway { max-width: 640px; margin-top: 64px; }
.rc-story__takeaway-label { color: var(--blue-300); font-size: 14px; line-height: 20px; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase; }
.rc-story__takeaway-text { margin-top: 8px; color: var(--grey-300); font-size: 16px; line-height: 26px; }
@media (min-width: 1200px) { .rc-chart { margin-top: 48px; } }

/* The small grey line under each aim says what it is: why that aim matters. */
.rc-story__aim-why-label { display: block; margin-bottom: 4px; color: var(--grey-300); font-size: 14px; line-height: 20px; font-weight: 700; }
/* Closing notes stand apart from the columns and table above them. */
.rc-story__aims .rc-story__takeaway, .rc-story__made .rc-story__takeaway { margin-top: 72px; }

/* Sources and Limits: drop-downs on phones (closed at first), open sections everywhere else. */
.rc-story__fold-summary { display: block; list-style: none; cursor: default; }
.rc-story__fold-summary::-webkit-details-marker { display: none; }
.rc-story__fold-icon { display: none; }

/* --- Phones: the site's phone spacing (section gap 60, block gap 24) --- */
@media (max-width: 767px) {
  .rc-story__hero { gap: 24px; margin-top: 24px; }
  .rc-story__blocks { gap: 20px; }
  .rc-chart { margin-top: 24px; gap: 32px 24px; }
  .rc-chart__row { grid-template-rows: 120px auto; row-gap: 10px; }
  .rc-chart__track { height: 120px; }
  .rc-story__takeaway, .rc-story__aims .rc-story__takeaway, .rc-story__made .rc-story__takeaway { margin-top: 32px; }
  .rc-story__aim-list { gap: 32px; margin-top: 24px; }
  .rc-story__aim { padding-top: 20px; }
  .rc-story__aim-text { margin-top: 10px; line-height: 26px; }
  .rc-story__aim-why { margin-top: 14px; }
  .rc-story__table { margin-top: 24px; }
  .rc-story__table tbody tr + tr { margin-top: 20px; }
  .rc-story__source-list, .rc-story__limit-list { margin-top: 4px; }

  .rc-story__fold { border-top: 1px solid var(--ink-700); border-bottom: 1px solid var(--ink-700); }
  .rc-story__fold + .rc-story__fold { margin-top: 0; border-top: 0; }
  .rc-story__fold-summary { position: relative; min-height: 44px; padding: 20px 40px 20px 0; cursor: pointer; }
  .rc-story__fold-summary .section-header { gap: 6px; }
  .rc-story__fold-summary .section-header__text { font-size: 15px; line-height: 22px; }
  .rc-story__fold-icon {
    display: block;
    position: absolute;
    right: 4px;
    top: 26px;
    width: 12px;
    height: 12px;
    border-right: 2px solid var(--grey-300);
    border-bottom: 2px solid var(--grey-300);
    transform: rotate(45deg);
    transition: transform 200ms ease;
  }
  .rc-story__fold[open] .rc-story__fold-icon { transform: translateY(4px) rotate(-135deg); }
  .rc-story__fold-summary:focus-visible { outline: 2px solid var(--blue-300); outline-offset: 4px; border-radius: 4px; }
  .rc-story__fold[open] > :last-child { padding-bottom: 24px; }
}

/* Phones: the same spacing and heading sizes as the case study pages. */
@media (max-width: 767px) {
  .rc-story__fold:first-of-type { margin-top: 40px; }
  .rc-story__aim-name { font-size: 20px; line-height: 28px; }
}
