/*
Theme Name:   Astra Child — Smart e-business
Theme URI:    https://www.smart-e-business.com/
Description:  Thème enfant d'Astra pour Smart e-business (styles personnalisés, formulaire CF7).
Author:       Smart e-business
Template:     astra
Version:      1.0.0
Text Domain:  astra-child-seb
*/

/* ==========================================================================
   Séparateurs
   ========================================================================== */
.wp-block-separator.has-alpha-channel-opacity {
  border-color: var(--ast-global-color-0);
  margin: 50px auto !important;
}
[data-ast-blocks-layout] .wp-block-separator:not(.is-style-wide):not(.is-style-dots) {
  max-width: 16.66% !important;
}

/* ==========================================================================
   Formulaire Contact Form 7 (wrapper <div class="cf7-seb">)
   ========================================================================== */
.cf7-seb .cf7-row {
  display: flex;
  gap: 30px;
  margin-bottom: 22px;
}
.cf7-seb .cf7-row > p {
  flex: 1;
  margin: 0;
}
.cf7-seb p {
  margin: 0 0 22px;
}
.cf7-seb .wpcf7-form-control-wrap {
  display: block;
}

.cf7-seb input[type="text"],
.cf7-seb input[type="email"],
.cf7-seb textarea {
  width: 100%;
  box-sizing: border-box;
  background: var(--ast-global-color-5);
  color: var(--ast-global-color-2);
  border: 0 !important;
  border-radius: 30px !important;
  box-shadow: none !important;
  padding: 20px 48px !important;
  font: inherit;
}
.cf7-seb input[type="text"],
.cf7-seb input[type="email"] {
  height: auto !important;
  min-height: 58px;
  line-height: 1.5;
}
.cf7-seb textarea {
  height: 230px;
  padding: 24px 48px !important;
  resize: vertical;
}
.cf7-seb ::placeholder {
  color: var(--ast-global-color-2);
  opacity: 1;
}
.cf7-seb input:focus,
.cf7-seb textarea:focus {
  outline: 2px solid var(--ast-global-color-0);
  outline-offset: 2px;
}

.cf7-seb .cf7-submit {
  display: flex;
  justify-content: center;
  margin: 10px 0 0;
}
.cf7-seb input[type="submit"] {
  background: var(--ast-global-color-0);
  color: #fff;
  border: 0;
  border-radius: 30px;
  padding: 16px 50px;
  font: inherit;
  cursor: pointer;
  transition: background 0.2s;
}
.cf7-seb input[type="submit"]:hover {
  background: var(--ast-global-color-1);
}

/* L'icône de chargement ne doit pas décaler le bouton */
.cf7-seb .wpcf7-spinner {
  display: none !important;
}

/* Messages de validation */
.cf7-seb .wpcf7-not-valid-tip {
  margin: 6px 0 0 24px;
  font-size: 0.9rem;
}
.wpcf7 form .wpcf7-response-output {
  border-radius: 20px;
  text-align: center;
}

@media (max-width: 600px) {
  .cf7-seb .cf7-row {
    flex-direction: column;
    gap: 22px;
  }
}

/* ==========================================================================
   Carrousel d'articles Spectra (classe additionnelle : carousel-services)
   Images à hauteur identique, recadrées sans déformation
   ========================================================================== */
.wp-block-uagb-post-carousel.carousel-services .uagb-post__image {
  overflow: hidden;
}
.wp-block-uagb-post-carousel.carousel-services .uagb-post__image a {
  display: block;
}
.wp-block-uagb-post-carousel.carousel-services .uagb-post__image img {
  display: block !important;
  width: 100% !important;
  height: auto !important;
  aspect-ratio: 3 / 2 !important;
  object-fit: cover !important;
  object-position: center;
}

/* Titres du carrousel : balise H3 (hiérarchie SEO) mais taille H4 */
.wp-block-uagb-post-carousel.carousel-services .uagb-post__title,
.wp-block-uagb-post-carousel.carousel-services .uagb-post__title a {
  font-size: 1.6rem;
  line-height: 1.3;
}

/* ==========================================================================
   Post Grid « steps » (classe additionnelle : numbered-steps)
   Titres H3 à la taille H4 + pastille numérotée devant chaque titre
   ========================================================================== */
.wp-block-uagb-post-grid.numbered-steps {
  counter-reset: step;
}
.wp-block-uagb-post-grid.numbered-steps .uagb-post__inner-wrap {
  counter-increment: step;
}
.wp-block-uagb-post-grid.numbered-steps .uagb-post__title {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  font-size: 1.6rem;
  line-height: 1.3;
}
.wp-block-uagb-post-grid.numbered-steps .uagb-post__title a {
  font-size: inherit;
  line-height: inherit;
}
.wp-block-uagb-post-grid.numbered-steps .uagb-post__title::before {
  content: counter(step);
  flex: 0 0 35px;
  width: 35px;
  height: 35px;
  border-radius: 50%;
  background: #fff;
  color: var(--ast-global-color-0);
  font-size: 1.1rem;
  font-weight: 500;
  line-height: 35px;
  text-align: center;
}

/* ==========================================================================
   Trait vertical entre deux sections (classe additionnelle : section-connector)
   À poser sur la section du HAUT : le trait est centré sur sa limite basse
   ========================================================================== */
.section-connector {
  position: relative;
}
.section-connector::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: 0;
  z-index: 2;
  width: 2px;
  height: 56px;
  background: var(--ast-global-color-0);
  transform: translate(-50%, 50%);
  pointer-events: none;
}

/* Variante : bloc Espaceur (Spacer) posé ENTRE deux sections,
   avec la classe additionnelle « vertical-connector » */
.vertical-connector {
  position: relative;
  z-index: 2;
  width: 2px;
  height: 56px !important;
  margin: -28px auto !important;
  background: var(--ast-global-color-0);
}

/* ==========================================================================
   Sur-titre avec trait devant (classe additionnelle : eyebrow-line)
   À poser sur le bloc Titre avancé Spectra (aligné à gauche)
   ========================================================================== */
.wp-block-uagb-advanced-heading.eyebrow-line .uagb-desc-text {
  display: flex;
  align-items: center;
  gap: 14px;
}
.wp-block-uagb-advanced-heading.eyebrow-line .uagb-desc-text::before {
  content: "";
  flex: 0 0 48px;
  width: 48px;
  height: 1px;
  background: var(--ast-global-color-0);
}

/* ==========================================================================
   Citation avec grand guillemet en fond (classe additionnelle : big-quote)
   À poser sur le bloc Citation. Le guillemet est en haut à gauche, derrière
   le texte, qui est décalé pour ne jamais passer dessus.
   ========================================================================== */
.wp-block-quote.big-quote {
  position: relative;
  overflow: hidden;
  padding-left: 110px !important;
  padding-right: 110px !important;
}
.wp-block-quote.big-quote::before {
  content: "";
  position: absolute;
  top: 24px;
  left: 28px;
  z-index: 0;
  width: 84px;
  height: 59px;
  background: #fff;
  opacity: 0.3;
  pointer-events: none;
  /* Guillemet plein dessiné en SVG (indépendant de la police et de l'italique) */
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 70'%3E%3Ccircle cx='20' cy='48' r='16'/%3E%3Cpath d='M4 48C4 24 16 8 36 2L40 11C28 16 22 24 22 34Z'/%3E%3Ccircle cx='70' cy='48' r='16'/%3E%3Cpath d='M54 48C54 24 66 8 86 2L90 11C78 16 72 24 72 34Z'/%3E%3C/svg%3E") no-repeat center / contain;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 70'%3E%3Ccircle cx='20' cy='48' r='16'/%3E%3Cpath d='M4 48C4 24 16 8 36 2L40 11C28 16 22 24 22 34Z'/%3E%3Ccircle cx='70' cy='48' r='16'/%3E%3Cpath d='M54 48C54 24 66 8 86 2L90 11C78 16 72 24 72 34Z'/%3E%3C/svg%3E") no-repeat center / contain;
}
.wp-block-quote.big-quote > * {
  position: relative;
  z-index: 1;
}

@media (max-width: 600px) {
  .wp-block-quote.big-quote {
    padding-top: 4.5rem !important;
    padding-left: var(--wp--preset--spacing--60) !important;
    padding-right: var(--wp--preset--spacing--60) !important;
  }
  .wp-block-quote.big-quote::before {
    top: 14px;
    left: 18px;
    width: 56px;
    height: 39px;
  }
}

/* ==========================================================================
   Archive du blog : 2 articles par ligne au lieu de 3 (ordinateur uniquement)
   Astra (sans Pro) fixe la largeur à 33,33 % ; en dessous de 922 px
   Astra repasse déjà à 1 colonne.
   ========================================================================== */
@media (min-width: 922px) {
  .ast-blog-layout-4-grid .ast-article-post {
    width: 50%;
  }
}

/* ==========================================================================
   Formulaire CF7 dans la sidebar (fond gris) : 1 champ par ligne,
   paddings réduits, champs blancs
   ========================================================================== */
.widget-area .cf7-seb .cf7-row {
  flex-direction: column;
  gap: 14px;
  margin-bottom: 14px;
}
.widget-area .cf7-seb p {
  margin: 0 0 14px;
}
.widget-area .cf7-seb input[type="text"],
.widget-area .cf7-seb input[type="email"],
.widget-area .cf7-seb textarea {
  background: #fff;
  padding: 14px 24px !important;
}
.widget-area .cf7-seb input[type="text"],
.widget-area .cf7-seb input[type="email"] {
  min-height: 48px;
}
.widget-area .cf7-seb textarea {
  height: 150px;
  padding: 16px 24px !important;
}
.widget-area .cf7-seb input[type="submit"] {
  padding: 13px 36px;
}
.widget-area .cf7-seb .wpcf7-not-valid-tip {
  margin-left: 12px;
}

/* ==========================================================================
   Liste d'icônes « coordonnées » (classe additionnelle : contact-list)
   Le libellé en gras garde sa taille, le texte en dessous est plus petit
   ========================================================================== */
.wp-block-uagb-icon-list.contact-list .uagb-icon-list__label {
  font-size: 0.875rem;
  line-height: 1.5;
  overflow-wrap: anywhere; /* évite qu'un e-mail long déborde de la colonne */
}
.wp-block-uagb-icon-list.contact-list .uagb-icon-list__label strong {
  font-size: 1rem;
}

/* Cartes du carrousel : coins arrondis (6 px visibles)
   Spectra dessine le fond gris dans la zone de contenu (background-clip: content-box)
   et crée l'espace entre les cartes avec un padding de 10 px. Le rayon visible du fond
   vaut donc : rayon de l'article - padding = 16 px - 10 px = 6 px. */
.wp-block-uagb-post-carousel.carousel-services .uagb-post__inner-wrap {
  border-radius: 16px;
}
.wp-block-uagb-post-carousel.carousel-services .uagb-post__image {
  border-radius: 6px 6px 0 0;
}

/* Carrousel : cartes de hauteur égale par CSS (remplace le calcul JS de Spectra,
   qui n'ajustait les cartes hors champ qu'au premier passage) */
.wp-block-uagb-post-carousel.carousel-services .slick-track {
  display: flex;
}
.wp-block-uagb-post-carousel.carousel-services .slick-slide {
  height: auto;
}
.wp-block-uagb-post-carousel.carousel-services .slick-slide > div {
  height: 100%;
}
.wp-block-uagb-post-carousel.carousel-services .uagb-post__inner-wrap {
  display: flex !important; /* écrase le display:inline-block posé en inline par le JS */
  flex-direction: column;
  height: 100% !important; /* écrase la hauteur inline posée par le JS */
}
/* Bouton « En savoir plus » aligné en bas de chaque carte */
.wp-block-uagb-post-carousel.carousel-services .uagb-post__cta {
  margin-top: auto;
}

/* Carrousel : espacements verticaux resserrés entre image, titre, extrait et bouton
   (réduit la hauteur de la carte la plus haute, donc le vide des cartes plus courtes) */
.wp-block-uagb-post-carousel.carousel-services .uagb-post__image {
  padding-bottom: 20px;
}
.wp-block-uagb-post-carousel.carousel-services .uagb-post__title {
  padding-bottom: 8px;
}
.wp-block-uagb-post-carousel.carousel-services .uagb-post__excerpt {
  padding-bottom: 16px;
}

/* Carrousel : titres limités à 3 lignes (« … » au-delà) */
.wp-block-uagb-post-carousel.carousel-services .uagb-post__title {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
  line-clamp: 3;
  overflow: hidden;
}

/* ==========================================================================
   En-tête collant (reste en haut au défilement)
   ========================================================================== */
#masthead {
  position: sticky;
  top: 0;
  z-index: 999;
}
.admin-bar #masthead {
  top: 32px;
}
@media (max-width: 782px) {
  .admin-bar #masthead {
    top: 46px;
  }
}

/* ==========================================================================
   Menu principal (ordinateur) : onglet actif en pastille
   ========================================================================== */
#ast-desktop-header .main-header-menu > .menu-item {
  display: flex;
  align-items: center;
}
#ast-desktop-header .main-header-menu > .menu-item > .menu-link {
  height: auto;
  line-height: 1.4; /* le <li> hérite de line-height: 80px d'Astra, qui gonflait la pastille */
  padding: 6px 18px;
  border-radius: 30px;
  transition: background 0.2s, color 0.2s;
}
#ast-desktop-header .main-header-menu > .menu-item.current-menu-item > .menu-link,
#ast-desktop-header .main-header-menu > .menu-item.current-menu-ancestor > .menu-link {
  background: var(--ast-global-color-0);
  color: #fff;
}

/* Ombre légère sous l'en-tête une fois la page défilée (classe posée par un petit script) */
#masthead {
  transition: box-shadow 0.25s ease;
}
#masthead.is-scrolled {
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.08);
}
