/* MXGP Terrassement */

/* Polices hébergées sur le site (Barlow / Barlow Condensed, licence SIL OFL), sous-ensemble latin.
   - Titres (Condensed) : "block" -> on attend la police (préchargée) plutôt que d'afficher Arial puis basculer.
   - Texte courant : "optional" -> si la police n'est pas là tout de suite, on garde la police système
     pour toute la page, sans bascule visible ; elle sera en cache dès la page suivante. */
@font-face { font-family: "Barlow Condensed"; font-style: normal; font-weight: 600; font-display: block; src: url("../fonts/barlow-condensed-600.woff2") format("woff2"); }
@font-face { font-family: "Barlow Condensed"; font-style: normal; font-weight: 700; font-display: block; src: url("../fonts/barlow-condensed-700.woff2") format("woff2"); }
@font-face { font-family: "Barlow Condensed"; font-style: normal; font-weight: 800; font-display: block; src: url("../fonts/barlow-condensed-800.woff2") format("woff2"); }
@font-face { font-family: "Barlow"; font-style: normal; font-weight: 400; font-display: optional; src: url("../fonts/barlow-400.woff2") format("woff2"); }
@font-face { font-family: "Barlow"; font-style: normal; font-weight: 600; font-display: optional; src: url("../fonts/barlow-600.woff2") format("woff2"); }
@font-face { font-family: "Barlow"; font-style: normal; font-weight: 700; font-display: optional; src: url("../fonts/barlow-700.woff2") format("woff2"); }

:root {
  --ink: #1a1a1e;
  --ink-2: #2a2a2a;
  --paper: #f1f1f3;
  --white: #ffffff;
  --grey: #626369;
  --line: #d9d9de;
  /* Couleurs du logo MXGP */
  --accent: #c21715;          /* rouge du logo : boutons, soulignés, puces */
  --accent-hover: #a51210;
  --accent-ink: #ffffff;      /* texte posé sur l'accent */
  --accent-text: #b3140f;     /* accent utilisé comme couleur de texte sur fond clair */
  --accent-on-dark: #e8342e;  /* accent lisible sur fond sombre */
  --mark: var(--accent);      /* soulignés, puces, focus */
  --dark: #212126;            /* anthracite de la plaque du logo */
  --darker: #18181c;
  --on-dark: #ececee;
  --on-dark-muted: #a7a8ad;
  --header-bg: #ffffff;
  --header-ink: var(--ink);
  --header-muted: var(--grey);
  --header-line: var(--line);
  --error: #b3261e;
  --ok: #2f6f45;

  --f-head: "Barlow Condensed", "Arial Narrow", Arial, sans-serif;
  --f-body: "Barlow", Arial, sans-serif;

  --wrap: 1240px;
  --pad: clamp(16px, 4vw, 40px);
  --header-h: 72px;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: calc(var(--header-h) + 8px); }
body {
  margin: 0;
  font-family: var(--f-body);
  font-size: 18px;
  line-height: 1.6;
  color: var(--ink);
  background: var(--white);
}
img { max-width: 100%; height: auto; display: block; }
a { color: inherit; -webkit-tap-highlight-color: transparent; }
/* Safari (iOS) colore les boutons en bleu système par défaut : on neutralise */
button { color: inherit; font: inherit; -webkit-appearance: none; appearance: none; -webkit-tap-highlight-color: transparent; }
p { margin: 0 0 1em; }
h1, h2, h3 {
  font-family: var(--f-head);
  font-weight: 700;
  line-height: 1.02;
  margin: 0 0 .5em;
  text-transform: uppercase;
  letter-spacing: .005em;
}
h1 { font-size: clamp(2.6rem, 7vw, 5.6rem); }
h2 { font-size: clamp(2rem, 4.2vw, 3.3rem); }
h3 { font-size: 1.6rem; }

.wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 var(--pad); }
.block { padding: clamp(56px, 8vw, 110px) 0; }
.block--paper { background: var(--paper); }
.block--ink { background: var(--dark); color: var(--on-dark); }
.muted { color: var(--grey); }
.block--ink .muted { color: var(--on-dark-muted); }

.skip-link { position: absolute; left: -9999px; top: 8px; z-index: 999; background: var(--ink); color: #fff; padding: 10px 14px; }
.skip-link:focus { left: 8px; }
:focus-visible { outline: 3px solid var(--mark); outline-offset: 2px; }

/* Boutons */
.btn {
  display: inline-flex; align-items: center; gap: .5em;
  padding: 15px 26px;
  font-family: var(--f-head); font-weight: 700; font-size: 1.15rem;
  text-transform: uppercase; letter-spacing: .03em; line-height: 1;
  text-decoration: none; border: 2px solid transparent; cursor: pointer;
  background: none; color: inherit;
}
.btn--accent { background: var(--accent); color: var(--accent-ink); }
.btn--accent:hover { background: var(--accent-hover); }
.btn--ink { background: var(--ink); color: #fff; }
.btn--ink:hover { background: #333; }
.btn--line { border-color: currentColor; }
.btn--line:hover { background: var(--ink); color: #fff; border-color: var(--ink); }
.btn--full { width: 100%; justify-content: center; }

.textlink {
  font-family: var(--f-head); font-weight: 700; font-size: 1.15rem; text-transform: uppercase;
  letter-spacing: .03em; text-decoration: none; border-bottom: 3px solid var(--mark); padding-bottom: 2px;
}
.textlink:hover { border-color: var(--ink); }

/* En-tête */
.header { position: sticky; top: 0; z-index: 50; background: var(--header-bg); color: var(--header-ink); border-bottom: 1px solid var(--header-line); }
.header .wrap { display: flex; align-items: center; height: var(--header-h); gap: 32px; }
.brand { display: flex; align-items: center; text-decoration: none; margin-right: auto; }
.brand img { display: block; height: 50px; width: auto; }
.footer .brand img { height: 58px; }
@media (max-width: 960px) { .brand img { height: 42px; } }

.nav ul { display: flex; gap: 28px; list-style: none; margin: 0; padding: 0; }
.nav a, .nav a:link, .nav a:visited, .nav a:hover, .nav a:active {
  font-family: var(--f-head); font-weight: 600; font-size: 1.15rem; text-transform: uppercase; letter-spacing: .03em;
  text-decoration: none; padding: 6px 0; border-bottom: 3px solid transparent; color: var(--header-ink);
}
.header__phone, .header__phone:visited { color: var(--header-ink); }
.nav a:hover, .nav a[aria-current="page"] { border-bottom-color: var(--mark); }
.header__phone { text-align: right; text-decoration: none; line-height: 1.1; white-space: nowrap; }
.header__phone small { display: block; font-size: .78rem; color: var(--header-muted); text-transform: uppercase; letter-spacing: .08em; }
.header__phone strong { font-family: var(--f-head); font-size: 1.45rem; font-weight: 700; }
.nav-toggle { display: none; background: none; color: var(--header-ink); border: 2px solid var(--header-ink); border-radius: 0; padding: 8px 12px; font-family: var(--f-head); font-weight: 700; text-transform: uppercase; font-size: 1rem; cursor: pointer; }

@media (max-width: 960px) {
  .header .wrap { gap: 16px; }
  .header__phone { display: none; }
  .nav-toggle { display: block; }
  .nav { position: absolute; top: 100%; left: 0; right: 0; background: var(--header-bg); border-bottom: 1px solid var(--header-line); display: none; }
  .nav.is-open { display: block; }
  .nav ul { flex-direction: column; gap: 0; padding: 8px var(--pad) 16px; }
  .nav a, .nav a:link, .nav a:visited, .nav a:hover, .nav a:active { display: block; padding: 14px 0; border-bottom: 1px solid var(--header-line); font-size: 1.4rem; }
  .nav a[aria-current="page"], .nav a[aria-current="page"]:visited { border-bottom-color: var(--header-line); color: var(--accent-text); }
}

/* Hero */
.hero { position: relative; min-height: min(82vh, 760px); display: flex; align-items: flex-end; color: #fff; background: var(--ink); }
.hero img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.hero::after { content: ""; position: absolute; inset: 0; background: linear-gradient(to right, rgba(0,0,0,.7) 0%, rgba(0,0,0,.35) 50%, rgba(0,0,0,0) 80%), linear-gradient(to top, rgba(0,0,0,.6) 0%, rgba(0,0,0,0) 60%); }
.hero .wrap { position: relative; z-index: 1; width: 100%; padding-bottom: clamp(40px, 7vw, 80px); }
.hero h1 { max-width: 15ch; margin-bottom: .3em; }
.hero__sub { font-size: clamp(1.05rem, 1.6vw, 1.3rem); max-width: 44ch; margin-bottom: 28px; color: #eee; }
.hero__actions { display: flex; flex-wrap: wrap; gap: 18px 28px; align-items: center; }
.hero__actions .textlink { color: #fff; }

/* Intro */
.intro { display: grid; grid-template-columns: 1fr 1.2fr; gap: clamp(28px, 6vw, 96px); }
.intro h2 { margin: 0; }
.intro p { font-size: 1.2rem; }
.facts { display: flex; flex-wrap: wrap; gap: 10px 32px; list-style: none; padding: 20px 0 0; margin: 24px 0 0; border-top: 1px solid var(--line); font-weight: 600; }
.facts li::before { content: ""; display: inline-block; width: 8px; height: 8px; background: var(--mark); margin-right: 10px; vertical-align: middle; }
@media (max-width: 860px) { .intro { grid-template-columns: 1fr; } }

/* Services */
.head-row { display: flex; justify-content: space-between; align-items: flex-end; gap: 24px; flex-wrap: wrap; margin-bottom: 36px; }
.head-row h2 { margin: 0; }
.services { list-style: none; margin: 0; padding: 0; border-top: 2px solid var(--ink); }
.service { display: grid; grid-template-columns: 70px 1.1fr 1.4fr 1.3fr; gap: 24px; padding: 28px 0; border-bottom: 1px solid var(--line); align-items: baseline; }
.service__n { font-family: var(--f-head); font-weight: 700; font-size: 1.2rem; color: var(--grey); }
.service h3 { margin: 0; font-size: 1.9rem; }
.service p { margin: 0; }
.service__list { margin: 0; font-size: .95rem; color: var(--grey); }
@media (max-width: 980px) {
  .service { grid-template-columns: 50px 1fr; gap: 6px 16px; }
  .service p, .service__list { grid-column: 2; }
}

/* Bande photos */
.photos { display: grid; grid-template-columns: 1.6fr 1fr 1fr; gap: 20px 16px; }
.photos figure { margin: 0; display: flex; flex-direction: column; }
.photos img { width: 100%; aspect-ratio: 4/3; object-fit: cover; }
.photos figure:first-child { grid-row: span 2; }
.photos figure:first-child img { aspect-ratio: auto; height: 0; flex: 1 1 auto; min-height: 320px; }
.photos figure:nth-child(4) { grid-column: 2 / 4; }
.photos figure:nth-child(4) img { aspect-ratio: 21/10; }
.photos figcaption { font-size: .9rem; color: var(--grey); padding: 8px 0 0; }
@media (max-width: 860px) {
  .photos { grid-template-columns: 1fr 1fr; }
  .photos figure:first-child { grid-row: auto; grid-column: 1 / -1; }
  .photos figure:first-child img { height: auto; min-height: 0; aspect-ratio: 16/10; }
  .photos figure:nth-child(4) { grid-column: 1 / -1; }
}
@media (max-width: 520px) {
  .photos { grid-template-columns: 1fr; }
  .photos img, .photos figure:nth-child(4) img { aspect-ratio: 4/3; }
}

/* Déroulé */
.steps { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(4, 1fr); gap: 0; counter-reset: s; }
.steps li { counter-increment: s; padding: 0 24px 0 0; border-left: 0; }
.steps li::before { content: counter(s) "."; display: block; font-family: var(--f-head); font-weight: 800; font-size: 3rem; line-height: 1; color: var(--accent-on-dark); margin-bottom: 8px; }
.steps strong { display: block; font-family: var(--f-head); font-size: 1.4rem; text-transform: uppercase; margin-bottom: 4px; color: #fff; }
.steps p { margin: 0; color: var(--on-dark-muted); font-size: 1rem; }
@media (max-width: 860px) { .steps { grid-template-columns: 1fr 1fr; gap: 32px 0; } }
@media (max-width: 480px) { .steps { grid-template-columns: 1fr; } }

/* Zone */
.zone { display: grid; grid-template-columns: 1fr 1.1fr; gap: clamp(28px, 5vw, 72px); align-items: start; }
.zone__map { border: 1px solid var(--line); background: #ddd; aspect-ratio: 1/1; }
@media (max-width: 600px) { .map-label--minor { display: none; } }
.zone__map { position: relative; background: #ecebe7; z-index: 0; }
.zone__fallback { position: absolute; inset: 0; display: grid; place-items: center; font-weight: 600; }
.zone__map .leaflet-container, .zone__map.leaflet-container { font-family: var(--f-body); background: #ecebe7; }
.map-label {
  background: none; border: 0; box-shadow: none; padding: 0;
  font-family: var(--f-body); font-size: 12px; font-weight: 600; color: var(--ink);
  text-shadow: 0 0 2px #fff, 0 0 2px #fff, 0 0 3px #fff;
}
.map-label::before { display: none; }
.map-pin span {
  position: absolute; transform: translate(12px, -50%);
  background: var(--accent); color: var(--accent-ink); border: 2px solid var(--ink);
  font-family: var(--f-head); font-weight: 800; font-size: 15px; letter-spacing: .04em;
  padding: 2px 8px; white-space: nowrap; line-height: 1.2;
}
.zone__map .leaflet-control-zoom a { border-radius: 0; color: var(--ink); }
.zone__map .leaflet-control-zoom { border: 1px solid var(--ink) !important; border-radius: 0; box-shadow: none; }
.zone__map .leaflet-control-attribution { font-size: 10px; }
.map-tiles { filter: grayscale(1) contrast(.7) brightness(1.18); }
.communes { columns: 2; column-gap: 24px; list-style: none; padding: 0; margin: 20px 0 0; }
.communes li { padding: 7px 0; border-bottom: 1px solid var(--line); break-inside: avoid; }
.communes li:first-child { font-weight: 700; }
@media (max-width: 860px) { .zone { grid-template-columns: 1fr; } }

/* FAQ */
.faq { display: grid; grid-template-columns: 1fr 1fr; gap: 0 56px; margin: 0; }
.faq div { padding: 22px 0; border-top: 1px solid var(--line); }
.faq dt { font-weight: 700; font-size: 1.12rem; margin-bottom: 6px; }
.faq dd { margin: 0; color: var(--grey); }
@media (max-width: 860px) { .faq { grid-template-columns: 1fr; } }

/* Bandeau contact */
.callout { display: grid; grid-template-columns: 1.2fr 1fr; gap: 32px; align-items: end; }
.callout h2 { color: #fff; margin: 0 0 .3em; }
.callout__phone { font-family: var(--f-head); font-weight: 800; font-size: clamp(2.6rem, 6vw, 4.6rem); color: var(--accent-on-dark); text-decoration: none; line-height: 1; display: inline-block; }
.callout__phone:hover { color: var(--on-dark); }
.callout__side { display: flex; flex-direction: column; gap: 14px; align-items: flex-start; }
.callout .textlink { color: #fff; }
@media (max-width: 860px) { .callout { grid-template-columns: 1fr; } }

/* Titres de page */
.page-head { padding: clamp(44px, 7vw, 90px) 0 clamp(28px, 4vw, 48px); border-bottom: 2px solid var(--ink); }
.page-head h1 { font-size: clamp(2.6rem, 6vw, 4.8rem); margin-bottom: .2em; }
.page-head p { font-size: 1.2rem; max-width: 60ch; color: var(--grey); margin: 0; }
.crumbs { font-size: .9rem; color: var(--grey); margin-bottom: 18px; }
.crumbs a { text-decoration: none; border-bottom: 1px solid var(--line); }

/* Réalisations */
.filters { display: flex; flex-wrap: wrap; gap: 4px 26px; margin: 0 0 36px; }
.filter {
  background: none; border: 0; padding: 6px 0; cursor: pointer;
  font-family: var(--f-head); font-weight: 600; font-size: 1.2rem; text-transform: uppercase; letter-spacing: .03em; color: var(--grey);
  border-bottom: 3px solid transparent;
}
.filter:hover { color: var(--ink); }
.filter[aria-pressed="true"] { color: var(--ink); border-bottom-color: var(--mark); }
.projects { display: grid; grid-template-columns: repeat(3, 1fr); gap: 44px 20px; }
.project { margin: 0; }
.project[hidden] { display: none; }
.project img { width: 100%; aspect-ratio: 4/3; object-fit: cover; background: var(--paper); }
.project__where { font-size: .85rem; text-transform: uppercase; letter-spacing: .08em; color: var(--grey); margin: 14px 0 4px; font-weight: 600; }
.project h2 { font-size: 1.6rem; margin: 0 0 6px; }
.project p { margin: 0; font-size: 1rem; color: var(--ink-2); }
@media (max-width: 980px) { .projects { grid-template-columns: 1fr 1fr; } }
@media (max-width: 600px) { .projects { grid-template-columns: 1fr; } }

/* Contact */
.contact { display: grid; grid-template-columns: 1fr 1.5fr; gap: clamp(32px, 6vw, 88px); align-items: start; }
.coords dl { margin: 0; }
.coords div { padding: 16px 0; border-bottom: 1px solid var(--line); }
.coords dt { font-size: .8rem; text-transform: uppercase; letter-spacing: .1em; color: var(--grey); font-weight: 600; }
.coords dd { margin: 2px 0 0; font-size: 1.1rem; }
.coords dd a { text-decoration: none; }
.coords .big { font-family: var(--f-head); font-weight: 800; font-size: 2.4rem; line-height: 1.1; }

.form h2 { font-size: 2rem; }
.row { display: grid; grid-template-columns: 1fr 1fr; gap: 0 20px; }
.field { margin-bottom: 20px; }
.field label, .group legend { display: block; font-weight: 600; margin-bottom: 6px; font-size: 1rem; }
.req { color: var(--accent-text); }
.field input, .field select, .field textarea {
  width: 100%; font: inherit; font-size: 1rem; padding: 12px 12px;
  border: 1px solid #a9a397; border-radius: 0; background: #fff; color: var(--ink);
}
.field textarea { min-height: 160px; resize: vertical; }
.field input:focus, .field select:focus, .field textarea:focus { outline: 2px solid var(--ink); outline-offset: 0; border-color: var(--ink); }
.field [aria-invalid="true"] { border-color: var(--error); }
.hint { display: block; font-size: .88rem; color: var(--grey); margin-top: 4px; }
.err { display: block; font-size: .88rem; color: var(--error); }
.group { border: 0; padding: 0; margin: 0 0 20px; }
.group .opts { display: grid; grid-template-columns: 1fr 1fr; gap: 8px 20px; }
.group label { display: flex; gap: 10px; align-items: center; font-size: 1rem; cursor: pointer; }
.group input, .consent input { width: 18px; height: 18px; accent-color: var(--ink); flex: none; }
.consent { display: flex; gap: 10px; align-items: flex-start; font-size: .92rem; color: var(--grey); margin: 4px 0 22px; }
.consent input { margin-top: 3px; }
.hp { position: absolute !important; left: -9999px !important; width: 1px; height: 1px; overflow: hidden; }
.form-status { display: none; margin-top: 16px; padding: 12px 14px; border-left: 4px solid; }
.form-status.is-error { display: block; border-color: var(--error); color: var(--error); background: #fbeeec; }
.form-status.is-success { display: block; border-color: var(--ok); color: var(--ok); background: #eaf3ec; }
@media (max-width: 900px) { .contact { grid-template-columns: 1fr; } }
@media (max-width: 560px) { .row, .group .opts { grid-template-columns: 1fr; } }

/* Texte long */
.prose > * { max-width: 760px; }
.prose h2 { font-size: 1.9rem; margin-top: 1.6em; }
.prose h2:first-child { margin-top: 0; }

/* Pied de page */
.footer { background: var(--darker); color: var(--on-dark-muted); font-size: .95rem; padding: 56px 0 24px; }
.footer a { text-decoration: none; color: var(--on-dark); }
.footer a:hover { color: var(--accent-on-dark); }
.footer__grid { display: grid; grid-template-columns: 1.5fr 1fr 1fr; gap: 32px; padding-bottom: 40px; }
.footer ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.footer h3 { font-size: 1.1rem; color: #fff; letter-spacing: .06em; margin-bottom: 14px; }
.footer__bottom { border-top: 1px solid rgba(255,255,255,.12); padding-top: 20px; display: flex; flex-wrap: wrap; gap: 10px 24px; justify-content: space-between; font-size: .85rem; }
.footer__bottom ul { display: flex; flex-wrap: wrap; gap: 8px 20px; }
.link-button { background: none; border: 0; padding: 0; font: inherit; color: var(--on-dark); cursor: pointer; }
.link-button:hover { color: var(--accent-on-dark); }
@media (max-width: 760px) { .footer__grid { grid-template-columns: 1fr; } }

/* Barre d'action mobile */
.mobile-bar { display: none; }
@media (max-width: 760px) {
  body { padding-bottom: 60px; }
  .mobile-bar { display: grid; grid-template-columns: 1fr 1fr; position: fixed; left: 0; right: 0; bottom: 0; z-index: 60; }
  .mobile-bar a { display: flex; align-items: center; justify-content: center; height: 60px; font-family: var(--f-head); font-weight: 700; font-size: 1.2rem; text-transform: uppercase; text-decoration: none; }
  .mobile-bar a:first-child { background: var(--ink); color: #fff; }
  .mobile-bar a:last-child { background: var(--accent); color: var(--accent-ink); }
}

/* Cookies */
.cookie { position: fixed; left: 0; right: 0; bottom: 0; z-index: 80; background: var(--dark); color: var(--on-dark); padding: 16px 0; font-size: .92rem; border-top: 3px solid var(--accent); }
.cookie[hidden] { display: none; }
.cookie .wrap { display: flex; gap: 16px 28px; align-items: center; justify-content: space-between; flex-wrap: wrap; }
.cookie p { margin: 0; max-width: 70ch; }
.cookie a { color: #fff; }
.cookie__actions { display: flex; gap: 10px; }
.cookie .btn { padding: 10px 18px; font-size: 1rem; }
.cookie .btn--line { color: #fff; }

.visually-hidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; }

