/* Randomized Link Underline Styles – v1.4.4 */
:root{
  --lu-color: currentColor;
  --lu-thickness: 1.5px;
  --lu-offset: 0.18em;
  --lu-style: solid;
  --lu-bg: none;
  --lu-bg-size: 0;
  --lu-anim: none;
}

a[href]:not(.no-random-underline){
  text-decoration-line: underline;
  text-decoration-color: var(--lu-color);
  text-decoration-thickness: var(--lu-thickness);
  text-underline-offset: var(--lu-offset);
  text-decoration-style: var(--lu-style);
  background-image: var(--lu-bg);
  background-repeat: no-repeat;
  background-position: 0 100%;
  background-size: 100% var(--lu-bg-size);
  animation: var(--lu-anim);
}

/* Hover focus states: slightly strengthen underline */
a[href]:not(.no-random-underline):hover,
a[href]:not(.no-random-underline):focus-visible{
  text-decoration-thickness: calc(var(--lu-thickness) + 0.5px);
}

/* Gentle animated gradient for underline background */
@keyframes lu-slow-pan {
  0% { background-position: 0 100%; }
  100% { background-position: 200% 100%; }
}

/* Respect reduced motion */
@media (prefers-reduced-motion: reduce){
  a[href]:not(.no-random-underline){
    animation: none !important;
  }
}





/* === PATCH v2: Keep background-image on thumbnail anchors; only adjust underline + sizing === */
.post-components a.post-thumb,
.post-components a[class*="post-thumb"],
.post-components a[style*="background-image"],
.prev-next-post-nav a,
.td-module-thumb a,
.tie-col-xs-6 a {
  /* Do NOT touch background/background-image here. */
  text-decoration: none !important;
  background-color: transparent !important;
  background-position: center center !important;
  background-repeat: no-repeat !important;
  background-size: cover !important;
}
/* underline فقط برای لینک‌های متنی */
.post-components a:not(.post-thumb):not([style*="background-image"]):not(.td-module-thumb):not(.tie-media-icon):not(.thumb):not(.has-bg) {
  text-decoration: underline;
}
/* === END PATCH v2 === */

