/*
Name: Block Contact
Slug: block-contact
Description: Section de contact (formulaire Contact Form 7 stylé Bootscore / BS Contact Form 7)
Author: Groupe Wibi
Author URI: https://opticchic.fr

Notes :
- Le formulaire est stylé en Bootstrap 5 par le plugin "BS Contact Form 7"
  (form-label, form-control, form-select, btn btn-primary, spinner...).
  Ce fichier ne restyle PAS les champs : il gère la mise en forme du bloc et
  pose le formulaire dans une carte blanche lisible sur le fond rose.
- On cible les CLASSES (.block-contact) et jamais l'ID, car l'ID est dynamique
  (block-contact-{post}-{index}).
*/

.form-label {
  font-weight: bold;
  color: #b9296074;
}


.form-control:focus {
  border-color: #da6090 !important;
  box-shadow: 0 0 0 0.25rem #f3368036 !important;
}

/* Section de base */
.block-contact {
  position: relative;
  overflow: hidden;
  background-color: #f33680;
  border-top: 5px solid #8fb62c;
/* TODO (Optic Chic) 2026-07-16: Rendre le chemin de l'image de fond configurable via ACF ou Theme Options plutôt que codé en dur. */
  background-image: url('../block-contact/imgs/block-contact-bg2.png');
  background-repeat: no-repeat;
  background-size: cover;
  background-position: center;
}

/* Pleine hauteur en mode fullPage.js */
#fullpage .block-contact,
#fullpage section.block-contact,
#fullpage .fp-section.block-contact {
  height: 100%;
  min-height: 100%;
}

/* Hauteur mini en mode normal (hors fullPage) */
body:not(.fp-enabled) .block-contact {
  min-height: clamp(360px, 45vw, 760px);
}

/* Calque dégradé au-dessus du fond pour la lisibilité */
.block-contact::before {
  content: '';
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  /* background: linear-gradient(
    90deg,
    rgba(0, 0, 0, 0.45) 0%,
    rgba(0, 0, 0, 0.15) 60%,
    rgba(0, 0, 0, 0.00) 100%
  ); */
}

/* Conteneur centré (aligné sur .container de Bootstrap) */
.block-contact__inner {
  position: relative;
  z-index: 2;
  width: min(1200px, calc(100% - 2rem));
  margin-inline: auto;
  padding-block: clamp(1.5rem, 4vw, 3rem);
  height: 100%;
  display: flex;
  align-items: center;
}

/* Disposition 2 colonnes : texte à gauche, formulaire à droite */
.block-contact__content {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: clamp(1.5rem, 4vw, 3rem);
  align-items: center;
  width: 100%;
}

/* Colonne de gauche : titre + texte (blanc sur fond rose) */
.block-contact__left {
  color: #fff;
  max-width: 55ch;
}

.block-contact__title {
  font-family: var(--font-third);
  margin: 0 0 1rem;
  font-weight: 700;
  line-height: 1.1;
  /* TODO (Optic Chic) 2024-06-13: Taille de police revue "beaucoup plus gros" pour le titre */
  font-size: clamp(2.5rem, 6vw, 4.5rem);
}

.block-contact__text {
  font-size: clamp(1rem, 1.2vw, 1.125rem);
  line-height: 1.6;
}

.block-contact__text a {
  color: #fff;
  text-decoration: underline;
}

/* Colonne de droite : carte blanche contenant le formulaire */
.block-contact__right {
  width: 100%;
}

.block-contact__form.card {
  border-radius: 1rem;
  background-color: #ffffff40;
}

.block-contact__form .card-body {
  padding: clamp(1.25rem, 2.5vw, 2rem);
}

/* Ajustements légers : le reste (champs, boutons, alertes) vient de
   Bootstrap + BS Contact Form 7, on ne le surcharge pas. */
.block-contact__form .wpcf7 {
  margin: 0;
}

.block-contact__form .wpcf7-response-output {
  margin-inline: 0;
}

/* Bouton d'envoi pleine largeur pour une meilleure ergonomie mobile */
.block-contact__form .wpcf7-submit,
.block-contact__form button[type="submit"] {
  width: 100%;
}

/*
 * Liste de choix (Objet) : le menu natif macOS n'est pas stylable.
 * On masque le <select> et on affiche une liste custom (fond #f33680).
 */
.block-contact__form .opticchic-select {
  position: relative;
}

.block-contact__form .opticchic-select select.form-select,
.block-contact__form .opticchic-select select {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.block-contact__form .opticchic-select__toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  min-height: calc(1.5em + 0.75rem + 2px);
  padding: 0.375rem 0.75rem;
  border: 1px solid #ced4da;
  border-radius: 0.375rem;
  background-color: #fff;
  color: #212529;
  text-align: left;
  cursor: pointer;
  appearance: none;
}

.block-contact__form .opticchic-select__toggle::after {
  content: '';
  flex-shrink: 0;
  margin-left: 0.5rem;
  width: 0.5rem;
  height: 0.5rem;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: rotate(45deg) translateY(-2px);
}

.block-contact__form .opticchic-select.is-open .opticchic-select__toggle {
  border-color: #f33680;
}

.block-contact__form .opticchic-select__list {
  display: none;
  position: absolute;
  z-index: 20;
  top: calc(100% + 2px);
  left: 0;
  right: 0;
  margin: 0;
  padding: 0.35rem 0;
  list-style: none;
  background-color: #f33680;
  color: #fff;
  border-radius: 0.5rem;
  box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15);
  overflow: hidden;
}

.block-contact__form .opticchic-select.is-open .opticchic-select__list {
  display: block;
}

.block-contact__form .opticchic-select__option {
  padding: 0.55rem 0.9rem;
  color: #fff;
  cursor: pointer;
}

.block-contact__form .opticchic-select__option:hover,
.block-contact__form .opticchic-select__option.is-active {
  background-color: rgba(255, 255, 255, 0.28);
  color: #fff;
}

.block-contact__form .opticchic-select__option.is-selected {
  font-weight: 600;
}

/* Mobile : empilement (texte puis formulaire) */
@media (max-width: 768px) {
  .block-contact__content {
    grid-template-columns: 1fr;
  }

  .block-contact::before {
    background: linear-gradient(
      180deg,
      rgba(0, 0, 0, 0.45) 0%,
      rgba(0, 0, 0, 0.15) 60%,
      rgba(0, 0, 0, 0.05) 100%
    );
  }
}
