/* ================
   Responsive rules
================ */

/* body background-attachment */
@media (max-width: 900px) {
  body {
    background-attachment: scroll;
  }
}

/* header rail + hero inner (desktop large) */
@media (min-width: 1200px) {
  .header-rail {
    max-width: none;
    margin-left: var(--page-gutter);
    margin-right: auto;
    padding-right: 0;
  }

  .container.hero-inner {
    max-width: 100%;
    margin-left: var(--page-gutter);
    margin-right: auto;
  }

  .nav {
    margin-right: 18px;
  }

  /* rail global = même logique que le hero */
  .container {
    max-width: 100%;
    margin-left: var(--page-gutter);
    margin-right: var(--page-gutter);
    padding-left: 18px;
    padding-right: 18px;
  }
}

/* baseline + whatsapp text */
@media (max-width: 1150px) {
  .baseline-full {
    display: none;
  }

  .baseline-short {
    display: inline;
  }

  .wa-full {
    display: none;
  }

  .wa-short {
    display: inline;
  }
}

/* grids desktop */
@media (min-width: 860px) {
  .grid-2 {
    grid-template-columns: 1fr 1fr
  }

  .grid-3 {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .grid-2.services-grid {
    grid-template-columns: 1fr;
  }

  .footer-grid {
    grid-template-columns: 1.2fr .9fr .7fr
  }
}

@media (min-width: 860px) {
  #process .process-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    align-items: stretch;
  }

  #process .process-card {
    min-height: 100%;
  }

  #process .process-cta {
    grid-template-columns: minmax(0, 1fr) auto;
  }

  #process .process-cta-actions {
    padding-left: 28px;
    border-left: 1px solid rgba(31, 41, 55, .10);
  }
}

@media (max-width: 859px) {
  #process .process-flow {
    display: none;
  }

  #process .process-cta-actions {
    width: 100%;
  }

  #process .process-cta-actions .btn {
    width: 100%;
    justify-content: center;
  }
}

@media (max-width: 640px) {
  #process .process-card {
    padding: 22px 18px 20px;
    border-radius: 22px;
  }

  #process .process-card-number {
    width: 48px;
    height: 48px;
    font-size: 1.7rem;
    border-radius: 16px;
  }

  #process .process-cta {
    padding: 20px 18px;
    border-radius: 22px;
  }

}

/* nav mobile */
@media (max-width: 860px) {
  .nav-toggle {
    display: inline-block;
    border: 1px solid var(--border);
    background: rgba(255, 255, 255, .65);
  }

  .nav {
    position: fixed;
    inset: 64px 12px auto 12px;
    display: none;
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
    padding: 12px;
    border-radius: 18px;
    border: 1px solid var(--border);
    background: rgba(251, 247, 241, .95);
    backdrop-filter: blur(12px);
    box-shadow: var(--shadow);
  }

  .nav.is-open {
    display: flex;
  }

  .nav-open {
    overflow: hidden;
  }
}

/* hero overlay tablet */
@media (max-width: 980px) {
  .hero--media::before {
    background:
      radial-gradient(60% 80% at 18% 25%,
        rgba(214, 174, 140, 0.35),
        transparent 60%),
      linear-gradient(to right,
        rgba(251, 247, 241, 1) 0%,
        rgba(251, 247, 241, 0.95) 65%,
        rgba(251, 247, 241, 0.85) 75%,
        rgba(251, 247, 241, 0.20) 90%);
  }

  .hero--media {
    min-height: clamp(400px, 70svh, 500px);
  }
}

@media (max-width: 1125px) {
  .hero-bg {
    object-position: 60% 30%;
  }

  .hero-inner {
    padding-inline: 1.5rem;
  }
}

/* hero overlay smaller */
@media (max-width: 750px) {
  .hero--media::before {
    background:
      radial-gradient(60% 80% at 18% 25%,
        rgba(214, 174, 140, 0.35),
        transparent 60%),
      linear-gradient(to right,
        rgba(251, 247, 241, 1) 0%,
        rgba(251, 247, 241, 0.98) 65%,
        rgba(251, 247, 241, 0.95) 75%,
        rgba(251, 247, 241, 0.80) 98%);
  }

  .hero-benefits {
    margin-top: -1px;
    overflow: visible;
    background-image: url("/assets/img/grain-paper.png");
    background-repeat: repeat;
    background-size: 420px 420px;
    box-shadow: 0 10px 22px rgba(17, 24, 39, 0.1), 0 -8px 18px rgba(17, 24, 39, 0.06);
  }

  .benefits-scroll {
    width: 100%;
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
    scrollbar-gutter: stable;
  }

  /* La rangée DOIT être plus large que l’écran => scroll */
  .benefits {
    display: flex;
    flex-wrap: nowrap;
    justify-content: center;
    align-items: center;

    width: max-content;
    min-width: max-content;

    margin: 0 auto;
  }

  .benefit {
    flex: 0 0 auto;
    white-space: nowrap;
    padding: 12px 18px;
  }

  .benefit:first-child,
  .benefit:nth-child(2),
  .benefit:last-child {
    padding: 12px 18px;
  }

  .benefit-text {
    overflow: visible;
    max-width: none;
    min-width: max-content;
    display: inline-flex;
    align-items: baseline;
    gap: 8px;
  }
}

/* benefits text smaller */
@media (max-width: 900px) {
  .benefit-text strong {
    font-size: 0.80rem;
  }

  .benefit-text span {
    font-size: 0.70rem;
  }
}

/* hero mobile */
@media (max-width: 599px) {
  .hero-bg {
    object-position: 55% 20%;
  }
}

/* services grid responsive */
@media (max-width: 980px) {
  #services .grid-3 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 640px) {
  #services .grid-3 {
    grid-template-columns: 1fr;
  }
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  .hero-title .word {
    animation: none;
    opacity: 1;
    transform: none;
    filter: none;
    will-change: auto;
  }

  .hero-copy h1::after {
    animation: none;
    opacity: 1;
    transform: none;
    will-change: auto;
  }

  .hero-subtitle,
  .hero-description,
  .hero-cta,
  .hero-cta .btn {
    animation: none;
    opacity: 1;
    transform: none;
    will-change: auto;
  }
}