/* Reset & Global */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Arial', sans-serif;
  line-height: 1.6;
  color: #0c2a53;
}

/* Global image settings */
img {
  max-width: 100%;
  height: auto;
  display: block;
}

/* HEADER */

/* Logo dans le header */
.logo-le {
  max-width: 150px;
  height: auto;
}

/* HERO */
#hero {
  position: relative;
  text-align: center;
  overflow: hidden;
  height: 100vh;
}

/* Vidéo en arrière-plan */
#hero-video {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover; /* La vidéo couvre toute la section */
  z-index: 1;
  pointer-events: none; /* Empêche toute interaction avec la vidéo */
}

/* Texte au-dessus de la vidéo */
.hero-text {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  color: #fff;
  z-index: 2; /* Par-dessus la vidéo */
  text-align: center;
}

/* Pour éviter que le header fixe ne recouvre la galerie */
#gallery, #about, #contact {
  scroll-margin-top: 80px;
}

#gallery::before {
  content: "";
  display: block;
  height: 80px;
  margin-top: -80px;
}

/* Conteneur commun */
.content-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
}

/* CAROUSEL & Galerie */
.carousel-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
}

.carousel-slide {
  display: none;
}

.carousel-slide.active {
  display: block;
}

.gallery-grid {
  display: grid;
  gap: 15px;
  grid-template-columns: repeat(4, 1fr);
}

@media (max-width: 1199px) and (min-width: 768px) {
  .gallery-grid {
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  }
}

@media (max-width: 767px) {
  .gallery-grid {
    grid-template-columns: 1fr;
  }
}

.gallery-item {
  position: relative;
  overflow: hidden;
}

.gallery-item img {
  width: 100%;
  height: 150px;
  object-fit: cover;
}

.gallery-item.span-2 {
  grid-column: span 2;
}

.carousel-controls {
  text-align: center;
  margin-top: 20px;
}

.carousel-controls button {
  background: transparent;
  border: none;
  padding: 0;
  margin: 0 10px;
  cursor: pointer;
}

.carousel-controls svg,
.carousel-controls i {
  width: 24px;
  height: 24px;
  display: block;
}

/* Titre "Galerie" centré */
#gallery h2 {
  text-align: center;
  margin-bottom: 20px;
  font-size: 2em;
  color: #0c2a53;
}

/* === Deux sections galerie === */
.gallery-section { padding: 100px 0; }
.gallery-section .content-container h2 {
  text-align: center;
  margin-bottom: 20px;
  font-size: 2em;
  color: #0c2a53;
}

/* (Option) Espace entre les 2 galeries */
#gallery-pros { border-bottom: 1px solid #eee; padding-bottom: 32px; margin-bottom: 32px; }

/* Conserve ta grille existante.
   Si tu veux un peu plus grand sur desktop : */
/* .gallery-grid { grid-template-columns: repeat(4, 1fr); } */

/* Vignettes cliquables */
.gallery-item img { cursor: zoom-in; border-radius: 6px; }

/* === LIGHTBOX image gauche / texte droite === */
#lightbox.hidden { display: none; }
#lightbox {
  position: fixed; inset: 0; z-index: 1000;
  display: grid; place-items: center;
}
.lightbox-backdrop {
  position: absolute; inset: 0;
  background: rgba(0,0,0,0.6);
}
#lightbox-close {
  position: absolute; top: 18px; right: 22px; z-index: 2;
  font-size: 32px; line-height: 1;
  background: transparent; border: none; color: #fff; cursor: pointer;
}
.lightbox-content {
  position: relative; z-index: 2;
  width: min(1100px, 94vw);
  height: min(80vh, 800px);
  background: #fff;
  border-radius: 10px;
  overflow: hidden;
  display: grid;
  grid-template-columns: 1.8fr 1fr; /* image / texte */
  box-shadow: 0 12px 40px rgba(0,0,0,.25);
}
.lightbox-media {
  position: relative;
  background: #000;
  display: grid; place-items: center;
}
#lightbox-img {
  max-width: 100%; max-height: 100%;
  object-fit: contain;
}
.lightbox-arrow {
  position: absolute; top: 50%; transform: translateY(-50%);
  background: rgba(0,0,0,0.45);
  color: #fff; border: none; cursor: pointer;
  padding: 8px 12px; border-radius: 8px;
}
#lightbox-prev { left: 10px; }
#lightbox-next { right: 10px; }
.lightbox-aside {
  padding: 22px;
  overflow: auto;
}
.lightbox-aside h3 { margin: 0 0 8px; font-size: 1.25rem; color: #0c2a53; }
.lightbox-aside p  { margin: 0; line-height: 1.5; color: #0c2a53; }

/* Mobile : pile image puis texte */
@media (max-width: 768px) {
  .lightbox-content { grid-template-columns: 1fr; height: 90vh; }
  .lightbox-aside { border-top: 1px solid #eee; }
}

/* Présentation "Notre Atelier" */
.presentation-text {
  max-width: 900px;
  margin: 0 auto;
  padding: 40px 20px;
  text-align: center;
  background: #eaeaea;
  border-radius: 8px;
}

.presentation-text h2 {
  font-size: 2em;
  margin-bottom: 20px;
  color: #0c2a53;
  font-weight: bold;
}

.presentation-text p {
  font-size: 1.1em;
  line-height: 1.6;
  color: #555;
  text-align: justify;
}

.presentation-text strong {
  color: #000;
  font-weight: bold;
}

.presentation-text h3 {
  font-size: 1.3em;
  text-align: left;
  margin-bottom: 10px;
  color: #0c2a53;
  font-weight: bold;
}

.services-list {
  list-style-type: disc;
  padding-left: 20px;
  text-align: left;
  max-width: 400px;
  margin: 20px 0;
}

.services-list li {
  font-size: 1.1em;
  margin: 10px 0;
  color: #555;
}

.creation-info {
  font-size: 0.8em;
  color: #999;
  margin-top: 20px;
}

/* SECTION ABOUT */
#about {
  padding: 50px 200px;
}

@media (max-width: 767px) {
  #about{
      padding: 50px 25px;
  }

  .engagements{
    padding-block: 1em !important; 
  }

  #projectkey {
    padding: 125px 25px !important;
  }

  #projectkey h2 {
    font-size: 1.75em !important;
  }
}

#about h2{
  text-align: center;
  color:#0c2a53;
  font-size: 2rem;
}

.frise-lassabe{
  margin:0 auto;
}

/* SECTION CONTACT */
#contact {
  padding: 50px 20px;
  background: #e7ecf1;
}

#contact h2 {
  text-align: center;
  margin-bottom: 20px;
  font-size: 2em;
  color: #0c2a53;
}

#contact form {
  width: 80%;
  margin: 0 auto;
  display: grid;
  gap: 10px;
}

.form-group {
  margin-bottom: 10px;
}

.form-group label {
  display: block;
  margin-bottom: 5px;
  font-size: 1em;
  color: #0c2a53;
}

.form-group input,
.form-group textarea {
  width: 100%;
  padding: 10px;
  border: 1px solid #ccc;
  border-radius: 4px;
  font-size: 1em;
  transition: border-color 0.3s;
}

.form-group input:focus,
.form-group textarea:focus {
  border-color: #999;
  outline: none;
}

.form-group textarea {
  min-height: 120px;
}

#contact button {
  width: auto;
  padding: 5px 10px;
  background: #0c2a53;
  border: none;
  color: #fff;
  font-size: 0.9em;
  border-radius: 4px;
  cursor: pointer;
  transition: background-color 0.3s;
  display: inline-block;
  justify-self: start;
}

#contact button:hover {
  background-color: #e7ecf1;
  color: #0c2a53;
  border: 1px solid #0c2a53;
}

/* FOOTER – fond gris foncé + texte blanc */
footer {
  background: #0c2a53;
  color: #fff;
}

/* Conteneur horizontal : logo à gauche + contact à côté + icônes à droite */
.footer-container {
  display: flex;
  justify-content: space-between;
  align-items: center;  /* centre verticalement le contenu */
  padding: 20px 5%;     /* espacement horizontal */
}

/* Zone gauche : logo + contact */
.footer-left {
  display: flex;
  align-items: center;
  gap: 20px;
}

.footer-logo {
  max-width: 150px;
  height: auto;
}

.footer-contact {
  text-align: left;
}

.footer-contact p {
  margin: 2px 0;
  line-height: 1.4;
  font-size: 0.9em;
}

/* Zone droite : icônes sociales */
.footer-right {
  display: flex;
  align-items: center;
  gap: 15px;            /* espacement régulier */
}

.footer-right .social-icon {
  color: #fff;
  font-size: 1.8em;
  text-decoration: none;
}

.footer-right .proeco-logo {
  width: 100px;
}

/* Mentions légales centrées en dessous */
.footer-legal {
  background: #0c2a53;
  color: #fff;
  text-align: center;
  padding-bottom: 10px;
  font-size: 0.85em;
}

/* === Lightbox === */
#lightbox {
  position: fixed;
  top: 0; left: 0;
  width: 100%; height: 100%;
  background: rgba(12, 42, 83, 0.8);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2000;
}

#lightbox.hidden {
  display: none;
}

#lightbox-img {
  max-width: 90%;
  max-height: 90%;
  box-shadow: 0 0 20px rgba(12, 42, 83, 0.5);
}

#lightbox-close {
  position: absolute;
  top: 20px; right: 30px;
  font-size: 2.5rem;
  color: #fff;
  cursor: pointer;
  background:transparent;
}

.lightbox-arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  color: white;
  font-size: 2rem;
  cursor: pointer;
}

#lightbox-prev { left: 30px; }
#lightbox-next { right: 30px; }

/* === Nouveau responsive pour cacher le menu sur mobile === */
@media (max-width: 767px) {
  /* Centrage du layout sur mobile */
  #hero,
  .carousel-container,
  .presentation-text,
  #contact form {
    margin-left: auto;
    margin-right: auto;
    padding-left: 10px;
    padding-right: 10px;
    text-align: center;
  }
  /* Galerie full width but contents centered */
  .gallery-grid {
    justify-items: center;
  }
  /* Footer centré en colonne */
  .footer-container {
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 15px;
  }
  .footer-left,
  .footer-right {
    justify-content: center;
    width: 100%;
  }
  #contact form .form-group label {
    text-align: left;
  }

  .gallery-grid {
    display: flex !important;              /* flexbox horizontal */
    overflow-x: auto !important;           /* scroll horizontal */
    scroll-snap-type: x mandatory;          /* snap automatique */
    -webkit-overflow-scrolling: touch;      /* inertie iOS */
    padding: 0 20px;                        /* même padding latéral */
    margin: 0 -20px;                        /* compense le padding pour plein écran */
  }

  .gallery-item {
    flex: 0 0 100% !important;             /* largeur complète */
    max-width: 100% !important;
    scroll-snap-align: center;             /* snap au centre */
    margin-right: 15px;                    /* gap identique desktop */
  }
  .gallery-item:last-child {
    margin-right: 0;
  }

  .gallery-item img {
    width: 100% !important;
    height: 150px !important;
    object-fit: cover !important;
  }

  .carousel-controls {
    display: flex !important;
    justify-content: space-between;
    position: absolute;
    bottom: 10px;
    left: 20px;
    width: calc(100% - 40px);
    pointer-events: auto;
  }
  .carousel-controls svg,
  .carousel-controls i {
    fill: #fff;
  }
}

@media (max-width: 767px) {
  .carousel-controls {
    position: static !important;
    bottom: auto !important;
    left: auto !important;
    width: 100% !important;
    justify-content: center !important;
    margin: 20px 0 !important;
  }
}

/* === Galerie 4×3 + espace réservé même vide === */
:root {
  --gallery-cols: 4;
  --gallery-rows: 3;
  --gallery-gap: 15px;      /* doit matcher ton .gallery-grid gap */
  --gallery-cell-h: 150px;  /* doit matcher .gallery-item img { height: 150px; } */
  --gallery-min-h: calc(
    var(--gallery-rows) * var(--gallery-cell-h)
    + (var(--gallery-rows) - 1) * var(--gallery-gap)
  );
}

/* Forcer 4 colonnes en desktop (écrase ton repeat(5,1fr) précédent) */
.gallery-grid {
  grid-template-columns: repeat(var(--gallery-cols), 1fr);
}

/* Réserver l'espace d'une galerie "complète" même si vide */
.gallery-section .carousel-container {
  min-height: var(--gallery-min-h);
  position: relative;
}

/* Cas "vide" : message centré (avec la structure <div class="empty-message"><p>…</p></div>) */
.gallery-section .empty-message {
  min-height: var(--gallery-min-h);
  display: grid;
  place-items: center;
}
.gallery-section .empty-message p {
  margin: 0;
  color: #666;
  font-style: italic;
}

/* (Sécurité) Si ton ancien PHP mettait directement <p> dans .carousel-container */
.gallery-section .carousel-container > p {
  min-height: var(--gallery-min-h);
  display: grid;
  place-items: center;
  margin: 0;
  color: #666;
  font-style: italic;
}

/* Mobile : réduire l'espace réservé pour éviter un grand "blanc" */
@media (max-width: 767px) {
  :root {
    --gallery-rows: 2;
    --gallery-min-h: calc(
      var(--gallery-rows) * var(--gallery-cell-h)
      + (var(--gallery-rows) - 1) * var(--gallery-gap)
    );
  }
}


.hero-text .hero-logo {
  width: 80%;            
  height: auto;
  display: block;
}

.hero-text {
 background: rgba(12, 42, 83, 0.7);
    display: flex;
    padding: 10px;
    border-radius: 4px;
    text-align: center;
    flex-direction: column;
    align-items: center;
}

.hero-text p {
  font-weight: bold;
  font-size: 1.5em; 
  line-height: 1.3; 
  padding-block: 15px;
}

@media (max-width: 767px) {
  .carousel-slide.active img {
    height: 60vh !important;    
    object-fit: cover !important;
  }
}

html, body {
  overflow-x: hidden !important;
}

.mentions-studio-chax {
    display: flex;
    justify-content: flex-end;
    padding-inline: 1%;
    color: #fff;
}

footer a {
  color: #fff;
}

/* engagements */

.engagements {
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  color: #0c2a53;
  padding-block: 5em;
}

.engagements h2 {
  font-size: 2rem;
  margin-bottom: 2.5rem;
  font-weight: 600;
}

.engagements-grid {
  display: flex;
  flex-direction: row;
  justify-content: center; /* Centrage horizontal */
  align-items: stretch; /* Aligne les cartes sur la même hauteur */
  gap: 10em; /* Espacement réduit pour équilibrer */
  flex-wrap: wrap; /* Permet le passage sur deux lignes en responsive */
}

@media (max-width: 768px) {
  .engagements-grid {
    flex-direction: column;
    gap: 2em; /* Réduit l'espace entre les cartes sur mobile */
  }
}

.engagements-card {
  background: white;
  border: 2px solid #0c2a53;
  border-radius: 1rem;
  padding: 2rem 1.5rem;
  box-shadow: 0 8px 18px rgba(0,0,0,0.05);
  max-width: 350px;
  width: 100%;

  /* --- Harmonisation de la hauteur --- */
  display: flex;
  flex-direction: column;
  justify-content: center; /* Centre verticalement le contenu */
  text-align: center; /* Centre le texte */
  min-height: 350px; /* Hauteur minimale identique pour toutes les cartes */
}

.engagements-card.highlight {
  background: #e7ecf1;
  border: 2px solid #0c2a53;
}

.engage h3 {
  font-size: 1.5rem;
  margin-bottom: 0.8rem;
  color: #f1752d;
  text-align: center;
}

.engage {
  display: flex;
  flex-direction: column;
  align-items: center;
}

/* image frise */
/* Image zoomable (aucune redirection) */
.zoomable img {
  cursor: zoom-in;
  width: 100%;
  height: auto;
  display: block;
}

/* Lightbox minimaliste, proche de la galerie */
.img-lightbox.hidden { display: none; }
.img-lightbox {
  position: fixed;
  inset: 0;
  z-index: 1000;
  background: rgba(0,0,0,0.75);
  display: grid;
  place-items: center;
  padding: 16px;
  cursor: zoom-out; /* clic fond = fermeture */
}
/* Fond blanc derrière l'image agrandie */
.img-lightbox img {
  background: #fff;       /* le fameux fond blanc */
  padding: 12px;          /* marge autour de l'image */
  border-radius: 12px;    /* angles adoucis */
  box-shadow: 0 12px 40px rgba(0,0,0,.35); /* relief propre */
}

/* Un peu moins de padding sur mobile */
@media (max-width: 480px) {
  .img-lightbox img {
    padding: 8px;
    border-radius: 10px;
  }
}

.img-lightbox-close {
  position: absolute;
  top: 12px;
  right: 14px;
  background: transparent;
  border: none;
  color: #fff;
  font-size: 34px;
  line-height: 1;
  cursor: pointer;
}

.img-lightbox-card {
  background: #fff;
  border-radius: 12px;
  padding: 12px;
  max-width: 95vw;
  max-height: 90vh;
  display: grid;
  place-items: center;
  box-shadow: 0 12px 40px rgba(0,0,0,.35);
}
.img-lightbox-card img {
  max-width: 100%;
  max-height: calc(90vh - 24px); /* tenir compte du padding */
  object-fit: contain;
}

#projectkey {
      padding: 125px 200px;
      display: flex;
      flex-direction: column;
      align-items: center;
      color: #0c2a53;
}

#projectkey h2 {
    font-size: 2em;
}

/* ===========================
   NAV (chax-*) – FIXE + BURGER
   =========================== */

/* Vars */
:root{
  --chax-hdr-h: 80px;
  --chax-brand: #0c2a53;
  --chax-brand-r: 12; --chax-brand-g: 42; --chax-brand-b: 83;
  --chax-alpha: .66;       /* transparence header */
  --chax-text: #fff;       /* texte sur fond brand */
}

/* Overlay global via <html> (aucun élément HTML requis) */
html::before{
  content:""; position: fixed; inset: 0;
  background: rgba(0,0,0,.45);
  opacity: 0; pointer-events: none; transition: opacity .2s ease;
  z-index: 999; /* sous le header (1001) et le menu (1002) */
}
html.chax-open::before{ opacity: 1; pointer-events: auto; }

/* Header fixe, semi-transparent */
.chax-header{
  position: fixed; inset: 0 0 auto 0; height: var(--chax-hdr-h);
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 10px 20px;
  background: rgba(var(--chax-brand-r), var(--chax-brand-g), var(--chax-brand-b), var(--chax-alpha));
  -webkit-backdrop-filter: saturate(140%) blur(6px);
  backdrop-filter: saturate(140%) blur(6px);
  z-index: 1001;
}
.chax-brand img{ display:block; height:auto; max-height: calc(var(--chax-hdr-h) - 20px); }

/* Burger */
.chax-burger{
  display: inline-flex; flex-direction: column; gap: 5px;
  width: 40px; height: 40px; align-items: center; justify-content: center;
  background: transparent; border: none; cursor: pointer; z-index: 1003;
}
.chax-burger span{ width: 22px; height: 2px; background: var(--chax-text); border-radius: 2px; }

/* Liens */
.chax-navlist{
  list-style:none; margin:0; padding:0; display:flex; gap:20px; align-items:center;
}
.chax-navlist a{
  color: var(--chax-text) !important; text-decoration: none !important; font-weight: 700;
}
.chax-navlist a:hover, .chax-navlist a:focus{ opacity:.9; }

/* ===== Mobile (<=900px): dropdown sous le header ===== */
@media (max-width: 900px){
  .chax-navlist{
    position: fixed; left: 0; right: 0; top: var(--chax-hdr-h);
    display: none; flex-direction: column; gap: 0;
    background: var(--chax-brand);
    padding: 8px 12px 12px;
    border-top: 1px solid rgba(255,255,255,.15);
    box-shadow: 0 8px 24px rgba(0,0,0,.18);
    z-index: 1002; /* au-dessus de l'overlay */
  }
  .chax-navlist li{ padding: 10px 4px; border-bottom: 1px solid rgba(255,255,255,.08); }
  .chax-navlist li:last-child{ border-bottom: none; }

  /* état ouvert (piloté par JS via <html class="chax-open">) */
  html.chax-open .chax-navlist{ display:flex; }
}

/* ===== Desktop (>900px) : inline ===== */
@media (min-width: 901px){
  .chax-burger{ display:none; }
  .chax-navlist{ position: static; display:flex; background:transparent; box-shadow:none; border:0; padding:0; }
}


/* === PATCH BURGER: annule le "display:none !important" hérité === */
@media (max-width: 900px){
  /* caché par défaut en mobile (on garde le comportement attendu) */
  header .chax-nav .chax-navlist{
    display: none !important;
  }

  /* quand le burger est ouvert, on force l'affichage du menu */
  html.chax-open header .chax-nav .chax-navlist{
    display: flex !important;
    flex-direction: column;
    gap: 0;
    position: fixed;
    left: 0; right: 0; top: var(--chax-hdr-h, 80px);
    background: var(--chax-brand, #0c2a53);
    padding: 8px 12px 12px;
    border-top: 1px solid rgba(255,255,255,.15);
    box-shadow: 0 8px 24px rgba(0,0,0,.18);
    z-index: 1002;
  }

  /* Overlay (déjà défini plus haut) — on s'assure qu'il s'active */
  html.chax-open::before{
    opacity: 1;
    pointer-events: auto;
  }
}

/* === PATCH: supprimer la bande blanche derrière le header === */

/* 1) On annule le padding-top global qui créait un vide blanc au-dessus du hero */
body { padding-top: 0 !important; }

/* 2) On garde de bons offsets d’ancre pour les sections ciblées par la nav */
:root { --chax-hdr-h: 80px; } /* si déjà défini, tu peux ignorer cette ligne */
#about, #contact, #projectkey, #gallery { scroll-margin-top: var(--chax-hdr-h); }

/* 3) S'assurer que le header est bien au-dessus du hero et semi-transparent */
.chax-header {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 1001; /* > vidéo du hero */
  background: rgba(12, 42, 83, 0.66); /* ton bleu en transparent */
  -webkit-backdrop-filter: saturate(140%) blur(6px);
  backdrop-filter: saturate(140%) blur(6px);
}

/* 4) (Optionnel) neutraliser d’anciens styles génériques du header si présents */
@media (min-width: 901px){
  header nav ul { display: flex !important; } /* évite un display:none résiduel */
}

body { padding-top: 0 !important; }
#hero { height: auto !important; min-height: calc(100dvh - var(--chax-hdr-h, 80px)); }
#about, #contact, #projectkey, #gallery { scroll-margin-top: var(--chax-hdr-h); }
footer { margin-top: auto !important; }

.recaptcha-container {
  display: flex;
  justify-content: flex-start;
  margin: 1rem 0;
}

/* Affiche les sauts de lignes du texte brut */
#lightbox-desc {
  white-space: pre-line; /* \n => saut de ligne visuel */
}
