/* ============================================================
   G2M Tôlerie — SITE V1.9 (COMPLET + MAJ)
   style.css (global, partagé entre toutes les pages)
   - UI premium sombre + doré
   - responsive mobile/desktop
   - header sticky + nav mobile
   - cards / sections / gallery
   - pages internes (pageHead, grids, forms)
   - FIX images: pages galerie en "contain" via body[data-page]
   - Lightbox plein écran (galerie)
   - Accessibilité + focus + petits polish
============================================================ */

:root{
  --bg:#070a12;
  --bg2:#0b1020;
  --panel:rgba(255,255,255,.04);
  --panel2:rgba(255,255,255,.06);
  --stroke:rgba(255,255,255,.08);
  --stroke2:rgba(255,213,74,.18);

  --txt:#e9eefc;
  --muted:rgba(233,238,252,.72);
  --muted2:rgba(233,238,252,.55);

  --gold:#ffd54a;
  --gold2:#ffb300;

  --shadow:0 18px 60px rgba(0,0,0,.55);
  --shadow2:0 10px 25px rgba(0,0,0,.35);

  --r1:16px;
  --r2:22px;

  --wrap:1160px;
}

*{ box-sizing:border-box; }
html,body{ height:100%; }

/* PWA polish */
html{ background: var(--bg); }
body{
  margin:0;
  font-family: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Arial;
  background:
    radial-gradient(1000px 600px at 10% -10%, rgba(255,213,74,.10), transparent 55%),
    radial-gradient(900px 500px at 90% 0%, rgba(90,120,255,.14), transparent 55%),
    radial-gradient(1100px 800px at 60% 120%, rgba(255,130,50,.08), transparent 60%),
    linear-gradient(180deg, var(--bg) 0%, var(--bg2) 70%, var(--bg) 100%);
  color:var(--txt);
  -webkit-font-smoothing:antialiased;
  text-rendering:optimizeLegibility;
  overflow-x:hidden;
  overscroll-behavior: none;
}

::selection{ background: rgba(255,213,74,.25); }
a{ color:inherit; text-decoration:none; }
img{ max-width:100%; display:block; }

/* Focus (clavier) */
:focus{ outline:none; }
:focus-visible{
  outline: 3px solid rgba(255,213,74,.35);
  outline-offset: 2px;
}

/* Smooth scroll (global) */
html{ scroll-behavior:smooth; }

.wrap{
  width:min(var(--wrap), calc(100% - 40px));
  margin:0 auto;
}

.muted{ color:var(--muted); }

/* =========================
   Typography (uniformiser)
========================= */
h1,h2,h3{ color:var(--txt); }
h2{ margin:0; font-size:26px; letter-spacing:-.3px; }
h3{ margin:0; font-size:18px; letter-spacing:-.2px; }
p{ margin:0; }

/* =========================
   Buttons
========================= */
.btn{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  gap:10px;
  padding:12px 16px;
  border-radius:14px;
  border:1px solid var(--stroke);
  background: rgba(255,255,255,.04);
  color:var(--txt);
  font-weight:700;
  letter-spacing:.2px;
  box-shadow: var(--shadow2);
  transition: transform .15s ease, background .15s ease, border-color .15s ease;
  white-space:nowrap;
  user-select:none;
}
.btn:hover{
  transform: translateY(-1px);
  background: rgba(255,255,255,.06);
  border-color: rgba(255,255,255,.14);
}
.btn:active{ transform: translateY(0); }

.btn.primary{
  background: linear-gradient(135deg, rgba(255,213,74,.95), rgba(255,179,0,.92));
  color:#1a1200;
  border-color: rgba(255,213,74,.5);
  box-shadow: 0 16px 40px rgba(255,179,0,.18), var(--shadow2);
}
.btn.primary:hover{
  border-color: rgba(255,213,74,.7);
  background: linear-gradient(135deg, rgba(255,213,74,1), rgba(255,179,0,1));
}

/* =========================
   Header / Topbar
========================= */
.topbar{
  position:sticky;
  top:0;
  z-index:50;
  backdrop-filter: blur(12px);
  background: rgba(6,8,14,.55);
  border-bottom:1px solid rgba(255,255,255,.06);
}
.topbar .inner{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:16px;
  padding:14px 0;
}

.brand{
  display:flex;
  align-items:center;
  gap:12px;
  min-width:260px;
}
.logoImg{
  width:44px;
  height:44px;
  border-radius:14px;
  border:1px solid rgba(255,213,74,.22);
  background: rgba(255,255,255,.03);
  box-shadow: var(--shadow2);
  object-fit: cover;
}
.logoImg.small{
  width:34px;
  height:34px;
  border-radius:12px;
}
.brandText{ display:flex; flex-direction:column; line-height:1.05; }
.brandName{
  font-weight:900;
  letter-spacing:.2px;
}
.brandSub{
  font-size:12px;
  color:var(--muted2);
  margin-top:4px;
}

.nav{
  display:flex;
  gap:16px;
  align-items:center;
  padding:8px 12px;
  border:1px solid rgba(255,255,255,.06);
  border-radius:999px;
  background: rgba(255,255,255,.03);
}
.nav a{
  font-weight:700;
  font-size:14px;
  color:var(--muted);
  padding:10px 10px;
  border-radius:12px;
  transition: background .15s ease, color .15s ease;
}
.nav a:hover{
  color:var(--txt);
  background: rgba(255,255,255,.05);
}
.nav a.active,
.nav a[aria-current="page"]{
  color: var(--txt);
  background: rgba(255,255,255,.06);
  border:1px solid rgba(255,213,74,.20);
}

.ctaRow{
  display:flex;
  gap:10px;
  align-items:center;
}

.burger{
  display:none;
  width:48px;
  height:44px;
  border-radius:14px;
  border:1px solid rgba(255,255,255,.08);
  background: rgba(255,255,255,.04);
  box-shadow: var(--shadow2);
  cursor:pointer;
}
.burger span{
  display:block;
  height:2px;
  width:22px;
  background: rgba(233,238,252,.9);
  margin:6px auto;
  border-radius:2px;
  transition: transform .15s ease, opacity .15s ease;
}

/* mobile nav panel */
.mobileNav{
  padding:10px 0 18px;
  border-top:1px solid rgba(255,255,255,.06);
}
.mobileNav a{
  display:block;
  padding:12px 0;
  color:var(--muted);
  font-weight:800;
  border-bottom:1px dashed rgba(255,255,255,.08);
}
.mobileNav a:hover{ color:var(--txt); }
.mobileNav a.active,
.mobileNav a[aria-current="page"]{ color: var(--txt); }
.mobileActions{
  display:flex;
  gap:10px;
  padding-top:12px;
}

/* =========================
   Hero
========================= */
.hero{ padding:28px 0 10px; }
.heroGrid{
  display:grid;
  grid-template-columns: 1.4fr .6fr;
  gap:18px;
  align-items:stretch;
}
.heroCard{
  border-radius: var(--r2);
  background: linear-gradient(180deg, rgba(255,255,255,.04), rgba(255,255,255,.02));
  border:1px solid rgba(255,255,255,.08);
  box-shadow: var(--shadow);
  overflow:hidden;
}
.heroMedia{
  height:240px;
  position:relative;
  background:
    radial-gradient(600px 240px at 30% 0%, rgba(255,213,74,.18), transparent 60%),
    radial-gradient(700px 280px at 80% 60%, rgba(90,120,255,.16), transparent 65%),
    rgba(255,255,255,.02);
  border-bottom:1px solid rgba(255,255,255,.06);
}
.heroMedia img{
  width:100%;
  height:100%;
  object-fit:cover;
  filter: contrast(1.05) saturate(1.1);
  opacity:.95;
  transform: scale(1.01);
}

.heroContent{ padding:18px 18px 20px; }
.chips{
  display:flex;
  flex-wrap:wrap;
  gap:8px;
  margin-bottom:10px;
}
.chip{
  padding:8px 10px;
  border-radius:999px;
  font-size:12px;
  font-weight:800;
  letter-spacing:.15px;
  color:var(--muted);
  border:1px solid rgba(255,255,255,.08);
  background: rgba(255,255,255,.03);
}
.chipGold{
  color:#2a1a00;
  border-color: rgba(255,213,74,.35);
  background: linear-gradient(135deg, rgba(255,213,74,.95), rgba(255,179,0,.92));
}

.heroTitle{
  font-size:42px;
  line-height:1.05;
  margin:10px 0 10px;
  letter-spacing:-.6px;
}
.heroSub{
  margin:0 0 14px;
  color:var(--muted);
  font-weight:600;
  line-height:1.55;
  max-width:58ch;
}
.heroActions{
  display:flex;
  gap:10px;
  flex-wrap:wrap;
  margin:12px 0 10px;
}
.heroInfos{
  display:flex;
  flex-wrap:wrap;
  gap:10px 14px;
  margin-top:14px;
}
.info{
  font-size:13px;
  color:var(--muted2);
  font-weight:700;
  border:1px solid rgba(255,255,255,.06);
  background: rgba(255,255,255,.02);
  padding:10px 12px;
  border-radius:14px;
}

/* side stack */
.sideStack{
  display:flex;
  flex-direction:column;
  gap:18px;
}
.sideCard{
  display:grid;
  grid-template-columns: 110px 1fr;
  gap:12px;
  align-items:center;
  border-radius: var(--r2);
  background: rgba(255,255,255,.03);
  border:1px solid rgba(255,255,255,.08);
  box-shadow: var(--shadow2);
  overflow:hidden;
}
.sideCard img{
  width:110px;
  height:110px;
  object-fit:cover;
  filter: contrast(1.05) saturate(1.05);
}
.sideText{ padding:10px 12px; }
.sideText strong{
  display:block;
  font-size:15px;
  letter-spacing:.2px;
}
.sideText span{
  display:block;
  margin-top:6px;
  color:var(--muted);
  font-weight:600;
  line-height:1.35;
}

/* =========================
   Sections / Panels
========================= */
.section{ padding:22px 0; }
.sectionHead{
  display:flex;
  align-items:flex-end;
  gap:12px;
  margin-bottom:14px;
}
.sectionHead.between{
  justify-content:space-between;
  align-items:center;
}
.sectionHead p{
  margin:6px 0 0;
  color:var(--muted);
  font-weight:600;
  line-height:1.5;
  max-width:72ch;
}
.row{
  display:flex;
  gap:10px;
  flex-wrap:wrap;
  margin-top:14px;
}

.split{
  display:grid;
  grid-template-columns: 1fr 1fr;
  gap:18px;
  align-items:stretch;
}
.panel{
  border-radius: var(--r2);
  background: rgba(255,255,255,.03);
  border:1px solid rgba(255,255,255,.08);
  box-shadow: var(--shadow2);
  overflow:hidden;
}
.pad{ padding:16px; }
.mediaBlock img{
  width:100%;
  height:100%;
  min-height:320px;
  object-fit:cover;
  filter: contrast(1.05) saturate(1.1);
}

/* KPIs */
.kpis{
  display:grid;
  grid-template-columns: 1fr;
  gap:10px;
  margin-top:12px;
}
.kpi{
  padding:12px 12px;
  border-radius:16px;
  border:1px solid rgba(255,255,255,.06);
  background: rgba(255,255,255,.02);
}
.kpi strong{
  display:block;
  font-size:15px;
}
.kpi span{
  display:block;
  margin-top:6px;
  color:var(--muted);
  font-weight:600;
  line-height:1.45;
}

/* =========================
   Grid cards
========================= */
.grid4{
  display:grid;
  grid-template-columns: repeat(4, 1fr);
  gap:14px;
}

.card{
  border-radius: var(--r2);
  background: rgba(255,255,255,.03);
  border:1px solid rgba(255,255,255,.08);
  box-shadow: var(--shadow2);
  overflow:hidden;
  transition: transform .15s ease, border-color .15s ease, background .15s ease;
}
.card:hover{
  transform: translateY(-2px);
  border-color: rgba(255,213,74,.22);
  background: rgba(255,255,255,.04);
}

/* base (cover) */
.card .img{
  position:relative;
  background: rgba(255,255,255,.02);
}
.card .img img{
  width:100%;
  height:160px;
  object-fit:cover;
  filter: contrast(1.05) saturate(1.05);
}

/* option: image entière (contain) */
.card .img.contain{
  height:160px;
  display:flex;
  align-items:center;
  justify-content:center;
  padding:10px;
}
.card .img.contain img{
  height:100%;
  width:100%;
  object-fit:contain;
  filter:none;
  transform:none;
}

/* format large pages internes */
.card.large .img img{ height: 220px; }
.card.large .img.contain{ height:220px; }

.card .body{ padding:12px 12px 14px; }
.card p{
  margin:8px 0 0;
  color:var(--muted);
  font-weight:600;
  line-height:1.5;
  font-size:13.5px;
}
.card h2{
  margin:0;
  font-size: 18px;
  letter-spacing:-.2px;
}

/* =========================
   Gallery
========================= */
.gallery{
  display:grid;
  grid-template-columns: repeat(2, 1fr);
  gap:10px;
  margin-top:12px;
}
.gItem{
  border-radius:16px;
  overflow:hidden;
  border:1px solid rgba(255,255,255,.08);
  background: rgba(255,255,255,.02);
}
.gItem img{
  width:100%;
  height:140px;
  object-fit:cover;
  transition: transform .2s ease;
}
.gItem:hover img{ transform: scale(1.015); }

/* =========================
   CTA Band
========================= */
.ctaBand{
  margin-top:18px;
  padding:16px 16px;
  border-radius: var(--r2);
  border:1px solid rgba(255,213,74,.18);
  background:
    radial-gradient(700px 260px at 10% 0%, rgba(255,213,74,.16), transparent 60%),
    rgba(255,255,255,.03);
  box-shadow: var(--shadow2);
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:14px;
  flex-wrap:wrap;
}
.ctaBand p{
  margin:8px 0 0;
  color:var(--muted);
  font-weight:650;
  line-height:1.45;
}
.ctaBtns{
  display:flex;
  gap:10px;
  flex-wrap:wrap;
}

/* =========================
   Footer
========================= */
.footer{
  padding:26px 0 34px;
  border-top:1px solid rgba(255,255,255,.06);
  margin-top:18px;
  background: rgba(0,0,0,.08);
}
.footGrid{
  display:grid;
  grid-template-columns: 1fr .6fr;
  gap:18px;
  align-items:start;
}
.footBrand{
  display:flex;
  gap:12px;
  align-items:center;
}
.footName{ font-weight:900; }
.footSmall{
  font-size:13px;
  color:var(--muted2);
  font-weight:650;
  line-height:1.5;
}
.footSmall a{ color:var(--gold); }
.mt{ margin-top:10px; }

.footLinks{
  display:flex;
  flex-direction:column;
  gap:10px;
  padding-top:6px;
}
.footLinks a{
  color:var(--muted);
  font-weight:800;
}
.footLinks a:hover{ color:var(--txt); }

/* =========================
   Utility
========================= */
[hidden]{ display:none !important; }
.mt2{ margin-top: 18px; }

/* ============================================================
   Pages internes (pageHead, grids, forms, prose)
============================================================ */
.pageHead{ padding: 26px 0 12px; }
.pageHead h1{
  margin:0;
  font-size: 38px;
  letter-spacing: -0.6px;
}
.pageHead p{
  margin:10px 0 0;
  color: var(--muted);
  font-weight: 650;
  line-height: 1.55;
  max-width: 82ch;
}

.pageBadges{
  margin-top: 14px;
  display:flex;
  gap:10px;
  flex-wrap:wrap;
}
.badge{
  display:inline-flex;
  align-items:center;
  padding: 9px 12px;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,.08);
  background: rgba(255,255,255,.03);
  color: var(--muted);
  font-weight: 850;
  font-size: 12px;
  letter-spacing: .2px;
}

/* Grids */
.grid2{
  display:grid;
  grid-template-columns: 1fr 1fr;
  gap:14px;
}
.grid3{
  display:grid;
  grid-template-columns: repeat(3, 1fr);
  gap:14px;
}

/* Lists */
.list{
  margin: 12px 0 0;
  padding-left: 18px;
  color: var(--muted);
  font-weight: 650;
  line-height: 1.6;
}
.list li{ margin: 6px 0; }

/* Prose (legal pages) */
.prose h2{
  margin: 0 0 10px;
  font-size: 18px;
  letter-spacing:-.2px;
}
.prose p{
  margin: 0 0 14px;
  color: var(--muted);
  font-weight: 650;
  line-height: 1.65;
}
.prose a{ color: var(--gold); }

.hr{
  height:1px;
  width:100%;
  background: rgba(255,255,255,.08);
  margin: 16px 0;
}

/* Contact info */
.infoList{
  margin-top: 10px;
  display:grid;
  gap:10px;
}
.infoLine{
  padding: 12px 12px;
  border-radius: 16px;
  border: 1px solid rgba(255,255,255,.06);
  background: rgba(255,255,255,.02);
  color: var(--muted);
  font-weight: 650;
  line-height: 1.5;
}
.infoLine strong{ color: var(--txt); }

/* Forms */
.form{
  margin-top: 10px;
  display:grid;
  gap: 12px;
}
.form label{
  display:grid;
  gap: 8px;
  font-weight: 850;
  color: var(--txt);
}
.form input, .form textarea{
  width:100%;
  border-radius: 16px;
  border: 1px solid rgba(255,255,255,.10);
  background: rgba(255,255,255,.03);
  color: var(--txt);
  padding: 12px 12px;
  font-size: 14px;
  outline: none;
}
.form input:focus, .form textarea:focus{
  border-color: rgba(255,213,74,.30);
  box-shadow: 0 0 0 3px rgba(255,213,74,.12);
}
.form textarea{
  resize: vertical;
  min-height: 140px;
}
.small{
  font-size: 12px;
  color: var(--muted2);
  font-weight: 650;
}

/* ============================================================
   FIX IMAGES — pages galerie (Réalisations / Parc machines)
   -> Ajoute dans tes pages :
      <body data-page="realisations">
      <body data-page="parc">
============================================================ */
body[data-page="realisations"] .card .img,
body[data-page="parc"] .card .img{
  height: 220px;
  display:flex;
  align-items:center;
  justify-content:center;
  padding:10px;
  background: rgba(255,255,255,.02);
}
body[data-page="realisations"] .card .img img,
body[data-page="parc"] .card .img img{
  width:100%;
  height:100%;
  object-fit: contain;
  filter:none;
  transform:none;
}

/* Bonus : si tu oublies data-page mais tu mets .contain => OK déjà.
   Si tu veux forcer partout, remplace cover par contain, mais je déconseille. */

/* =========================
   Responsive
========================= */
@media (max-width: 980px){
  .nav{ display:none; }
  .ctaRow{ display:none; }
  .burger{ display:inline-block; }
  .heroGrid{ grid-template-columns: 1fr; }
  .split{ grid-template-columns: 1fr; }
  .grid4{ grid-template-columns: repeat(2, 1fr); }
  .mediaBlock img{ min-height:240px; }
  .footGrid{ grid-template-columns: 1fr; }

  .pageHead h1{ font-size: 32px; }
  .grid2{ grid-template-columns: 1fr; }
  .grid3{ grid-template-columns: 1fr; }
}

@media (max-width: 560px){
  .wrap{ width: min(var(--wrap), calc(100% - 26px)); }
  .heroTitle{ font-size:34px; }
  .heroMedia{ height:210px; }
  .grid4{ grid-template-columns: 1fr; }
  .gallery{ grid-template-columns: 1fr; }
  .sideCard{ grid-template-columns: 96px 1fr; }
  .sideCard img{ width:96px; height:96px; }
}

/* ============================================================
   G2M — LIGHTBOX (galerie plein écran) V1
   (si tu utilises un JS lightbox)
============================================================ */
.lb{
  position:fixed;
  inset:0;
  z-index:9999;
  display:none;
}
.lb[aria-hidden="false"]{ display:block; }

.lb__backdrop{
  position:absolute;
  inset:0;
  background: rgba(0,0,0,.86);
  backdrop-filter: blur(6px);
}

.lb__panel{
  position:relative;
  height:100%;
  display:grid;
  grid-template-rows:auto 1fr auto;
  padding: 14px;
}

.lb__top{
  display:flex;
  justify-content:space-between;
  align-items:center;
  gap:10px;
  color: var(--txt);
  padding: 8px 6px;
}

.lb__title{
  font-weight:900;
  letter-spacing:.2px;
  color: var(--txt);
}
.lb__meta{
  color: var(--muted);
  font-weight:650;
  font-size:13px;
  margin-top:3px;
}

.lb__btn{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  width:44px;
  height:44px;
  border-radius:14px;
  border:1px solid rgba(255,255,255,.10);
  background: rgba(255,255,255,.05);
  color: var(--txt);
  box-shadow: var(--shadow2);
  cursor:pointer;
  transition: transform .15s ease, background .15s ease, border-color .15s ease;
}
.lb__btn:hover{
  transform: translateY(-1px);
  background: rgba(255,255,255,.07);
  border-color: rgba(255,255,255,.18);
}

.lb__stage{
  position:relative;
  display:flex;
  align-items:center;
  justify-content:center;
  height:100%;
  max-width: 1100px;
  margin: 0 auto;
}

.lb__img{
  max-width: 100%;
  max-height: calc(100vh - 180px);
  width:auto;
  height:auto;
  object-fit: contain;
  border-radius: 18px;
  border: 1px solid rgba(255,255,255,.10);
  background: rgba(255,255,255,.03);
  box-shadow: var(--shadow);
}

.lb__nav{
  position:absolute;
  top:50%;
  transform: translateY(-50%);
  display:flex;
  align-items:center;
  justify-content:center;
  width:54px;
  height:54px;
  border-radius:18px;
  border:1px solid rgba(255,255,255,.10);
  background: rgba(255,255,255,.05);
  box-shadow: var(--shadow2);
  cursor:pointer;
}
.lb__nav:hover{ background: rgba(255,255,255,.08); }

.lb__nav.prev{ left: 8px; }
.lb__nav.next{ right: 8px; }

.lb__bottom{
  max-width:1100px;
  margin: 0 auto;
  padding: 8px 6px 14px;
  color: var(--muted);
  font-weight:650;
  display:flex;
  justify-content:space-between;
  gap:12px;
  flex-wrap:wrap;
}

.lb__hint{
  font-size:13px;
  color: var(--muted2);
}

@media (max-width: 560px){
  .lb__nav{ width:48px; height:48px; border-radius:16px; }
  .lb__img{ max-height: calc(100vh - 220px); }
}