/* =====================================================================
   B-Clean Design — foundation: tokens, fonts, base type, buttons, forms
   Loaded after Divi's styles. Selectors are prefixed with `body.bc-skin`
   (two classes) so they outrank Divi's generated module CSS, which Divi
   also prints late in the <body>.
   ===================================================================== */

/* ---------- 1. Tokens ---------- */
:root {
  /* Ink ramp, tinted warm (paper, letterheads) */
  --bc-ink: #1f1b16;            /* primary text; darkest surface */
  --bc-ink-2: #2b2620;          /* raised surface on ink */
  --bc-body: #3f3933;           /* paragraph text on light */
  --bc-muted: #6b635a;          /* secondary text (5.9:1 on white) */
  --bc-paper: #fdfbf7;          /* cards */
  --bc-bg: #ffffff;             /* page */
  --bc-sand: #f7f4ee;           /* tinted section */
  --bc-sand-2: #efe9df;         /* inputs and quiet fills on sand */
  --bc-line: rgba(31, 27, 22, 0.10);          /* hairline */
  --bc-line-strong: rgba(31, 27, 22, 0.22);

  /* The brand accent: amber is a fill or lives on ink — never small text on white */
  --bc-amber: #f5a623;
  --bc-amber-ink: #9a6200;      /* amber as text on light (5.1:1 on white, 4.6:1 on sand) */
  --bc-amber-soft: #fdeecb;     /* amber tint */

  --bc-font: "DM Sans", system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;

  /* Scale and shape */
  --bc-r-sm: 8px;
  --bc-r-md: 12px;
  --bc-r-lg: 20px;
  --bc-ease: cubic-bezier(0.22, 1, 0.36, 1);
  --bc-header-h: 72px;
  --bc-wrap: 1240px;
  --bc-gutter: 24px;

  /* The signature: a short amber dash */
  --bc-dash: 24px;
}

/* ---------- 2. Fonts (self-hosted; latin covers everything French needs) ---------- */
@font-face {
  font-family: "DM Sans";
  font-style: normal;
  font-weight: 300 700;
  font-display: swap;
  src: url("../assets/fonts/dm-sans-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122, U+2190-2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "DM Sans";
  font-style: italic;
  font-weight: 300 700;
  font-display: swap;
  src: url("../assets/fonts/dm-sans-italic-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122, U+2190-2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

/* ---------- 3. Base ---------- */
html {
  scroll-padding-top: calc(var(--bc-header-h) + 16px);   /* anchored sections land under the sticky header */
  -webkit-text-size-adjust: 100%;
}
body.bc-skin {
  margin: 0;
  font-family: var(--bc-font);
  font-size: 17px;
  line-height: 1.6;
  font-optical-sizing: auto;
  font-variant-numeric: lining-nums;        /* DM Sans defaults to old-style 9s; prices and phones stay level */
  color: var(--bc-body);
  background: var(--bc-bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
/* One family everywhere. Divi writes a family into each module's CSS, hence the one !important. */
body.bc-skin :is(h1, h2, h3, h4, h5, h6, p, a, li, dt, dd, blockquote, figcaption, td, th, label,
  button, input, textarea, select, .et_pb_text, .et_pb_button, .et_pb_menu, .et_pb_contact_form) {
  font-family: var(--bc-font) !important;
}
body.bc-skin ::selection { background: var(--bc-amber); color: var(--bc-ink); }

/* Headings: hierarchy by size and colour, one weight */
body.bc-skin :is(h1, h2, h3, h4, h5, h6) {
  color: var(--bc-ink);
  font-weight: 500;
  padding: 0;
  margin: 0 0 16px;
}
body.bc-skin #main-content h1 { font-size: clamp(44px, 5.4vw, 76px); line-height: 1.02; letter-spacing: -0.03em; margin: 0; }
body.bc-skin #main-content h2 { font-size: clamp(30px, 3.1vw, 42px); line-height: 1.1; letter-spacing: -0.02em; }
body.bc-skin #main-content h3 { font-size: clamp(20px, 1.6vw, 23px); line-height: 1.25; letter-spacing: -0.01em; }
body.bc-skin #main-content h4 { font-size: 17px; line-height: 1.4; }
body.bc-skin #main-content :is(h5, h6) { font-size: 17px; line-height: 1.45; }

/* Paragraphs and text */
body.bc-skin #main-content p,
body.bc-skin .bc-prose p {
  font-size: 17px;
  line-height: 1.65;
  color: var(--bc-body);
  margin: 0 0 16px;
}
body.bc-skin #main-content p:last-child,
body.bc-skin .bc-prose p:last-child { margin-bottom: 0; }
body.bc-skin #main-content strong,
body.bc-skin .bc-prose strong { color: var(--bc-ink); font-weight: 600; }
body.bc-skin #main-content a:not(.et_pb_button):not(.bc-btn) {
  color: var(--bc-ink);
  text-decoration: underline;
  text-decoration-color: var(--bc-amber);
  text-decoration-thickness: 2px;
  text-underline-offset: 3px;
  transition: color 150ms var(--bc-ease);
}
body.bc-skin #main-content a:not(.et_pb_button):not(.bc-btn):hover { color: var(--bc-amber-ink); }
body.bc-skin #main-content ul { padding-left: 20px; margin: 0 0 16px; }
body.bc-skin #main-content li { margin-bottom: 8px; }
body.bc-skin #main-content li::marker { color: var(--bc-amber-ink); }

/* Links that start a block need room for the fixed header when followed */
body.bc-skin :is(section, div, h2, h3)[id] { scroll-margin-top: calc(var(--bc-header-h) + 16px); }

/* Focus: one ring, everywhere */
body.bc-skin :is(a, button, input, textarea, select, summary, [tabindex]):focus-visible {
  outline: 3px solid var(--bc-amber) !important;
  outline-offset: 2px !important;
}
body.bc-skin :is(input, textarea, select):focus-visible {
  outline-offset: 0 !important;
  border-color: var(--bc-ink) !important;
}

/* Images */
body.bc-skin #main-content img { height: auto; border-radius: var(--bc-r-md); }
body.bc-skin #main-content .et_pb_image { margin-left: 0 !important; margin-right: 0 !important; }

/* Divi's chrome: the sections and rows this design keeps */
body.bc-skin #main-content .et_pb_section { padding: 72px 0; }
body.bc-skin #main-content .et_pb_row {
  width: min(var(--bc-wrap), calc(100% - 48px)) !important;
  max-width: var(--bc-wrap) !important;
  padding: 0 !important;
}
body.bc-skin #main-content .et_pb_column { padding: 0 !important; }
/* Divi's clearfix (::after) would become an invisible first grid item in any row laid out as a grid. */
body.bc-skin #main-content .et_pb_row.is-bc-grid::before,
body.bc-skin #main-content .et_pb_row.is-bc-grid::after { content: none !important; display: none !important; }

/* Divi's back-to-top button, in the palette */
body.bc-skin .et_pb_scroll_top {
  right: 24px;
  bottom: 24px;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 1px solid var(--bc-line) !important;
  border-radius: 50% !important;
  background: var(--bc-paper) !important;
  color: var(--bc-ink) !important;
  box-shadow: 0 4px 16px rgba(31, 27, 22, 0.10) !important;
  font-size: 22px !important;
  opacity: 1 !important;
  transition: background-color 150ms var(--bc-ease) !important;
}
body.bc-skin .et_pb_scroll_top:hover,
body.bc-skin .et_pb_scroll_top:focus-visible { background: var(--bc-amber) !important; color: var(--bc-ink) !important; }

/* Skip link (added by the plugin) */
.bc-skip {
  position: absolute;
  left: 16px;
  top: calc(-1 * var(--bc-header-h) - 60px);
  z-index: 1000;
  display: inline-flex;
  align-items: center;
  height: 44px;
  padding: 0 20px;
  background: var(--bc-ink);
  color: var(--bc-paper);
  border-radius: var(--bc-r-sm);
  font: 500 16px/1 var(--bc-font);
  text-decoration: none;
  transition: top 200ms var(--bc-ease);
}
.bc-skip:focus { top: 12px; }

/* ---------- 4. Buttons ---------- */
/* One button system. Divi's presets (hard offset shadows, 2px borders, Divi blue) are all replaced.
   Divi writes its preset as `body #page-container …` with !important, so these rules carry #main-content. */
body.bc-skin #main-content .et_pb_button:is(.et_pb_module, .et_pb_contact_submit),
.bc-btn {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 8px !important;
  height: 48px !important;       /* Divi's preset sets height and padding with !important too */
  padding: 0 24px !important;
  border: 0 !important;
  border-radius: 10px !important;
  background: var(--bc-ink) !important;
  color: var(--bc-paper) !important;
  font-family: var(--bc-font) !important;
  font-size: 16px !important;
  font-weight: 500 !important;
  line-height: 1 !important;
  letter-spacing: 0 !important;
  text-transform: none !important;
  text-decoration: none !important;
  white-space: nowrap;
  box-shadow: none !important;
  transition: background-color 150ms var(--bc-ease), color 150ms var(--bc-ease), transform 120ms var(--bc-ease) !important;
}
body.bc-skin #main-content .et_pb_button:is(.et_pb_module, .et_pb_contact_submit) > span {
  color: inherit !important;
  font: inherit !important;
  letter-spacing: inherit !important;
  text-transform: inherit !important;
  line-height: inherit !important;
}
body.bc-skin #main-content .et_pb_button:is(.et_pb_module, .et_pb_contact_submit)::before,
body.bc-skin #main-content .et_pb_button:is(.et_pb_module, .et_pb_contact_submit)::after { display: none !important; }   /* Divi's arrow and icon pseudos */
body.bc-skin #main-content .et_pb_button:is(.et_pb_module, .et_pb_contact_submit):hover,
body.bc-skin #main-content .et_pb_button:is(.et_pb_module, .et_pb_contact_submit):focus,
.bc-btn:hover,
.bc-btn:focus {
  background: var(--bc-ink-2) !important;
  color: #ffffff !important;
  transform: none !important;
  box-shadow: none !important;
}
body.bc-skin #main-content .et_pb_button:is(.et_pb_module, .et_pb_contact_submit):active,
.bc-btn:active { transform: scale(0.98) !important; }
body.bc-skin #main-content .et_pb_button_module_wrapper { margin: 0 !important; text-align: left !important; }

/* Secondary: quiet, on a hairline */
.bc-btn--ghost {
  background: transparent !important;
  color: var(--bc-ink) !important;
  box-shadow: inset 0 0 0 1px var(--bc-line-strong) !important;
}
.bc-btn--ghost:hover,
.bc-btn--ghost:focus { background: var(--bc-sand) !important; color: var(--bc-ink) !important; }
/* On ink: the accent */
.bc-btn--amber { background: var(--bc-amber) !important; color: var(--bc-ink) !important; }
.bc-btn--amber:hover,
.bc-btn--amber:focus { background: #ffbd45 !important; color: var(--bc-ink) !important; }
.bc-btn--sm { height: 40px; padding: 0 18px; font-size: 15px !important; border-radius: var(--bc-r-sm) !important; }

/* Text link with an arrow: "En savoir plus" */
.bc-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--bc-ink);
  font: 500 16px/1.2 var(--bc-font);
  text-decoration: none;
  transition: color 150ms var(--bc-ease), gap 150ms var(--bc-ease);
}
.bc-link .bc-icon { transition: transform 150ms var(--bc-ease); }
.bc-link:hover,
.bc-link:focus { color: var(--bc-amber-ink); }
.bc-link:hover .bc-icon { transform: translateX(2px); }

/* ---------- 5. Forms (the plugin's quote form; Divi's contact form lives in pages.css) ---------- */
body.bc-skin .bc-form :is(input[type="text"], input[type="email"], input[type="tel"], textarea, select) {
  width: 100%;
  height: 48px;
  padding: 0 14px;
  border: 1px solid var(--bc-line-strong) !important;
  border-radius: var(--bc-r-sm) !important;
  background: var(--bc-paper) !important;
  color: var(--bc-ink) !important;
  font-family: var(--bc-font) !important;
  font-size: 16px !important;
  font-weight: 400 !important;
  line-height: 1.3 !important;
  letter-spacing: 0 !important;
  text-transform: none !important;
  box-shadow: none !important;
  transition: border-color 150ms var(--bc-ease), box-shadow 150ms var(--bc-ease) !important;
}
body.bc-skin .bc-form textarea {
  height: auto;
  min-height: 120px;
  padding: 12px 14px;
  resize: vertical;
}
body.bc-skin .bc-form :is(input, textarea, select):hover { border-color: var(--bc-ink) !important; }
body.bc-skin .bc-form :is(input, textarea):focus {
  border-color: var(--bc-ink) !important;
  box-shadow: 0 0 0 3px var(--bc-amber) !important;
}
body.bc-skin .bc-form ::placeholder { color: var(--bc-muted); opacity: 1; }

/* ---------- 6. Icons and helpers ---------- */
.bc-icon {
  width: 1.25em;
  height: 1.25em;
  flex: none;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.75;
  stroke-linecap: round;
  stroke-linejoin: round;
  vertical-align: -0.2em;
}
.bc-eyebrow {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 0 0 16px;
  color: var(--bc-muted);
  font: 500 15px/1.4 var(--bc-font);
  letter-spacing: 0.01em;
}
.bc-eyebrow::before {
  content: "";
  width: var(--bc-dash);
  height: 3px;
  border-radius: 2px;
  background: var(--bc-amber);
  flex: none;
}
.bc-visually-hidden {
  position: absolute !important;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}
.bc-prose { max-width: 62ch; }

/* Honeypot and other traps: out of the flow, out of the tab order, never shown */
.bc-trap {
  position: absolute !important;
  left: -9999px !important;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

@media (max-width: 980px) {
  :root { --bc-header-h: 64px; --bc-gutter: 20px; }
  body.bc-skin #main-content .et_pb_section { padding: 56px 0; }
  body.bc-skin #main-content .et_pb_row { width: calc(100% - 40px) !important; }
}
@media (max-width: 600px) {
  body.bc-skin { font-size: 16px; }
  body.bc-skin #main-content p, body.bc-skin .bc-prose p { font-size: 16px; }
  body.bc-skin #main-content .et_pb_section { padding: 48px 0; }
  body.bc-skin #main-content .et_pb_row { width: calc(100% - 32px) !important; }
  body.bc-skin #main-content .et_pb_button:is(.et_pb_module, .et_pb_contact_submit), .bc-btn { height: 46px; padding: 0 20px; white-space: normal; text-align: center; }
}

/* Reduced motion: keep colour changes, drop movement */
@media (prefers-reduced-motion: reduce) {
  body.bc-skin *, .bc-header *, .bc-footer * {
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}
