/* ================================================================
 * EFEITOS VISUAIS REUTILIZAVEIS
 * Efeito de riscos SVG para destaques em textos e outros componentes.
 * ================================================================ */

:root {
  --y-effect-ink: #c99a2e;
  --y-effect-duration: 0.5s;
  --y-effect-delay: 0.2s;
}

/* -----------------------------------------------------
 * RISCO SVG
 * O SVG e os paths usam visibility:hidden inline no HTML para evitar
 * flash antes do carregamento desta folha de estilos.
 * ----------------------------------------------------- */
.y-effect-mark,
.y-risco {
  position: relative;
  display: inline-block;
  white-space: nowrap;
}

.y-effect-mark svg,
.y-risco svg {
  position: absolute;
  left: -3%;
  width: 106%;
  bottom: -0.3em;
  height: 0.5em;
  overflow: visible;
  pointer-events: none;
  visibility: visible !important;
}

.y-effect-mark svg path,
.y-risco svg path {
  fill: none;
  stroke: var(--ink, var(--y-effect-ink));
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-dasharray: 100;
  stroke-dashoffset: 100;
  animation: y-effect-mark-draw var(--duration, var(--y-effect-duration)) cubic-bezier(.5, 0, .4, 1) forwards;
  animation-delay: var(--delay, var(--y-effect-delay));
}

@keyframes y-effect-mark-draw {
  0% {
    visibility: visible;
    stroke-dashoffset: 100;
  }

  100% {
    visibility: visible;
    stroke-dashoffset: 0;
  }
}

/* -----------------------------------------------------
 * VARIACOES
 * Os aliases numericos preservam compatibilidade com marcacoes antigas.
 * ----------------------------------------------------- */
.y-effect-mark--triplo,
.y-risco-1 {
  --y-effect-mark-style: triplo;
}

.y-effect-mark--triplo svg path:nth-of-type(1),
.y-risco-1 svg path:nth-of-type(1) {
  stroke-width: 3.4;
}

.y-effect-mark--triplo svg path:nth-of-type(2),
.y-risco-1 svg path:nth-of-type(2) {
  stroke-width: 1.8;
  opacity: 0.9;
  animation-delay: calc(var(--delay, var(--y-effect-delay)) + var(--duration, var(--y-effect-duration)) * 0.12);
  animation-duration: calc(var(--duration, var(--y-effect-duration)) * 0.94);
}

.y-effect-mark--triplo svg path:nth-of-type(3),
.y-risco-1 svg path:nth-of-type(3) {
  stroke-width: 1.1;
  opacity: 0.7;
  animation-delay: calc(var(--delay, var(--y-effect-delay)) + var(--duration, var(--y-effect-duration)) * 0.22);
  animation-duration: calc(var(--duration, var(--y-effect-duration)) * 0.9);
}

.y-effect-mark--simples,
.y-risco-2 {
  --y-effect-mark-style: simples;
}

.y-effect-mark--simples svg path:nth-of-type(1),
.y-risco-2 svg path:nth-of-type(1) {
  stroke-width: 2.6;
}

.y-effect-mark--ondulado,
.y-risco-3 {
  --y-effect-mark-style: ondulado;
}

.y-effect-mark--ondulado svg path:nth-of-type(1),
.y-risco-3 svg path:nth-of-type(1) {
  stroke-width: 3;
}

.y-effect-mark--ondulado svg path:nth-of-type(2),
.y-risco-3 svg path:nth-of-type(2) {
  stroke-width: 1.6;
  opacity: 0.85;
  animation-delay: calc(var(--delay, var(--y-effect-delay)) + var(--duration, var(--y-effect-duration)) * 0.15);
  animation-duration: calc(var(--duration, var(--y-effect-duration)) * 0.9);
}

/* -----------------------------------------------------
 * ACESSIBILIDADE
 * Reduz o movimento e deixa todos os tracados no estado final.
 * ----------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
  .y-effect-mark svg,
  .y-risco svg {
    animation: none;
    visibility: visible !important;
  }

  .y-effect-mark svg path,
  .y-risco svg path {
    animation: none;
    stroke-dashoffset: 0;
    visibility: visible !important;
  }
}
