/* Teradix homepage, modules section ("Seven modules. One cycle."): phone and tablet fixes.
   Loads AFTER css/teradix-modules.css. Only max-width rules, every selector scoped under .mods,
   logical properties so the same rules hold on a right-to-left page. Desktop is untouched. */

/* ---------- stacked layout (phones and portrait tablets, same breakpoint as the base file) ---------- */
@media (max-width:820px){
  /* The panel is now a tall stack the visitor scrolls through. Auto-advance would swap it under
     their thumb every 7s, so the timer bar is switched off: with no animation there is no
     animationend, and the script never moves on by itself. Tapping a tab still works. */
  .mods.mods--auto .mods__tab[aria-selected="true"] .mods__bar{animation:none}

  /* labels never below 12px */
  .mods .mods__no{font-size:12px}
  .mods .mods__flow dt{font-size:12px;flex-basis:48px}
  .mods .mods__tab{min-height:48px;text-align:start}

  /* the module name is a link: give it a 44px tap height without moving the lime underline */
  .mods .mods__head h3{margin-top:6px}
  .mods .mods__head h3 a{display:inline-block;padding-top:10px;min-height:44px}

  /* one measure for the whole stack: heading, screen, caption and list share the same edges */
  .mods .mods__head,
  .mods .mods__body{max-width:none}
  .mods .mods__win,
  .mods .mods__fig figcaption{max-width:none;margin-inline:0}
  .mods .mods__sum{max-width:40em}

  /* the connector card sizes to its content instead of a fixed ratio */
  .mods .mods__conn{aspect-ratio:auto;gap:22px}

  /* direction-safe list bullets, counter and window title */
  .mods .mods__feats li{padding:14px 0;padding-inline-start:26px}
  .mods .mods__feats li::before{left:auto;inset-inline-start:0}
  .mods .mods__count b{margin-right:0;margin-inline-end:-8px}
  .mods .mods__chrome span{margin-left:0;margin-inline-start:8px}

  /* Stacked panels differ a lot in height (a product screen against the short connector card).
     Sharing one grid cell would stretch the short ones and leave a hole, so only the open panel
     takes space here; it fades in with opacity alone. */
  .mods.mods--js .mods__panel{align-content:start;transition:none}
  .mods.mods--js .mods__panel:not(.on){display:none}
  .mods.mods--js .mods__panel.on{animation:modsStackIn .35s ease both}

  /* nothing in the stack may push the page sideways */
  .mods .mods__stage,
  .mods .mods__panel{min-width:0}
  .mods .mods__feats b,
  .mods .mods__feats span,
  .mods .mods__connl li,
  .mods .mods__flow dd{overflow-wrap:anywhere}
}

/* ---------- portrait tablet and large phone: use the width the stack now has ---------- */
@media (min-width:600px) and (max-width:820px){
  .mods .mods__tab{padding:14px 12px 16px;font-size:14px}
  .mods .mods__feats{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));column-gap:32px}
  .mods .mods__connl{grid-template-columns:repeat(3,minmax(0,1fr))}
  .mods .mods__conn{padding:28px}
}

/* ---------- phone ---------- */
@media (max-width:520px){
  .mods .mods__tab{padding:8px 10px 10px;min-height:52px;font-size:14px;line-height:1.2}
  .mods .mods__head h3{font-size:clamp(26px,7.4vw,30px);overflow-wrap:anywhere}
  .mods .mods__sum{font-size:17px}
  .mods .mods__chrome{height:32px;padding-inline:12px}
  .mods .mods__fig figcaption{font-size:13px}
  .mods .mods__conn{padding:18px 16px 20px}
  .mods .mods__connl{column-gap:16px}
  .mods .mods__connl li{font-size:15.5px}
  .mods .mods__flow dd{font-size:15px}
  /* full-width action: an easy thumb target, the offset block stays inside the gutter */
  .mods .mods__cta{display:flex;justify-content:space-between;margin-inline-end:7px;padding-inline:20px;min-height:52px}
}

/* ---------- very narrow phone (320 to 359px): one tab per row, names never break mid-word ---------- */
@media (max-width:359px){
  .mods.mods--js .mods__tabs{grid-template-columns:minmax(0,1fr)}
  .mods .mods__tab:last-child{grid-column:auto}
  .mods .mods__connl{grid-template-columns:minmax(0,1fr)}
}

/* the base file keeps the tablet two-column panel down to 821px; in that band the copy column is narrow */
@media (min-width:821px) and (max-width:1100px){
  .mods .mods__tab{padding-inline:8px;font-size:13.5px}
  .mods .mods__head h3{margin-top:8px}
  .mods .mods__head h3 a{display:inline-block;padding-top:8px;min-height:44px}
  .mods .mods__feats li{padding:14px 0;padding-inline-start:26px}
  .mods .mods__feats li::before{left:auto;inset-inline-start:0}
}

@media (max-width:820px){
  @keyframes modsStackIn{from{opacity:0}to{opacity:1}}
}
@media (max-width:820px) and (prefers-reduced-motion:reduce){
  .mods.mods--js .mods__panel.on{animation:none}
}
