/* AZ Maçonnerie V2.0 — Interface mobile autonome
   Chargé uniquement jusqu'à 700 px. */
@media(max-width:960px){
  .menu{display:block}.nav{display:none;position:absolute;top:var(--header);left:0;right:0;background:#171513;padding:1.2rem;flex-direction:column;align-items:flex-start}.nav.open{display:flex}
  .intro,.story-step,.precision-wrap,.ba-wrap,.contact-grid{grid-template-columns:1fr}
  .story-step:nth-child(even) .story-image{order:0}
  .service-grid{grid-template-columns:repeat(2,1fr)}
  .precision-image{min-height:65svh}.precision-copy{padding:4rem 1rem}
}

@media(max-width:640px){
  .container{width:min(calc(100% - 1.2rem),var(--max))}
  .hero-content{padding-bottom:2.5rem}.actions .btn{width:100%}.hero-proof{gap:1rem}.hero-proof>div{width:calc(50% - .5rem)}
  .service-grid,.form-grid,.footer-grid{grid-template-columns:1fr}.full{grid-column:auto}
  .story-image{min-height:380px}.services-head{display:block}.services-head p{margin-top:1rem}
  .delivery{min-height:78svh}.fab{width:54px;height:54px}
}

@media(max-width:960px){
 .hero-v14{min-height:760px}.hero-v14 .hero-content{padding-top:calc(var(--header) + 5rem)}
 .hero-overlay{background:linear-gradient(90deg,rgba(5,5,5,.87),rgba(5,5,5,.48) 66%,rgba(5,5,5,.2)),linear-gradient(0deg,rgba(5,5,5,.62),transparent 55%)}
 .method-cards{grid-template-columns:repeat(3,1fr)}
}

@media(max-width:640px){
 .hero-v14{min-height:760px;align-items:end}.hero-v14 .hero-content{padding:calc(var(--header) + 5rem) 0 6.7rem;align-self:end}
 .hero-v14 h1{font-size:clamp(2.75rem,13vw,4.15rem);max-width:9.5ch}.hero-v14 .hero-copy{font-size:1rem;max-width:34ch}
 .hero-v14 .hero-slide img{object-position:center center}.hero-v14 .hero-slide:nth-child(1) img{object-position:57% center}.hero-v14 .hero-slide:nth-child(2) img{object-position:58% center}.hero-v14 .hero-slide:nth-child(3) img{object-position:47% center}.hero-v14 .hero-slide:nth-child(4) img{object-position:42% center}.hero-v14 .hero-slide:nth-child(5) img{object-position:55% center}
 .hero-overlay{background:linear-gradient(0deg,rgba(3,3,3,.92) 0%,rgba(3,3,3,.68) 46%,rgba(3,3,3,.16) 78%),linear-gradient(90deg,rgba(3,3,3,.28),transparent)}
 .hero-controls{right:auto;left:50%;transform:translateX(-50%);bottom:1.25rem}.hero-arrow{display:none}
 .method-strip{padding:1.8rem 0}.method-cards{display:flex;overflow-x:auto;scroll-snap-type:x mandatory;padding-bottom:.5rem;gap:.75rem}.method-card{flex:0 0 78%;min-height:170px;scroll-snap-align:start}
}

@media(max-width:960px){
  .hero-v14{min-height:700px}
  .hero-v14 .hero-content{padding:calc(var(--header) + 4rem) 0 4.6rem}
  .hero-v14 h1{font-size:clamp(2.7rem,8vw,4.7rem);max-width:10.5ch}
  .hero-overlay{
    background:
      linear-gradient(90deg,rgba(5,5,5,.81),rgba(5,5,5,.43) 65%,rgba(5,5,5,.13)),
      linear-gradient(0deg,rgba(5,5,5,.46),transparent 55%);
  }
}

@media(max-width:640px){
  .hero-v14{min-height:720px}
  .hero-v14 .hero-content{padding:calc(var(--header) + 3.6rem) 0 5.1rem}
  .hero-v14 h1{font-size:clamp(2.45rem,12vw,3.65rem);max-width:10.8ch;line-height:1}
  .hero-v14 .hero-copy{font-size:.98rem;max-width:32ch;margin-top:.9rem}
  .hero-v14 .actions{margin-top:1.2rem}
  .hero-overlay{
    background:
      linear-gradient(0deg,rgba(3,3,3,.90) 0%,rgba(3,3,3,.65) 42%,rgba(3,3,3,.12) 76%),
      linear-gradient(90deg,rgba(3,3,3,.20),transparent 70%);
  }
}

@media(max-width:960px){
  .method-detail{grid-template-columns:1fr;min-height:0}
  .method-detail-media{min-height:360px;aspect-ratio:16/10}
}

@media(max-width:640px){
  .method-heading{text-align:left}
  .method-details{margin-top:1rem}
  .method-detail{border-radius:1rem}
  .method-detail-media{min-height:240px;aspect-ratio:4/3}
  .method-detail-copy{padding:1.35rem}
  .method-detail-no{font-size:2.7rem}
  .method-detail-copy h3{font-size:1.85rem}
  .method-detail-copy p{font-size:1rem}
}

@media (max-width:700px){
  .method-strip{
    padding:1.75rem 0 2.15rem;
  }

  .method-heading{
    margin-bottom:1.1rem;
    text-align:left;
  }

  .method-cards{
    display:block;
    overflow:visible;
    padding:0;
  }

  .method-card{
    width:100%;
    min-height:0;
    display:grid;
    grid-template-columns:auto minmax(0,1fr) auto;
    align-items:center;
    gap:.9rem;
    padding:1rem .95rem;
    margin:0;
    border:0;
    border-top:1px solid rgba(23,21,19,.13);
    border-radius:0;
    overflow:visible;
    background:transparent;
    color:#171513;
    isolation:auto;
    scroll-snap-align:none;
    outline:0;
  }

  .method-card:first-of-type{
    border-top:0;
  }

  .method-card img,
  .method-card:after,
  .method-card.active:before{
    display:none;
  }

  .method-card:focus-visible{
    outline:2px solid var(--clay);
    outline-offset:3px;
  }

  .method-card .method-no{
    position:static;
    display:block;
    min-width:2.35rem;
    color:var(--clay);
    font-size:1.45rem;
    line-height:1;
    text-shadow:none;
  }

  .method-card-copy{
    position:static;
    display:grid;
    gap:.18rem;
    min-width:0;
    text-align:left;
  }

  .method-card-copy strong{
    color:#171513;
    font-size:1.08rem;
    line-height:1.15;
  }

  .method-card-copy small{
    display:block;
    color:#6d655e;
    font-size:.86rem;
    line-height:1.35;
  }

  .method-card::before{
    content:"+";
    position:static;
    display:grid;
    place-items:center;
    grid-column:3;
    grid-row:1;
    width:2rem;
    height:2rem;
    border:1px solid rgba(23,21,19,.2);
    border-radius:50%;
    color:#171513;
    font-size:1.35rem;
    line-height:1;
  }

  .method-card.active{
    margin-top:.15rem;
    padding-top:1.05rem;
    background:#fffaf4;
    box-shadow:inset 4px 0 0 var(--clay);
    outline:0;
  }

  .method-card.active::before{
    content:"−";
    display:grid;
  }

  .method-details{
    display:none;
  }

  /* Les panneaux sont déplacés par JS juste après leur bouton. */
  .method-cards > .method-detail{
    display:block;
    min-height:0;
    margin:0 0 .55rem;
    border-radius:0 0 .95rem .95rem;
    overflow:hidden;
    background:#171513;
    color:#fff;
    animation:none;
  }

  .method-cards > .method-detail[hidden]{
    display:none;
  }

  .method-cards > .method-detail .method-detail-copy{
    display:block;
    padding:1.05rem 1.05rem .95rem;
  }

  .method-cards > .method-detail .method-detail-no{
    display:none;
  }

  .method-cards > .method-detail h3{
    margin:0;
    color:#fff;
    font-size:1.45rem;
    line-height:1.12;
  }

  .method-cards > .method-detail p{
    margin:.65rem 0 0;
    max-width:none;
    color:rgba(255,255,255,.82);
    font-size:.96rem;
    line-height:1.58;
  }

  .method-cards > .method-detail .method-detail-media{
    min-height:0;
    height:clamp(170px,48vw,220px);
    aspect-ratio:auto;
    background:#282522;
  }

  .method-cards > .method-detail .method-detail-media img{
    width:100%;
    height:100%;
    object-fit:cover;
    object-position:center;
  }

  /* Le contenu textuel apparaît avant la photographie. */
  .method-cards > .method-detail{
    display:flex;
    flex-direction:column;
  }
  .method-cards > .method-detail .method-detail-copy{order:1}
  .method-cards > .method-detail .method-detail-media{order:2}

  body.rtl-page .method-heading,
  body.rtl-page .method-card-copy{
    text-align:right;
  }

  body.rtl-page .method-card.active{
    box-shadow:inset -4px 0 0 var(--clay);
  }
}

/* =========================================================
   V2.0 — Reconstruction mobile indépendante
   ========================================================= */
:root{--header:68px}

html,body{overflow-x:hidden}
body{font-size:16px}
.container{width:min(calc(100% - 1.25rem),var(--max))}
section{padding:3.25rem 0}

/* Navigation tactile */
.header{height:var(--header)}
.header-inner{gap:.65rem}
.brand{gap:.55rem;font-size:.88rem}
.brand-mark{width:40px;height:40px}
.langs{gap:.2rem}
.langs a{padding:.27rem .38rem;font-size:.78rem}

/* Hero mobile réellement autonome */
.hero-v14{
  min-height:720px;
  min-height:100svh;
  align-items:end;
}
.hero-v14 .hero-content{
  align-self:end;
  padding:calc(var(--header) + 2.5rem) 0 5.4rem;
}
.hero-v14 h1{
  font-size:clamp(2.45rem,12vw,3.7rem);
  max-width:10.8ch;
  line-height:1;
}
.hero-v14 .hero-copy{
  max-width:33ch;
  font-size:.98rem;
  margin-top:.9rem;
}
.hero-v14 .actions{margin-top:1.2rem}
.actions .btn{width:100%}
.hero-proof{gap:.75rem;margin-top:1.6rem}
.hero-proof>div{width:calc(50% - .4rem)}
.hero-controls{right:auto;left:50%;transform:translateX(-50%);bottom:1.1rem}
.hero-arrow{display:none}

/* Transition serrée entre la méthode et le manifeste AZ */
.method-strip{
  padding:1.6rem 0 1.35rem;
}
.method-strip + section{
  padding-top:2.1rem;
}
.method-cards > .method-detail{
  margin-bottom:.3rem;
}
.method-cards > .method-detail .method-detail-media{
  height:clamp(165px,46vw,210px);
}

/* Manifeste */
.intro{
  display:grid;
  grid-template-columns:1fr;
  gap:1rem;
  align-items:start;
}
.intro p:last-child{
  font-size:1.06rem;
}

/* Les six engagements : aucun héritage de hauteur desktop */
.story{padding:3.5rem 0}
.story-step{
  display:flex;
  flex-direction:column;
  gap:1rem;
  margin-top:2.4rem;
  align-items:stretch;
}
.story-step:nth-child(even) .story-image{order:0}
.story-image{
  order:0;
  min-height:0;
  height:auto;
  aspect-ratio:4/3;
  border-radius:1rem;
}
.story-image img{
  width:100%;
  height:100%;
  object-fit:cover;
}
.story-text{
  order:1;
}
.step-no{
  display:block;
  margin:0 0 .3rem;
  font-size:2.9rem;
  line-height:.9;
}
.story-text h3{font-size:1.6rem}
.story-text p{
  margin-top:.65rem;
  max-width:none;
}
.story-step + .story-step{
  margin-top:2.8rem;
}

/* Services : chaque titre habille sa photographie */
.services-head{
  display:block;
}
.services-head p{margin-top:.8rem}
.service-grid{
  display:grid;
  grid-template-columns:1fr;
  gap:1rem;
  margin-top:2rem;
}
.service{
  min-height:0;
  height:clamp(300px,92vw,410px);
}
.service:after{
  background:linear-gradient(0deg,rgba(0,0,0,.88) 0%,rgba(0,0,0,.48) 38%,rgba(0,0,0,.05) 72%);
}
.service-content{
  inset:auto 1.15rem 1.15rem;
}
.service-content h3{
  font-size:1.55rem;
  color:#fff;
}
.service p{
  display:block;
  font-size:.9rem;
  line-height:1.4;
}
/* La carte Piscines & extérieurs reçoit un habillage renforcé */
.service:last-child .service-content{
  padding:.85rem .9rem;
  margin:-.85rem -.9rem;
  border-radius:.8rem;
  background:rgba(12,12,12,.42);
  backdrop-filter:blur(4px);
}

/* Sections lourdes : flux naturel */
.precision-wrap,
.ba-wrap,
.contact-grid{
  display:grid;
  grid-template-columns:1fr;
  gap:1.5rem;
}
.precision-image{
  min-height:0;
  height:clamp(310px,95vw,460px);
}
.precision-copy{padding:3rem .7rem}
.compare{aspect-ratio:4/3}
.form-grid,.footer-grid{grid-template-columns:1fr}
.full{grid-column:auto}
.delivery{min-height:72svh}
.delivery-content{padding:3rem 0}
.fab{width:54px;height:54px}

/* RTL mobile */
body.rtl-page .story-text,
body.rtl-page .services-head,
body.rtl-page .service-content{
  text-align:right;
}


@media (max-width:700px){
 .hero-progress{bottom:.72rem;width:34vw}
 .contact-direct{grid-template-columns:1fr;margin-top:1.1rem}
 .contact-direct small{grid-column:1}
}

/* V5.2 — Samsung / Chrome mobile
   Les slides restent animées même lorsque le système réduit les mouvements.
   Seul le zoom est neutralisé dans ce cas. */
.hero-slide{will-change:opacity,transform;backface-visibility:hidden;-webkit-backface-visibility:hidden}
.hero-slide img{transform:translateZ(0);-webkit-transform:translateZ(0)}
@media (prefers-reduced-motion: reduce){
  .hero-slide{transition:opacity .75s ease!important}
  .hero-slide.active{animation:none!important;transform:scale(1.02)!important}
  .hero-progress-bar{animation-duration:7600ms!important}
}

/* V5.3 — garde-fou spécifique aux pages arabe et darija sur mobile */
@media (max-width:700px){
  body.rtl-page .hero-v14{
    min-height:720px!important;
    background-image:url('/assets/images/hero-etude.webp')!important;
    background-size:cover!important;
    background-position:57% center!important;
  }
  body.rtl-page .hero-v14 .hero-content{
    display:block!important;
    padding:calc(var(--header) + 3.6rem) 0 5.1rem!important;
    align-self:end!important;
  }
  body.rtl-page .hero-v14 .hero-content,
  body.rtl-page .hero-v14 .hero-content *{
    visibility:visible!important;
  }
}


/* V5.5 — RTL horizontal overflow lock (Samsung/Chromium) */
@media (max-width:700px){
  html{overflow-x:hidden!important;max-width:100%!important}
  body.rtl-page{overflow-x:hidden!important;max-width:100%!important;position:relative!important}
  body.rtl-page .header,
  body.rtl-page main,
  body.rtl-page .footer,
  body.rtl-page section{max-width:100vw!important;overflow-x:clip}
  body.rtl-page .skip:not(:focus){position:fixed!important;inset:0 auto auto 0!important;width:1px!important;height:1px!important;clip-path:inset(50%)!important;overflow:hidden!important}
}
