/* Concrete Designs — Services page only (linked from services.html).
   1) Site Visits media composition on phones   2) hero video fallback   3) scroll controls for the two horizontal lists */

/* ---------- 1. Site Visits media ----------------------------------------------------------------
   Cause of the flattened pictures: services.css line 197 (.sv-fig--duo .sv-duo{aspect-ratio:16/10}) comes AFTER the
   phone rule at line 141 and silently wins, so two stacked pictures were squeezed into one 16:10 box (≈105px each).
   Cause of the cut head: the third tile (portrait photo) was forced to 16:10 on phones.
   Ratios below are taken from the real files: site-02 = 1050×1400 (3:4), site-11 = 1400×1050 (4:3), visit-roof = 960×1280 (3:4). */
@media (max-width:699px){
  #site-visits .sv-fig--duo .sv-duo{aspect-ratio:auto;grid-template-columns:minmax(0,1fr)}
  #site-visits .sv-fig--duo .sv-duo>*:nth-child(1){aspect-ratio:3/4}
  #site-visits .sv-fig--duo .sv-duo>*:nth-child(2){aspect-ratio:4/3}
  #site-visits .sv-strip--3 .sv-tile:nth-child(3){aspect-ratio:4/5}
}
/* tablet: the two pictures sit side by side at their own natural ratios (3:4 and 4:3) so neither is cropped */
@media (min-width:700px) and (max-width:999px){
  #site-visits .sv-fig--duo .sv-duo{grid-template-columns:minmax(0,.75fr) minmax(0,1.3333fr);aspect-ratio:2.1/1}
}
/* keep the head in frame at every size (only this one picture) */
#site-visits .sv-tile img[src*="visit-roof"]{object-position:50% 0}

/* ---------- 2. Hero video fallback (only used when the phone refuses to autoplay) ------------------- */
.sv-hero.sv-static .sv-hero-vid{animation:svDrift 24s ease-in-out infinite alternate;will-change:transform}
.sv-hero.sv-static:not(.sv-inview) .sv-hero-vid{animation-play-state:paused}
@keyframes svDrift{from{transform:scale(1.03)}to{transform:scale(1.11) translate3d(-1.5%,-1%,0)}}
@media (prefers-reduced-motion:reduce){.sv-hero.sv-static .sv-hero-vid{animation:none}}
@media (max-width:640px){.sv-hero{padding-bottom:80px}}     /* lifts the service list clear of the floating WhatsApp button */

/* ---------- 3. Scroll controls (hero list + sticky index bar) -------------------------------------- */
.sc-wrap{display:contents;--sc-bg:#F3F0E8;--sc-fg:#16171A;--sc-btn:#F3F0E8;--sc-bd:rgba(22,23,26,.42);--sc-dfg:rgba(22,23,26,.3);--sc-dbd:rgba(22,23,26,.16);--sc-hv:#16171A;--sc-hvfg:#F3F0E8}
.sc-wrap--chips{--sc-bg:rgba(10,11,13,.96);--sc-fg:#F3F0E8;--sc-btn:rgba(11,12,14,.94);--sc-bd:rgba(242,240,232,.55);--sc-dfg:rgba(243,240,232,.32);--sc-dbd:rgba(242,240,232,.2);--sc-hv:#F3F0E8;--sc-hvfg:#0B0C0E}
.sc-pair{position:absolute;right:8px;top:50%;transform:translateY(-50%);z-index:3;display:none;gap:8px}
.sc-wrap.sc-on{display:block;position:relative}              /* only becomes a real box when the list actually scrolls */
.sc-wrap.sc-on .sc-pair{display:flex}
.sc-wrap.sc-on::after{content:"";position:absolute;top:0;right:0;bottom:0;width:118px;z-index:2;pointer-events:none;background:linear-gradient(270deg,var(--sc-bg) 42%,transparent)}
.sc-btn{position:relative;width:36px;height:36px;display:grid;place-items:center;padding:0;border:1px solid var(--sc-bd);border-radius:50%;background:var(--sc-btn);color:var(--sc-fg);cursor:pointer;touch-action:manipulation;-webkit-tap-highlight-color:transparent;transition:background .25s,color .25s,opacity .25s}
.sc-btn::before{content:"";position:absolute;inset:-4px}                     /* 44 × 44 touch target */
.sc-btn svg{width:15px;height:15px}
.sc-prev svg{transform:scaleX(-1)}
.sc-btn[disabled]{color:var(--sc-dfg);border-color:var(--sc-dbd);cursor:default}   /* dimmed, but the button stays opaque so text never shows through */
.sc-btn:focus-visible{outline:2px solid var(--gold);outline-offset:3px}
@media (hover:hover){.sc-btn:not([disabled]):hover{background:var(--sc-hv);color:var(--sc-hvfg)}}
.sc-wrap.sc-on>.sv-chips::after,.sc-wrap.sc-on>.sv-idx::after{content:"";flex:0 0 100px}   /* lets the last item scroll clear of the buttons */
@media (max-width:999px){                                                     /* phone / tablet: the horizontal bar sticks under the header */
  .sc-wrap--idx{display:block;position:sticky;top:var(--hh);z-index:20}
  .sc-wrap--idx>.sv-idx{position:static}
}
@media (min-width:1000px){
  .sc-wrap--idx .sc-pair{display:none!important}
  .sc-wrap--idx::after{display:none}
}
