/* ==========================================================
   Ajustements liés à l'intégration WordPress
   (n'altèrent pas le design d'origine, ils l'adaptent aux
   balises générées par wp_nav_menu() et Contact Form 7)
   ========================================================== */

/* Le bouton "Devis" du menu : la classe est ajoutée sur le <li>
   depuis Apparence > Menus (Options d'écran > Classes CSS),
   on la reporte donc aussi sur le lien enfant. */
li.btn-devis-nav > a {
  background: var(--gold);
  color: var(--navy);
  padding: 10px 22px;
  border-radius: 30px;
  font-weight: 600 !important;
}
li.btn-devis-nav > a::after { display: none !important; }
li.btn-devis-nav > a:hover { background: var(--gold-dark); }

/* Contact Form 7 : neutralise les <span> ajoutés autour de chaque champ
   pour laisser .form-group (flex column) gérer la mise en page. */
.form-group span.wpcf7-form-control-wrap {
  display: contents;
}

.form-group .wpcf7-not-valid-tip {
  display: block;
  font-size: 12px;
  color: #c0392b;
  margin-top: 4px;
  font-weight: 400;
}

/* Message de succès / erreur CF7, calé sur le style .success-msg d'origine */
.wpcf7 form .wpcf7-response-output {
  display: block;
  margin-top: 18px;
  padding: 14px 18px;
  border-radius: 2px;
  font-size: 13.5px;
}

.wpcf7 form.sent .wpcf7-response-output {
  background: #f0faf4;
  border: 1px solid #a8d5b5;
  color: #1a6b3a;
}

.wpcf7 form.invalid .wpcf7-response-output,
.wpcf7 form.unaccepted .wpcf7-response-output,
.wpcf7 form.failed .wpcf7-response-output,
.wpcf7 form.spam .wpcf7-response-output {
  background: #fdf0ef;
  border: 1px solid #e3a9a3;
  color: #a3352c;
}

.wpcf7 form.submitting .btn-primary {
  opacity: .6;
  pointer-events: none;
}

/* Emplacements réservés (photos non renseignées via ACF) : reprend le style .ph d'origine */
.ph img { width: 100%; height: 100%; object-fit: cover; display: block; }

/* Filtres projets : masqués proprement en JS (classe utilitaire) */
.projet-card.is-hidden { display: none !important; }

/* Description d'un projet (contenu WYSIWYG ACF) : conserve l'espacement des paragraphes d'origine */
.projet-detail-grid .description p { margin-bottom: 20px; font-size: 16px; }
.projet-detail-grid .description p:last-child { margin-bottom: 0; }

/* ==========================================================
   Galerie photos d'un projet (façon galerie produit WooCommerce)
   ========================================================== */
.projet-gallery {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.projet-gallery-main {
  position: relative;
  aspect-ratio: 4 / 3;
  border-radius: 4px;
  overflow: hidden;
  background: #f4f2ee;
}

.projet-gallery-main img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  cursor: zoom-in;
}

.gallery-arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 40px;
  height: 40px;
  border: none;
  border-radius: 50%;
  background: rgba(255, 255, 255, .85);
  color: var(--navy, #1a2b3c);
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background .2s ease;
  z-index: 2;
}
.gallery-arrow:hover { background: #fff; }
.gallery-prev { left: 14px; }
.gallery-next { right: 14px; }

.projet-gallery-thumbs {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(72px, 1fr));
  gap: 10px;
}

.gallery-thumb {
  padding: 0;
  border: 2px solid transparent;
  border-radius: 3px;
  overflow: hidden;
  cursor: pointer;
  aspect-ratio: 1 / 1;
  background: #f4f2ee;
  transition: border-color .2s ease, opacity .2s ease;
  opacity: .7;
}
.gallery-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.gallery-thumb:hover { opacity: 1; }
.gallery-thumb.active {
  border-color: var(--gold, #c9a24b);
  opacity: 1;
}

/* Lightbox plein écran */
.ab-lightbox {
  position: fixed;
  inset: 0;
  background: rgba(15, 20, 25, .94);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  padding: 40px;
}
.ab-lightbox.open { display: flex; }

.ab-lightbox .lightbox-img {
  position: absolute;
  top: 0;
  width: 50%;
  height: 100vh;
  object-fit: contain;
  border-radius: 2px;
  animation: fadeUp .25s ease both;
}

.lightbox-close {
  position: absolute;
  top: 22px;
  right: 28px;
  background: none;
  border: none;
  color: #fff;
  font-size: 34px;
  line-height: 1;
  cursor: pointer;
  opacity: .8;
}
.lightbox-close:hover { opacity: 1; }

.lightbox-arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 52px;
  height: 52px;
  border: none;
  border-radius: 50%;
  background: rgba(255, 255, 255, .12);
  color: #fff;
  font-size: 28px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background .2s ease;
}
.lightbox-arrow:hover { background: rgba(255, 255, 255, .25); }
.lightbox-prev { left: 24px; }
.lightbox-next { right: 24px; }

.lightbox-counter {
  position: absolute;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  color: rgba(255, 255, 255, .7);
  font-size: 13px;
  letter-spacing: .04em;
}

@media (max-width: 680px) {
  .projet-gallery-thumbs { grid-template-columns: repeat(auto-fill, minmax(58px, 1fr)); }
  .lightbox-arrow { width: 42px; height: 42px; font-size: 22px; }
  .lightbox-prev { left: 10px; }
  .lightbox-next { right: 10px; }
}