/*
 Theme Name:   Archdeco Child Peldoro
 Theme URI:    https://www.peldoro.ch/
 Description:  Child theme Archdeco optimisé pour Elementor (Peldoro).
 Author:       Peldoro
 Template:     archdeco
 Version:      1.0.0
*/

/* ============== GLOBAL ============== */

/* Empêcher le scroll horizontal sur mobile */
@media (max-width: 768px) {
  html, body {
    overflow-x: hidden !important;
  }

  /* Masquer certains éléments verticaux du thème qui gênent sur mobile */
  .elementor-page .cmsmasters_vertical_text,
  .elementor-page .cmsmasters_vertical_block,
  .elementor-page .cmsmasters_vertical_heading,
  .elementor-page .cmsmasters_sidebar {
    display: none !important;
    visibility: hidden !important;
    opacity: 0 !important;
  }

  /* Sécurité sur les images du contenu Elementor */
  .elementor-page img {
    max-width: 100% !important;
    height: auto !important;
  }

  /* Grille de projets : 1 carte par ligne en mobile */
  .elementor-page .cmsmasters_portfolio .project,
  .elementor-page .cmsmasters_wrap_portfolio .project,
  .elementor-page .projects .project {
    width: 100% !important;
    max-width: 480px !important;
    margin: 0 auto 32px !important;
    float: none !important;
    clear: both !important;
  }

  .elementor-page .cmsmasters_portfolio .project img,
  .elementor-page .cmsmasters_wrap_portfolio .project img,
  .elementor-page .projects .project img {
    width: 100% !important;
    height: auto !important;
  }
}

/* Neutraliser le background global Archdeco qui écrase les images Elementor */
body.cmsmasters_body {
  background-image: none !important;
  background-color: #ffffff !important;
}

/* Hero page "Présentation / Qui nous sommes" – éviter le fond parasite sur le conteneur spécifique */
@media (max-width: 1024px) {
  body.page-id-40894 .elementor-element-14d6b254 {
    background-image: none !important;
    background-color: transparent !important;
  }
}

/* ===== Fix images Elementor sur mobile (hors logos header) ===== */
@media (max-width: 768px) {

  /* S'assurer que les images Elementor restent visibles,
     mais on EXCLUT les images du widget logo CMSMasters */
  .elementor img:not(.elementor-widget-cmsmasters-site-logo__retina-img):not(.elementor-widget-cmsmasters-site-logo-second):not(.elementor-widget-cmsmasters-site-logo__img) {
    display: block !important;
    max-width: 100% !important;
    height: auto !important;
    opacity: 1 !important;
    visibility: visible !important;
  }

  /* Éviter que le thème cache des blocs entiers */
  .elementor-page .cmsmasters_row,
  .elementor-page [class*="cmsmasters"] img {
    opacity: 1 !important;
    visibility: visible !important;
  }
}

/* === Peldoro – supprimer les logos doublons du widget CMSMasters dans le header === */
.elementor-location-header img.elementor-widget-cmsmasters-site-logo__retina-img,
.elementor-location-header img.elementor-widget-cmsmasters-site-logo-second,
.elementor-location-header img.elementor-widget-cmsmasters-site-logo__img.elementor-widget-cmsmasters-site-logo-second {
    display: none !important;
    opacity: 0 !important;
    visibility: hidden !important;
    height: 0 !important;
    width: 0 !important;
    pointer-events: none !important;
}
