/* us-mobile-20261125
   Mobile fixes from Louis's Nov 25 review. Preview only until he OKs.
   Loaded last on pages that already use site-chrome. */

/* ---- 1. Product cards: price + Buy sit close under the description on phones.
   Desktop keeps equal-height rows (margin-top:auto). */
@media (max-width: 640px){
  html body .picks .pr,
  html body .bf-card .bf-price,
  html body .bk-card .pr,
  html body .bk-card .bk-pr,
  html body .card .pr,
  html body .kcard .meta,
  html body .picks .pcard > .pr{
    margin-top:0 !important;
  }
  html body .picks .ds,
  html body .line-card p.ds,
  html body article.kcard p.ds,
  html body .kcard p.ds,
  html body .kcard > p,
  html body li.card .ds,
  html body .pack .desc,
  html body .bk-card .ds,
  html body .card .ds{
    flex:0 0 auto;
  }
}

/* ---- 2. Trust badges: wrap long labels; even 8-up grid (8th badge is in HTML) ---- */
html body .trust-band .tbb-t b,
html body .trust-band .tbb-t small{
  overflow-wrap:anywhere;
  max-width:100%;
}

/* ---- 3. Below-trust left shift: trust-band was width:100% + padding without
   border-box, so it overflowed ~40px and left a white strip on the right.
   Also neutralize leftover 100vw / calc(50% - 50vw) pull on pitch bands. */
html body .trust-band,
html body .nl-band,
html body .mb-band,
html body .hband,
html body .sband,
html body .fband,
html body .mcp-strip,
html body footer.tai-newfoot{
  box-sizing:border-box;
  max-width:100%;
}
html body .trust-band{
  width:100%;
}
html body .hband,
html body .sband,
html body .fband{
  width:100% !important;
  max-width:100% !important;
  margin-left:0 !important;
  margin-right:0 !important;
}

/* ---- 4. Footer: two centered wrapping rows; policy + contact on top ---- */
footer.tai-newfoot nav.tai-fnav{
  display:flex;
  flex-wrap:wrap;
  justify-content:center;
  text-align:center;
}
footer.tai-newfoot nav.tai-fnav-policy{
  margin:0 0 2px;
}
footer.tai-newfoot nav.tai-fnav-rest{
  margin:0 0 10px;
}

/* ---- 5. Course sales page: stack the cover in normal flow on mobile;
   tighten the sale-price line and section gaps. ---- */
@media (max-width:799px){
  html body .course-hero .grid,
  html body .course-hero .copy{
    display:flex;
    flex-direction:column;
    align-items:stretch;
    grid-template-columns:minmax(0,1fr) !important;
    gap:12px;
  }
  html body .course-hero{
    padding:20px 0 8px;
  }
  html body .course-hero .cover{
    width:min(220px,70%);
    max-width:220px;
    margin:8px auto;
    justify-self:center;
    align-self:center;
  }
  html body .course-hero .cover img{
    width:100%;
    height:auto;
    display:block;
  }
  html body .course-sec{padding:20px 0}
  html body .course-sec h2{margin:0 0 8px}
  html body .course-buy{padding:4px 0 8px}
}
html body .course-hero .price{
  line-height:1.2;
}
html body .course-hero .price .rf-off,
html body .course-hero .price span.rf-off{
  display:block;
  font-size:.86rem;
  line-height:1.35;
  font-weight:700;
  margin-top:6px;
  max-width:36em;
}

/* Desktop course: cover now lives inside .copy, so the outer 2-col grid
   would leave an empty column. Collapse the outer grid and pin the cover
   to a side column of .copy instead. */
@media (min-width:800px){
  html body .course-hero .grid:has(> .copy > .cover){
    display:block;
    grid-template-columns:none;
  }
  html body .course-hero .copy:has(> .cover){
    display:grid;
    grid-template-columns:minmax(0,1.15fr) minmax(240px,320px);
    gap:40px;
    align-items:start;
  }
  html body .course-hero .copy:has(> .cover) > :not(.cover){
    grid-column:1;
  }
  html body .course-hero .copy:has(> .cover) > .cover{
    grid-column:2;
    grid-row:1 / span 20;
    justify-self:end;
    align-self:start;
    max-width:320px;
    width:100%;
    margin:0;
  }
}

/* ---- 6. How we make this: in-article callout (replaces the bottom sband) ---- */
html body article.post .ai-callout{
  margin:0 0 1.35rem;
  padding:12px 14px;
  border-left:3px solid #02CEFC;
  background:#eefbfe;
  color:#0f1b2d;
  font-weight:700;
  font-size:1rem;
  line-height:1.4;
  border-radius:0 8px 8px 0;
}
html body article.post .ai-callout span{
  color:#00718f;
}

/* ---- 7. All-Trades bundle on /kits/: fill the dead space to the right of
   the cover on mobile; keep a balanced cover + inside-look + pitch on desktop. */
html body .kit-agency{
  display:grid !important;
  grid-template-columns:132px minmax(0,1fr);
  gap:12px 14px;
  align-items:start;
  flex-wrap:nowrap;
}
html body .kit-agency > .im{
  grid-column:1;
  grid-row:1;
  flex:none;
  box-sizing:border-box;
  width:132px;
  max-width:100%;
  aspect-ratio:1/1;
}
html body .kit-agency .kit-agency-body{
  grid-column:2;
  grid-row:1;
  flex:none;
  min-width:0;
}
html body .kit-agency .kit-agency-inside{
  display:none;
  margin:0;
  padding:0;
  min-width:0;
}
html body .kit-agency .kit-agency-inside img{
  display:block;
  width:100%;
  height:auto;
  border-radius:10px;
  border:1px solid rgba(0,113,143,.22);
  background:#fff;
  box-shadow:0 1px 4px rgba(16,24,40,.08);
}
html body .kit-agency .kit-agency-inside figcaption{
  margin:6px 0 0;
  font-size:.72rem;
  line-height:1.3;
  color:#425466;
  text-align:center;
}
html body .kit-agency .kit-agency-pitch{
  list-style:disc;
  margin:0 0 10px;
  padding:0 0 0 1.1em;
  color:#425466;
  font-size:.88rem;
  line-height:1.4;
}
html body .kit-agency .kit-agency-pitch li{margin:0 0 5px}
html body .kit-agency .kit-agency-pitch li:last-child{margin-bottom:0}
html body .kit-agency h2{margin:0 0 8px}
html body .kit-agency a.go.buy{
  margin-top:10px;
  width:100%;
  white-space:normal;
  text-align:center;
}
@media (min-width:700px){
  html body .kit-agency{
    grid-template-columns:160px 160px minmax(0,1fr);
    gap:16px 20px;
    align-items:start;
  }
  html body .kit-agency > .im{
    box-sizing:border-box;
    width:160px;
    grid-column:1;
    grid-row:1;
  }
  html body .kit-agency .kit-agency-inside{
    display:block;
    grid-column:2;
    grid-row:1;
  }
  html body .kit-agency .kit-agency-body{
    grid-column:3;
    grid-row:1;
  }
  html body .kit-agency h2{font-size:1.1rem}
  html body .kit-agency .kit-agency-pitch{font-size:.95rem}
  html body .kit-agency a.go.buy{width:auto;max-width:100%;align-self:start}
}
@media (max-width:699px){
  html body .kit-agency{padding:12px}
  html body .kit-agency h2{font-size:.92rem;line-height:1.25}
  html body .kit-agency .kit-agency-pitch{font-size:.82rem}
  /* Cover + inside look stack on the left; pitch stays to the right */
  html body .kit-agency .kit-agency-inside{
    display:block;
    grid-column:1;
    grid-row:2;
  }
  html body .kit-agency .kit-agency-body{
    min-width:0;
    grid-column:2;
    grid-row:1 / span 2;
  }
}


/* ---- 8. Product cards: size to content, not to the full grid height.
   height/min-height:100% on grid items is resolved against the whole
   grid container in iOS Safari, so every card becomes as tall as the
   section and a large blank appears below the Buy button. Desktop
   rows still equalize via align-items:stretch (no percentage height).
   On phones, cards hug their content so a short card does not grow
   a blank under the button; leftover full-width cards do the same. */
html body .line-card,
html body .picks .pcard,
html body .card.bk-card,
html body .bk-card,
html body .bf-card,
html body .bf-cell > .bf-card,
html body .kcard,
html body article.kcard,
html body li.card,
html body .pack,
html body .learn-hub .card,
html body.packs-rebuild .packs-singles .pack,
html body.packs-rebuild .pack{
  height:auto !important;
  min-height:0 !important;
}
@media (max-width:899px){
  html body .line-grid > :last-child:nth-child(odd),
  html body .kit-full > :last-child:nth-child(odd),
  html body .cards > :last-child:nth-child(odd),
  html body .cards.m-grid > :last-child:nth-child(odd),
  html body .picks-grid > :last-child:nth-child(odd),
  html body .bf-grid > :last-child:nth-child(odd),
  html body .bf-grid.sm > :last-child:nth-child(odd){
    align-self:start;
    height:auto !important;
    min-height:0 !important;
  }
}
@media (max-width:640px){
  html body .line-grid,
  html body .line-grid.cols-2,
  html body .line-grid.cols-3,
  html body .line-grid.cols-4,
  html body .picks-grid,
  html body .kits .grid,
  html body .kit-full,
  html body .cards,
  html body .cards.m-grid,
  html body .bk-grid,
  html body .bf-grid,
  html body .bf-grid.sm,
  html body.learn-hub ul.cards,
  html body.learn-hub ul.cards.three,
  html body.packs-rebuild .packs-singles{
    align-items:stretch;
  }
}

/* ---- 9. Center leftover catalog cards so the last row looks intentional.
   /kits/ has 13 trade kits in 2 columns; /business/ has 26 packs in 4. */
@media (min-width:900px){
  html body .kit-full > :last-child:nth-child(odd){
    grid-column:1 / -1 !important;
    justify-self:center !important;
    width:calc((100% - 16px) / 2) !important;
    max-width:100%;
    align-self:start;
  }
}
@media (min-width:1000px){
  html body.packs-rebuild .packs-singles{
    justify-content:center;
  }
  html body.packs-rebuild .packs-singles > li{
    flex:0 1 calc(25% - 18px);
    max-width:calc(25% - 18px);
  }
}
@media (min-width:700px) and (max-width:999px){
  html body.packs-rebuild .packs-singles{
    justify-content:center;
  }
  html body.packs-rebuild .packs-singles > li{
    flex:0 1 calc(33.333% - 18px);
    max-width:calc(33.333% - 18px);
  }
}

/* ---- 10. Equal-height rows; Buy pinned to the bottom; no iOS height:100%.
   Grid stretch sizes cards to the ROW only. Cards are flex columns with
   height:auto (never height:100%, which iOS resolves against the whole grid).
   margin-top:auto goes on the buy block so leftover space sits above the button. */
html body .line-grid,
html body .picks-grid,
html body .cards,
html body .cards.m-grid,
html body .bk-grid,
html body .kit-full,
html body .kits .grid,
html body .bf-grid,
html body .bf-grid.sm,
html body.learn-hub ul.cards,
html body.packs-rebuild .packs-singles{
  align-items:stretch;
}
html body .line-card,
html body .picks .pcard,
html body .card.bk-card,
html body .bk-card,
html body .bf-card,
html body .kcard,
html body article.kcard,
html body li.card,
html body .pack,
html body .learn-hub .card{
  display:flex !important;
  flex-direction:column !important;
  height:auto !important;
  min-height:0 !important;
}
html body .bk-card .bk-buyblock,
html body .card .bk-buyblock,
html body .picks .us-buy-actions,
html body .bf-card .us-buy-actions,
html body .card .us-buy-actions,
html body .line-card .foot,
html body .kit-full .kcard .go-row,
html body .pack .btn,
html body .pack a.btn-primary{
  margin-top:auto;
}
/* If a card has no buyblock wrapper, pin the Buy button itself. */
html body .bk-card > a.bk-buy,
html body .bk-card > a.go.bk-buy,
html body li.card > a.go,
html body .learn-hub .card > a.go,
html body .kcard > a.go,
html body article.kcard > a.go{
  margin-top:auto;
}
html body .bk-card a.m-cardlink,
html body .bk-card a.bk-link{
  flex:0 0 auto;
}
/* Footer Atlas group: a labeled wrapping row, tidy on phone and desktop */
footer.tai-newfoot nav.tai-fnav-atlas{
  display:flex;
  flex-wrap:wrap;
  justify-content:center;
  align-items:center;
  gap:0 14px;
  margin:0 0 12px;
}
footer.tai-newfoot nav.tai-fnav-atlas .tai-fnav-label{
  display:inline-flex;
  align-items:center;
  min-height:40px;
  padding:0 4px;
  font-weight:800;
  color:var(--tai-ink,#0f1b2d);
}
footer.tai-foot nav.foot-atlas{
  display:flex;
  flex-wrap:wrap;
  justify-content:center;
  gap:0 14px;
  margin:8px 0 10px;
}
footer.tai-foot nav.foot-atlas .tai-fnav-label{
  font-weight:800;
  display:inline-flex;
  align-items:center;
  min-height:40px;
  padding:0 4px;
}
