/* Randomized Link Underline Styles – v1.4.4 (patched for subtle single-color) */
:root{
  --lu-color: currentColor;
  --lu-thickness: 1.15px;
  --lu-offset: 0.18em;
  --lu-style: solid;
}

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: none;
  animation: none;
}

a[href]:not(.no-random-underline):hover,
a[href]:not(.no-random-underline):focus-visible{
  text-decoration-thickness: calc(var(--lu-thickness) + 0.25px);
}

/* 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 === */

/* === LOCAL PATCH: do not underline links in site header/topbar (phones, titles, menu items) === */
header a[href],
.header a[href],
.site-header a[href],
#site-header a[href],
#theme-header a[href],
#top-header a[href],
.top-header a[href],
.topbar a[href],
#topbar a[href],
.tmc-topbar a[href],
#tmc-topbar a[href] {
  text-decoration: none !important;
}

/* === END LOCAL PATCH === */


/* === LOCAL PATCH 2 (strong): never underline phone numbers anywhere (tel:, WhatsApp, sms, topbar) === */
a[href^="tel:"],
a[href^="tel:+"],
a[href*="wa.me"],
a[href*="whatsapp.com"],
a[href^="sms:"],
.tmc-topbar a,
#tmc-topbar a,
.tmc-topbar a *,
#tmc-topbar a * {
  text-decoration: none !important;
  text-decoration-line: none !important;
  border-bottom: none !important;
  box-shadow: none !important;
  background-image: none !important;
}
/* === END LOCAL PATCH 2 (strong) === */

/* === LOCAL PATCH 3 (ahan-sazeh custom) === */
/* remove underline from phone/tel/wa links everywhere + header menus */
a[href*="wa.me"],
a[href*="api.whatsapp.com"],
a[href*="web.whatsapp.com"],
a[href^="tel:"],
a[href^="callto:"],
a[href^="sms:"],
header a,
.site-header a,
#site-header a,
#masthead a,
.topbar a,
.top-bar a,
#topbar a,
#top-bar a {
  text-decoration: none !important;
  text-decoration-line: none !important;
  border-bottom: none !important;
  background-image: none !important;
  box-shadow: none !important;
}
/* === END LOCAL PATCH 3 === */

/* === LOCAL PATCH 4 (ahan-sazeh harder kill) === */
/* kill underline for phone-like and header/breadcrumb links everywhere */
a[href^="tel:"],
a[href*="tel:"],
a[href^="callto:"],
a[href^="sms:"],
a[href*="wa.me"],
a[href*="whatsapp.com"],
a[href*="wa.link"],
a[href*="chat.whatsapp.com"],
header a,
header a *,
.site-header a,
.site-header a *,
#site-header a,
#site-header a *,
#masthead a,
#masthead a *,
.topbar a,
.topbar a *,
.top-bar a,
.top-bar a *,
#topbar a,
#topbar a *,
#top-bar a,
#top-bar a *,
.breadcrumb a,
.breadcrumb a *,
.woocommerce-breadcrumb a,
.woocommerce-breadcrumb a * {
  text-decoration: none !important;
  text-decoration-line: none !important;
  text-decoration-color: transparent !important;
  border-bottom: none !important;
  background-image: none !important;
  box-shadow: none !important;
}
/* === END LOCAL PATCH 4 === */

/* === LOCAL PATCH 5 (mobile-specific kill) === */
@media (max-width: 900px) {
  /* common mobile wrappers / headers / menus */
  .mobile-header a,
  .mobile-header a *,
  .mobile-topbar a,
  .mobile-topbar a *,
  .mobile-menu a,
  .mobile-menu a *,
  .mobile-nav a,
  .mobile-nav a *,
  .header-mobile a,
  .header-mobile a *,
  .nav-mobile a,
  .nav-mobile a *,
  .menu-mobile a,
  .menu-mobile a *,
  [class*="mobile-header"] a,
  [class*="mobile-header"] a *,
  [class*="mobile-nav"] a,
  [class*="mobile-nav"] a *,
  [class*="mobile-menu"] a,
  [class*="mobile-menu"] a *,
  .elementor-nav-menu--dropdown a,
  .elementor-nav-menu--dropdown a *,
  .elementor-menu-toggle,
  .elementor-menu-toggle * {
    text-decoration: none !important;
    text-decoration-line: none !important;
    text-decoration-color: transparent !important;
    border-bottom: none !important;
    background-image: none !important;
    box-shadow: none !important;
  }
}
/* === END LOCAL PATCH 5 === */

/* === LOCAL PATCH 6 (top phone strip brutal) === */
#tmc-topbar,
#tmc-topbar *,
.tmc-topbar,
.tmc-topbar *,
.phone-topbar,
.phone-topbar *,
.topbar-phone,
.topbar-phone *,
.top-phone,
.top-phone *,
.header-phone,
.header-phone *,
.call-bar,
.call-bar *,
.phone-bar,
.phone-bar *,
[class*="phone-bar"],
[class*="phone-bar"] *,
[class*="hotline"],
[class*="hotline"] * {
  text-decoration: none !important;
  text-decoration-line: none !important;
  text-decoration-color: transparent !important;
  border-bottom: none !important;
  background-image: none !important;
  box-shadow: none !important;
}
/* also in mobile just in case */
@media (max-width: 900px) {
  #tmc-topbar,
  #tmc-topbar *,
  .tmc-topbar,
  .tmc-topbar *,
  .phone-topbar,
  .phone-topbar *,
  .topbar-phone,
  .topbar-phone *,
  .top-phone,
  .top-phone *,
  .header-phone,
  .header-phone *,
  .call-bar,
  .call-bar *,
  .phone-bar,
  .phone-bar *,
  [class*="phone-bar"],
  [class*="phone-bar"] *,
  [class*="hotline"],
  [class*="hotline"] * {
    text-decoration: none !important;
    text-decoration-line: none !important;
    text-decoration-color: transparent !important;
    border-bottom: none !important;
    background-image: none !important;
    box-shadow: none !important;
  }
}
/* === END LOCAL PATCH 6 === */

