/*
Theme Name: DBM Complet
Theme URI: https://dboyermorin.com
Author: Distributions Boyer & Morin Inc.
Description: Modern bilingual (EN/FR) theme for Distributions Boyer & Morin Inc. — geosynthetics, root & weed control, ground reinforcement. Includes one-click demo content for every page of the site.
Version: 2.0.5
Requires at least: 6.0
Requires PHP: 7.4
License: GNU General Public License v2 or later
Text Domain: dbm-complet
*/

/* ---------- Design tokens ---------- */
:root {
  --ink: #282323;
  --ink-soft: #534b4a;
  --green: #b9625d;
  --green-dark: #854440;
  --lime: #efaaa5;
  --sand: #f8f2f1;
  --line: #e5d9d7;
  --white: #ffffff;
  --radius: 14px;
  --radius-lg: 24px;
  --shadow: 0 1px 2px rgba(40,35,35,.05), 0 12px 32px -12px rgba(40,35,35,.18);
  --maxw: 1180px;
  --font-head: "Barlow Condensed", "Oswald", system-ui, sans-serif;
  --font-body: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--font-body);
  font-size: 17px;
  line-height: 1.7;
  color: var(--ink-soft);
  background: var(--white);
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--green); text-decoration: none; }
a:hover { color: var(--green-dark); text-decoration: underline; }
h1, h2, h3, h4 {
  font-family: var(--font-head);
  color: var(--ink);
  line-height: 1.08;
  letter-spacing: -.01em;
  margin: 0 0 .5em;
  font-weight: 600;
  text-transform: uppercase;
}
h1 { font-size: clamp(2.6rem, 6vw, 4.4rem); }
h2 { font-size: clamp(1.9rem, 3.6vw, 2.8rem); }
h3 { font-size: 1.35rem; letter-spacing: 0; }
p { margin: 0 0 1.1em; }
ul, ol { margin: 0 0 1.2em; padding-left: 1.2em; }
li { margin-bottom: .4em; }

.wrap { max-width: var(--maxw); margin: 0 auto; padding: 0 24px; }
.section { padding: 84px 0; }
.section--sand { background: var(--sand); }
.eyebrow {
  font-family: var(--font-head);
  text-transform: uppercase;
  letter-spacing: .22em;
  font-size: .8rem;
  font-weight: 600;
  color: var(--green);
  margin: 0 0 .8rem;
}
.lead { font-size: 1.15rem; color: var(--ink-soft); max-width: 62ch; }
.welcome { max-width: 860px; margin-bottom: 54px; }
.welcome p { max-width: 74ch; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; gap: .5rem;
  font-family: var(--font-head); text-transform: uppercase; letter-spacing: .08em;
  font-weight: 600; font-size: 1rem;
  padding: .85rem 1.6rem; border-radius: 999px; border: 1.5px solid transparent;
  transition: all .18s ease; cursor: pointer; text-decoration: none;
}
.btn:hover { text-decoration: none; transform: translateY(-1px); }
.btn--primary { background: var(--green); color: #fff; }
.btn--primary:hover { background: var(--green-dark); color: #fff; }
.btn--ghost { border-color: rgba(255,255,255,.45); color: #fff; }
.btn--ghost:hover { background: rgba(255,255,255,.12); color: #fff; }
.btn--outline { border-color: var(--line); color: var(--ink); background: #fff; }
.btn--outline:hover { border-color: var(--green); color: var(--green); }

/* ---------- Header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 60;
  background: rgba(255,255,255,.96);
  backdrop-filter: saturate(140%) blur(10px);
  border-bottom: 1px solid var(--line);
}
.header-inner { display: flex; align-items: center; gap: 24px; min-height: 112px; }
.brand { display: block; width: min(470px, 49vw); color: var(--ink); }
.brand:hover { text-decoration: none; color: var(--green); }
.brand img { width: 100%; height: 94px; object-fit: contain; object-position: left center; }

.nav { margin-left: auto; }
.nav ul { display: flex; gap: 6px; list-style: none; margin: 0; padding: 0; }
.nav li { position: relative; margin: 0; }
.nav a {
  display: block; padding: .55rem .85rem; border-radius: 8px;
  font-weight: 500; font-size: .95rem; color: var(--ink);
}
.nav a:hover, .nav .current-menu-item > a { background: var(--sand); color: var(--green); text-decoration: none; }
.nav .sub-menu {
  position: absolute; left: 0; top: 100%; min-width: 250px;
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 8px; display: none; flex-direction: column; gap: 2px;
}
.nav li:hover > .sub-menu, .nav li:focus-within > .sub-menu { display: flex; }
.lang-switch {
  font-family: var(--font-head); text-transform: uppercase; letter-spacing: .12em;
  font-size: .85rem; font-weight: 600; color: var(--ink);
  border: 1.5px solid var(--line); border-radius: 999px; padding: .4rem 1rem;
}
.lang-switch:hover { border-color: var(--green); color: var(--green); text-decoration: none; }
.nav-toggle { display: none; background: none; border: 0; font-size: 1.6rem; color: var(--ink); cursor: pointer; margin-left: auto; }

@media (max-width: 980px) {
  .nav-toggle { display: block; }
  .header-inner { min-height: 92px; }
  .brand { width: min(390px, 72vw); }
  .brand img { height: 76px; }
  .nav { position: fixed; inset: 92px 0 auto; background: #fff; border-bottom: 1px solid var(--line); display: none; padding: 12px 24px 24px; max-height: calc(100vh - 92px); overflow-y: auto; }
  .nav.is-open { display: block; }
  .nav ul { flex-direction: column; gap: 0; }
  .nav .sub-menu { position: static; display: flex; border: 0; box-shadow: none; padding-left: 14px; }
}

/* ---------- Hero ---------- */
.hero {
  position: relative; color: #fff; overflow: hidden;
  background: linear-gradient(120deg, var(--ink) 0%, #3f3433 58%, var(--green-dark) 100%);
}
.hero::after {
  content: ""; position: absolute; inset: 0;
  background-image: radial-gradient(rgba(239,170,165,.18) 1px, transparent 1px);
  background-size: 22px 22px; opacity: .5; pointer-events: none;
}
.hero-inner { position: relative; z-index: 2; padding: 110px 0 120px; max-width: var(--maxw); }
.hero h1 { color: #fff; font-size: clamp(2.2rem, 4.2vw, 3.55rem); white-space: nowrap; }
.hero h1 em { font-style: normal; color: var(--lime); }
.hero-subtitle { font-family: var(--font-head); text-transform: uppercase; color: var(--lime) !important; font-size: 1.35rem !important; }
.hero p { color: rgba(255,255,255,.82); font-size: 1.2rem; max-width: 56ch; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 28px; }
.hero-stats { display: flex; flex-wrap: wrap; gap: 40px; margin-top: 54px; }
.hero-stats div strong { display: block; font-family: var(--font-head); font-size: 2.4rem; color: var(--lime); line-height: 1; }
.hero-stats div span { font-size: .85rem; letter-spacing: .12em; text-transform: uppercase; color: rgba(255,255,255,.7); }

/* ---------- Page header ---------- */
.page-hero { background: var(--sand); border-bottom: 1px solid var(--line); padding: 64px 0 56px; }
.breadcrumb { font-size: .85rem; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-soft); margin-bottom: .6rem; }

/* ---------- Product grid ---------- */
.grid { display: grid; gap: 26px; }
.grid--3 { grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); }
.grid--2 { grid-template-columns: repeat(auto-fit, minmax(340px, 1fr)); }

.card {
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius-lg);
  overflow: hidden; display: flex; flex-direction: column;
  transition: transform .2s ease, box-shadow .2s ease, border-color .2s ease;
}
.card:hover { transform: translateY(-4px); box-shadow: var(--shadow); border-color: #cfd9cf; }
.card__media { aspect-ratio: 16/10; background: var(--sand); overflow: hidden; display: flex; align-items: center; justify-content: center; }
.card__media img { width: auto; height: auto; max-width: 100%; max-height: 100%; object-fit: contain; }
.card__body { padding: 24px; flex: 1; display: flex; flex-direction: column; }
.card__body h3 { margin-bottom: .35rem; }
.card__body p { font-size: .96rem; margin-bottom: 1rem; }
.card__link { margin-top: auto; font-family: var(--font-head); text-transform: uppercase; letter-spacing: .1em; font-size: .88rem; font-weight: 600; }

/* ---------- Feature list ---------- */
.features { display: grid; gap: 22px; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }
.feature { padding: 26px; border-radius: var(--radius); background: #fff; border: 1px solid var(--line); }
.feature h3 { font-size: 1.1rem; }
.feature p { font-size: .95rem; margin: 0; }

/* ---------- Content typography ---------- */
.entry { max-width: 820px; }
.entry img { border-radius: var(--radius); margin: 1.6em 0; width: auto; }
/* Product photos are small originals: show them at their real size, never stretched. */
.page-thumb { display: flex; justify-content: center; background: var(--sand); border-radius: 24px; padding: 28px; margin: 0 0 44px; }
.page-thumb img { width: auto; height: auto; max-width: 100%; border-radius: 12px; }
.entry h2 { margin-top: 1.8em; }
.entry h3 { margin-top: 1.6em; }
.entry ul li::marker { color: var(--green); }
.entry blockquote {
  margin: 1.8em 0; padding: 1.2em 1.6em; border-left: 4px solid var(--lime);
  background: var(--sand); border-radius: 0 var(--radius) var(--radius) 0; font-size: 1.05rem;
}
.entry table { width: 100%; border-collapse: collapse; margin: 1.4em 0; }
.entry td, .entry th { border-bottom: 1px solid var(--line); padding: .7em .6em; text-align: left; font-size: .95rem; }

.resources { list-style: none; padding: 0; display: grid; gap: 10px; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); }
.resources li { margin: 0; }
.resources a {
  display: flex; gap: .6rem; align-items: center; padding: .8rem 1rem;
  border: 1px solid var(--line); border-radius: var(--radius); background: #fff;
  font-size: .93rem; color: var(--ink);
}
.resources a::before { content: "PDF"; font-family: var(--font-head); font-size: .7rem; letter-spacing: .1em; background: var(--green); color: #fff; padding: .2rem .45rem; border-radius: 4px; }
.resources a:hover { border-color: var(--green); text-decoration: none; color: var(--green); }

/* ---------- CTA band ---------- */
.cta-band { background: var(--ink); color: #fff; border-radius: var(--radius-lg); padding: 52px; display: flex; flex-wrap: wrap; gap: 24px; align-items: center; justify-content: space-between; }
.cta-band h2 { color: #fff; margin: 0; }
.cta-band p { color: rgba(255,255,255,.75); margin: .4rem 0 0; }

/* ---------- Contact form ---------- */
.form { display: grid; gap: 16px; max-width: 620px; }
.form label { font-size: .85rem; letter-spacing: .1em; text-transform: uppercase; font-weight: 600; color: var(--ink); display: block; margin-bottom: .35rem; }
.form input, .form textarea {
  width: 100%; padding: .85rem 1rem; border: 1px solid var(--line); border-radius: var(--radius);
  font: inherit; color: var(--ink); background: #fff;
}
.form input:focus, .form textarea:focus { outline: 2px solid var(--green); outline-offset: 1px; border-color: var(--green); }
.form textarea { min-height: 150px; resize: vertical; }
.form .hp { position: absolute; left: -9999px; }
.notice { padding: 1rem 1.2rem; border-radius: var(--radius); margin-bottom: 1.2rem; font-size: .95rem; }
.notice--ok { background: #e7f6ee; color: var(--green-dark); border: 1px solid #bfe4d1; }
.notice--err { background: #fdeceb; color: #8f2d24; border: 1px solid #f3c7c2; }

.contact-details { list-style: none; padding: 0; }
.contact-details li { display: flex; gap: .7rem; align-items: baseline; }
.contact-details strong { font-family: var(--font-head); text-transform: uppercase; letter-spacing: .1em; font-size: .85rem; color: var(--ink); min-width: 96px; }

/* ---------- Footer ---------- */
.site-footer { background: var(--ink); color: rgba(255,255,255,.72); padding: 64px 0 28px; margin-top: 0; border-top: 5px solid var(--green); }
.site-footer a { color: rgba(255,255,255,.82); }
.site-footer a:hover { color: var(--lime); }
.footer-grid { display: grid; gap: 34px; grid-template-columns: 1.4fr 1fr 1fr; }
.site-footer h4 { font-family: var(--font-head); text-transform: uppercase; letter-spacing: .14em; font-size: .9rem; color: #fff; margin-bottom: 1rem; }
.footer-logo { width: min(430px, 100%); height: auto; margin-bottom: 18px; }
.site-footer .footer-logo { filter: none; }
.site-footer ul { list-style: none; padding: 0; }
.footer-bottom { border-top: 1px solid rgba(255,255,255,.12); margin-top: 44px; padding-top: 20px; font-size: .85rem; display: flex; flex-wrap: wrap; gap: 12px; justify-content: space-between; }
@media (max-width: 780px) { .footer-grid { grid-template-columns: 1fr; } .cta-band { padding: 32px; } .section { padding: 60px 0; } }
@media (max-width: 720px) { .hero h1 { white-space: normal; } }

/* ---------- Reveal on scroll ---------- */
.reveal { opacity: 0; transform: translateY(18px); transition: opacity .6s ease, transform .6s ease; }
.reveal.is-visible { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) { .reveal { opacity: 1; transform: none; transition: none; } }

.skip-link { position: absolute; left: -9999px; }
.skip-link:focus { left: 12px; top: 12px; background: #fff; padding: .6rem 1rem; z-index: 100; border-radius: 8px; }

/* ---------- Portfolio (réalisations) ---------- */
.portfolio { display: grid; gap: 26px; grid-template-columns: repeat(2, 1fr); margin: 28px 0 40px; }
.portfolio__item { background: #fff; border: 1px solid rgba(17,24,20,.08); border-radius: 18px; overflow: hidden; box-shadow: 0 8px 24px rgba(17,24,20,.07); transition: transform .25s ease, box-shadow .25s ease; }
.portfolio__item:hover { transform: translateY(-4px); box-shadow: 0 18px 40px rgba(17,24,20,.14); }
.portfolio__link { display: flex; flex-direction: column; height: 100%; text-decoration: none; color: inherit; }
.portfolio__media { position: relative; aspect-ratio: 3 / 2; background: var(--sand); overflow: hidden; display: flex; align-items: center; justify-content: center; }
.portfolio__media img { width: auto; height: auto; max-width: 100%; max-height: 100%; object-fit: contain; display: block; }
.portfolio__count { position: absolute; right: 12px; bottom: 12px; background: rgba(17,24,20,.72); color: #fff; font-size: .78rem; letter-spacing: .02em; padding: 5px 10px; border-radius: 999px; }
.portfolio__body { padding: 20px 22px 24px; display: flex; flex-direction: column; gap: .55rem; flex: 1; }
.portfolio__body h3 { font-family: var(--font-head); font-size: 1.12rem; line-height: 1.25; margin: 0; }
.portfolio__body p { margin: 0; font-size: .94rem; line-height: 1.55; color: rgba(17,24,20,.72); }
.portfolio__more { margin-top: auto; padding-top: .4rem; font-weight: 600; font-size: .9rem; color: var(--green, #1f5c3d); }

/* Single project page */
.project-cover { display: block; width: fit-content; max-width: 100%; border-radius: 22px; overflow: hidden; margin-bottom: 36px; }
.project-cover img { width: auto; height: auto; max-width: min(100%, 640px); max-height: 420px; object-fit: contain; display: block; }
.entry--narrow { max-width: 760px; }
.project-gallery__title { font-family: var(--font-head); margin: 46px 0 18px; }
.project-gallery { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(min(240px, 100%), 280px)); }
.project-gallery__item { display: flex; align-items: center; justify-content: center; border-radius: 14px; overflow: hidden; background: var(--sand); aspect-ratio: 4 / 3; }
.project-gallery__item img { width: auto; height: auto; max-width: 100%; max-height: 100%; object-fit: contain; display: block; }
.project-back { margin-top: 38px; }
.project-back .btn--ghost { border-color: rgba(17,24,20,.2); color: inherit; }
.project-back .btn--ghost:hover { background: rgba(17,24,20,.06); color: inherit; }

/* Lightbox */
.lightbox { position: fixed; inset: 0; background: rgba(10,14,12,.92); display: flex; align-items: center; justify-content: center; z-index: 999; padding: 24px; }
.lightbox img { max-width: 94vw; max-height: 88vh; border-radius: 10px; }
.lightbox__close, .lightbox__nav { position: absolute; background: rgba(255,255,255,.14); color: #fff; border: 0; border-radius: 999px; width: 46px; height: 46px; font-size: 1.4rem; cursor: pointer; }
.lightbox__close { top: 20px; right: 20px; }
.lightbox__nav--prev { left: 18px; top: 50%; transform: translateY(-50%); }
.lightbox__nav--next { right: 18px; top: 50%; transform: translateY(-50%); }
.lightbox__close:hover, .lightbox__nav:hover { background: rgba(255,255,255,.28); }
@media (max-width: 780px) { .portfolio { grid-template-columns: 1fr; } .project-gallery { grid-template-columns: repeat(2, 1fr); } }
