/* Rais Roulage — adaptive / responsive global */

*,
*::before,
*::after {
  box-sizing: border-box;
}

img,
video,
iframe,
embed,
object {
  max-width: 100%;
  height: auto;
}

.rais-home-video video {
  height: 100%;
}

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  overflow-x: hidden;
}

.ast-container,
.e-con-inner {
  max-width: 100%;
}

/* Empêche les débordements de flex/grid */
.e-con,
.e-con-inner,
.elementor-widget-container {
  min-width: 0;
}

/* Tableaux */
.entry-content table,
.elementor-widget-text-editor table {
  display: block;
  width: 100%;
  max-width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

/* Header mobile : logo + menu confortables */
@media (max-width: 921px) {
  .site-logo-img img,
  .custom-logo {
    height: 48px !important;
    width: auto !important;
    max-width: none !important;
  }

  .ast-builder-menu-mobile .main-navigation .menu-item > .menu-link {
    padding-top: 12px;
    padding-bottom: 12px;
  }

  .elementor-heading-title {
    word-wrap: break-word;
    overflow-wrap: anywhere;
  }

  .elementor-button {
    max-width: 100%;
    white-space: normal;
    text-align: center;
  }

  /* Sections boxed : respirations latérales */
  .e-con-boxed > .e-con-inner {
    padding-left: max(16px, env(safe-area-inset-left));
    padding-right: max(16px, env(safe-area-inset-right));
  }

  .rais-home-video {
    border-radius: 14px;
    min-height: 220px;
  }

  .rais-home-video video {
    min-height: 220px;
  }
}

@media (max-width: 700px) {
  .elementor-widget-text-editor,
  .elementor-widget-heading {
    text-align: left;
  }

  h1.elementor-heading-title,
  .elementor-widget-heading h1 {
    font-size: clamp(1.5rem, 7vw, 2rem) !important;
    line-height: 1.25 !important;
  }

  h2.elementor-heading-title,
  .elementor-widget-heading h2 {
    font-size: clamp(1.25rem, 5.5vw, 1.65rem) !important;
    line-height: 1.3 !important;
  }

  .elementor-widget-text-editor p {
    font-size: 0.95rem;
    line-height: 1.55;
  }

  /* Boutons pleine largeur sur petit écran quand pertinents */
  .elementor-mobile-align-center .elementor-button,
  .elementor-align-center .elementor-button {
    width: 100%;
  }

  .rais-secteurs-wrap,
  .rais-contact-wrap {
    padding-left: 16px;
    padding-right: 16px;
  }
}

@media (max-width: 480px) {
  .rais-sectors-grid > .e-con-inner,
  .elementor-element-ea34ed1 > .e-con-inner,
  .rais-secteurs-grid {
    grid-template-columns: 1fr 1fr !important;
    gap: 12px !important;
  }

  .elementor-element-ea34ed1 .elementor-widget-image img,
  .rais-sector-media img {
    height: 140px !important;
  }

  .elementor-element-ea34ed1 .elementor-button,
  .rais-sector-btn {
    font-size: 12px !important;
    min-height: 40px;
    padding-left: 8px !important;
    padding-right: 8px !important;
  }
}

/* Carrousels : ne pas déborder */
.elementor-image-carousel-wrapper,
.swiper,
.swiper-wrapper {
  max-width: 100%;
}

/* Map / embeds contact */
.rais-contact-map iframe,
iframe[src*="google.com/maps"],
iframe[src*="maps"] {
  width: 100% !important;
  max-width: 100%;
  border: 0;
  border-radius: 14px;
}

/* Footer : stack lisible */
@media (max-width: 921px) {
  .site-primary-footer-wrap .ast-builder-grid-row {
    row-gap: 28px;
  }

  .footer-widget-area-inner {
    text-align: left !important;
  }
}

/* Réduction de motion */
@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* Pages Secteurs (Médical, Électronique, Mesure, Appareillage) :
   marges latérales de 200 px réduites progressivement sur tablette / mobile */
:root {
  --rais-side: clamp(16px, calc((100vw - 760px) * 0.31), 200px);
}

.elementor-965 .elementor-element.elementor-element-7c9654a > .elementor-widget-container,
.elementor-967 .elementor-element.elementor-element-b63ef81 > .elementor-widget-container {
  padding-left: var(--rais-side) !important;
  padding-right: var(--rais-side) !important;
}

.elementor-916 .elementor-element.elementor-element-bee3cf9,
.elementor-963 .elementor-element.elementor-element-110581e {
  --padding-left: var(--rais-side) !important;
  --padding-right: var(--rais-side) !important;
}

/* Carrière : le titre du hero est un <h1> (SEO) mais garde le style d'origine */
.elementor-element-d385f44 h1.elementor-heading-title {
  line-height: 1.3 !important;
}

@media (max-width: 700px) {
  .elementor-element-d385f44 h1.elementor-heading-title {
    font-size: clamp(1.25rem, 5.5vw, 1.65rem) !important;
  }
}

/* Pages Secteurs : titres longs (ex. « Industrieelektronik ») sur petit écran */
.horlogerie-section .text-content {
  min-width: 0;
}

.horlogerie-section .text-content h1 {
  overflow-wrap: anywhere;
}

@media (max-width: 600px) {
  html[lang="de-CH"] .horlogerie-section .text-content h1 {
    font-size: min(48px, 9.2vw);
  }
}

/* Carrière : conteneurs imbriqués (75 % > 68 % > 50 %) – pleine largeur sur tablette / mobile */
@media (max-width: 1024px) {
  .elementor-37 .elementor-element.elementor-element-564b392,
  .elementor-37 .elementor-element.elementor-element-a2e05ec {
    --width: 100% !important;
  }
}

@media (max-width: 767px) {
  .elementor-37 .elementor-element.elementor-element-aa8a4c4,
  .elementor-37 .elementor-element.elementor-element-cff03ce {
    --width: 100% !important;
  }
}

/* ==========================================================================
   MOBILE — échelle typographique unique (≤ 767 px)
   corps 12 px · grand titre 20 px · sous-titre 16 px
   Pied de page : 4 blocs sur 2 colonnes × 2 lignes
   ========================================================================== */
@media (max-width: 767px) {
  /* Corps de texte : 12 px */
  body #main p,
  body #main li,
  body #main dd,
  body #main .elementor-widget-text-editor,
  body #main .elementor-widget-text-editor p,
  body #main .elementor-button,
  body #main .elementor-button-text,
  body #main .rais-hero-more,
  body #main .rais-chip,
  body #main .rais-secteurs-lead,
  body #main .rais-secteurs-eyebrow,
  body #main .rais-secteurs-cta,
  body #main .rais-sector-btn,
  body #main .rais-contact-lead,
  body #main .adeka-form-intro,
  body #main .cf-type span,
  body #main .cf-label,
  body #main .cf-file-btn,
  body #main .cf-file-name,
  body #main .cf-file-hint,
  body #main .cf-status,
  body #main .cf-submit,
  body #main .rais-tl__date,
  body #main .rais-tl .rais-tl__item p,
  body #main .rais-points__desc,
  body #main .rais-points__bar-text span,
  body #main .rais-rg__cap span,
  body #main .rais-legal-body p,
  body #main .rais-legal-updated,
  body #main .horlogerie-section .text-content p,
  body #main .types-section li,
  body #main .e-n-accordion-item-title-text,
  body #main .elementor-icon-list-text {
    font-size: 12px !important;
    line-height: 1.55 !important;
  }

  /* Grand titre : 20 px */
  body #main h1,
  body #main h1.elementor-heading-title,
  body #main .rais-secteurs-title,
  body #main .rais-contact-title,
  body #main .rais-hero-copy .elementor-heading-title,
  body #main .rais-hero-copy h1.elementor-heading-title,
  body #main .rais-hero-copy h2.elementor-heading-title {
    font-size: 20px !important;
    line-height: 1.2 !important;
  }

  /* Sous-titres : 16 px */
  body #main h2,
  body #main h3,
  body #main h4,
  body #main h2.elementor-heading-title,
  body #main h3.elementor-heading-title,
  body #main .elementor-heading-title,
  body #main .rais-tl__title,
  body #main .rais-tl .rais-tl__item h3,
  body #main .rais-points__title,
  body #main .adeka-form-title,
  body #main .rais-secteurs-note h2,
  body #main .rais-legal-body h2,
  body #main .mm-label,
  body #main .horlogerie-section .text-content h2,
  body #main .types-section h3 {
    font-size: 16px !important;
    line-height: 1.3 !important;
  }

  /* Le titre du hero reste le plus grand (même spécificité plus forte) */
  body #main .rais-hero-copy .elementor-heading-title,
  body #main h1.elementor-heading-title,
  body #main h1 {
    font-size: 20px !important;
  }

  /* Libellés courts (légendes, intertitres de listes) : entre corps et sous-titre */
  body #main .rais-points__item strong,
  body #main .rais-points__bar-text strong,
  body #main .rais-rg__cap strong {
    font-size: 14px !important;
  }

  /* Pied de page : 2 colonnes × 2 lignes */
  body .site-footer .site-primary-footer-wrap .ast-builder-footer-grid-columns {
    display: grid !important;
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 22px 16px !important;
    align-items: start !important;
    padding-left: 20px !important;
    padding-right: 20px !important;
  }

  body .site-footer .site-primary-footer-wrap .site-footer-section-4,
  body .site-footer .site-primary-footer-wrap .site-footer-section-4 .ast-builder-layout-element,
  body .site-footer .site-primary-footer-wrap .footer-social-inner-wrap {
    justify-content: flex-start !important;
    text-align: left !important;
    margin-left: 0 !important;
  }

  body .site-footer .site-primary-footer-wrap .site-footer-section {
    min-width: 0;
    width: auto !important;
  }

  body .site-footer h2,
  body .site-footer h3,
  body .site-footer h4,
  body .site-footer h5,
  body .site-footer h6,
  body .site-footer .wp-block-heading {
    font-size: 16px !important;
    line-height: 1.3 !important;
  }

  body .site-footer p,
  body .site-footer li,
  body .site-footer a,
  body .site-footer .ast-footer-copyright,
  body .site-footer .ast-footer-copyright p {
    font-size: 12px !important;
    line-height: 1.6 !important;
    overflow-wrap: anywhere;
  }
}

/* MOBILE — images réduites */
@media (max-width: 921px) {
  /* Home : photo du bloc « Précision » */
  .elementor-10 .elementor-element.elementor-element-57a9bca {
    min-height: 200px !important;
    height: 200px !important;
  }
}
@media (max-width: 767px) {
  /* Carrière : logo dans l'annonce */
  .elementor-37 .elementor-element.elementor-element-aa8a4c4 {
    min-height: 0 !important;
    padding: 12px 0 !important;
  }
  .elementor-37 .elementor-element.elementor-element-21d5ee6 {
    width: 110px !important;
    max-width: 110px !important;
    margin: 0 auto !important;
  }
  .elementor-37 .elementor-element.elementor-element-21d5ee6 img {
    width: 100% !important;
    max-width: 110px !important;
    height: auto !important;
  }
}

/* Carrousels des 4 secteurs + Roulage de filet : même taille (référence : Appareillage) */
.elementor-963 .elementor-element.elementor-element-624d900 {
  --padding-top: 0px;
  --padding-right: 0px;
  --padding-bottom: 0px;
  --padding-left: 0px;
  padding: 0 !important;
}
.elementor-967.rais-roulage-page .elementor-element.elementor-element-d394391 {
  padding-left: 10px !important;
  padding-right: 10px !important;
}
.elementor-963 .elementor-element.elementor-element-9d5e168 {
  width: 100% !important;
  max-width: 1140px !important;
  margin-left: auto !important;
  margin-right: auto !important;
}
