/* S5: front end QA pass. Breakpoints (tablet 768 and 1024 first), keyboard, reduced motion. */

/* 1. Headings and copy: no one word last lines */
h1,h2,h3,h4,.display,.h2{text-wrap:balance}
p,.lede,li{text-wrap:pretty}

/* 2. Home vendor rail: while it is pinned, fill the screen so no white strip shows under it */
@media(min-width:761px){
  #railSec{min-height:100vh;min-height:100svh;display:flex;flex-direction:column;justify-content:center}
}
/* 3. Reduced motion: the rail does not scroll itself, so let people swipe or scroll it */
@media(min-width:761px) and (prefers-reduced-motion:reduce){
  #railSec .rail-wrap{overflow-x:auto;scroll-snap-type:x mandatory;scrollbar-width:thin;padding-bottom:12px}
  #railSec .vcard{scroll-snap-align:start}
}

/* 4. Closed menu drawer: keep its links out of the keyboard tab order */
.drawer{visibility:hidden;transition:clip-path .8s var(--ease),visibility 0s linear .8s}
.drawer.open{visibility:visible;transition:clip-path .8s var(--ease),visibility 0s}
html.s5-lock,html.s5-lock body{overflow:hidden}
@media(min-width:700px){.drawer .btn{align-self:flex-start;min-width:320px}}

/* 5. Focus ring on video players (native controls had none) */
video:focus-visible{outline:3px solid var(--navy,#1B2A4A);outline-offset:3px}

/* 6. Hero stat rows: four columns were cramped on tablets ("USD 15B+" broke over two lines) */
@media(min-width:761px) and (max-width:900px){
  .hero-stats{grid-template-columns:repeat(2,minmax(0,1fr))}
  .hero-stats div:nth-child(3){border-left:0;padding-left:0}
  .hero-stats div{padding-bottom:18px}
}
/* 7. Scroll cue collided with the stat row at laptop and tablet widths */
@media(max-width:1180px){.scroll-cue{display:none}}

/* 8. Hero buttons dropped to two lines at 1024 to 1240 by a few pixels */
@media(min-width:901px) and (max-width:1240px){
  .hero-in.hero-2 .btn-row .btn{padding-inline:22px}
  .hero-in.hero-2 .btn-row{gap:10px}
}
@media(min-width:901px) and (max-width:1100px){
  .hero-in.hero-2 .btn-row .btn{padding-inline:16px;font-size:15px}
  #vera .btn-row{flex-wrap:nowrap;gap:10px}
  #vera .btn-row .btn{padding-inline:18px;font-size:15px;white-space:nowrap}
}

/* 9. Home case cards at 901 to 1240: the big percentage pushed "saved" into the card edge */
@media(min-width:901px) and (max-width:1240px){
  body[data-page="home"] .case-top{flex-direction:column;gap:6px}
  body[data-page="home"] .case .tag{white-space:nowrap;overflow:hidden;text-overflow:ellipsis;max-width:100%}
}

/* 10. Vera apps grid: nine cards left an empty grey cell on tablets */
@media(min-width:600px) and (max-width:980px){
  .apps>.app:last-child:nth-child(odd){grid-column:1/-1}
}

/* 11. Three film cards in two columns left a hole (article, Oracle) */
@media(min-width:600px) and (max-width:980px){
  .vids:not(:has(> :nth-child(4))){grid-template-columns:repeat(3,minmax(0,1fr))}
  .vids:not(:has(> :nth-child(4))) h4{font-size:16px;line-height:1.3}
  .vids:not(:has(> :nth-child(4))) .rel{font-size:12.5px;text-wrap:balance}
}

/* 12. Article "Keep reading": three short cards side by side on tablets */
@media(min-width:600px) and (max-width:860px){
  .related{grid-template-columns:repeat(3,minmax(0,1fr));gap:14px}
  .related .rcard{padding:20px}
  .related .rcard h4{font-size:18px}
}

/* 13. Vendor chip rows that scroll sideways: fade the edge so it reads as "more" */
@media(max-width:1060px){
  body:is([data-page="cases"],[data-page="whitepapers"]) .filters{-webkit-mask-image:linear-gradient(90deg,#000 calc(100% - 48px),transparent);mask-image:linear-gradient(90deg,#000 calc(100% - 48px),transparent)}
}

/* 14. Booking day picker: last day was clipped on tablets */
@media(min-width:621px) and (max-width:1100px){
  body[data-page="contact"] .days{display:grid;grid-auto-flow:column;grid-auto-columns:minmax(0,1fr);gap:6px;overflow:visible}
  body[data-page="contact"] .days .day{width:auto;min-width:0}
}

/* 15. Studio rails on tablets: two cards in view instead of one oversized card */
@media(min-width:600px) and (max-width:900px){
  body[data-page="studio"] .srail-t{grid-auto-columns:calc(50% - 8px)}
}
