/* Local to the supplied heading. Load after the shared editorial styles.
 * Default/no-JS presentation is the complete underline, not invisible content.
 */
.scribble-heading[data-scribble] {
  --scribble-gold: #bd9a63;
  position: relative;
  display: inline-block;
  min-width: 0;
  max-width: 100%;
  padding-bottom: .44em;
  vertical-align: top;
  overflow-wrap: break-word;
}

.scribble-heading[data-scribble] > .scribble-underline {
  position: absolute;
  display: block;
  left: 1%;
  bottom: 0;
  width: 98%;
  max-width: 100%;
  height: clamp(18px, .55em, 36px);
  /* Internal SVG margins contain the rounded caps even at a 320px viewport. */
  overflow: hidden;
  pointer-events: none;
  user-select: none;
  fill: none;
  filter: none;
}

.scribble-heading[data-scribble] .scribble-underline path {
  fill: none;
  stroke: var(--scribble-gold);
  stroke-width: 1.35px;
  stroke-linecap: round;
  stroke-linejoin: round;
  vector-effect: non-scaling-stroke;
  stroke-dasharray: none;
  stroke-dashoffset: 0;
  opacity: .88;
  filter: none;
}

.scribble-heading[data-scribble-state="pending"] .scribble-underline path {
  stroke-dasharray: 1;
  stroke-dashoffset: 1;
  opacity: 0;
}

.scribble-heading[data-scribble-state="drawing"] .scribble-underline path {
  stroke-dasharray: 1;
  animation: travision-scribble-draw 1150ms cubic-bezier(.35, .04, .27, .97) both;
}

@keyframes travision-scribble-draw {
  from { stroke-dashoffset: 1; }
  to { stroke-dashoffset: 0; }
}

@media (max-width: 767px) {
  .scribble-heading[data-scribble] .scribble-underline path { stroke-width: 1.2px; }
}

/* Site pause and operating-system preferences override an in-flight animation
 * before its JS lifecycle callback, without changing text or heading position. */
[data-motion="off"] .scribble-heading[data-scribble] .scribble-underline path {
  animation: none !important;
  stroke-dasharray: none !important;
  stroke-dashoffset: 0 !important;
  opacity: .88 !important;
}

@media (prefers-reduced-motion: reduce), print {
  .scribble-heading[data-scribble] .scribble-underline path {
    animation: none !important;
    stroke-dasharray: none !important;
    stroke-dashoffset: 0 !important;
    opacity: .88 !important;
  }
}
