/* Case-page rules that must win over each page's own stylesheet, so this file loads last.

   1. Tablet widths (670–1023px), owner-approved November 22, 2026. At these widths the locked
      two-column layouts leave headings one or two words per line, so they end on a single word:
      the hero and each section stack as on phones (heading above its text), and three-card
      journey maps use their phone layout. Four-card maps stay two to a row (see case.css). */
@container (min-width:670px) and (max-width:1023px){
  /* Hero: the visual moves under the text, centered, at its desktop size. */
  .case .hero-grid{grid-template-columns:1fr}
  .case .hero-media{justify-self:center;margin-top:4px}

  /* Sections: heading above its text, divider between sections, as on phones. The text
     keeps its 700px measure. */
  .case .section{grid-template-columns:1fr;gap:18px;padding-top:clamp(36px,4cqi,52px)}
  .case .sections .section+.section{border-top:1px solid var(--rule)}
  .case .section>*{padding-top:0!important;border-top:0!important}
}
@container (min-width:671px) and (max-width:1023px){
  /* Three-card journey maps: stacked, with down arrows and the bracket's phone box. */
  .case .journey.cards-3 .stages{grid-template-columns:1fr}
  .case .journey.cards-3 .stages>li:not(:last-child) .stage::after{top:auto;bottom:-13px;right:50%;transform:translateX(50%) rotate(135deg)}
  .case .journey.cards-3 .bracket{grid-template-columns:1fr}
  .case .journey.cards-3 .bracket .span{display:none}
  .case .journey.cards-3 .bracket p{grid-column:1;max-width:none;border-left:3px solid var(--bracket-edge,var(--lime));background:var(--navy);color:var(--cream);padding:14px 16px;border-radius:0 8px 8px 0;margin-top:4px}
}

/* 2. Takeaway motif (owner QA, November 22, 2026). Every case shows its motif at the same .6
      opacity at every width (it was .32 on phones), and the artwork always reaches the band's
      bottom edge: on narrow screens the square, sized from the width, ended inside the band with
      a hard edge. The image box now runs from its top offset to the band's bottom and the artwork
      covers it, top-aligned, which on desktop looks exactly as before. */
.case .takeaway .motif{bottom:0;height:auto;aspect-ratio:auto;max-width:none;object-fit:cover;object-position:50% 0;opacity:.6}
@container (max-width:669px){
  .case .takeaway .motif{width:125%;top:-34px}
}

/* 3. Steppers on phones (owner QA, November 22, 2026). Komodo's and Coaching's own stylesheets set
      their step columns (5 and 7) for every width, which overrode the shared one-column phone
      layout, so on phones the steps squeezed into narrow columns and their labels ran into each
      other. Below 670px every stepper is one column with the line down the left, as the
      checkpoints show; Coaching's "Needs review" branch follows step 4. */
@container (max-width:669px){
  .case .tl{grid-template-columns:1fr;gap:0}
  .case .tl::before{left:14px;right:auto;top:15px;bottom:15px;width:2px;height:auto}
  /* The branch button drops its desktop centring offset and sits in the branch's flow. */
  .case .br-btn{left:auto;top:auto;transform:none}
}
/* A step with only a name (no "when" line) centres it on its dot; the dot spans two rows only
   when there is a second line to sit beside. */
.case .tl-btn:not(:has(.tl-when)) .tl-dot{grid-row:auto}

/* 4. Scale's and HNconnect's takeaway motifs (owner QA, November 22, 2026): sized from the band's
      height, not the page width, so the whole profile shows (at 936px wide only the forehead or
      crown did), and set a little higher. The square starts above the band and runs past its
      bottom, so no edge shows. */
:is(.case-scale,.case-hn-connect) .takeaway .motif{top:-100px;bottom:auto;height:calc(100% + 156px);width:auto;aspect-ratio:1}
@container (max-width:669px){
  :is(.case-scale,.case-hn-connect) .takeaway .motif{top:-60px;height:calc(100% + 100px);width:auto}
}
