/* ══════════════════ Split Text ══════════════════ */
.ston-split-text {
    display: inline-block;
}

.ston-split-text .ston-word,
.ston-split-text .ston-char {
    will-change: transform, opacity;
}


/* ══════════════════ Marquee ══════════════════ */
.ston-marquee {
    position: relative;
    overflow: hidden;
    width: 100%;
    white-space: nowrap;
    /* The strip is laid out left to right in every language: the loop math measures it that way.
       In RTL the strip started at the right edge, so a gap opened as it moved. Text keeps its own direction below. */
    direction: ltr;
}

[dir="rtl"] .ston-marquee-item { direction: rtl; }

.ston-marquee-track {
    display: flex;
    align-items: center;
    gap: 60px; /* same space between copies of the set as between items */
    width: max-content;
    will-change: transform;
}

/* هر .ston-marquee-set یک نسخه‌ی کامل از آیتم‌هاست؛ JS به تعداد لازم از همین کپی می‌کنه
   تا حداقل ۲ برابر عرض کانتینر پر بشه و لوپ همیشه بدون‌پرش باشه */
.ston-marquee-set {
    display: flex;
    align-items: center;
    flex-shrink: 0;
    gap: 60px;
}

.ston-marquee-item {
    display: inline-flex;
    align-items: center;
    font-size: 1.5rem;
    font-weight: 600;
    white-space: nowrap;
}

.ston-marquee-prefix {
    display: inline-block;
    flex-shrink: 0;
    margin-inline-end: 8px;
}

.ston-marquee-item img {
    max-height: 60px;
    width: auto;
    display: block;
}

.ston-marquee-fade {
    -webkit-mask-image: linear-gradient(to right, transparent 0, #000 8%, #000 92%, transparent 100%);
    mask-image: linear-gradient(to right, transparent 0, #000 8%, #000 92%, transparent 100%);
}

/* ══════════════════ Counter ══════════════════ */
.ston-counter-box {
    display: inline-block;
}

.ston-counter-wrap {
    font-size: 3rem;
    font-weight: 700;
    display: inline-block;
    direction: ltr; /* اعداد همیشه چپ‌به‌راست نمایش داده بشن، حتی در سایت‌های راست‌چین */
}

.ston-counter-label {
    font-size: 1rem;
    opacity: 0.8;
}

/* ══════════════════ Magnetic Button ══════════════════ */
.ston-magnetic-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    font-weight: 600;
    will-change: transform;
    cursor: pointer;
}

.ston-magnetic-btn-inner {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    will-change: transform;
    pointer-events: none;
}

.ston-cursor {
    position: fixed;
    top: 0;
    left: 0;
    pointer-events: none;
    z-index: 999999;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity .2s ease;
}

.ston-cursor-icon svg,
.ston-cursor-icon i {
    width: 100%;
    height: 100%;
    font-size: inherit;
}

html.ston-cursor-hide-native,
html.ston-cursor-hide-native * {
    cursor: none !important;
}

@media (hover: none) {
    .ston-cursor { display: none !important; }
}


/* ══════════════════ Pulse Badge (also the Status List badge) ══════════════════ */
.ston-badge {
    --ston-badge-dot: #eb1f27;
    --ston-badge-ring: color-mix(in srgb, var(--ston-badge-dot) 70%, transparent);
    --ston-badge-dot-size: 5px;
    --ston-badge-gap: 10px;
    --ston-badge-speed: 1.8s;
    --ston-badge-border: color-mix(in srgb, currentColor 30%, transparent);
    display: inline-flex;
    align-items: center;
    margin: 0;
    line-height: 1.4;
}
.ston-badge a { color: inherit; text-decoration: none; }
.ston-badge--pill {
    padding: 4px 10px;
    border: 1px solid var(--ston-badge-border);
    border-radius: 100px;
}
.ston-badge.has-dot::before {
    content: '';
    flex: 0 0 auto;
    width: var(--ston-badge-dot-size);
    height: var(--ston-badge-dot-size);
    margin-inline-end: var(--ston-badge-gap);
    border-radius: 50%;
    background: var(--ston-badge-dot);
}
.ston-badge--ring::before {
    margin-inline-start: 4px;
    box-shadow: 0 0 0 4px var(--ston-badge-ring);
    animation: ston-badge-ring var(--ston-badge-speed) ease-in-out infinite;
}
.ston-badge--blink::before { animation: ston-badge-blink var(--ston-badge-speed) ease-in-out infinite; }
@keyframes ston-badge-ring {
    0%, 100% { box-shadow: 0 0 0 4px var(--ston-badge-ring); }
    50% { box-shadow: 0 0 0 7px transparent; }
}
@keyframes ston-badge-blink {
    0%, 100% { opacity: 1; }
    50% { opacity: .3; }
}

/* ══════════════════ Text Rotator ══════════════════ */
.ston-rotator { margin: 0; }
.ston-rotator-words {
    position: relative;
    display: inline-block;
    vertical-align: top;
    overflow: hidden;
    min-height: 1.25em;
}
.ston-rotator--stack .ston-rotator-words { display: block; }
.ston-rotator-word {
    position: absolute;
    top: 0;
    left: 0;
    white-space: nowrap;
    opacity: 0;
    transition: opacity .6s ease, transform .6s cubic-bezier(.2,.7,.2,1), filter .6s ease;
}
[dir="rtl"] .ston-rotator-word { left: auto; right: 0; }
.ston-rotator--slide-up .ston-rotator-word { transform: translateY(100%); }
.ston-rotator--slide-up .ston-rotator-word.is-leaving { transform: translateY(-100%); }
.ston-rotator--slide-down .ston-rotator-word { transform: translateY(-100%); }
.ston-rotator--slide-down .ston-rotator-word.is-leaving { transform: translateY(100%); }
.ston-rotator--blur .ston-rotator-word { filter: blur(8px); }
.ston-rotator-words .ston-rotator-word.is-active { opacity: 1; transform: none; filter: none; }

/* ══════════════════ Tag Pills ══════════════════ */
.ston-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin: 0;
    padding: 0;
    list-style: none;
}
.ston-tags > li { margin: 0; padding: 0; }
.ston-tag {
    display: inline-block;
    padding: 7px 14px;
    border: 1px solid color-mix(in srgb, currentColor 25%, transparent);
    border-radius: 100px;
    font-size: 12px;
    line-height: 1.4;
    color: inherit;
    text-decoration: none;
    transition: background-color .25s ease, border-color .25s ease, color .25s ease;
}
.ston-tag:hover, .ston-tag:focus-visible { background-color: color-mix(in srgb, currentColor 12%, transparent); }
.ston-tags--stagger > li { opacity: 0; transform: translateY(12px); transition: opacity .5s ease, transform .5s ease; transition-delay: calc(var(--ston-tag-i, 0) * 80ms); }
.ston-tags--stagger.is-in > li { opacity: 1; transform: none; }

/* ══════════════════ Connection Flow ══════════════════ */
.ston-flow {
    --ston-flow-box: 64px;
    --ston-flow-speed: 2.5s;
    --ston-flow-dot: #eb1f27;
    --ston-flow-dot-back: var(--ston-flow-dot);
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    padding: 44px;
    box-sizing: border-box;
}
.ston-flow-node {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    font-size: 12px;
}
.ston-flow-box {
    display: flex;
    align-items: center;
    justify-content: center;
    width: var(--ston-flow-box);
    height: var(--ston-flow-box);
    border: 1px solid color-mix(in srgb, currentColor 18%, transparent);
    border-radius: 14px;
    font-weight: 700;
    font-size: 13px;
}
.ston-flow-box svg { width: 45%; height: 45%; fill: currentColor; }
.ston-flow-box i { font-size: calc(var(--ston-flow-box) * .4); }
.ston-flow-label { opacity: .6; }
.ston-flow-line {
    position: relative;
    flex: 1;
    height: 1px;
    margin: 0 14px 22px;
    background: color-mix(in srgb, currentColor 18%, transparent);
}
.ston-flow-dot {
    position: absolute;
    top: -2.5px;
    left: 0;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--ston-flow-dot);
    box-shadow: 0 0 8px 1px var(--ston-flow-dot);
}
.ston-flow--both .ston-flow-dot { animation: ston-flow-both calc(var(--ston-flow-speed) * 2) linear infinite; }
.ston-flow--one .ston-flow-dot { animation: ston-flow-one var(--ston-flow-speed) linear infinite; }
@keyframes ston-flow-both {
    0% { left: 0; }
    49.9% { background: var(--ston-flow-dot); box-shadow: 0 0 8px 1px var(--ston-flow-dot); }
    50% { left: calc(100% - 6px); background: var(--ston-flow-dot-back); box-shadow: 0 0 8px 1px var(--ston-flow-dot-back); }
    100% { left: 0; background: var(--ston-flow-dot-back); box-shadow: 0 0 8px 1px var(--ston-flow-dot-back); }
}
@keyframes ston-flow-one {
    0% { left: 0; opacity: 0; }
    10% { opacity: 1; }
    90% { opacity: 1; }
    100% { left: calc(100% - 6px); opacity: 0; }
}
/* RTL: the "from" node sits on the right, so the line is mirrored and the dot starts there too. */
[dir="rtl"] .ston-flow-line { transform: scaleX(-1); }
@media (max-width: 480px) { .ston-flow { padding: 28px 16px; } }

/* ══════════════════ Status List ══════════════════ */
.ston-status-list {
    --ston-status: #7bd88f;
    display: flex;
    flex-direction: column;
    gap: 16px;
    margin: 0;
    padding: 0;
    list-style: none;
}
.ston-status-item {
    display: flex;
    align-items: center;
    gap: 14px;
    margin: 0;
    padding: 14px 18px;
    border: 1px solid color-mix(in srgb, currentColor 15%, transparent);
    border-radius: 10px;
}
.ston-status-icon { flex: 0 0 auto; display: inline-flex; font-size: 30px; line-height: 1; }
.ston-status-icon svg { width: 1em; height: 1em; fill: currentColor; }
.ston-status-text { display: flex; flex-direction: column; flex: 1 1 auto; min-width: 0; gap: 2px; }
.ston-status-title { font-size: 13px; }
.ston-status-meta { font-size: 12px; opacity: .6; }
.ston-status-badge {
    --ston-badge-dot: var(--ston-status);
    --ston-badge-border: var(--ston-status);
    --ston-badge-gap: 5px;
    flex: 0 0 auto;
    font-size: 12px;
    color: var(--ston-status);
}

/* ══════════════════ Ripple Button ══════════════════ */
.ston-ripple-wrap { display: flex; }
.ston-ripple {
    --ston-ripple-size: 80px;
    --ston-ripple-color: #c0392b;
    --ston-ripple-speed: 1.2s;
    --ston-ripple-scale: 2.5;
    position: relative;
    z-index: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: var(--ston-ripple-size);
    height: var(--ston-ripple-size);
    border: 3px solid rgba(255,255,255,.3);
    border-radius: 50%;
    background-color: #fff;
    color: #c0392b;
    font-size: 24px;
    text-decoration: none;
    transition: background-color .3s ease, color .3s ease;
}
.ston-ripple svg { width: 1em; height: 1em; fill: currentColor; }
.ston-ripple.has-ripple::before {
    content: '';
    position: absolute;
    inset: 0;
    z-index: -1;
    border-radius: 50%;
    background-color: var(--ston-ripple-color);
    opacity: 0;
    animation: ston-ripple var(--ston-ripple-speed) ease-out infinite;
}
@keyframes ston-ripple {
    0% { transform: scale(1); opacity: .5; }
    70% { transform: scale(calc(var(--ston-ripple-scale) * .8)); opacity: .2; }
    100% { transform: scale(var(--ston-ripple-scale)); opacity: 0; }
}

/* Marquee: second-colour part of a text item. */
.ston-marquee-highlight { margin-inline-start: .25em; }

@media (prefers-reduced-motion: reduce) {
    .ston-badge.has-dot::before,
    .ston-flow-dot,
    .ston-ripple.has-ripple::before { animation: none; }
    .ston-rotator-word { transition: none; }
    .ston-tags--stagger > li { opacity: 1; transform: none; transition: none; }
}

/* ══════════════════ Lock Preview ══════════════════ */
.ston-lock {
    --ston-lock-line: #232326;
    --ston-lock-block: #1b1b1e;
    --ston-lock-skel: #2c2c30;
    --ston-lock-red: #eb1f27;
    --ston-lock-green: #7bd88f;
    --ston-lock-cursor: #fff;
    --ston-lock-ms: 700ms;
    position: relative;
    overflow: hidden;
    color: #f2f2f2;
    background-color: #141416;
    border: 1px solid var(--ston-lock-line);
    border-radius: 18px;
    isolation: isolate;
    text-align: start;
}
.ston-lock-chrome {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 12px 16px;
    border-bottom: 1px solid var(--ston-lock-line);
}
.ston-lock-dots { display: flex; gap: 6px; }
.ston-lock-dots i { width: 9px; height: 9px; border-radius: 50%; background: var(--ston-lock-skel); }
.ston-lock-url {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    flex: 1 1 auto;
    max-width: 260px;
    margin-inline: auto;
    padding: 5px 12px;
    font-size: 11px;
    opacity: .7;
    background: var(--ston-lock-block);
    border-radius: 999px;
    white-space: nowrap;
    overflow: hidden;
    direction: ltr; /* an address reads left to right, like in a real browser, also on RTL sites */
}
.ston-lock-url svg { width: 10px; height: 10px; fill: var(--ston-lock-green); flex: none; }
.ston-lock-page { display: flex; flex-direction: column; gap: 10px; padding: 16px; }

.ston-lock-block {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 14px 16px;
    background: var(--ston-lock-block);
    border: 1px dashed transparent;
    border-radius: 10px;
    transition: transform .45s cubic-bezier(.2,.8,.2,1), border-color .3s ease, box-shadow .3s ease;
}
.ston-lock-block.is-locked { border-color: color-mix(in srgb, var(--ston-lock-red) 28%, transparent); }
.ston-lock-block.is-editable { border-color: color-mix(in srgb, var(--ston-lock-green) 35%, transparent); }
.ston-lock-tag {
    position: absolute;
    top: 8px;
    inset-inline-end: 10px;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 3px 8px;
    font-size: 10px;
    line-height: 1.3;
    letter-spacing: .02em;
    border-radius: 999px;
    color: color-mix(in srgb, var(--ston-lock-red) 60%, #fff);
    background: color-mix(in srgb, var(--ston-lock-red) 16%, transparent);
}
.ston-lock-tag svg { width: 10px; height: 10px; fill: currentColor; }
.is-editable > .ston-lock-tag { color: var(--ston-lock-green); background: color-mix(in srgb, var(--ston-lock-green) 12%, transparent); }

.ston-lock-text { font-size: 13px; font-weight: 600; min-height: 1.3em; padding-inline-end: 110px; }
.ston-lock-block--hero { padding-block: 22px; }
.ston-lock-block--hero .ston-lock-text { font-size: 22px; line-height: 1.15; }
.ston-lock-row { display: flex; align-items: center; gap: 10px; padding-inline-end: 110px; }
.ston-lock-row .ston-lock-text { padding: 0; }
.ston-lock-logo { width: 14px; height: 14px; border-radius: 4px; background: var(--ston-lock-red); flex: none; }
.ston-lock-nav { display: none; }
.ston-lock-bar { display: block; width: 100%; height: 6px; border-radius: 4px; background: var(--ston-lock-skel); }
.ston-lock-bar--80 { width: 80%; }
.ston-lock-bar--70 { width: 70%; }
.ston-lock-bar--30 { width: 30%; }
.ston-lock-bar--18 { width: 18%; }
.ston-lock-pill { display: block; width: 84px; height: 22px; margin-top: 4px; border-radius: 999px; background: var(--ston-lock-red); opacity: .85; }
.ston-lock-tiles { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 20px; }
.ston-lock-img { display: block; aspect-ratio: 16 / 10; border-radius: 6px; background: linear-gradient(135deg, var(--ston-lock-skel), color-mix(in srgb, var(--ston-lock-skel) 55%, transparent)); }
.ston-lock-block--image .ston-lock-img { aspect-ratio: 16 / 6; margin-top: 20px; }

/* Typing caret on the block being edited. */
.ston-lock-text.is-typing::after {
    content: '';
    display: inline-block;
    width: 2px;
    height: 1em;
    margin-inline-start: 2px;
    vertical-align: -.12em;
    background: var(--ston-lock-green);
    animation: ston-lock-caret .8s steps(1) infinite;
}
@keyframes ston-lock-caret { 50% { opacity: 0; } }

/* Drag attempt: lifted, red outline, then a short shake back into place. */
.ston-lock-block.is-grabbed { border-style: solid; border-color: var(--ston-lock-red); box-shadow: 0 14px 30px -12px rgba(0,0,0,.7); z-index: 2; }
.ston-lock-block.is-shake { animation: ston-lock-shake .42s ease; }
@keyframes ston-lock-shake {
    20% { transform: translateX(-6px); }
    40% { transform: translateX(5px); }
    60% { transform: translateX(-3px); }
    80% { transform: translateX(2px); }
}
.ston-lock-block.is-saved { border-style: solid; border-color: var(--ston-lock-green); }

.ston-lock-cursor {
    position: absolute;
    top: 0;
    left: 0;
    z-index: 5;
    width: 22px;
    height: 22px;
    pointer-events: none;
    opacity: 0;
    transform: translate(var(--x, 80%), var(--y, 90%));
    transition: transform var(--ston-lock-ms) cubic-bezier(.45,.05,.25,1), opacity .3s ease;
}
.ston-lock-cursor svg { width: 100%; height: 100%; fill: var(--ston-lock-cursor); stroke: #000; stroke-width: 1.2; filter: drop-shadow(0 2px 3px rgba(0,0,0,.5)); }
.ston-lock-cursor.is-on { opacity: 1; }
.ston-lock-cursor.is-press svg { transform: scale(.82); transform-origin: 20% 15%; transition: transform .12s ease; }

.ston-lock-toast {
    position: absolute;
    left: 50%;
    bottom: 14px;
    z-index: 6;
    padding: 8px 14px;
    font-size: 12px;
    white-space: nowrap;
    color: #fff;
    background: var(--ston-lock-red);
    border-radius: 999px;
    box-shadow: 0 8px 24px -8px rgba(0,0,0,.6);
    opacity: 0;
    transform: translate(-50%, 12px);
    transition: opacity .3s ease, transform .3s ease;
    pointer-events: none;
}
.ston-lock-toast.is-ok { color: #0b1a0f; background: var(--ston-lock-green); }
.ston-lock-toast.is-on { opacity: 1; transform: translate(-50%, 0); }

/* Page Mockup additions (1.5): accent, custom tags, buttons, forms, lists, real images, tag position. */
.ston-lock { --ston-lock-accent: var(--ston-lock-red); --ston-lock-tag: #8ab4f8; }
.ston-lock-logo, .ston-lock-pill { background: var(--ston-lock-accent); }
.ston-lock-block.is-custom { border-color: color-mix(in srgb, var(--ston-lock-tag) 35%, transparent); }
.is-custom > .ston-lock-tag { color: var(--ston-lock-tag); background: color-mix(in srgb, var(--ston-lock-tag) 14%, transparent); }
.ston-lock-tag i, .ston-lock-tag .e-font-icon-svg { font-size: 10px; width: 10px; height: 10px; fill: currentColor; }
.ston-lock-block.is-none .ston-lock-text, .ston-lock-block.is-none .ston-lock-row { padding-inline-end: 0; }
.ston-lock-sub { font-size: 12px; opacity: .72; line-height: 1.5; }
.ston-lock-btn {
    display: inline-flex;
    align-items: center;
    align-self: flex-start;
    min-height: 26px;
    margin-top: 4px;
    padding: 4px 14px;
    font-size: 12px;
    font-weight: 600;
    color: #fff;
    background: var(--ston-lock-accent);
    border-radius: 999px;
}
.ston-lock-btn .ston-lock-text { padding: 0; font-size: inherit; min-height: 0; }
.ston-lock-btn-row { display: flex; }
.ston-lock-form { display: flex; flex-direction: column; gap: 8px; margin-top: 18px; }
.ston-lock-field {
    display: block;
    min-height: 26px;
    padding: 5px 10px;
    font-size: 11px;
    opacity: .75;
    border: 1px solid var(--ston-lock-skel);
    border-radius: 6px;
}
.ston-lock-list { display: flex; flex-direction: column; gap: 6px; margin: 18px 0 0; padding: 0; list-style: none; }
.ston-lock-li { display: flex; align-items: center; gap: 8px; font-size: 12px; }
.ston-lock-li::before { content: ''; flex: none; width: 6px; height: 6px; border-radius: 50%; background: var(--ston-lock-accent); }
.ston-lock-li.is-empty .ston-lock-bar { flex: 1 1 auto; }
.ston-lock-photo { display: block; width: 100%; height: auto; aspect-ratio: 16 / 10; object-fit: cover; border-radius: 6px; }
.ston-lock-block--image .ston-lock-photo { aspect-ratio: 16 / 6; margin-top: 20px; }
.ston-lock-caption { font-size: 11px; opacity: .7; }
/* Tag position (prefix class on the widget wrapper). */
.ston-lock-tags--top-start .ston-lock-tag { inset-inline-end: auto; inset-inline-start: 10px; }
.ston-lock-tags--bottom-end .ston-lock-tag { top: auto; bottom: 8px; }
.ston-lock-tags--bottom-start .ston-lock-tag { top: auto; bottom: 8px; inset-inline-end: auto; inset-inline-start: 10px; }
.ston-lock-tags--bottom-end .ston-lock-text, .ston-lock-tags--bottom-start .ston-lock-text,
.ston-lock-tags--bottom-end .ston-lock-row, .ston-lock-tags--bottom-start .ston-lock-row { padding-inline-end: 0; }
.ston-lock-tags--bottom-end .ston-lock-block, .ston-lock-tags--bottom-start .ston-lock-block { padding-bottom: 34px; }
.ston-lock-tags--top-start .ston-lock-block { padding-top: 34px; }
.ston-lock-tags--top-start .ston-lock-text, .ston-lock-tags--top-start .ston-lock-row { padding-inline-end: 0; }
/* Messages at the top. */
.ston-lock--toast-top .ston-lock-toast { top: 56px; bottom: auto; transform: translate(-50%, -12px); }
.ston-lock--toast-top .ston-lock-toast.is-on { transform: translate(-50%, 0); }
/* A move that is allowed. */
.ston-lock-block.is-moved { border-style: solid; border-color: var(--ston-lock-green); }
/* A click. */
.ston-lock-block.is-clicked { border-style: solid; border-color: var(--ston-lock-accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--ston-lock-accent) 25%, transparent); }

@media (min-width: 600px) {
    .ston-lock-nav { display: flex; gap: 8px; margin-inline-start: auto; }
    .ston-lock-nav i { display: block; width: 26px; height: 5px; border-radius: 3px; background: var(--ston-lock-skel); }
}
@media (max-width: 420px) {
    .ston-lock-text, .ston-lock-row { padding-inline-end: 0; margin-top: 18px; }
    .ston-lock-row .ston-lock-text { margin-top: 0; }
    .ston-lock-block--hero .ston-lock-text { font-size: 18px; }
}
@media (prefers-reduced-motion: reduce) {
    .ston-lock-cursor, .ston-lock-toast { display: none; }
    .ston-lock-block { transition: none; }
}
