/* SourcingPromo — case studies: the archive (/cases/), one case topic and one project.

   Every class here is prefixed `case-` so it can never reach another page's markup, and every value
   comes from tokens.css: no raw colour, no fixed radius. The shared pieces are reused rather than
   restated — .section, .wrap, .stack, .cluster, .lede, .eyebrow, .btn, .card, .facts,
   .placeholder-media, .note, .small, .empty and the catalogue's .cat-pagination. Mobile first: one
   column, the two-column reading layout from 960px where the project actually has a sidebar. */

/* ---------- chip rows: the topic family and the chosen conditions ---------- */
.case-chips{display:block;min-width:0}
.case-chips--sub{margin-top:.15rem;padding-left:.85rem;border-left:2px solid var(--line)}
.case-chips__row{list-style:none;margin:0;padding:0;display:flex;flex-wrap:wrap;align-items:center;gap:.5rem}
.case-chip{
  display:inline-flex;align-items:center;gap:.4rem;
  padding:.35rem .75rem;border:1px solid var(--line-strong);border-radius:var(--radius-pill);
  background:var(--paper);color:var(--ink-2);font-size:var(--step--1);font-weight:600;
  line-height:1.3;text-decoration:none;
}
.case-chip:hover{border-color:var(--ink);color:var(--ink);background:var(--sand)}
.case-chip.is-on{background:var(--brand-tint);border-color:var(--brand);color:var(--brand-dark)}
.case-chip--sub{font-weight:600}
.case-chip__count{
  padding:0 .4rem;border-radius:var(--radius-pill);background:var(--sand-2);
  font-size:.75rem;color:var(--ink-3);font-variant-numeric:tabular-nums;
}
.case-chip.is-on .case-chip__count{background:var(--paper);color:var(--brand-dark)}

.case-chip:focus-visible,
.case-filter-link:focus-visible,
.case-filters__trigger:focus-visible,
.case-card__more:focus-visible{outline:2px solid var(--focus);outline-offset:3px;border-radius:var(--radius-sm)}

/* ---------- the secondary conditions, inside the shared disclosure behaviour ----------
   The panel's height is animated by the behaviour runtime, so nothing here sets one. */
.case-filters{display:flex;flex-direction:column;gap:.6rem;min-width:0}
.case-filters__trigger{align-self:flex-start;cursor:pointer}
.case-filters__trigger[aria-expanded="true"]{border-color:var(--ink);background:var(--sand)}
.case-filters__panel{min-width:0}
.case-filters__inner{
  display:grid;gap:1.15rem;margin-top:.35rem;padding:1rem 1.1rem;
  border:1px solid var(--line);border-radius:var(--radius);background:var(--paper);
}
@media (min-width:720px){.case-filters__inner{grid-template-columns:repeat(2,minmax(0,1fr))}}
.case-filter-group{min-width:0}
.case-filter-group__title{
  margin-bottom:.5rem;font-size:var(--step--1);font-weight:700;letter-spacing:.06em;
  text-transform:uppercase;color:var(--ink-3);
}
.case-filter-list{list-style:none;margin:0;padding:0;display:grid;gap:.25rem}
.case-filter-link{
  display:flex;flex-wrap:wrap;align-items:baseline;justify-content:space-between;gap:.2rem .8rem;
  padding:.45rem .6rem;border:1px solid transparent;border-radius:var(--radius-sm);
  font-size:.9375rem;color:var(--ink-2);text-decoration:none;
}
.case-filter-link:hover{border-color:var(--line);background:var(--sand);color:var(--ink)}
.case-filter-link.is-on{border-color:var(--brand);background:var(--brand-tint);color:var(--brand-dark);font-weight:600}
.case-filter-link__name{min-width:0}
.case-filters__clear{margin:.2rem 0 0}

/* ---------- the result line ---------- */
.case-results{display:flex;flex-wrap:wrap;align-items:baseline;gap:.4rem 1rem;margin-bottom:1.25rem}
.case-results__count{margin:0;font-weight:600}
.case-results__conditions{margin:0}
.case-results__clear{font-size:var(--step--1);text-decoration:underline;text-underline-offset:3px}

/* The list sits under the header block, which already carries its own spacing. */
.case-body{padding-top:0}
.case-intro{max-width:var(--measure-body);margin-top:.25rem}
.case-hero__topic .case-chip{margin-top:.15rem}

/* ---------- the card grid: 3 across, 2 on a tablet, 1 on a phone ---------- */
.case-grid{grid-template-columns:minmax(0,1fr)}
@media (min-width:640px){.case-grid{grid-template-columns:repeat(2,minmax(0,1fr))}}
@media (min-width:1000px){.case-grid{grid-template-columns:repeat(3,minmax(0,1fr))}}
.case-card{min-width:0}
.case-card__media{aspect-ratio:16/10}
.case-card__img{width:100%;height:100%;object-fit:cover}
.case-card__placeholder{
  width:100%;height:100%;padding:.5rem;text-align:center;line-height:1.4;letter-spacing:.06em;
}
.case-card__body{gap:.5rem}
.case-card__chip{align-self:flex-start}
.case-card__notice{margin:0;font-weight:600;color:var(--warn)}
.case-card__lead{display:-webkit-box;-webkit-line-clamp:3;-webkit-box-orient:vertical;overflow:hidden}
.case-card__client{margin:0;letter-spacing:.02em}
.case-card__lines{margin:0;display:grid;gap:.35rem}
.case-card__line{display:grid;grid-template-columns:auto minmax(0,1fr);gap:.4rem;align-items:baseline}
.case-card__line dt{margin:0;font-size:var(--step--1);color:var(--ink-3);white-space:nowrap}
.case-card__line dt::after{content:":"}
.case-card__line dd{margin:0;font-size:.9375rem;line-height:1.5;color:var(--ink-2)}
.case-card__foot{justify-content:flex-start}

/* ---------- pagination and the page's closing words ---------- */
.case-pagination{margin-top:clamp(1.5rem,3vw,2.5rem)}
.case-confidential{margin-top:1.25rem}
.case-back{margin-top:1.5rem}

/* ---------- the closing band, on the archive and on a project ---------- */
.case-band__title{max-width:32ch}
.case-band .lede{max-width:var(--measure-lead)}

/* ---------- one project ---------- */
.case-hero__topic{margin:0}
.case-hero__lede{max-width:var(--measure-lead)}
.case-hero__figure{margin:0;display:flex;flex-direction:column;gap:.5rem;min-width:0}
.case-hero__media{
  aspect-ratio:4/3;overflow:hidden;background:var(--sand-2);
  border:1px solid var(--line);border-radius:var(--radius-lg);
}
.case-hero__img{width:100%;height:100%;object-fit:cover}
.case-facts{max-width:46rem}

/* The project overview the record writes itself: the same facts list, two or four to a row. */
.case-overview{
  max-width:52rem;display:grid;gap:1rem;margin:0;
  grid-template-columns:repeat(auto-fit,minmax(min(100%,13rem),1fr));
}

.case-single-section{padding-top:0}
.case-single{display:grid;gap:clamp(1.5rem,4vw,2.75rem)}
.case-single__main{min-width:0}
.case-single__related{min-width:0}

/* ---------- the contents column ----------
   One column below 960px, where it reads as a short list of anchor links above the project, and a
   sticky right column above that. The links are ordinary anchors, so the page navigates with no
   script at all; the shared scrollspy behaviour only marks the block being read. */
.case-toc{
  display:grid;gap:.55rem;min-width:0;align-content:start;
  padding:.9rem 1rem;border:1px solid var(--line);border-radius:var(--radius);background:var(--paper);
}
.case-toc__title{
  margin:0;font-size:var(--step--1);font-weight:700;letter-spacing:.06em;
  text-transform:uppercase;color:var(--ink-3);
}
.case-toc__list{list-style:none;margin:0;padding:0;display:grid;gap:.1rem}
.case-toc__link{
  display:block;padding:.3rem 0 .3rem .65rem;border-left:2px solid var(--line);
  color:var(--ink-2);font-size:var(--step--1);font-weight:600;line-height:1.35;text-decoration:none;
}
.case-toc__link:hover{color:var(--ink);border-left-color:var(--line-strong)}
.case-toc__link[aria-current="location"]{color:var(--brand-dark);border-left-color:var(--brand)}
.case-toc__link:focus-visible{outline:2px solid var(--focus);outline-offset:2px;border-radius:var(--radius-sm)}

/* An anchor lands below the sticky header instead of under it. */
.case-block[id]{scroll-margin-top:6.5rem}

@media (min-width:960px){
  .case-single:has(.case-toc){grid-template-columns:minmax(0,1fr) 15rem;align-items:start}
  .case-single__main{grid-column:1;grid-row:1}
  .case-toc{grid-column:2;grid-row:1;position:sticky;top:5.5rem;align-self:start}
  .case-single__related{
    grid-column:1/-1;grid-row:2;display:grid;align-items:start;
    grid-template-columns:repeat(2,minmax(0,1fr));gap:1.25rem;
  }
}

.case-block{display:flex;flex-direction:column;gap:.6rem;min-width:0}
.case-block h2{font-size:var(--step-2)}
.case-block__text{margin:0;max-width:var(--measure-body);line-height:1.65;color:var(--ink-2)}

/* The craft block: the same facts list as the hero, with a sub-heading above the method and the
   three photographs in the evidence row's own grid. The order figures use tabular numbers. */
.case-craft__title{font-size:var(--step-1)}
.case-craft__media{margin-top:.35rem}
.case-cost dd{font-variant-numeric:tabular-nums}

/* ---------- two options compared ----------
   Two columns from 720px, one below it, and one column whenever the record keeps a single option. */
.case-compare{display:grid;gap:.9rem;margin-top:.35rem}
@media (min-width:720px){
  .case-compare{grid-template-columns:repeat(2,minmax(0,1fr))}
  .case-compare--single{grid-template-columns:minmax(0,1fr)}
}
.case-compare__col{
  min-width:0;padding:1rem 1.1rem;background:var(--paper);
  border:1px solid var(--line);border-radius:var(--radius);
}
.case-compare__title{font-size:var(--step-1)}
.case-compare__text{margin:0;max-width:var(--measure-body);line-height:1.6;color:var(--ink-2)}

/* ---------- the delivery timeline ---------- */
.case-timeline__list{list-style:none;margin:0;padding:0;display:grid;gap:0}
.case-timeline__node{position:relative;padding:0 0 1.15rem 1.6rem;border-left:2px solid var(--line)}
.case-timeline__node:last-child{border-left-color:transparent;padding-bottom:0}
.case-timeline__node::before{
  content:"";position:absolute;left:-6px;top:.35rem;width:10px;height:10px;
  border-radius:var(--radius-pill);background:var(--brand);
}
.case-timeline__date{
  margin:0;font-size:var(--step--1);font-weight:700;color:var(--ink-3);
  font-variant-numeric:tabular-nums;
}
.case-timeline__title{font-size:var(--step-1);margin-top:.15rem}
.case-timeline__text{margin:.2rem 0 0;max-width:var(--measure-body);line-height:1.6;color:var(--ink-2)}

.case-steps{list-style:none;margin:0;padding:0;display:grid;gap:1.1rem;counter-reset:case-step}
.case-step{
  position:relative;padding-left:2.2rem;counter-increment:case-step;
  display:flex;flex-direction:column;gap:.4rem;min-width:0;
}
.case-step::before{
  content:counter(case-step);position:absolute;left:0;top:0;
  width:1.6rem;height:1.6rem;border-radius:var(--radius-pill);
  background:var(--brand-tint);color:var(--brand-dark);
  font-size:.75rem;font-weight:700;display:grid;place-items:center;
}
.case-step__title{font-size:var(--step-1)}
.case-step__text{margin:0;max-width:var(--measure-body);line-height:1.6;color:var(--ink-2)}

/* ---------- figures, evidence and the illustrative notice ----------
   The notice is a line of text, never a caption hidden behind an icon: an illustration must not read
   as a photograph of the completed project.
   A photograph keeps its own proportions. A tracking screen cropped into a fixed frame loses the date
   and the status it is there to prove, so the frame here is only a background and the image is fitted
   whole, and on a desktop it is capped at 420–480 px tall. */
.case-figure{margin:0;display:flex;flex-direction:column;gap:.4rem;min-width:0}
.case-figure__img{
  width:100%;height:auto;object-fit:contain;
  background:var(--sand);border:1px solid var(--line);border-radius:var(--radius);
}
@media (min-width:720px){
  /* 420–480 px tall on a desktop; on a phone the photograph follows its own width instead. */
  .case-figure__img{max-height:clamp(420px,42vw,480px)}
}
.case-figure__caption{margin:0;font-size:var(--step--1);line-height:1.5;color:var(--ink-3)}
/* The notice an illustration must carry: a visible line, read as a badge, never hidden in a caption. */
.case-figure__notice{
  display:inline-flex;align-self:flex-start;margin:0;padding:.3rem .6rem;
  border-radius:var(--radius-sm);background:var(--brand-tint);color:var(--brand-dark);
  font-size:var(--step--1);font-weight:600;line-height:1.4;
}
.case-evidence{
  list-style:none;margin:0;padding:0;display:grid;gap:.9rem;align-items:start;
  grid-template-columns:repeat(auto-fit,minmax(min(100%,15rem),1fr));
}
.case-evidence__item{min-width:0}
/* A wide photograph — a tracking screen, a shipping label — takes the row and keeps its ratio. */
.case-evidence__item--wide{grid-column:1/-1}

/* ---------- the testimonial: quoted, with the attribution the record gives ---------- */
.case-quote{margin:0;padding-left:1rem;border-left:3px solid var(--brand)}
.case-quote__body{margin:0}
.case-quote__body p{margin:0;max-width:none;font-size:var(--step-1);line-height:1.55;color:var(--ink)}
.case-prose{max-width:var(--maxw-narrow)}

/* ---------- the sidebar panels ---------- */
.case-panel{
  display:flex;flex-direction:column;gap:.7rem;min-width:0;
  padding:1.1rem 1.2rem;background:var(--paper);
  border:1px solid var(--line);border-radius:var(--radius-lg);
}
.case-panel--sand{background:var(--sand)}
.case-panel__title{font-size:var(--step-1)}
.case-links{list-style:none;margin:0;padding:0;display:grid;gap:.5rem}
.case-links a{font-weight:600;text-decoration:none;border-bottom:1px solid var(--line-strong);align-self:flex-start}
.case-links a:hover{border-bottom-color:var(--brand)}
.case-panel__chips{gap:.4rem}

/* ---------- the last two projects, and the empty states ---------- */
.case-more__title{font-size:var(--step-2)}
.case-more__foot{margin-top:1.25rem}
.case-empty{display:flex;flex-direction:column;gap:.7rem;max-width:none;margin-inline:auto;text-align:center}
.case-empty p{margin:0}
.case-empty__actions{justify-content:center;margin-top:.4rem}
