/* Mobile home carousel mechanics: requires validation in live Elementor.
   This file deliberately does not touch blog cards or desktop. */
@media (max-width:767px) {
  body.home .fidar-services .fidar-services__inner {
    height:auto!important; min-height:0!important; overflow:hidden!important;
  }
  body.home .fidar-services .fidar-services__grid {
    position:relative!important; inset:auto!important; transform:none!important;
    display:grid!important; grid-template-rows:repeat(2, minmax(0,auto))!important;
    grid-template-columns:repeat(5,calc((100% - 2 * 10px) / 3))!important;
    grid-auto-flow:row!important; gap:8px 10px!important;
    width:100%!important; max-width:100%!important; height:auto!important;
    overflow-x:auto!important; overflow-y:hidden!important;
    scroll-snap-type:x mandatory; overscroll-behavior-inline:contain;
    scrollbar-width:none; -webkit-overflow-scrolling:touch;
  }
  body.home .fidar-services .fidar-services__grid::-webkit-scrollbar {display:none;}
  body.home .fidar-services .fidar-services__card:nth-child(n) {
    display:flex!important; min-width:0!important; scroll-snap-align:start;
  }
  body.home .fidar-portfolio,
  body.home .fidar-portfolio .fidar-portfolio__inner,
  body.home .elementor-widget-fidar-portfolio,
  body.home .elementor-widget-fidar-portfolio>.elementor-widget-container {
    height:auto!important; min-height:0!important; overflow:visible!important;
  }
  body.home .fidar-portfolio .fidar-portfolio__inner {
    position:relative!important; isolation:isolate!important;
  }
  body.home .fidar-portfolio .fidar-portfolio__layout {
    position:relative!important; top:auto!important; right:auto!important; bottom:auto!important; left:auto!important; height:auto!important; min-height:0!important; overflow:visible!important; isolation:isolate!important;
  }
  /* Stationary glow belongs to the section's backdrop; it is NOT a card shadow. */
  body.home .fidar-portfolio .fidar-portfolio__layout:before {
    content:""; position:absolute; pointer-events:none; z-index:0;
    inset:0 0 17px; background:radial-gradient(ellipse 50% 48% at 50% 48%,rgba(65,153,183,.21),transparent 91%);
    filter:blur(17px);
  }
  body.home .fidar-portfolio .fidar-portfolio__side {
    position:relative!important; display:flex!important; flex-direction:column!important;
    width:100%!important; max-width:100%!important; height:auto!important;
    overflow:visible!important; z-index:1!important;
  }
  body.home .fidar-portfolio .fidar-portfolio__grid {
    position:relative!important; display:flex!important; flex-wrap:nowrap!important;
    gap:clamp(6px,2.31vw,10px)!important;
    width:100%!important; max-width:100%!important; height:auto!important;
    padding:0!important; margin:0!important;
    overflow-x:auto!important; overflow-y:hidden!important;
    scroll-snap-type:x mandatory; overscroll-behavior-inline:contain;
    scrollbar-width:none; -webkit-overflow-scrolling:touch;
  }
  body.home .fidar-portfolio .fidar-portfolio__grid::-webkit-scrollbar {display:none;}
  body.home .fidar-portfolio .fidar-portfolio__card:nth-child(n) {
    display:block!important; flex:0 0 calc((100% - 3 * clamp(6px,2.31vw,10px)) / 4)!important;
    width:calc((100% - 3 * clamp(6px,2.31vw,10px)) / 4)!important;
    max-width:none!important; min-width:0!important;
    box-shadow:none!important; scroll-snap-align:start;
  }
  body.home .fidar-portfolio .fidar-portfolio__button {
    position:relative!important; top:auto!important; right:auto!important; bottom:auto!important; left:auto!important;
    transform:none!important; align-self:center!important;
    flex:0 0 auto!important; max-width:100%!important; margin:14px auto 0!important;
  }
}
/* End stops should align the final card edge (RTL), not snap slightly past it. */
@media (max-width:767px) {
  body.home .fidar-portfolio .fidar-portfolio__card:last-child,
  body.home .fidar-services .fidar-services__card:last-child {scroll-snap-align:end;}
}

/* Mobile touch devices must not stick on a synthetic
   :hover after a tap. Keep genuine keyboard-focus pausing intact. */
@media (max-width:767px) and (hover:none) {
  body.home .fidar-clients.fidar-clients--carousel:not(.is-paused)
  .fidar-clients__row:hover .fidar-clients__row-track {
    animation-play-state:running!important;
  }
}

/* Chromium RTL fractional rounding: reserve two pixels at the terminal
   scroll edge. Verified in isolated fixture at 320/360/390/430px;
   card dimensions, gaps, and desktop remain unchanged. */
@media (max-width:767px) {
  body.home .fidar-services .fidar-services__grid,
  body.home .fidar-portfolio .fidar-portfolio__grid {
    padding-left:2px!important;
    box-sizing:border-box!important;
  }
}
