/* elmat.tn v2 — identité : vert ELMAT #138753, encre vert profond, gris atelier.
   Motif graphique : le parallélogramme du logo (coins biseautés sur boutons, cadres et repères). */

:root {
  --green: #138753;
  --green-dark: #0E6A41;
  --green-light: #E3F1E9;
  --ink: #0F2B1E;
  --ink-2: #163A2A;
  --paper: #F5F7F5;
  --white: #FFFFFF;
  --steel: #E5E9E6;
  --line: #CBD3CD;
  --text: #24312A;
  --muted: #5C6963;
  --focus: #F5C518;
  --font-body: "Barlow", "Helvetica Neue", Arial, sans-serif;
  --font-display: "Barlow Semi Condensed", "Arial Narrow", Arial, sans-serif;
  --max: 1200px;
  --cut: 10px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; overflow-x: clip; }
body { margin: 0; background: var(--white); color: var(--text); font: 400 1.0625rem/1.55 var(--font-body); -webkit-font-smoothing: antialiased; overflow-x: clip; }
img { max-width: 100%; height: auto; display: block; }
a { color: var(--green-dark); }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; }
.wrap { max-width: var(--max); margin: 0 auto; padding: 0 24px; }
h1, h2, h3, h4 { font-family: var(--font-display); color: var(--ink); line-height: 1.08; margin: 0; }
h1 { font-size: clamp(2.3rem, 4.6vw, 3.6rem); font-weight: 800; }
h2 { font-size: clamp(1.8rem, 3vw, 2.4rem); font-weight: 700; }
h3 { font-size: 1.35rem; font-weight: 700; }
h4 { font-size: 1.1rem; font-weight: 700; }
p { margin: 0 0 1em; }
.lead { font-size: 1.2rem; max-width: 60ch; }
.muted { color: var(--muted); }
.skip-link { position: absolute; left: -9999px; top: 8px; background: var(--ink); color: #fff; padding: 10px 14px; z-index: 100; }
.skip-link:focus { left: 8px; }

/* Parallélogramme : coins biseautés comme le sigle du logo */
.cut { clip-path: polygon(var(--cut) 0, 100% 0, calc(100% - var(--cut)) 100%, 0 100%); }

/* ---------- Boutons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  padding: 14px 26px; font: 600 1rem var(--font-body); text-decoration: none;
  color: #fff; background: var(--green); border: 0; cursor: pointer;
  clip-path: polygon(var(--cut) 0, 100% 0, calc(100% - var(--cut)) 100%, 0 100%);
  transition: background-color .15s ease;
}
.btn:hover { background: var(--green-dark); color: #fff; }
.btn-light { background: #fff; color: var(--ink); }
.btn-light:hover { background: var(--paper); color: var(--ink); }
.btn-ghost { background: transparent; color: var(--ink); box-shadow: inset 0 0 0 2px var(--ink); clip-path: none; }
.btn-ghost:hover { background: var(--ink); color: #fff; }
.btn-outline-light { background: transparent; color: #fff; box-shadow: inset 0 0 0 2px #fff; clip-path: none; }
.btn-outline-light:hover { background: #fff; color: var(--ink); }
.link-more { font-weight: 600; text-decoration: none; color: var(--green-dark); border-bottom: 2px solid var(--green-light); }
.link-more:hover { border-color: var(--green); }

/* ---------- En-tête ---------- */
.site-header { position: sticky; top: 0; z-index: 50; background: #fff; box-shadow: 0 1px 0 var(--line); }
.topbar { background: var(--ink); color: #D6E3DB; font-size: .92rem; }
.topbar .wrap { display: flex; align-items: center; justify-content: space-between; height: 38px; gap: 24px; }
.topnav { display: flex; gap: 22px; }
.topnav a, .topbar-phone { color: #fff; text-decoration: none; font-weight: 500; }
.topnav a:hover, .topbar-phone:hover { color: #9BDDBA; }
.topnav a[aria-current="page"] { color: #9BDDBA; }
.topbar-right { display: flex; align-items: center; gap: 22px; }
.lang-switch { display: flex; gap: 0; border: 1px solid rgba(255,255,255,.35); }
.lang-switch a { color: #fff; text-decoration: none; padding: 2px 9px; font-weight: 600; font-size: .85rem; }
.lang-switch .lang-current { background: var(--green); }
.mainbar .wrap { display: flex; align-items: center; gap: 28px; height: 84px; }
.brand img { height: 44px; width: auto; }
.nav { margin-left: auto; display: flex; align-items: center; gap: 28px; }
.nav-families { display: flex; gap: 26px; }
.nav-families a { color: var(--ink); text-decoration: none; font-family: var(--font-display); font-weight: 700; font-size: 1.1rem; padding: 6px 0; border-bottom: 3px solid transparent; }
.nav-families a:hover, .nav-families a[aria-current="page"] { border-color: var(--green); }
.nav-top { display: none; }
.nav-cta { padding: 12px 20px; }
.nav-toggle { display: none; margin-left: auto; width: 44px; height: 44px; padding: 0; background: transparent; border: 1px solid var(--line); cursor: pointer; align-items: center; justify-content: center; }
.nav-toggle span, .nav-toggle span::before, .nav-toggle span::after { display: block; width: 20px; height: 2px; background: var(--ink); position: relative; content: ""; }
.nav-toggle span::before { position: absolute; top: -6px; }
.nav-toggle span::after { position: absolute; top: 6px; }

/* ---------- Sections ---------- */
.section { padding: 88px 0; }
.section--paper { background: var(--paper); }
.section--ink { background: var(--ink); color: #D6E3DB; }
.section--ink h2, .section--ink h3 { color: #fff; }
.section-head { max-width: 780px; margin-bottom: 40px; }
.section-head h2 { position: relative; padding-left: 26px; }
.section-head h2::before { content: ""; position: absolute; left: 0; top: .18em; width: 14px; height: .8em; background: var(--green); clip-path: polygon(30% 0, 100% 0, 70% 100%, 0 100%); }
.section-head p { font-size: 1.12rem; color: var(--muted); margin: 14px 0 0 26px; }
.section--ink .section-head p { color: #B9CDC2; }

/* ---------- Hero accueil ---------- */
.hero { position: relative; background: var(--ink); color: #fff; overflow: hidden; }
.hero-media { position: absolute; inset: 0; }
.hero-media img { width: 100%; height: 100%; object-fit: cover; opacity: .55; }
.hero-media::after { content: ""; position: absolute; inset: 0; background: linear-gradient(90deg, rgba(15,43,30,.95) 0%, rgba(15,43,30,.75) 45%, rgba(15,43,30,.25) 100%); }
.hero .wrap { position: relative; padding-top: 96px; padding-bottom: 96px; max-width: var(--max); }
.hero h1 { color: #fff; max-width: 15ch; margin-bottom: 20px; }
.hero p { font-size: 1.22rem; max-width: 52ch; color: #E2ECE6; margin-bottom: 32px; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 14px; }
.hero-strip { background: var(--green); color: #fff; }
.hero-strip ul { list-style: none; margin: 0; padding: 14px 0; display: flex; flex-wrap: wrap; gap: 10px 36px; font-family: var(--font-display); font-weight: 600; font-size: 1.05rem; }
.hero-strip li { position: relative; padding-left: 18px; }
.hero-strip li::before { content: ""; position: absolute; left: 0; top: .45em; width: 9px; height: .55em; background: #fff; clip-path: polygon(30% 0, 100% 0, 70% 100%, 0 100%); }

/* ---------- Familles (pôles) ---------- */
.pillars { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 18px; }
.pillars .body { padding: 16px 16px 18px; }
.pillars h3 { font-size: 1.2rem; }
.pillars p { font-size: .94rem; }
.pillar { background: #fff; border: 1px solid var(--line); text-decoration: none; color: var(--text); display: flex; flex-direction: column; }
.pillar .media { aspect-ratio: 4 / 3; overflow: hidden; background: var(--steel); }
.pillar .media img { width: 100%; height: 100%; object-fit: cover; }
.pillar .body { padding: 20px 20px 22px; display: flex; flex-direction: column; gap: 8px; flex: 1; }
.pillar h3 { color: var(--ink); }
.pillar p { margin: 0; color: var(--muted); font-size: .98rem; }
.pillar .more { margin-top: auto; padding-top: 12px; font-weight: 600; color: var(--green-dark); }
.pillar:hover { border-color: var(--green); }
.pillar:hover h3 { color: var(--green-dark); }

/* ---------- Présentation ---------- */
.intro-grid { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); gap: 56px; align-items: center; }
.intro-grid ul { padding-left: 20px; }
.intro-grid li { margin-bottom: 8px; }

/* Bandeau de chiffres (caché tant que les chiffres ne sont pas validés) */
.stats { background: var(--green); color: #fff; }
.stats ul { list-style: none; margin: 0; padding: 30px 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; text-align: center; }
.stats strong { display: block; font-family: var(--font-display); font-size: 2.6rem; font-weight: 800; line-height: 1; }
.stats span { font-size: 1rem; }

/* ---------- Marchés ---------- */
.markets { display: grid; grid-template-columns: repeat(3, 1fr); gap: 22px; }
.market { background: #fff; border-top: 4px solid var(--green); padding: 26px 26px 28px; border-left: 1px solid var(--line); border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.market h3 { margin-bottom: 10px; }
.market ul { margin: 12px 0 0; padding-left: 18px; color: var(--muted); }
.market li { margin-bottom: 6px; }

/* ---------- Réalisations ---------- */
.projects { display: grid; grid-template-columns: repeat(auto-fit, minmax(290px, 1fr)); gap: 22px; }
.project { background: #fff; border: 1px solid var(--line); display: flex; flex-direction: column; }
.project .media { aspect-ratio: 16 / 10; overflow: hidden; background: var(--steel); }
.project .media img { width: 100%; height: 100%; object-fit: cover; }
.project .body { padding: 20px 22px 22px; }
.project .sector { display: inline-block; font-size: .85rem; font-weight: 600; color: var(--ink); background: var(--green-light); padding: 3px 10px; margin-bottom: 10px; clip-path: polygon(6px 0, 100% 0, calc(100% - 6px) 100%, 0 100%); }
.project h3 { margin-bottom: 8px; font-size: 1.25rem; }
.project p { margin: 0; color: var(--muted); font-size: .98rem; }
.project dl { margin: 14px 0 0; display: grid; grid-template-columns: auto 1fr; gap: 4px 12px; font-size: .95rem; }
.project dt { font-weight: 600; color: var(--ink); }
.project dd { margin: 0; color: var(--muted); }

/* ---------- Démarche ---------- */
.steps { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(5, 1fr); gap: 18px; counter-reset: step; }
.steps li { background: #fff; border: 1px solid var(--line); padding: 22px 20px; position: relative; }
.steps li::before { counter-increment: step; content: counter(step, decimal-leading-zero); display: block; font-family: var(--font-display); font-size: 2rem; font-weight: 800; color: var(--green); line-height: 1; margin-bottom: 10px; }
.steps h3 { font-size: 1.15rem; margin-bottom: 6px; }
.steps p { margin: 0; color: var(--muted); font-size: .95rem; }
.steps--4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.gallery--2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }

/* ---------- Bandeau contact ---------- */
.cta-band { background: var(--ink-2); color: #D6E3DB; padding: 64px 0; }
.cta-band .wrap { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: 40px; align-items: center; }
.cta-band h2 { color: #fff; margin-bottom: 12px; }
.cta-band p { margin: 0; max-width: 60ch; }
.cta-actions { display: flex; flex-direction: column; align-items: flex-start; gap: 14px; }
.cta-phone { color: #fff; text-decoration: none; font-weight: 600; }
.cta-phone:hover { color: #9BDDBA; }

/* ---------- Pages internes ---------- */
.page-hero { background: var(--paper); border-bottom: 1px solid var(--line); }
.page-hero .wrap { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); gap: 48px; align-items: center; padding-top: 64px; padding-bottom: 64px; }
.page-hero .kicker { font-family: var(--font-display); font-weight: 600; color: var(--green-dark); margin-bottom: 10px; }
.page-hero h1 { margin-bottom: 16px; }
.page-hero .lead { margin-bottom: 24px; }
.page-hero figure { margin: 0; }
.frame { background: #fff; border: 1px solid var(--line); padding: 10px; }
.frame img { width: 100%; }
.frame figcaption { font-size: .9rem; color: var(--muted); padding: 10px 4px 2px; }

.two-col { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 48px; align-items: start; }
.three-col { display: grid; grid-template-columns: repeat(3, 1fr); gap: 22px; }
.card { background: #fff; border: 1px solid var(--line); padding: 26px 26px 28px; }
.card h3 { margin-bottom: 10px; }
.card p:last-child { margin-bottom: 0; }
.card ul { margin: 10px 0 0; padding-left: 18px; }
.card li { margin-bottom: 6px; }

.spec { width: 100%; border-collapse: collapse; background: #fff; border: 1px solid var(--line); }
.spec th, .spec td { text-align: left; vertical-align: top; padding: 14px 18px; border-top: 1px solid var(--line); }
.spec th { width: 30%; color: var(--ink); font-weight: 600; background: var(--paper); }
.spec tr:first-child th, .spec tr:first-child td { border-top: 0; }

.checks { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px 28px; }
.checks li { position: relative; padding-left: 26px; }
.checks li::before { content: ""; position: absolute; left: 0; top: .42em; width: 12px; height: .7em; background: var(--green); clip-path: polygon(30% 0, 100% 0, 70% 100%, 0 100%); }

.gallery { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.gallery figure { margin: 0; background: #fff; border: 1px solid var(--line); padding: 8px; }
.gallery img { width: 100%; aspect-ratio: 16 / 10; object-fit: cover; }
.gallery figcaption { font-size: .9rem; color: var(--muted); padding: 8px 4px 2px; }

/* Emplacement photo (en attendant les photos de l'atelier) */
.ph { margin: 0; background: repeating-linear-gradient(135deg, #EEF2EF 0 12px, #E6EBE7 12px 24px); border: 1px dashed var(--line); display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; color: var(--muted); padding: 24px; min-height: 240px; }
.ph svg { width: 34px; height: 34px; margin-bottom: 10px; opacity: .6; }
.ph span { font-size: .92rem; max-width: 26ch; }
.ph.tall { min-height: 340px; }

/* ---------- Contact ---------- */
.contact-grid { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, .8fr); gap: 56px; align-items: start; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 18px; }
.field label { font-weight: 600; color: var(--ink); }
.field input, .field textarea, .field select { font: 400 1rem var(--font-body); color: var(--text); background: #fff; border: 1px solid var(--line); padding: 12px 14px; }
.field input:focus, .field textarea:focus, .field select:focus { border-color: var(--green); outline: 3px solid var(--focus); outline-offset: 1px; }
.field textarea { min-height: 150px; resize: vertical; }
.field .hint { font-size: .9rem; color: var(--muted); }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.form-status { margin-top: 16px; padding: 12px 14px; display: none; }
.form-status.ok { display: block; background: var(--green-light); color: var(--ink); border: 1px solid var(--green); }
.form-status.err { display: block; background: #FBEDEA; color: #7A2418; border: 1px solid #D8543C; }
.contact-card { background: var(--paper); border: 1px solid var(--line); padding: 30px; }
.contact-card h3 { margin-bottom: 12px; }
.contact-card address { font-style: normal; line-height: 1.6; margin-bottom: 16px; }
.contact-card dl { margin: 0; display: grid; grid-template-columns: auto 1fr; gap: 8px 18px; }
.contact-card dt { font-weight: 600; color: var(--ink); }
.contact-card dd { margin: 0; }
.contact-card .map-link { display: inline-block; margin-top: 18px; }

/* Panneau de faits : liste de définitions empilée, dans une carte */
.contact-card .facts-list { display: block; margin: 0; }
.contact-card .facts-list dt { font-family: var(--font-display); font-size: 1.08rem; font-weight: 700; color: var(--ink); margin-top: 14px; }
.contact-card .facts-list dt:first-of-type { margin-top: 0; }
.contact-card .facts-list dd { margin: 2px 0 0; color: var(--muted); font-size: .97rem; padding-bottom: 12px; border-bottom: 1px solid var(--line); }
.contact-card .facts-list dd:last-of-type { border-bottom: 0; padding-bottom: 0; }

/* ---------- Pied de page ---------- */
.site-footer { background: var(--ink); color: #C9D8CF; padding: 56px 0 28px; }
.footer-grid { display: grid; grid-template-columns: 1.3fr 1fr 1fr; gap: 40px; }
.footer-brand img { height: 44px; width: auto; margin-bottom: 10px; }
.footer-brand .tagline { color: #9BDDBA; font-weight: 600; margin-bottom: 8px; }
.footer-brand p { max-width: 42ch; }
.site-footer h3 { color: #fff; font-size: 1.1rem; margin-bottom: 12px; }
.site-footer ul { list-style: none; margin: 0; padding: 0; columns: 2; column-gap: 24px; }
.site-footer li { margin-bottom: 8px; break-inside: avoid; }
.site-footer a { color: #fff; text-decoration: none; }
.site-footer a:hover { text-decoration: underline; }
.site-footer address { font-style: normal; line-height: 1.7; }
.footer-logos { display: flex; align-items: center; gap: 16px; margin-top: 16px; }
.footer-logos img { height: 42px; width: auto; background: #fff; padding: 4px; }
.staging-note { margin: 28px 0 0; padding: 10px 14px; background: rgba(245,197,24,.12); border: 1px solid rgba(245,197,24,.5); color: #F5E7B0; font-size: .92rem; }
.footer-bottom { margin-top: 36px; padding-top: 18px; border-top: 1px solid rgba(255,255,255,.15); display: flex; flex-wrap: wrap; justify-content: space-between; gap: 10px; font-size: .92rem; }

/* ---------- Responsive ---------- */
@media (max-width: 1160px) {
  .pillars { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 1080px) {
  .steps, .steps--4 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .nav-families { gap: 18px; }
  .nav-families a { font-size: 1rem; }
}
@media (max-width: 960px) {
  .section { padding: 64px 0; }
  .intro-grid, .two-col, .page-hero .wrap, .contact-grid, .cta-band .wrap { grid-template-columns: minmax(0, 1fr); gap: 32px; }
  .markets, .projects, .three-col, .gallery, .gallery--2 { grid-template-columns: minmax(0, 1fr); }
  .pillars { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .footer-grid { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .topnav { display: none; }
  .topbar .wrap { justify-content: flex-end; }
  .nav { position: fixed; inset: 122px 0 0 0; display: none; flex-direction: column; align-items: stretch; gap: 0; background: #fff; padding: 12px 24px 32px; overflow: auto; }
  .nav.is-open { display: flex; }
  .nav-families, .nav-top { display: flex; flex-direction: column; gap: 0; }
  .nav-families a, .nav-top a { padding: 14px 0; border-bottom: 1px solid var(--line) !important; border-top: 0; }
  .nav-top { margin-top: 8px; }
  .nav-top a { font-weight: 500; color: var(--ink); text-decoration: none; }
  .nav-top .lang-switch { margin-top: 16px; align-self: flex-start; border-color: var(--line); }
  .nav-top .lang-switch a { color: var(--ink); border: 0 !important; padding: 4px 12px; }
  .nav-top .lang-switch .lang-current { background: var(--green); color: #fff; }
  .nav-cta { margin-top: 20px; }
  .nav-toggle { display: inline-flex; }
  .hero .wrap { padding-top: 64px; padding-bottom: 64px; }
}
@media (max-width: 600px) {
  .pillars, .steps, .steps--4, .checks, .form-row { grid-template-columns: minmax(0, 1fr); }
  .stats ul { grid-template-columns: minmax(0, 1fr); }
  .footer-grid { grid-template-columns: minmax(0, 1fr); }
  .site-footer ul { columns: 1; }
  .mainbar .wrap { height: 72px; }
  .brand img { height: 38px; }
  .nav { inset: 110px 0 0 0; }
  .spec th { width: 38%; }
  .topbar-phone { display: none; }
}
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } .btn { transition: none; } }
