/*
Theme Name: Divi Child
Theme URI: https://www.elegantthemes.com/gallery/divi/
Description: Thème enfant pour Divi
Template: Divi
Version: 1.0.0
*/

/* Déclaration des polices custom */
@font-face {
  font-family: 'Behind The Nineties';
  src: url('fonts/Behind-The-Nineties-Rg.woff2') format('woff2'),
    url('fonts/Behind-The-Nineties-Rg.woff') format('woff');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'Behind The Nineties';
  src: url('fonts/Behind-The-Nineties-Bd.woff2') format('woff2'),
    url('fonts/Behind-The-Nineties-Bd.woff') format('woff');
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'Hamilton Script Painted';
  src: url('fonts/Hamilton Script Painted.otf') format('opentype');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

/* Ajoutez vos styles personnalisés ci-dessous */

/* Découpe en "exclusion" avec le SVG fourni */
.section-mask-exclude {
  position: relative;
  /* Hauteur visuelle de la vague : ajuste selon l'écran */
  --cutout-height: 333px;

  /* Masque standard (Firefox) */
  mask-image: linear-gradient(#fff 0 0),
    url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' preserveAspectRatio='none' width='100%' height='333' viewBox='0 0 1922 333' fill='none'><path d='M1922 332.066H0V297.821C64.3131 264.92 216.158 191.746 405.5 191.746C666.5 191.746 717 229.066 870.5 229.066C1024 229.066 1186.66 169.566 1363.66 169.566C1540.66 169.566 1629 55.5664 1748.5 55.5664C1808.05 55.5664 1874.43 28.6665 1922 0V332.066Z' fill='%23ffffff'/></svg>");
  mask-repeat: no-repeat, no-repeat;
  mask-position: center 100%, center bottom;
  mask-size: 100% calc(100% + var(--cutout-height)), 100% var(--cutout-height);
  mask-composite: exclude;

  /* WebKit (Chrome/Safari) */
  -webkit-mask-image: linear-gradient(#fff 0 0),
    url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' preserveAspectRatio='none' width='100%' height='333' viewBox='0 0 1922 333' fill='none'><path d='M1922 332.066H0V297.821C64.3131 264.92 216.158 191.746 405.5 191.746C666.5 191.746 717 229.066 870.5 229.066C1024 229.066 1186.66 169.566 1363.66 169.566C1540.66 169.566 1629 55.5664 1748.5 55.5664C1808.05 55.5664 1874.43 28.6665 1922 0V332.066Z' fill='%23ffffff'/></svg>");
  -webkit-mask-repeat: no-repeat, no-repeat;
  -webkit-mask-position: center 100%, center bottom;
  -webkit-mask-size: 100% calc(100% + var(--cutout-height)),
    100% var(--cutout-height);
  -webkit-mask-composite: xor;

  /* Padding bottom pour compenser la hauteur de la découpe */
  padding-bottom: var(--cutout-height);
  overflow: hidden;
  margin-bottom: 0;
  border-bottom: 2px solid #fafafa;
}

/* Ajustement spécifique pour 1280px */
@media (min-width: 1025px) and (max-width: 1440px) {
  .section-mask-exclude {
    --cutout-height: 200px;
  }
}

/* Ajustements pour tablette */
@media (max-width: 1024px) {
  .section-mask-exclude {
    --cutout-height: 180px;
  }
}

/* Ajustements pour mobile */
@media (max-width: 820px) {
  .section-mask-exclude {
    --cutout-height: 150px;
  }
}

/* Ajustements pour très petits écrans */
@media (max-width: 480px) {
  .section-mask-exclude {
    --cutout-height: 120px;
  }
}

/* Forcer la suppression de toutes les marges */
.section-mask-exclude + * {
  margin-top: 0 !important;
  padding-top: 0 !important;
}

/* Styles personnalisés pour le formulaire de contact */

/* Layout deux colonnes */
.contact-form-two-column p {
  display: flex;
  flex-direction: row;
  gap: 1rem;
  flex-wrap: wrap;
  margin-bottom: 1rem;
  font-family: 'Sura', sans-serif;

  span {
    width: 100%;
    flex: 1;
  }
}

/* Champs de formulaire */
.contact-field,
.contact-area {
  width: 100%;
  padding: 12px 0;
  border-top: none !important;
  border-left: none !important;
  border-right: none !important;
  border-bottom: 1px solid #242424;
  background: transparent !important;
  font-family: inherit;
  font-size: 16px;
  color: #333;
  transition: border-color 0.3s ease;
}

.contact-field::placeholder,
.contact-area::placeholder {
  color: #333;
  opacity: 1;
  font-weight: 400;
  padding-left: 10px;
}

.contact-field:focus,
.contact-area:focus {
  outline: none;
  border-bottom-color: #666;
}

/* Champs pleine largeur */
.wpcf7-form > p {
  margin-bottom: 1rem;
}

/* Zone de message */
.contact-area {
  height: 150px;
  resize: vertical;
  font-family: inherit;
}

/* Case à cocher acceptance */
.contact-check {
  margin: 30px 0;
}

.wpcf7-list-item {
  margin: 0;
}

.wpcf7-list-item-label {
  font-size: 13px;
  line-height: 1.6;
  color: #333;
  align-items: flex-start;
  display: inline;
  margin-left: 10px;
}

.wpcf7-list-item input[type='checkbox'] {
  margin-top: 3px;
  flex-shrink: 0;
}

.wpcf7-list-item label {
  display: flex;
  flex-direction: row;
}

/* Bouton Envoyer */
.contact-button {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 20px 8px 0 !important;
  background: transparent !important;
  border: none !important;
  color: #2c5f5d;
  font-size: 16px;
  font-weight: 700;
  font-family: 'Sura', serif;
  letter-spacing: 0.02em;
  cursor: pointer;
  transition: all 0.3s ease;
  position: relative;
  text-decoration: none;
  margin-left: auto;
  margin-right: auto;
}

.contact-button::after {
  content: '›';
  font-size: 20px;
  font-weight: 300;
  color: #2c5f5d;
  transition: all 0.3s ease;
  margin-left: 2px;
  opacity: 1;
  left: 75px;
  top: 40%;
}

p:has(.contact-button) {
  display: flex;
  justify-content: center;
  flex-direction: row;
  align-items: center;
  text-align: center;
}

.contact-button:hover {
  color: #1a3b39;
}

.contact-button:hover::after {
  color: #1a3b39;
  top: 40%;
  transform: translateX(10px) translateY(-10px);
}

.contact-button:focus {
  outline: 2px solid #2c5f5d;
  outline-offset: 2px;
}

/* Messages d'erreur CF7 */
.wpcf7-not-valid-tip {
  font-size: 12px;
  color: #d32f2f;
  margin-top: 5px;
}

span.wpcf7-not-valid {
  border-bottom-color: #d32f2f !important;
}

/* Champs facultatifs avec indication (optionnel) */
.facultatif {
  position: relative;
}

.facultatif::after {
  content: '(optionnel)';
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 12px;
  font-style: italic;
  color: #666;
  pointer-events: none;
  background: transparent;
  z-index: 1;
}

/* Pour les textarea, ajuster la position */
.facultatif textarea::after,
.contact-area.facultatif::after {
  top: 20px;
  transform: none;
}

/* Masquer l'indication quand le champ a du contenu */
.facultatif:focus::after,
.facultatif:not(:placeholder-shown)::after {
  opacity: 0;
}

/* Alternative si le focus ne fonctionne pas bien */
.facultatif.has-content::after {
  opacity: 0;
}

/* Champs facultatifs avec indication (optionnel) */
.wpcf7-form-control-wrap:has(.facultatif) {
  position: relative;
}

.wpcf7-form-control-wrap:has(.facultatif)::after {
  content: '(optionnel)';
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 12px;
  font-style: italic;
  color: #666;
  pointer-events: none;
  background: transparent;
  z-index: 10;
}

/* Alternative si :has() n'est pas supporté */
span:has(.facultatif) {
  position: relative;
}

span:has(.facultatif)::after {
  content: '(optionnel)';
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 12px;
  font-style: italic;
  color: #666;
  pointer-events: none;
  background: transparent;
  z-index: 10;
}

/* Pour les textarea */
span:has(.contact-area.facultatif)::after {
  top: 20px;
  transform: none;
}

/* Version avec sélecteur d'attribut si la classe n'est pas sur l'input */
span[class*='facultatif'] {
  position: relative;
}

span[class*='facultatif']::after {
  content: '(optionnel)';
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 12px;
  font-style: italic;
  color: #666;
  pointer-events: none;
  background: transparent;
  z-index: 10;
}

/* Masquer quand le champ a le focus ou du contenu */
span:has(.facultatif:focus)::after,
span:has(.facultatif:not(:placeholder-shown))::after {
  opacity: 0;
}

.wpcf7-spinner {
  display: none !important;
}

/* Responsive */
@media (max-width: 480px) {
  span:has(.facultatif)::after,
  span[class*='facultatif']::after {
    font-size: 11px;
    right: 8px;
  }
}

/* Responsive - ajuster la taille sur mobile */
@media (max-width: 480px) {
  .facultatif::after {
    font-size: 11px;
    right: 8px;
  }
}

/* Responsive */
@media (max-width: 768px) {
  .contact-form-two-column p {
    flex-direction: column;

    br {
      display: none;
    }
  }

  .contact-button {
    justify-content: flex-start;
    width: auto;
  }
}

/* Système de toast CF7 */
#cf7-toast-container {
  position: fixed;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 9999;
  max-width: 500px;
  width: 90%;
  pointer-events: none;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.cf7-toast {
  background: #fff;
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  margin-bottom: 10px;
  transform: translateY(100%);
  transition: all 0.3s ease;
  pointer-events: auto;
  border-left: 4px solid;
  width: 100%;
  word-wrap: break-word;
}

.cf7-toast-error {
  border-left-color: #d32f2f;
}

.cf7-toast-success {
  border-left-color: #2e7d32;
}

.cf7-toast-show {
  transform: translateY(0);
}

.cf7-toast-content {
  display: flex;
  align-items: flex-start;
  padding: 16px;
  gap: 12px;
}

.cf7-toast-icon {
  font-size: 18px;
  font-weight: bold;
  flex-shrink: 0;
  margin-top: 2px;
}

.cf7-toast-error .cf7-toast-icon {
  color: #d32f2f;
}

.cf7-toast-success .cf7-toast-icon {
  color: #2e7d32;
}

.cf7-toast-message {
  flex: 1;
  font-size: 14px;
  line-height: 1.4;
  color: #333;
  white-space: pre-line;
}

.cf7-toast-close {
  background: none;
  border: none;
  font-size: 18px;
  color: #666;
  cursor: pointer;
  padding: 0;
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 4px;
  flex-shrink: 0;
}

.cf7-toast-close:hover {
  background: #f5f5f5;
  color: #333;
}

.cf7-toast-close:focus {
  outline: 2px solid #2c5f5d;
  outline-offset: 1px;
}

/* Masquer les messages CF7 par défaut */
.wpcf7-response-output {
  display: none !important;
}

.wpcf7-not-valid-tip {
  display: none !important;
}

/* Responsive */
@media (max-width: 480px) {
  #cf7-toast-container {
    bottom: 10px;
    width: 95%;
    max-width: none;
  }

  .cf7-toast-message {
    font-size: 13px;
  }

  .cf7-toast-content {
    padding: 14px;
  }
}

.toggleable-section {
  display: none;
}

/* Bloquer le scroll du body quand popup ouvert */
body.popup-open {
  overflow: hidden;
}

.popup-close {
  display: none; /* Caché par défaut */
}

/* Style du popup en mobile */
@media (max-width: 965px) {
  .toggleable-section.mobile-popup {
    position: fixed !important;
    top: 53% !important;
    left: 50% !important;
    transform: translate(-50%, -50%) !important;
    width: 90% !important;
    max-width: 500px !important;
    max-height: 80vh !important;
    background: white !important;
    border-radius: 12px !important;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3) !important;
    z-index: 1000 !important;
    padding: 30px 20px 20px 20px !important;
    overflow-y: auto !important;
  }

  .toggleable-section.mobile-popup .popup-close:hover {
    background: rgba(0, 0, 0, 0.1);
  }

  .toggleable-section.mobile-popup::before:hover {
    background: rgba(0, 0, 0, 0.1);
  }
}

/* En desktop, comportement normal */
@media (min-width: 966px) {
  .toggleable-section {
    position: relative !important;
    transform: none !important;
  }
}

/* Bouton de fermeture (croix) - STICKY */
@media (min-width: 473px) and (max-width: 965px) {
  .mobile-popup::before {
    content: '×';
    position: sticky !important;
    left: calc(100% + 0px);
    font-size: 35px;
    font-weight: 300;
    color: #333;
    cursor: pointer;
    z-index: 1001;
    line-height: 1;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: start;
    justify-content: end;
    transition: background 0.2s;
    margin-bottom: 10px;
    background: white;
    pointer-events: auto !important;
    margin-right: -80px;
    margin-top: -30px !important;
  }
}

@media (max-width: 472px) {
  .popup-close {
    display: flex;
    position: sticky;
    top: 0;
    align-self: flex-end;
    font-size: 35px;
    font-weight: 300;
    color: #333;
    cursor: pointer;
    z-index: 1001;
    line-height: 1;
    width: 35px;
    height: 35px;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: background 0.2s;
    background: white;
    border: none;
    margin: -20px -10px 10px auto;
  }
}

.rion-timeline-card {
  h3 {
    padding-left: 1.5rem;
    padding-left: 1.5rem;
    margin-top: 2.5rem;
    margin-bottom: 1.5rem;
  }

  p {
    padding-left: 1.5rem;
    padding-left: 1.5rem;
  }

  .dsm-image {
    width: 100%;

    img {
      width: 100%;
    }
  }
}

#menu-main-menu {
  li {
    padding-left: 1.5rem;
    padding-right: 1.5rem;
  }
}

@media (max-width: 820px) {
  /* Masquer le tree */
  .content-timeline-middle {
    display: none !important;
  }

  .content-timeline-opposite {
    display: none !important;
  }

  /* Forcer l'affichage en colonne */
  .dsm-content-timeline-items-wrapper {
    display: flex !important;
    flex-direction: column !important;
    padding-left: 0 !important;
    padding-right: 0 !important;
    gap: 2rem;
  }

  /* Cartes en pleine largeur */
  .dsm_content_timeline_child {
    width: 100% !important;
    max-width: 100% !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
    margin-bottom: 0 !important;
  }

  /* Wrapper de contenu */
  .dsm-content-timeline-content-wrapper {
    width: 100% !important;
    max-width: 100% !important;
  }

  /* Style des cartes */
  .rion-timeline-card {
    padding: 0 !important;
  }

  .rion-timeline-card h3 {
    margin-top: 1.5rem;
  }

  /* S'assurer que les images prennent toute la largeur */
  .rion-timeline-card .dsm-image-wrapper,
  .rion-timeline-card .dsm-image {
    width: 100% !important;
  }
}

/* Forcer le menu mobile à partir de 1280px au lieu de 980px */
@media (min-width: 981px) and (max-width: 1280px) {
  /* Styles du menu Divi en mode mobile */
  .et_pb_menu--style-left_aligned .et_pb_menu_inner_container,
  .et_pb_menu--style-left_aligned .et_pb_row {
    align-items: center;
  }

  .et_pb_menu--style-left_aligned .et_pb_menu__wrap {
    justify-content: flex-end !important;
  }

  .et_pb_menu--style-left_aligned.et_pb_text_align_center .et_pb_menu__wrap {
    justify-content: center;
  }

  .et_pb_menu--style-left_aligned.et_pb_text_align_right .et_pb_menu__wrap {
    justify-content: flex-end;
  }

  .et_pb_menu--style-left_aligned.et_pb_text_align_justified .et_pb_menu__wrap {
    justify-content: space-between;
  }

  .et_pb_menu--style-inline_centered_logo
    .et_pb_menu_inner_container
    > .et_pb_menu__logo-wrap,
  .et_pb_menu--style-inline_centered_logo .et_pb_row > .et_pb_menu__logo-wrap {
    display: flex;
    flex-direction: column;
    align-items: center;
  }

  .et_pb_menu--style-inline_centered_logo
    .et_pb_menu_inner_container
    > .et_pb_menu__logo,
  .et_pb_menu--style-inline_centered_logo .et_pb_row > .et_pb_menu__logo {
    margin: 0 auto;
  }

  .et_pb_menu--style-inline_centered_logo .et_pb_menu__logo-slot {
    display: none;
  }

  .et_pb_menu .et_pb_row {
    min-height: 81px;
  }

  /* Masquer le menu desktop */
  .et_pb_menu .et_pb_menu__menu {
    display: none !important;
  }

  /* Afficher le menu hamburger avec flex-end */
  .et_pb_menu .et_mobile_nav_menu {
    float: none;
    margin: 0 6px;
    display: flex !important;
    align-items: center;
    justify-content: flex-end !important;
  }

  /* Menu déroulant mobile avec vos styles */
  .et_pb_menu .et_mobile_menu {
    top: 100%;
    padding: 5%;
    left: 0;
    right: 0;
    width: 100%;
    background: #fff;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  }

  .et_pb_menu .et_mobile_menu,
  .et_pb_menu .et_mobile_menu ul {
    list-style: none !important;
    text-align: left;
  }

  .et_pb_menu .et_mobile_menu ul {
    padding: 0;
  }

  /* Sous-menus (dropdowns) */
  .et_pb_menu .et_mobile_menu .menu-item-has-children > a {
    position: relative;
  }

  .et_pb_menu .et_mobile_menu .sub-menu {
    padding-left: 20px;
  }

  .et_pb_menu .et_mobile_menu li {
    padding: 10px 0;
    border-bottom: 1px solid #eee;
  }

  .et_pb_menu .et_mobile_menu li:last-child {
    border-bottom: none;
  }

  .et_pb_menu .et_mobile_menu a {
    color: #333;
    text-decoration: none;
    display: block;
    padding: 5px 0;
    transition: color 0.3s ease;
  }

  .et_pb_menu .et_mobile_menu a:hover {
    color: #2c5f5d;
  }

  /* Menu qui s'ouvre vers le haut si nécessaire */
  .et_pb_menu .et_pb_mobile_menu_upwards .et_mobile_menu {
    top: auto;
    bottom: 100%;
  }

  /* Icône hamburger alignée à droite */
  .et_pb_menu .mobile_menu_bar {
    display: flex;
    justify-content: flex-end;
  }

  /* Bouton mobile menu */
  .et_pb_menu .mobile_menu_bar:before {
    color: #333;
    font-size: 24px;
  }
}
