/* fix-s3: layout and interaction polish (third pass, product/UX) */

/* 1. Sub page heroes sat 60px right of the logo and of every section below. Align all heroes to the same edge. */
.hero-in{max-width:calc(1320px + var(--gut) + var(--gut-r))}

/* 2. Section headers on About, Cases, White papers and Locations stacked the intro under the title, leaving the right half empty. Title left, intro right, like every other page. */
@media(min-width:1000px){
  html body:is([data-page="about"],[data-page="cases"],[data-page="whitepapers"],[data-page="locations"]) section:not(#facts) .sh{flex-direction:row;flex-wrap:nowrap;align-items:flex-end;justify-content:space-between;gap:48px}
  html body:is([data-page="about"],[data-page="cases"],[data-page="whitepapers"],[data-page="locations"]) section:not(#facts) .sh>div{flex:1 1 auto;min-width:0}
  html body:is([data-page="about"],[data-page="cases"],[data-page="whitepapers"],[data-page="locations"]) section:not(#facts) .sh>p{flex:0 1 28em;max-width:28em;padding-bottom:6px}
}

/* 3. Mobile drawer: twelve equal links pushed the Book button below the fold. Primary links stay large, secondary links sit in a two column grid. */
@media(max-width:900px){
  .drawer .dr-links{grid-template-columns:1fr 1fr;column-gap:20px}
  .drawer .dr-links a{grid-column:1/-1;transition:padding .25s var(--ease)}
  .drawer .dr-links a:nth-child(n+5){grid-column:auto;font-size:18px;font-weight:500;padding:12px 0}
  .drawer .dr-links a:active{padding-left:6px}
  .drawer a.dr-cta{margin-top:24px}
}
/* 4. Drawer shows where you are */
body[data-page="home"] .drawer .dr-links a[href="/"],
body[data-page="vera"] .drawer .dr-links a[href="/vera-ai"],
body[data-page="oracle"] .drawer .dr-links a[href="/oracle-services"],
body[data-page="cases"] .drawer .dr-links a[href="/case-studies"],
body[data-page="whitepapers"] .drawer .dr-links a[href="/whitepapers"],
body:is([data-page="insights"],[data-page="article"]) .drawer .dr-links a[href="/insights"],
body[data-page="studio"] .drawer .dr-links a[href="/studio"],
body[data-page="about"] .drawer .dr-links a[href="/about-us"],
body[data-page="faq"] .drawer .dr-links a[href="/faq"],
body[data-page="locations"] .drawer .dr-links a[href="/locations"],
body[data-page="contact"] .drawer .dr-links a[href="/contact"]{text-decoration:underline;text-decoration-color:var(--navy);text-decoration-thickness:3px;text-underline-offset:6px}

/* 5 + 6. Home, Twelve practices: the pinned rail left a white strip under it while pinned. Fill the screen, center the content, and show how far through the twelve you are. */
@media(min-width:761px){
  body[data-page="home"] #railSec{min-height:100vh;display:flex;flex-direction:column;justify-content:center;box-sizing:border-box;position:relative}
  body[data-page="home"] #railSec::after{content:"";position:absolute;left:var(--gut);right:var(--gut-r);bottom:clamp(36px,5vh,56px);height:3px;border-radius:3px;max-width:1320px;margin-inline:auto;
    background:linear-gradient(var(--navy),var(--navy)) 0 0/calc(var(--rp,0) * 100%) 100% no-repeat,rgba(27,42,74,.16)}
}

/* 7. Home 390: the calculator button was the only half width CTA on mobile */
@media(max-width:600px){
  body[data-page="home"] #calc a.btn[href="/contact#book"]{justify-self:stretch!important;width:100%;justify-content:center}
}

/* 8. Home 390: the fee chart labels shrank to about 8px. Bring them to readable size. */
@media(max-width:600px){
  body[data-page="home"] #engine svg text[font-size="13"]{font-size:17px}
  body[data-page="home"] #engine svg text[font-size="14"]{font-size:16px}
  body[data-page="home"] #engine svg text[font-size="15"],
  body[data-page="home"] #engine svg text[font-size="16"]{font-size:18px}
  body[data-page="home"] #engine svg text[font-size="22"]{font-size:26px}
}

/* 9. Studio: the film's info card stopped 85px short of the player. Equal heights, note pinned to the bottom, full description. */
@media(min-width:901px){
  body[data-page="studio"] #featured .theater{align-items:stretch}
  body[data-page="studio"] #featured .chap-panel{align-self:stretch;display:flex;flex-direction:column}
  body[data-page="studio"] #featured .chap-panel>p:not(.small){-webkit-line-clamp:unset;line-clamp:unset;display:block;overflow:visible}
  body[data-page="studio"] #featured .chap-panel>.small{margin-top:auto;padding-top:14px}
}

/* 10. Studio 390: the sticky filter bar covered over a quarter of the screen. Compact single row tools. */
@media(max-width:600px){
  body[data-page="studio"] .st-bar{padding:8px 0 6px}
  body[data-page="studio"] .st-tools{flex-wrap:nowrap;gap:8px}
  body[data-page="studio"] .st-q{flex:1 1 auto;min-width:0}
  body[data-page="studio"] .st-q input,body[data-page="studio"] .st-s select{height:40px;font-size:14px;padding:0 14px}
  body[data-page="studio"] .st-s select{padding-right:26px;max-width:124px}
  body[data-page="studio"] .st-tools .count{display:none}
  body[data-page="studio"] #stClear{flex:none;font-size:14px}
  body[data-page="studio"] .st-chips{padding-top:8px}
  body[data-page="studio"] .st-chips .chip{padding:7px 14px;font-size:14px;min-height:36px}
  body[data-page="studio"] .st-chips.small{padding-top:6px}
}

/* 11. FAQ accordions (FAQ, Oracle, Article): hover feedback, open item marked, answer eases in */
.faq summary{transition:color .2s,padding .25s var(--ease)}
@media(hover:hover){.faq summary:hover{color:var(--gold-lo)}}
.faq details[open]{box-shadow:inset 3px 0 0 var(--sun)}
.faq details[open] summary,.faq details[open]>p,.faq details[open]>div{padding-left:18px}
.faq details[open]>p,.faq details[open]>div{animation:s3-ans .35s var(--ease) both}
@keyframes s3-ans{from{opacity:0;transform:translateY(-6px)}to{opacity:1;transform:none}}
@media(prefers-reduced-motion:reduce){.faq details[open]>p,.faq details[open]>div{animation:none}}

/* 12. About: two answers stretched full width into 170 character lines. Six answers now sit in three even rows of two. */
@media(min-width:861px){
  html body[data-page="about"] .aqas .aqa:nth-child(n+2){grid-column:auto}
  html body[data-page="about"] .aqas{grid-auto-flow:row}
}

/* 13. Studio rows: the left arrow looked clickable at the start of a row and the right one at the end. They now dim when there is nowhere to go. */
.srail-n .ar{transition:opacity .2s,background .2s}
.srail-n .ar:disabled{opacity:.35;cursor:default;background:#fff!important}

/* 14. FAQ 390: the two buttons under the fee film had different widths. Full width pair, like every other mobile CTA. */
@media(max-width:600px){
  body[data-page="faq"] .btn-row{display:grid;grid-template-columns:1fr;gap:10px}
  body[data-page="faq"] .btn-row .btn{width:100%;justify-content:center}
}

/* 15. FAQ 390: seven topic chips wrapped into four ragged rows above the answers. One swipeable row. */
@media(max-width:600px){
  body[data-page="faq"] .faq-nav{flex-wrap:nowrap;overflow-x:auto;scrollbar-width:none;margin-inline:calc(var(--gut) * -1);padding:2px var(--gut);scroll-snap-type:x proximity;scroll-padding-inline:var(--gut);-webkit-mask-image:linear-gradient(90deg,#000 calc(100% - 40px),transparent);mask-image:linear-gradient(90deg,#000 calc(100% - 40px),transparent)}
  body[data-page="faq"] .faq-nav::-webkit-scrollbar{display:none}
  body[data-page="faq"] .faq-nav a{flex:none;white-space:nowrap;scroll-snap-align:start}
}

/* 16. Oracle 390: the questions heading was centered while everything around it reads left. */
@media(max-width:600px){
  body[data-page="oracle"] .wrap.center{text-align:left}
  body[data-page="oracle"] .wrap.center .kicker{justify-content:flex-start}
  body[data-page="oracle"] .wrap.center .h2{margin-inline:0}
}

/* 17. Mobile: section header buttons (All films, All case studies) were half width on some pages and full width on others. Full width everywhere. */
@media(max-width:600px){
  .sh>.btn{width:100%;justify-content:center}
}

/* 18. Mobile closing panel: Book a meeting and Send the quote were two different short widths on every page except Home. Full width pair everywhere. */
@media(max-width:600px){
  .cta-big .btn-row{display:grid;grid-template-columns:1fr;gap:10px}
  .cta-big .btn-row .btn{width:100%;justify-content:center}
}

/* 19. Home 390: the first vendor card in the swipe row sat flush against the screen edge, 20px left of the heading above it. */
@media(max-width:760px){
  body[data-page="home"] .rail-wrap{scroll-padding-inline:var(--gut)}
}
