/* Shared layout corrections B01–B09. These scoped rules replace legacy fixed
   rows and offsets. Important declarations only counter existing important
   catalogue rules; no URL-specific geometry or new page copy. */
body[data-design-variant=figma] {
  --idh-section-heading-size:42px;
  --idh-section-heading-gap:48px;
  --idh-component-gap:48px;
}

/* B01: content determines card height; the CTA has its own final row. */
body[data-design-variant=figma] .cp-card-grid {align-items:stretch}
body[data-design-variant=figma] .cp-card-grid>.cp-card {
  display:flex;flex-direction:column;align-items:stretch;gap:20px;
  grid-template-rows:none;height:auto;min-height:0;max-height:none;min-width:0;
}
body[data-design-variant=figma] .cp-card-grid>.cp-card>:is(span,h3,p,b) {
  position:static;width:auto;max-width:100%;height:auto;min-height:0;
  margin-top:0;margin-bottom:0;overflow-wrap:anywhere;
}
body[data-design-variant=figma] .cp-card-grid>.cp-card>b {margin-top:auto;padding-top:8px}
body[data-design-variant=figma] .cp-card-grid>.mc-overview-card>img {
  position:static;inset:auto;flex:none;width:100%;height:auto;
  aspect-ratio:3/2;object-fit:contain;max-width:100%;opacity:1;
}
body[data-design-variant=figma] .cp-card-grid>.mc-overview-card>span {margin-top:0}
body[data-design-variant=figma] .cp-card-grid>.mc-overview-card>b {margin-bottom:28px}
body[data-design-variant=figma] .idh-project-cards>.cp-card>img {
  background:var(--idh-warm-50,#e5e2e3);padding:16px;
}

/* B02/B04: corresponding section headings follow the home collaboration axis. */
body[data-design-variant=figma] :is(.idh-section-heading,.fp-section-center,.fp-cases .fp-section-center,.fh-case-heading,.cp-section-head,.fh-benefits-title,.mc-section-head) {
  text-align:left;min-width:0;
}
body[data-design-variant=figma] .cp-section-head {width:100%;max-width:none;margin:0 0 52px}
body[data-design-variant=figma] :is(.idh-section-heading,.fp-section-center,.fp-cases .fp-section-center,.fh-case-heading,.cp-section-head,.fh-benefits-title,.mc-section-head)>:is(.fp-label,.fh-label,.cp-label) {
  width:100%;max-width:100%;justify-content:flex-start;text-align:left;
  margin:0 0 var(--idh-section-heading-gap);
}
body[data-design-variant=figma] :is(.idh-section-heading,.fp-section-center,.fp-cases .fp-section-center,.fh-case-heading,.cp-section-head,.fh-benefits-title,.mc-section-head)>h2 {
  font-size:var(--idh-section-heading-size);line-height:1.18;text-align:left;
  width:100%;max-width:100%;margin:0;overflow-wrap:anywhere;hyphens:auto;
}
body[data-design-variant=figma] :is(.fp-cases .fp-section-center,.fh-case-heading,.fp-dark-win>.fp-section-center) {
  width:100%;max-width:var(--idh-shell,1116px);
  margin-left:auto;margin-right:auto;
}

/* B03: an inherited grid gap (82px) became the flex gap in the case hero. */
body[data-design-variant=figma] .cp-case-detail .cp-hero :is(.cp-hero-grid,.cp-hero-copy) {
  gap:0!important;min-width:0;height:auto;min-height:0;max-height:none;
}

/* B07: child widths must respect their reserved hero grid column. */
body[data-design-variant=figma] :is(.fp-industry-detail .fp-line-hero,.cp-case-detail .cp-hero) :is(.fp-hero-copy,.cp-hero-copy) {
  min-width:0;max-width:100%!important;left:auto;
}
body[data-design-variant=figma] :is(.fp-industry-detail .fp-line-hero,.cp-case-detail .cp-hero) :is(.fp-hero-copy,.cp-hero-copy)>:is(h1,h2,p,a) {
  width:auto;max-width:100%!important;min-width:0;overflow-wrap:anywhere;hyphens:auto;
}
body[data-design-variant=figma] .fp-industry-detail .fp-line-hero .fp-line-art {
  width:100%;max-width:100%;min-width:0;left:auto;right:auto;top:auto;object-fit:contain;
}

/* B05: reserve both intro and illustration in the same centered container. */
body[data-design-variant=figma] .fp-dark-win>.idh-win-lead {
  display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1fr);
  align-items:center;gap:var(--idh-component-gap);
  width:100%;max-width:var(--idh-shell,1116px);margin:0 auto;
}
body[data-design-variant=figma] .idh-win-lead>picture {
  grid-column:2;grid-row:1;position:static;inset:auto;
  width:100%;max-width:100%;height:auto;margin:0;opacity:1;
}
body[data-design-variant=figma] .idh-win-lead .fp-win-art {
  position:static;inset:auto;transform:none;width:100%;max-width:100%;
  height:auto;max-height:420px;object-fit:contain;opacity:1;
}
body[data-design-variant=figma] .idh-win-lead>.fp-win-intro {
  grid-column:1;grid-row:1;position:static;inset:auto;width:100%;max-width:100%;
  min-width:0;margin:0;
}
body[data-design-variant=figma] .idh-win-lead .fp-win-intro>:is(h2,p) {
  width:auto;max-width:100%;overflow-wrap:anywhere;
}

/* B06: normal flow replaces the left/translate centering plus auto-margin mix. */
body[data-design-variant=figma] .fp-service-dark>.fp-metric-row {
  position:static;left:auto;right:auto;transform:none;
  width:100%;max-width:var(--idh-shell,1116px);
  margin:0 auto;height:auto;grid-template-columns:repeat(4,minmax(0,1fr));
}
body[data-design-variant=figma] .fp-service-dark>.fp-metric-row article {
  min-width:0;display:flex;flex-direction:column;align-items:flex-start;justify-content:flex-start;
  gap:24px;height:auto;padding:48px 24px;border-right:1px solid #aaa5aa;
}
body[data-design-variant=figma] .fp-service-dark>.fp-metric-row article:last-child {border-right:0}
body[data-design-variant=figma] .fp-metric-row :is(strong,p) {
  width:auto;max-width:100%;min-width:0;margin:0;overflow-wrap:anywhere;hyphens:auto;
}
body[data-design-variant=figma] .fp-service-dark>h2 {
  width:100%;max-width:var(--idh-shell,1116px);margin-left:auto;margin-right:auto;text-align:left;
}

/* B08: section typography, with shrinkable columns and natural word wrapping. */
body[data-design-variant=figma] .fp-ftf {grid-template-columns:repeat(2,minmax(0,1fr))}
body[data-design-variant=figma] .fp-ftf>div {min-width:0}
body[data-design-variant=figma] .fp-ftf h2 {
  font-size:var(--idh-section-heading-size);line-height:1.18;
  width:auto;max-width:100%;min-width:0;hyphens:auto;overflow-wrap:anywhere;
}

/* B09: explicit text placement is independent of the arrow's visibility. */
body[data-design-variant=figma] .fp-comparison article>div:first-child {grid-column:1;grid-row:1;min-width:0}
body[data-design-variant=figma] .fp-comparison article>.fp-comparison-arrow {grid-column:2;grid-row:1}
body[data-design-variant=figma] .fp-comparison article>div:last-child {grid-column:3;grid-row:1;min-width:0}
body[data-design-variant=figma] .fp-comparison article :is(h3,p) {max-width:100%;width:auto;hyphens:auto;overflow-wrap:anywhere}

@media(max-width:1100px) {
  body[data-design-variant=figma] .fp-service-dark>.fp-metric-row {grid-template-columns:repeat(2,minmax(0,1fr))}
  body[data-design-variant=figma] .fp-service-dark>.fp-metric-row article:nth-child(2n) {border-right:0}
}
@media(max-width:820px) {
  body[data-design-variant=figma] {--idh-component-gap:32px;--idh-section-heading-gap:32px}
  body[data-design-variant=figma] .fp-dark-win>.idh-win-lead {grid-template-columns:minmax(0,1fr)}
  body[data-design-variant=figma] .idh-win-lead>picture {grid-column:1;grid-row:2}
  body[data-design-variant=figma] .idh-win-lead .fp-win-art {max-height:300px}
  body[data-design-variant=figma] .fp-ftf {grid-template-columns:minmax(0,1fr)}
}
@media(max-width:600px) {
  body[data-design-variant=figma] {--idh-section-heading-size:32px}
  body[data-design-variant=figma] .fp-service-dark>.fp-metric-row {grid-template-columns:minmax(0,1fr)}
  body[data-design-variant=figma] .fp-service-dark>.fp-metric-row article {border-right:0;padding:32px 24px}
  body[data-design-variant=figma] .fp-comparison article>div:first-child {grid-column:1;grid-row:1}
  body[data-design-variant=figma] .fp-comparison article>.fp-comparison-arrow {grid-column:1;grid-row:2}
  body[data-design-variant=figma] .fp-comparison article>div:last-child {grid-column:1;grid-row:3}
}

/* Reuse the approved hero composition in the dark project section. */
body[data-design-variant=figma] .idh-win-lead>.idh-illustration-filter {position:absolute;width:0;height:0;pointer-events:none}
body[data-design-variant=figma] .idh-win-lead>.idh-challenge-illustration .fp-win-art {filter:url('#idh-project-negative')}

/* Approved FTF schematic: retain transparency and the complete composition. */
body[data-design-variant=figma] .fp-ftf figure {min-width:0}
body[data-design-variant=figma] .fp-ftf picture {display:block}
body[data-design-variant=figma] .fp-ftf img {display:block;width:100%;max-width:100%;height:auto;object-fit:contain}
