/* ==========================================================================
   EYNSO · Boutons au pinceau (tout le site)
   Un trait d'encre sumi se peint derrière le libellé au survol (souris) ;
   sur écran tactile, il se peint quand le bouton arrive à l'écran.
   - Boutons Elementor (.elementor-button) si l'option « tout le site » est active
     (Outils → EYNSO Projets), sinon seulement les classes ci-dessous ;
   - .ep-brush : n'importe quel lien ou bouton ; .ep-brush-link : trait sous un lien ;
   - .enso-brush-btn / .enso-brush-link : anciennes classes, toujours reconnues ;
   - variantes : .brush-light (fond sombre), .brush-seal (carmin), .brush-solid
     (trait visible au repos) ; .no-brush sur un bouton ou un conteneur pour l'exclure.
   Couleurs et durée : variables ci-dessous, réglables dans Outils → EYNSO Projets.
   ========================================================================== */
:root {
  --ep-brush-ink: #0D0C0A;      /* couleur du trait */
  --ep-brush-on: #F2F0E9;       /* texte posé sur le trait */
  --ep-brush-seal: #761924;     /* variante carmin */
  --ep-brush-dur: .55s;
  --ep-brush-ease: cubic-bezier(.22, .61, .36, 1);
  --ep-brush-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 600 120' preserveAspectRatio='none'%3E%3Cpath fill-rule='evenodd' d='M18 31 L23 30 L29 31 L34 30 L40 29 L45 29 L50 29 L56 29 L61 29 L67 28 L72 27 L77 28 L83 26 L88 27 L94 27 L99 28 L104 27 L110 27 L115 26 L121 26 L126 26 L132 26 L137 26 L142 24 L148 24 L153 25 L159 25 L164 24 L169 25 L175 25 L180 26 L186 26 L191 26 L196 26 L202 25 L207 24 L213 24 L218 24 L223 24 L229 25 L234 24 L240 24 L245 25 L250 25 L256 24 L261 26 L267 25 L272 25 L277 26 L283 26 L288 25 L294 26 L299 27 L304 27 L310 27 L315 27 L321 27 L326 28 L331 28 L337 29 L342 29 L348 29 L353 28 L359 28 L364 29 L369 28 L375 29 L380 30 L386 31 L391 31 L396 30 L402 32 L407 33 L413 32 L418 32 L423 32 L429 32 L434 33 L440 33 L445 33 L450 34 L469 34 L485 35 L469 36 L447 36 L456 38 L467 38 L476 40 L467 40 L446 40 L444 41 L483 42 L515 43 L483 44 L430 43 L450 44 L480 46 L505 47 L480 46 L438 45 L448 46 L506 47 L554 48 L506 49 L437 48 L434 49 L453 50 L470 51 L453 52 L434 53 L429 54 L486 56 L533 57 L486 57 L420 56 L441 57 L504 57 L555 57 L504 59 L427 60 L459 61 L524 60 L577 59 L524 61 L451 62 L422 63 L461 63 L493 63 L461 65 L417 66 L442 67 L478 67 L507 67 L478 68 L428 69 L452 70 L515 69 L566 69 L515 71 L444 72 L426 73 L449 74 L467 75 L449 76 L424 76 L458 77 L471 77 L482 77 L471 78 L450 78 L446 79 L474 80 L496 82 L474 83 L442 83 L430 84 L438 83 L444 83 L438 85 L428 86 L445 86 L440 86 L434 87 L429 86 L423 87 L418 87 L413 87 L407 86 L402 87 L396 86 L391 87 L386 85 L380 86 L375 85 L369 86 L364 86 L359 87 L353 88 L348 88 L342 89 L337 88 L331 89 L326 88 L321 88 L315 87 L310 87 L304 87 L299 87 L294 87 L288 88 L283 88 L277 87 L272 87 L267 87 L261 88 L256 89 L250 88 L245 89 L240 88 L234 88 L229 90 L223 89 L218 89 L213 90 L207 91 L202 89 L196 88 L191 89 L186 89 L180 89 L175 90 L169 90 L164 90 L159 91 L153 91 L148 91 L142 90 L137 89 L132 89 L126 90 L121 90 L115 90 L110 91 L104 90 L99 90 L94 89 L88 90 L83 89 L77 89 L72 91 L67 90 L61 90 L56 90 L50 90 L45 89 L40 88 L34 88 L29 89 L23 89 L18 90 L13 85 L9 66 L10 40 L15 33Z'/%3E%3Cpath d='M594 40 a1.6 1.6 0 1 0 .1 0ZM589 82 a1.2 1.2 0 1 0 .1 0ZM8 28 a1.1 1.1 0 1 0 .1 0Z'/%3E%3C/svg%3E");
}

/* ---- Bouton ---------------------------------------------------------- */
:is(.ep-brush, .enso-brush-btn, .ep-brush-all .elementor-button, .ep .ep-btn-w .elementor-button, .ep .ep-btn):not(.no-brush, .no-brush *) {
  position: relative;
  isolation: isolate;
  background: transparent !important;
  background-image: none !important;
  border-color: transparent !important;
  box-shadow: none !important;
  text-decoration: none !important;
  color: var(--ep-brush-ink) !important;
  fill: currentColor;
  transition: color .3s ease .05s !important;
}
:is(.ep-brush, .enso-brush-btn, .ep-brush-all .elementor-button, .ep .ep-btn-w .elementor-button, .ep .ep-btn):not(.no-brush, .no-brush *)::before {
  content: "";
  position: absolute; z-index: -1;
  inset: -34% -14% -34% -8%;           /* le trait déborde un peu : poils secs à droite */
  background: var(--ep-brush-ink);
  -webkit-mask: var(--ep-brush-mask) center / 100% 100% no-repeat;
          mask: var(--ep-brush-mask) center / 100% 100% no-repeat;
  clip-path: inset(0 100% 0 0);        /* caché : se peint de gauche à droite */
  transition: clip-path var(--ep-brush-dur) var(--ep-brush-ease), transform .25s ease;
  pointer-events: none;
}
/* révélé : survol (souris), focus clavier, repos sur écran tactile, variante pleine */
@media (hover: hover) {
  :is(.ep-brush, .enso-brush-btn, .ep-brush-all .elementor-button, .ep .ep-btn-w .elementor-button, .ep .ep-btn):not(.no-brush, .no-brush *):hover::before { clip-path: inset(0 0 0 0); }
  :is(.ep-brush, .enso-brush-btn, .ep-brush-all .elementor-button, .ep .ep-btn-w .elementor-button, .ep .ep-btn):not(.no-brush, .no-brush *):hover { color: var(--ep-brush-on) !important; }
}
:is(.ep-brush, .enso-brush-btn, .ep-brush-all .elementor-button, .ep .ep-btn-w .elementor-button, .ep .ep-btn):not(.no-brush, .no-brush *):focus-visible::before,
:is(.ep-brush, .enso-brush-btn, .ep-brush-all .elementor-button, .ep .ep-btn-w .elementor-button, .ep .ep-btn):not(.no-brush, .no-brush *).is-brushed::before,
:is(.brush-solid, .brush-solid .elementor-button):not(.no-brush)::before { clip-path: inset(0 0 0 0); }
:is(.ep-brush, .enso-brush-btn, .ep-brush-all .elementor-button, .ep .ep-btn-w .elementor-button, .ep .ep-btn):not(.no-brush, .no-brush *):focus-visible,
:is(.ep-brush, .enso-brush-btn, .ep-brush-all .elementor-button, .ep .ep-btn-w .elementor-button, .ep .ep-btn):not(.no-brush, .no-brush *).is-brushed,
:is(.brush-solid, .brush-solid .elementor-button):not(.no-brush) { color: var(--ep-brush-on) !important; }
:is(.ep-brush, .enso-brush-btn, .ep-brush-all .elementor-button, .ep .ep-btn-w .elementor-button, .ep .ep-btn):not(.no-brush, .no-brush *):focus-visible { outline: 2px solid var(--ep-brush-ink); outline-offset: 6px; }
:is(.ep-brush, .enso-brush-btn, .ep-brush-all .elementor-button, .ep .ep-btn-w .elementor-button, .ep .ep-btn):not(.no-brush, .no-brush *):active::before { transform: scale(.97, .9); }
/* tactile sans script : trait visible au repos */
@media (hover: none) {
  html:not(.ep-brush-io) :is(.ep-brush, .enso-brush-btn, .ep-brush-all .elementor-button, .ep .ep-btn-w .elementor-button, .ep .ep-btn):not(.no-brush, .no-brush *)::before { clip-path: inset(0 0 0 0); }
  html:not(.ep-brush-io) :is(.ep-brush, .enso-brush-btn, .ep-brush-all .elementor-button, .ep .ep-btn-w .elementor-button, .ep .ep-btn):not(.no-brush, .no-brush *) { color: var(--ep-brush-on) !important; }
}
/* variantes */
:is(.brush-light, .brush-light .elementor-button) { --ep-brush-ink: #F2F0E9; --ep-brush-on: #0D0C0A; }
:is(.brush-seal, .brush-seal .elementor-button, .enso-seal) { --ep-brush-ink: var(--ep-brush-seal); --ep-brush-on: #FBFAF6; }

/* ---- Lien : trait sous le texte -------------------------------------- */
:is(.ep-brush-link, .enso-brush-link):not(.no-brush) { position: relative; display: inline-block; text-decoration: none; color: inherit; }
:is(.ep-brush-link, .enso-brush-link):not(.no-brush)::after {
  content: "";
  position: absolute; left: -4px; right: -14px; bottom: -.24em; height: .5em;
  background: var(--ep-brush-ink);
  -webkit-mask: var(--ep-brush-mask) center / 100% 100% no-repeat;
          mask: var(--ep-brush-mask) center / 100% 100% no-repeat;
  clip-path: inset(0 100% 0 0);
  transition: clip-path calc(var(--ep-brush-dur) * .85) var(--ep-brush-ease);
  pointer-events: none;
}
@media (hover: hover) { :is(.ep-brush-link, .enso-brush-link):not(.no-brush):hover::after { clip-path: inset(0 0 0 0); } }
:is(.ep-brush-link, .enso-brush-link):not(.no-brush):focus-visible::after { clip-path: inset(0 0 0 0); }
.enso-brush-link.enso-seal::after { background: var(--ep-brush-seal); }

@media (prefers-reduced-motion: reduce) {
  :is(.ep-brush, .enso-brush-btn, .ep-brush-all .elementor-button, .ep .ep-btn-w .elementor-button, .ep .ep-btn)::before,
  :is(.ep-brush-link, .enso-brush-link)::after { transition: none !important; }
}
