/*
 Theme Name:   Bricks Child Theme
 Theme URI:    https://bricksbuilder.io/
 Description:  Homme à tout faire — design tokens, fonts et styles globaux.
 Author:       Bricks
 Author URI:   https://bricksbuilder.io/
 Template:     bricks
 Version:      1.2
 Text Domain:  bricks
*/

/* ---------- Fonts (auto-hébergées, pas d'appel à Google) ---------- */
@font-face {
  font-family: "Anton";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("fonts/anton-latin.woff2") format("woff2");
}
@font-face {
  font-family: "Roboto";
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url("fonts/roboto-latin.woff2") format("woff2");
}

/* ---------- Design tokens ---------- */
:root {
  /* Couleurs */
  --primary: #294c99;
  --primary-dark: #1e3a78;
  --primary-light: #7e9fe9;
  --primary-tint: rgba(41, 76, 153, 0.09);
  --accent: #f2b632;
  --dark: #111a2e;
  --dark-soft: #1b2742;
  --heading: #1c2433;
  --text: #4a5160;
  --text-muted: #6b7280;
  --text-on-dark: #c9d2e6;
  --bg: #ffffff;
  --bg-light: #f5f7fa;
  --border: #e2e6ee;
  --border-on-dark: rgba(255, 255, 255, 0.14);
  --white: #ffffff;
  --whatsapp: #1fa855;

  /* Bricks fixe 1rem = 10px : les tokens sont exprimés en px */
  /* Espacements fluides */
  --space-xs: clamp(8px, 7px + 0.2vw, 10px);
  --space-s: clamp(12px, 11px + 0.3vw, 16px);
  --space-m: clamp(20px, 17.6px + 0.6vw, 28px);
  --space-l: clamp(32px, 25.6px + 1.6vw, 48px);
  --space-xl: clamp(48px, 35px + 3vw, 80px);
  --space-xxl: clamp(64px, 45px + 5vw, 120px);
  --gutter: clamp(20px, 13px + 2vw, 40px);

  /* Typographie fluide */
  --text-xs: 13px;
  --text-s: 15px;
  --text-m: clamp(17px, 16.3px + 0.2vw, 19px);
  --text-l: clamp(19px, 17.6px + 0.45vw, 23px);
  --text-xl: clamp(22px, 19px + 0.8vw, 28px);
  --h1: clamp(38px, 24px + 3.4vw, 64px);
  --h2: clamp(30px, 22px + 2.2vw, 48px);
  --h3: clamp(19px, 17.6px + 0.4vw, 22px);

  /* Rayons */
  --radius-s: 6px;
  --radius-m: 10px;
  --radius-l: 16px;
}

/* ---------- Base ---------- */
html {
  scroll-behavior: smooth;
}
body {
  font-family: "Roboto", system-ui, -apple-system, "Segoe UI", sans-serif;
  font-size: var(--text-m);
  line-height: 1.65;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}
h1,
h2 {
  font-family: "Anton", "Arial Narrow", Impact, sans-serif;
  font-weight: 400;
  font-synthesis: none;
  line-height: 1.08;
  letter-spacing: 0.01em;
  color: var(--heading);
  text-wrap: balance;
}
h1 {
  font-size: var(--h1);
}
h2 {
  font-size: var(--h2);
}
h3,
h4,
h5,
h6 {
  font-family: "Roboto", system-ui, sans-serif;
  font-weight: 600;
  line-height: 1.3;
  color: var(--heading);
}
h3 {
  font-size: var(--h3);
}
p {
  text-wrap: pretty;
}
p.brxe-text-basic,
.brxe-text-basic p:last-child {
  margin: 0;
}
a {
  color: var(--primary);
}
:focus-visible {
  outline: 3px solid var(--primary-light);
  outline-offset: 2px;
}

/* ---------- Layout ---------- */
.brxe-container {
  width: 1180px;
}
.brxe-section {
  padding-left: var(--gutter);
  padding-right: var(--gutter);
}

/* ---------- Header ---------- */
#brx-header {
  position: sticky;
  top: 0;
  z-index: 999;
  background: var(--white);
  box-shadow: 0 1px 0 var(--border);
}
#brx-header .bricks-nav-menu > li > a {
  font-weight: 500;
  font-size: var(--text-s);
  color: var(--heading);
  padding: 8px 0;
  border-bottom: 2px solid transparent;
  transition: color 0.2s ease, border-color 0.2s ease;
}
#brx-header .bricks-nav-menu > li {
  margin: 0 0 0 28px;
}
#brx-header .bricks-nav-menu > li > a:hover,
#brx-header .bricks-nav-menu > li.current-menu-item > a {
  color: var(--primary);
  border-bottom-color: var(--primary);
}
#brx-header .bricks-mobile-menu-toggle {
  color: var(--heading);
}
#brx-header .bricks-mobile-menu-wrapper::before {
  background: var(--dark);
}
#brx-header .bricks-mobile-menu > li > a {
  color: var(--white);
  font-size: 18px;
  font-weight: 500;
  padding: 4px 28px;
}

/* ---------- Boutons ---------- */
.bricks-button {
  font-weight: 600;
  letter-spacing: 0.01em;
}

/* ---------- Footer ---------- */
#brx-footer a {
  color: var(--text-on-dark);
  text-decoration: none;
  transition: color 0.2s ease;
}
#brx-footer a:hover {
  color: var(--white);
}

/* ---------- Divers ---------- */
::selection {
  background: var(--primary);
  color: var(--white);
}
@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  * {
    transition: none !important;
    animation: none !important;
  }
}

/* ---------- Listes dans les textes ---------- */
.brxe-text ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 8px;
}
.brxe-text li {
  position: relative;
  padding-left: 30px;
}
.brxe-text li::before {
  content: "";
  position: absolute;
  left: 6px;
  top: 0.32em;
  width: 6px;
  height: 12px;
  border: solid var(--primary);
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}

/* ---------- Formulaires ---------- */
.brxe-form input:not([type="checkbox"]):not([type="radio"]):not([type="file"]),
.brxe-form textarea,
.brxe-form select {
  padding: 12px 14px;
  font-size: 16px;
  line-height: 1.4;
  color: var(--heading);
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
.brxe-form input:focus,
.brxe-form textarea:focus,
.brxe-form select:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-tint);
  outline: none;
}
.brxe-form ::placeholder {
  color: var(--text-muted);
  opacity: 1;
}
.brxe-form label {
  margin-bottom: 6px;
}
.brxe-form .options-wrapper label,
.brxe-form input[type="checkbox"] + label {
  font-weight: 400;
  font-size: var(--text-s);
  color: var(--text);
}
.brxe-form button[type="submit"] {
  padding: 16px 28px;
  font-size: var(--text-m);
  transition: background-color 0.2s ease;
}
.brxe-form button[type="submit"]:hover {
  background-color: var(--primary-dark);
}
.brxe-form .choose-files {
  padding: 10px 18px;
  border: 1px solid var(--primary);
  border-radius: var(--radius-s);
  color: var(--primary);
  font-weight: 600;
  font-size: var(--text-s);
  background: transparent;
}

/* ---------- Galerie ---------- */
.brxe-image-gallery .image {
  border-radius: var(--radius-m);
}
.brxe-form {
  margin-left: -8px;
  margin-right: -8px;
  width: calc(100% + 16px);
}
.brxe-form .form-group {
  padding: 0 8px 18px;
}
.brxe-form .submit-button-wrapper {
  padding-bottom: 0;
}

/* ---------- Barre d'appel mobile ---------- */
.hatf-callbar {
  display: none;
}
@media (max-width: 767px) {
  .hatf-callbar {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 998;
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    background: var(--dark);
    box-shadow: 0 -2px 12px rgba(0, 0, 0, 0.18);
    padding-bottom: env(safe-area-inset-bottom);
  }
  .hatf-callbar a {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 54px;
    color: var(--white);
    font-size: 15px;
    font-weight: 600;
    text-decoration: none;
  }
  .hatf-callbar a + a {
    border-left: 1px solid var(--border-on-dark);
  }
  .hatf-callbar__wa i {
    font-size: 19px;
    color: #25d366;
  }
  .hatf-callbar__devis {
    background: var(--primary);
  }
  body {
    padding-bottom: calc(54px + env(safe-area-inset-bottom));
  }
  /* Le bouton téléphone du header fait doublon avec la barre */
  #brxe-hb8y3s {
    display: none;
  }
}

/* ---------- Header : entrée avec sous-menu ---------- */
#brx-header .bricks-nav-menu > li > .brx-submenu-toggle {
  gap: 6px;
  color: var(--heading);
}
#brx-header .bricks-nav-menu > li > .brx-submenu-toggle > a {
  font-weight: 500;
  font-size: var(--text-s);
  color: var(--heading);
  padding: 8px 0;
  border-bottom: 2px solid transparent;
  transition: color 0.2s ease, border-color 0.2s ease;
}
#brx-header .bricks-nav-menu > li > .brx-submenu-toggle > a:hover,
#brx-header .bricks-nav-menu > li.current-menu-item > .brx-submenu-toggle > a,
#brx-header .bricks-nav-menu > li.current-menu-ancestor > .brx-submenu-toggle > a {
  color: var(--primary);
  border-bottom-color: var(--primary);
}
#brx-header .bricks-nav-menu > li > .brx-submenu-toggle > button {
  color: var(--heading);
  font-size: 12px;
  padding: 0;
}
#brx-header .bricks-nav-menu .sub-menu {
  min-width: 250px;
  padding: 8px;
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius-m);
  box-shadow: 0 8px 24px rgba(17, 26, 46, 0.1);
}
#brx-header .bricks-nav-menu .sub-menu > li > a {
  padding: 10px 12px;
  font-size: var(--text-s);
  font-weight: 500;
  color: var(--heading);
  border-radius: var(--radius-s);
  transition: background-color 0.2s ease, color 0.2s ease;
}
#brx-header .bricks-nav-menu .sub-menu > li > a:hover,
#brx-header .bricks-nav-menu .sub-menu > li.current-menu-item > a {
  background: var(--bg-light);
  color: var(--primary);
}
#brx-header .bricks-mobile-menu .brx-submenu-toggle > a,
#brx-header .bricks-mobile-menu .brx-submenu-toggle > button,
#brx-header .bricks-mobile-menu .sub-menu > li > a {
  color: var(--white);
}
#brx-header .bricks-mobile-menu .brx-submenu-toggle > a {
  font-size: 18px;
  font-weight: 500;
  padding: 4px 28px;
}
#brx-header .bricks-mobile-menu .sub-menu > li > a {
  font-size: 16px;
  padding: 4px 28px 4px 44px;
  opacity: 0.85;
}

/* ---------- Pages de texte (documents légaux) ---------- */
#brx-content.wordpress {
  width: 100%;
  max-width: calc(820px + 2 * var(--gutter));
  margin: 0 auto;
  padding: var(--space-xl) var(--gutter) var(--space-xxl);
  font-size: var(--text-m);
}
#brx-content.wordpress > h1 {
  font-size: var(--h2);
  margin-bottom: var(--space-m);
}
#brx-content.wordpress h2 {
  font-family: "Roboto", system-ui, sans-serif;
  font-weight: 600;
  font-size: var(--h3);
  letter-spacing: 0;
  line-height: 1.3;
  margin: var(--space-l) 0 var(--space-xs);
}
#brx-content.wordpress #cmplz-document,
#brx-content.wordpress .cmplz-document {
  max-width: none;
  font-size: inherit;
}
#brx-content.wordpress #cmplz-document p,
#brx-content.wordpress #cmplz-document li,
#brx-content.wordpress #cmplz-document td {
  font-size: inherit;
  line-height: 1.65;
}

/* ---------- Formulaire de demande de données (Complianz) ---------- */
#cmplz-datarequest-form label,
#cmplz-datarequest-form .cmplz-first-name,
#cmplz-datarequest-form p {
  color: var(--heading);
  opacity: 1;
}
#cmplz-datarequest-form input[type="text"],
#cmplz-datarequest-form input[type="email"] {
  padding: 12px 14px;
  font-size: 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius-s);
  color: var(--heading);
}
#cmplz-datarequest-form input[type="submit"] {
  padding: 14px 24px;
  background: var(--primary);
  color: var(--white);
  border: 0;
  border-radius: var(--radius-s);
  font-weight: 600;
  cursor: pointer;
}

/* ---------- Comparateur avant / après ---------- */
.hatf-compare {
  --pos: 50%;
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 10;
  overflow: hidden;
  border-radius: var(--radius-l);
  background: var(--bg-light);
}
.hatf-compare img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.hatf-compare__top {
  clip-path: inset(0 calc(100% - var(--pos)) 0 0);
}
.hatf-compare__range {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  opacity: 0;
  cursor: ew-resize;
}
.hatf-compare__handle {
  position: absolute;
  top: 0;
  bottom: 0;
  left: var(--pos);
  width: 3px;
  background: var(--white);
  transform: translateX(-50%);
  pointer-events: none;
  box-shadow: 0 0 0 1px rgba(17, 26, 46, 0.25);
}
.hatf-compare__handle::after {
  content: "\2194";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--white);
  color: var(--primary);
  font-size: 20px;
  border-radius: 50%;
  transform: translate(-50%, -50%);
  box-shadow: 0 2px 8px rgba(17, 26, 46, 0.3);
}
.hatf-compare__range:focus-visible + .hatf-compare__handle::after {
  outline: 3px solid var(--primary-light);
  outline-offset: 2px;
}
.hatf-compare__label {
  position: absolute;
  bottom: 12px;
  padding: 5px 10px;
  background: rgba(17, 26, 46, 0.78);
  color: var(--white);
  font-size: 13px;
  font-weight: 600;
  border-radius: var(--radius-s);
  pointer-events: none;
}
.hatf-compare__label--left {
  left: 12px;
}
.hatf-compare__label--right {
  right: 12px;
}

/* ---------- Consentement : bouton du footer à la place de l'onglet flottant ---------- */
#cmplz-manage-consent {
  display: none !important;
}
.hatf-consent-btn {
  width: auto;
  padding: 8px 14px;
  background: transparent;
  border: 1px solid var(--border-on-dark);
  border-radius: 100px;
  color: var(--text-on-dark);
  font-family: inherit;
  font-size: var(--text-xs);
  font-weight: 500;
  line-height: 1.2;
  cursor: pointer;
  transition: color 0.2s ease, border-color 0.2s ease, background-color 0.2s ease;
}
.hatf-consent-btn:hover {
  color: var(--white);
  border-color: rgba(255, 255, 255, 0.5);
  background: rgba(255, 255, 255, 0.06);
}
.hatf-consent-btn .brxe-icon,
.hatf-consent-btn i {
  color: var(--accent);
}
.hatf-consent-btn * {
  pointer-events: none;
}
