/* SourcingPromo — one buying guide (single-guide.php and parts/guide-body.php).
   Every value comes from tokens.css; every rule is prefixed `sp-guide` so it can never reach
   another page's markup. Mobile first: one column, then the wider layouts from 40rem and 56rem.
   Nothing here needs JavaScript — the table of contents and the copy button on the checklist are
   the shared disclosure and copy behaviours, which the runtime drives by data attributes. */

/* ---------- anchors ----------
   The sticky site header sits over the page, so a section reached from the table of contents stops
   below it rather than under it. */
.sp-guide [id^="sp-guide-"]{scroll-margin-top:6rem}

/* ---------- the head of the page ---------- */
/* ---------- the opening block ----------
   On a wide screen the words sit left and the one picture right; a record without a picture keeps
   the same text in one column, so nothing has to be invented to fill the other side. */
.sp-guide-hero{display:grid;gap:1.5rem;margin-top:.35rem}
.sp-guide-hero__text{display:flex;flex-direction:column;gap:.7rem;min-width:0}
.sp-guide-intro{margin:0;max-width:var(--maxw-narrow);color:var(--ink-2);line-height:1.65}
.sp-guide-title{margin:0}
.sp-guide-summary{margin:0;max-width:var(--measure-body)}
.sp-guide-byline{margin:0}
.sp-guide-answer{margin:.25rem 0 0}
.sp-guide-scope{margin:0}

/* The cover: 16:9, and nothing at all when the record has no image. */
.sp-guide-cover{
  margin:.25rem 0 0;border:1px solid var(--line);border-radius:var(--radius-lg);
  overflow:hidden;background:var(--sand);
}
.sp-guide-cover__img{
  display:block;width:100%;height:auto;aspect-ratio:16/9;object-fit:cover;background:var(--sand-2);
}
.sp-guide-hero__media{margin:0}
.sp-guide-hero__media .sp-guide-cover__img{aspect-ratio:8/5}
@media (min-width:56rem){
  .sp-guide-hero--media{grid-template-columns:minmax(0,1.05fr) minmax(0,1fr);align-items:center;gap:2.5rem}
}
.sp-guide-cover figcaption{
  padding:.7rem 1rem;border-top:1px solid var(--line);background:var(--paper);
  font-size:var(--step--1);color:var(--ink-3);line-height:1.5;
}

/* ---------- the table of contents ----------
   One row of links under the answer: it wraps on a wide screen and scrolls sideways on a phone, so
   every section stays one tap away without a second disclosure to open. */
.sp-guide-toc--chips{display:flex;flex-direction:column;gap:.55rem;min-width:0}
.sp-guide-toc__label{
  margin:0;font-size:.75rem;font-weight:700;letter-spacing:.1em;text-transform:uppercase;color:var(--ink-3);
}
.sp-guide-toc--chips .sp-guide-toc__list{
  list-style:none;margin:0;padding:0 0 .3rem;display:flex;flex-wrap:wrap;gap:.5rem;
  overflow-x:auto;scrollbar-width:thin;-webkit-overflow-scrolling:touch;
}
.sp-guide-toc--chips .sp-guide-toc__list li{flex:0 0 auto}
.sp-guide-toc--chips .sp-guide-toc__list a{
  display:inline-block;padding:.45rem .85rem;border:1px solid var(--line);border-radius:999px;
  background:var(--paper);color:var(--ink-2);text-decoration:none;
  font-size:var(--step--1);white-space:nowrap;transition:border-color .15s ease,color .15s ease;
}
.sp-guide-toc--chips .sp-guide-toc__list a:hover{color:var(--ink);border-color:var(--brand)}
.sp-guide-toc--chips .sp-guide-toc__list a:focus-visible{outline:2px solid var(--brand);outline-offset:2px}

/* ---------- the body ----------
   Both ways of building the body — the record's components and the older editor content — print in
   this one column, so a rebuilt guide and a legacy guide are read at the same measure. */
.sp-guide-body{padding-top:0}
.sp-guide-body__inner{max-width:min(100%,56rem);display:flex;flex-direction:column;gap:2rem}
/* The reading column stays narrow inside the wider body, so a table or a row of cards can be
   wider than the sentence beside it without stretching the sentence. */
.sp-guide-block__prose,.sp-guide-block__intro{max-width:var(--maxw-narrow)}
.sp-guide-body__label{
  margin:0;font-size:.75rem;font-weight:700;letter-spacing:.1em;text-transform:uppercase;
  color:var(--brand-dark);
}
.sp-guide-prose{max-width:var(--maxw-narrow)}

/* One component. The measure belongs to the column above, not to each block. */
.sp-guide-block{display:flex;flex-direction:column;gap:.75rem;min-width:0;margin:0}
.sp-guide-block__prose{max-width:none}
.sp-guide-block__intro{margin:0;color:var(--ink-2);line-height:1.6}
.sp-guide-block__note{margin:0;font-size:var(--step--1);color:var(--ink-3);line-height:1.55}

/* ---------- steps ---------- */
.sp-guide-steps .sp-guide-step__detail{display:block;margin-top:.15rem}

/* ---------- the comparison table ----------
   A real table, scrollable sideways inside its own frame rather than clipped. The hint below it says
   so, and is shown only where the table's own minimum width can exceed the column. */
.sp-guide-table-scroll{
  overflow-x:auto;-webkit-overflow-scrolling:touch;
  border:1px solid var(--line);border-radius:var(--radius);background:var(--paper);
}
.sp-guide-table-scroll:focus-visible{outline:2px solid var(--focus);outline-offset:2px}
.sp-guide-table{border-collapse:collapse;width:100%;min-width:36rem;font-size:.9375rem}
.sp-guide-table caption{
  caption-side:top;text-align:left;padding:.85rem 1rem;background:var(--sand);
  border-bottom:1px solid var(--line);color:var(--ink);font-weight:650;line-height:1.4;
}
.sp-guide-table th,
.sp-guide-table td{padding:.65rem .85rem;border-top:1px solid var(--line);text-align:left;vertical-align:top;line-height:1.5}
.sp-guide-table thead th{
  background:var(--paper);border-top:0;color:var(--ink-3);
  font-size:var(--step--1);font-weight:700;letter-spacing:.05em;text-transform:uppercase;
}
.sp-guide-table tbody th{font-weight:620;color:var(--ink)}
.sp-guide-table td{color:var(--ink-2)}
.sp-guide-unknown{color:var(--ink-3);font-style:italic}
.sp-guide-swipe{margin:.45rem 0 0;font-size:var(--step--1);color:var(--ink-3);line-height:1.4}
@media (min-width:40rem){.sp-guide-swipe{display:none}}

/* ---------- a figure ----------
   Only printed when the component carries an image; there is no empty frame. */
.sp-guide-figure{
  margin:0;border:1px solid var(--line);border-radius:var(--radius-lg);
  overflow:hidden;background:var(--page);
}
.sp-guide-figure__img{display:block;width:100%;height:auto}
.sp-guide-figure__caption{
  display:flex;flex-direction:column;gap:.3rem;
  padding:.8rem 1rem;border-top:1px solid var(--line);background:var(--paper);
  font-size:var(--step--1);color:var(--ink-2);line-height:1.5;
}
.sp-guide-figure__title{font-weight:650;color:var(--ink)}

/* ---------- use-case cards ----------
   Three short pictures and sentences: the same card in one, two or three columns. */
.sp-guide-cards{display:grid;gap:1.25rem;min-width:0}
.sp-guide-card{
  display:flex;flex-direction:column;min-width:0;overflow:hidden;
  border:1px solid var(--line);border-radius:var(--radius-lg);background:var(--paper);
}
.sp-guide-card__media{position:relative;background:var(--sand-2)}
.sp-guide-card__img{display:block;width:100%;height:auto;aspect-ratio:3/2;object-fit:cover}
.sp-guide-card__badge{position:absolute;left:.6rem;bottom:.6rem}
.sp-guide-card__body{display:flex;flex-direction:column;gap:.4rem;padding:1rem 1.1rem 1.15rem}
.sp-guide-card__title{margin:0;font-size:var(--step-1);line-height:1.3}
.sp-guide-card__text{margin:0;color:var(--ink-2);line-height:1.6}
@media (min-width:40rem){
  .sp-guide-cards{grid-template-columns:repeat(2,minmax(0,1fr))}
}
@media (min-width:56rem){
  .sp-guide-cards{grid-template-columns:repeat(3,minmax(0,1fr))}
}

/* ---------- two pictures side by side ----------
   Each carries its own short label over the image, so two fabrics are compared without the page
   asserting what they are made of. */
.sp-guide-figures{display:grid;gap:1rem;min-width:0}
.sp-guide-figures__item{margin:0;display:flex;flex-direction:column;gap:.5rem;min-width:0}
.sp-guide-figures__frame{
  position:relative;overflow:hidden;border:1px solid var(--line);
  border-radius:var(--radius-lg);background:var(--sand-2);
}
.sp-guide-figures__frame .sp-guide-figure__img{
  display:block;width:100%;height:auto;aspect-ratio:3/2;object-fit:cover;
}
.sp-guide-figures__label{
  position:absolute;left:.75rem;bottom:.75rem;padding:.3rem .7rem;border-radius:999px;
  background:rgba(255,255,255,.94);color:var(--ink);font-size:var(--step--1);font-weight:600;
}
.sp-guide-figures__badge{position:absolute;right:.6rem;top:.6rem}
@media (min-width:40rem){
  .sp-guide-figures{grid-template-columns:repeat(2,minmax(0,1fr))}
}
@media (min-width:56rem){
  .sp-guide-figures--single{grid-template-columns:minmax(0,1fr)}
}
.sp-guide-badge{
  align-self:flex-start;padding:.15rem .55rem;border-radius:var(--radius-pill);
  background:var(--brand-tint);color:var(--brand-dark);
  font-size:.7rem;font-weight:700;letter-spacing:.08em;text-transform:uppercase;
}

/* ---------- a choice, in two halves ---------- */
.sp-guide-decision{display:grid;gap:1rem}
.sp-guide-decision__part{
  display:flex;flex-direction:column;gap:.35rem;
  padding:.9rem 1.05rem;border:1px solid var(--line);border-radius:var(--radius);background:var(--paper);
}
.sp-guide-decision__title{
  margin:0;font-size:var(--step--1);font-weight:700;letter-spacing:.06em;
  text-transform:uppercase;color:var(--ink-3);line-height:1.35;
}
.sp-guide-decision__part p{margin:0;color:var(--ink-2);line-height:1.6}
@media (min-width:40rem){.sp-guide-decision{grid-template-columns:repeat(2,minmax(0,1fr))}}

/* ---------- a note ----------
   A bordered block, not a warning: the brand edge and the paper ground, no colour that shouts. */
.sp-guide-note{
  display:flex;flex-direction:column;gap:.35rem;
  padding:.9rem 1.1rem;background:var(--paper);
  border:1px solid var(--line-strong);border-left:3px solid var(--brand);
  border-radius:0 var(--radius) var(--radius) 0;
}
.sp-guide-note__title{margin:0;font-size:var(--step-0);font-weight:650;line-height:1.35}
.sp-guide-note p{margin:0;color:var(--ink-2);line-height:1.6}

/* ---------- checklists ----------
   Two of them: the one a component carries and the record's own purchasing checklist after the body.
   Both are read without JavaScript; the copy button only adds a copied line. */
.sp-guide-checklist-list,
.sp-guide-checklist__list{list-style:none;margin:0;padding:0;display:grid;gap:.55rem}
.sp-guide-checklist-list>li,
.sp-guide-checklist__list>li{position:relative;padding-left:1.5rem;color:var(--ink-2);line-height:1.55}
.sp-guide-checklist-list>li::before,
.sp-guide-checklist__list>li::before{
  content:"";position:absolute;left:0;top:.42em;width:.62rem;height:.62rem;
  border:1.5px solid var(--line-strong);border-radius:2px;background:var(--paper);
}
.sp-guide-checklist{
  display:flex;flex-direction:column;gap:.85rem;
  padding:1.1rem 1.2rem;border:1px solid var(--line);border-radius:var(--radius-lg);background:var(--sand);
}
.sp-guide-checklist__title{margin:0;font-size:var(--step-1)}
.sp-guide-copy{
  display:flex;flex-wrap:wrap;align-items:center;gap:.4rem .75rem;
  margin:0;padding-top:.9rem;border-top:1px solid var(--line-strong);
}
.sp-guide-copy__btn{cursor:pointer}
.sp-guide-copy__status{margin:0;min-height:1em}

/* ---------- an example ---------- */
.sp-guide-example{
  display:flex;flex-direction:column;gap:.3rem;
  padding-left:1rem;border-left:3px solid var(--line-strong);
}
.sp-guide-example__kind{
  margin:0;font-size:.72rem;font-weight:700;letter-spacing:.08em;text-transform:uppercase;color:var(--ink-3);
}
.sp-guide-example__text{margin:0;color:var(--ink-2);line-height:1.6}

/* ---------- the questions ---------- */
.sp-guide-faq{display:grid;gap:1rem}
.sp-guide-faq__item{
  display:flex;flex-direction:column;gap:.3rem;
  padding-top:.9rem;border-top:1px solid var(--line);
}
.sp-guide-faq__item:first-child{border-top:0;padding-top:0}
.sp-guide-faq__question{margin:0;font-size:var(--step-0);font-weight:650;line-height:1.4;color:var(--ink)}
.sp-guide-faq__answer{margin:0;color:var(--ink-2);line-height:1.6}

/* ---------- what comes after the body ---------- */
.sp-guide-download{gap:.6rem}
.sp-guide-related__inner{display:flex;flex-direction:column;gap:2rem}
.sp-guide-related__block{display:flex;flex-direction:column;gap:.9rem}
.sp-guide-related__title{margin:0;font-size:var(--step-2)}

/* ---------- the closing ask ---------- */
.sp-guide-cta{
  display:flex;flex-direction:column;gap:1rem;
  padding:1.35rem 1.5rem;background:var(--sand);
  border:1px solid var(--line);border-radius:var(--radius-lg);
}
.sp-guide-cta__title{margin:0;font-size:var(--step-2);line-height:1.25}
.sp-guide-cta__note{margin:0;color:var(--ink-2);line-height:1.6;max-width:var(--measure-body)}
.sp-guide-cta__actions{margin:0}
@media (min-width:56rem){
  .sp-guide-cta{flex-direction:row;align-items:center;justify-content:space-between;gap:2rem}
  .sp-guide-cta__actions{justify-content:flex-end}
}

/* ---------- focus ---------- */
.sp-guide-toc__trigger:focus-visible,
.sp-guide-toc__list a:focus-visible,
.sp-guide-copy__btn:focus-visible{outline:2px solid var(--focus);outline-offset:3px;border-radius:var(--radius-sm)}
