/* Teradix homepage, demo call-to-action section (#demo, .demo--v2): phone and tablet fixes.
   Load after css/teradix-ds-blue6.css. Only max-width rules, all scoped to the section's own classes.
   Logical properties throughout so the same rules hold on a right-to-left page. */

/* ---------- small laptops and tablets (up to 1200px) ---------- */
@media (max-width:1200px){
  /* three steps: the number tile spans two rows, which stretched a one-line title away from its text */
  .demo--v2 .demo2__steps li{grid-template-rows:auto 1fr}

  /* the ROI link was 21px tall: give it a 44px tap area and keep the underline tight to the words */
  .demo--v2 .demo2__alt{display:inline-flex;align-items:center;justify-content:center;min-height:44px;padding-block:0;border-bottom:0;line-height:1.35;
    text-decoration:underline;text-decoration-thickness:1.5px;text-underline-offset:5px;text-decoration-color:rgba(2,3,233,.4);text-wrap:balance}
  .demo--v2 .demo2__acts{gap:12px}

  /* the slider was a 34px strip: 44px so a thumb can land on it */
  .demo--v2 .demo__range{height:44px;margin-block:6px 0}
  .demo--v2 .demo__scale{margin-block-start:0}
}

/* ---------- tablets and phones (up to 900px, where the section goes to one column) ---------- */
@media (max-width:900px){
  /* the button was stretched across the whole tablet: size it to its label, with a sensible floor */
  .demo--v2 .demo2__btn{width:auto;min-width:min(100%,340px)}

  /* reading sizes: step text, slider label and footnote up to the 15px / 14px floor */
  .demo--v2 .demo2__steps span{font-size:15px;line-height:1.5;text-wrap:pretty}
  .demo--v2 .demo2__in label{font-size:15px;line-height:1.35}
  .demo--v2 .demo2__note{font-size:14px;line-height:1.5}
  .demo--v2 .demo__scale{font-size:12.5px}

  /* the proof line sat left under a centred section and broke after a stray dot */
  .demo--v2 .demo2__proof{display:block;text-align:center}
  .demo--v2 .demo2__proof p{line-height:1.6;text-wrap:balance}

  /* the two-line eyebrow above the logos had its lines touching */
  .demo--v2 .demo2__trust p{line-height:1.5;text-wrap:balance}
}

/* ---------- phones (up to 640px) ---------- */
@media (max-width:640px){
  /* headline: the lime underline was one bar across the full width, struck through the last line only.
     Inline + clone puts it under each line of the highlighted sentence, at the width of the words. */
  .demo.demo--v2 h2{font-size:clamp(30px,8.6vw,36px);line-height:1.1;letter-spacing:-.04em}
  .demo.demo--v2 h2 span{display:inline;width:auto;margin-inline:0;padding:0 .06em;
    -webkit-box-decoration-break:clone;box-decoration-break:clone}

  .demo--v2 .demo2__lead{font-size:16.5px;line-height:1.55}
}

@media (max-width:560px){
  /* full-width button, pulled in by the depth of its offset block so the block stays inside the gutter.
     box-shadow is physical (always falls to the right), so this margin is deliberately physical too. */
  .demo--v2 .demo2__acts{align-items:stretch}
  .demo--v2 .demo2__btn{width:auto;min-width:0;justify-content:center;margin-right:8px;margin-left:0;padding-block:20px;box-shadow:8px 8px 0 #0203E9}
  .demo--v2 .demo2__btn:hover{box-shadow:8px 8px 0 #0203E9;transform:none}
  .demo--v2 .demo2__btn:active{transform:translate(3px,3px);box-shadow:5px 5px 0 #0203E9}

  /* steps: let the text use the full column instead of sitting inside a second gutter */
  .demo--v2 .demo2__steps li{padding-inline:0;gap:6px 14px}

  /* savings figure: the longest value ("$50M to $100M") must fit a 320px phone */
  .demo--v2 .demo2__out b{font-size:clamp(30px,9.4vw,40px);white-space:normal;text-wrap:balance}
  .demo--v2 .demo2__calc{padding:24px 20px;gap:14px}
  .demo--v2 .demo2__note{margin-block-start:2px}

  /* logo strip: narrower fades so a 390px screen shows two whole logos */
  .demo--v2 .dmarq::before,.demo--v2 .dmarq::after{width:28px}
  .demo--v2 .dmarq__track{gap:40px;padding-right:40px} /* physical on purpose: the loop in the base stylesheet measures padding-right */
}
