/* ============================================================
   WEB SERVICES — "service index": an index strip over one framed
   stage (text left / neon plate right). All rules in one gray tone.
   ============================================================ */

.web-services-section {
    --ws-line: var(--line-strong);
    --ws-ink: var(--text-muted);
    padding: 60px 0;
    position: relative;
    z-index: 1;
}

.web-services-section,
.web-services-section .container,
.web-services-section .inner {
    overflow: visible !important;
}

/* خطوط و نقطه‌های سکشن، هم‌رنگ بقیه سایت (بدون سبز) */
.web-services-section::before,
.web-services-section::after,
.web-services-section .inner::before,
.web-services-section .inner::after {
    background: var(--line-px) !important;
}

.web-services-section .dot {
    background: var(--dot-empty) !important;
    border-color: var(--ws-line) !important;
    box-shadow: none !important;
}

/* ============================================================
   HEADER — کادر خط‌کشی جدا برای تایتل
   ============================================================ */
#web-services .ws-header {
    width: 100% !important;
    max-width: none !important;
    margin: 0 0 34px !important;
    padding: 22px 32px !important;
    position: relative !important;
    text-align: center !important;
    overflow: visible !important;
}

#web-services .ws-header::before {
    content: '' !important;
    position: absolute !important;
    left: calc(-1 * var(--line-ext)) !important;
    right: calc(-1 * var(--line-ext)) !important;
    top: 0 !important;
    bottom: 0 !important;
    height: auto !important;
    border: 0 !important;
    border-top: 1px solid var(--ws-line) !important;
    border-bottom: 1px solid var(--ws-line) !important;
    background: none !important;
    pointer-events: none;
}

#web-services .ws-header::after {
    content: '' !important;
    position: absolute !important;
    top: 0 !important;
    bottom: 0 !important;
    left: 0 !important;
    right: 0 !important;
    width: auto !important;
    border: 0 !important;
    border-left: 1px solid var(--ws-line) !important;
    border-right: 1px solid var(--ws-line) !important;
    background: none !important;
    box-shadow: none !important;
    pointer-events: none;
}

#web-services .ws-header h2 {
    margin: 0 0 6px !important;
    font-size: 2rem !important;
    font-weight: 700;
    letter-spacing: -1px;
    line-height: 1.2;
}

#web-services .ws-header p {
    max-width: 560px;
    margin: 0 auto !important;
    font-size: 0.82rem !important;
    opacity: 0.45;
}

/* ============================================================
   BOARD
   ============================================================ */
.ws-board {
    position: relative;
    border: 1px solid var(--ws-line);
    z-index: 2;
}

.ws-board::before,
.ws-board::after {
    content: '';
    position: absolute;
    top: -1px;
    height: 1px;
    background: var(--ws-line);
    pointer-events: none;
    z-index: 3;
}

.ws-board::before { left: 100%; right: calc(-1 * var(--line-ext)); }
.ws-board::after { right: 100%; left: calc(-1 * var(--line-ext)); }

/* ============================================================
   INDEX STRIP — ۰۱ / ۰۲ / ۰۳
   ============================================================ */
.ws-index {
    position: relative;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    border-bottom: 1px solid var(--ws-line);
}

/* خط زیر نوار ایندکس تا لبه‌های صفحه */
.ws-index::after {
    content: '';
    position: absolute;
    left: calc(-1 * var(--line-ext));
    right: calc(-1 * var(--line-ext));
    bottom: -1px;
    height: 1px;
    background: var(--ws-line);
    pointer-events: none;
    z-index: 3;
}

.ws-seg {
    position: relative;
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    align-items: center;
    gap: 16px;
    min-height: 96px;
    padding: 22px 46px 22px 24px;
    background: transparent;
    border: 0;
    border-right: 1px solid var(--ws-line);
    color: var(--text);
    font: inherit;
    text-align: left;
    cursor: pointer;
    appearance: none;
    transition: background 0.35s ease;
}

.ws-seg:last-of-type {
    border-right: 0;
}

.ws-seg:hover {
    background: rgba(255, 255, 255, 0.014);
}

[data-theme="light"] .ws-seg:hover {
    background: rgba(0, 0, 0, 0.016);
}

.ws-seg.active {
    background: rgba(255, 255, 255, 0.02);
}

[data-theme="light"] .ws-seg.active {
    background: rgba(0, 0, 0, 0.02);
}

.wseg-num {
    font-family: 'Vazirmatn', 'Inter', sans-serif;
    font-size: 0.78rem;
    font-weight: 600;
    line-height: 1;
    letter-spacing: 0.14em;
    color: var(--ws-ink);
    opacity: 0.5;
    transition: opacity 0.3s ease;
}

.ws-seg.active .wseg-num {
    opacity: 1;
}

.wseg-text {
    display: flex;
    flex-direction: column;
    gap: 5px;
    min-width: 0;
}

.wseg-title {
    font-size: 0.95rem;
    font-weight: 600;
    line-height: 1.3;
    letter-spacing: -0.2px;
    opacity: 0.7;
    transition: opacity 0.3s ease;
}

.ws-seg.active .wseg-title {
    opacity: 1;
}

.wseg-sub {
    font-family: 'Vazirmatn', 'Inter', sans-serif;
    font-size: 0.58rem;
    font-weight: 500;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: var(--ws-ink);
    opacity: 0.55;
}

/* گوشه‌ی هر سگمنت: مربع کوچک که در حالت فعال پر می‌شود */
.wseg-mark {
    position: absolute;
    top: 20px;
    right: 20px;
    width: 7px;
    height: 7px;
    border: 1px solid var(--ws-ink);
    opacity: 0.35;
    transform: rotate(45deg);
    transition: opacity 0.3s ease, background 0.3s ease, border-color 0.3s ease;
}

.ws-seg.active .wseg-mark {
    opacity: 1;
    background: var(--text);
    border-color: var(--text);
}

/* خط فعال که زیر سگمنت جابه‌جا می‌شود */
.ws-marker {
    position: absolute;
    bottom: -1px;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--text);
    opacity: 0.7;
    pointer-events: none;
    transition: transform 0.5s cubic-bezier(0.4, 0, 0.2, 1),
                width 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ============================================================
   STAGE
   ============================================================ */
.ws-stage {
    position: relative;
    display: grid;
    /* ستون تصویر دقیقاً یک‌سوم برد است تا با لبه‌ی گزینه‌ی سوم هم‌تراز شود */
    grid-template-columns: minmax(0, 2fr) minmax(0, 1fr);
    align-items: stretch;
}

/* خط پایین برد تا لبه‌های صفحه */
.ws-stage::after {
    content: '';
    position: absolute;
    left: calc(-1 * var(--line-ext));
    right: calc(-1 * var(--line-ext));
    bottom: -1px;
    height: 1px;
    background: var(--ws-line);
    pointer-events: none;
    z-index: 3;
}

.ws-stage-main {
    --ws-pad-x: 40px;
    display: flex;
    flex-direction: column;
    min-width: 0;
    /* پدینگ پایین صفر شد تا جدول ویژگی‌ها تا کف برد بیاید و با پنل شطرنجی هم‌تراز شود */
    padding: 36px var(--ws-pad-x) 0;
    border-right: 1px solid var(--ws-line);
}

.ws-eyebrow {
    display: flex;
    align-items: center;
    gap: 12px;
    font-family: 'Vazirmatn', 'Inter', sans-serif;
    font-size: 0.62rem;
    font-weight: 500;
    letter-spacing: 0.2em;
    color: var(--ws-ink);
    margin-bottom: 18px;
}

.ws-eb-num {
    color: var(--text);
    opacity: 0.65;
}

.ws-eb-rule {
    width: 34px;
    height: 1px;
    background: var(--ws-line);
}

.ws-title {
    font-size: clamp(1.7rem, 2.6vw, 2.15rem);
    font-weight: 800;
    letter-spacing: -1.1px;
    line-height: 1.12;
    color: var(--text);
    margin: 0 0 18px;
}

.ws-title-hl {
    background-image: linear-gradient(100deg, var(--hl-1, var(--accent)), var(--hl-2, #2d9fff));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.ws-text {
    font-size: 0.92rem;
    line-height: 1.9;
    color: var(--text-muted);
    max-width: 660px;
    margin: 0 0 30px;
}

/* مزیت‌ها در قالب جدول خط‌کشی */
.ws-feats {
    position: relative;
    list-style: none;
    /* جدول تا کف ستون می‌چسبد (هم‌تراز با پنل شطرنجی) */
    margin: auto 0 0;
    padding: 0;
    display: grid;
    grid-template-columns: 1fr 1fr;
    border-top: 1px solid var(--ws-line);
    border-left: 1px solid var(--ws-line);
}

/* خطوط افقی جدول تا لبه‌های ستون متن (لبه‌ی برد و خط جداکننده) */
.ws-feats::before {
    content: '';
    position: absolute;
    top: -1px;
    left: calc(-1 * var(--ws-pad-x, 40px));
    right: calc(-1 * var(--ws-pad-x, 40px));
    height: 1px;
    background: var(--ws-line);
    pointer-events: none;
}

.ws-feats li {
    position: relative;
    display: flex;
    align-items: center;
    gap: 11px;
    padding: 13px 16px;
    border-right: 1px solid var(--ws-line);
    border-bottom: 1px solid var(--ws-line);
    font-size: 0.8rem;
    line-height: 1.4;
    color: var(--text-muted);
    transition: background 0.3s ease, color 0.3s ease;
}

.ws-feats li:nth-child(odd)::after,
.ws-feats li:nth-child(even)::after {
    content: '';
    position: absolute;
    bottom: -1px;
    width: var(--ws-pad-x, 40px);
    height: 1px;
    background: var(--ws-line);
    pointer-events: none;
}

.ws-feats li:nth-child(odd)::after { left: calc(-1 * var(--ws-pad-x, 40px)); }
.ws-feats li:nth-child(even)::after { right: calc(-1 * var(--ws-pad-x, 40px)); }

.ws-feats li:hover {
    background: rgba(255, 255, 255, 0.016);
    color: var(--text);
}

[data-theme="light"] .ws-feats li:hover {
    background: rgba(0, 0, 0, 0.018);
}

.ws-feat-diamond {
    flex: 0 0 auto;
    width: 5px;
    height: 5px;
    border: 1px solid var(--ws-ink);
    transform: rotate(45deg);
    opacity: 0.7;
}

/* ============================================================
   VISUAL PLATE
   ============================================================ */
.ws-visual {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 340px;
    padding: 34px 26px;
    overflow: hidden;
    background-image:
        linear-gradient(var(--ws-line) 1px, transparent 1px),
        linear-gradient(90deg, var(--ws-line) 1px, transparent 1px);
    background-size: 28px 28px;
}

.ws-visual-cross {
    position: absolute;
    inset: 0;
    pointer-events: none;
    opacity: 0.7;
}

.ws-visual-cross::before,
.ws-visual-cross::after {
    content: '';
    position: absolute;
    background: var(--ws-line);
}

.ws-visual-cross::before {
    left: 0;
    right: 0;
    top: 50%;
    height: 1px;
}

.ws-visual-cross::after {
    top: 0;
    bottom: 0;
    left: 50%;
    width: 1px;
}

.ws-visual img {
    position: relative;
    z-index: 1;
    display: block;
    width: 100%;
    max-height: 260px;
    object-fit: contain;
}

.ws-visual-tag {
    position: absolute;
    left: 14px;
    bottom: 12px;
    z-index: 2;
    font-family: 'Vazirmatn', 'Inter', sans-serif;
    font-size: 0.56rem;
    font-weight: 500;
    letter-spacing: 0.16em;
    color: var(--ws-ink);
    opacity: 0.45;
}

/* ============================================================
   ENTRANCE ANIMATION
   ============================================================ */
@keyframes wsIn {
    from { opacity: 0; transform: translateY(10px); }
    to   { opacity: 1; transform: translateY(0); }
}

@keyframes wsPlate {
    from { opacity: 0; transform: scale(0.985); }
    to   { opacity: 1; transform: scale(1); }
}

.ws-stage.is-in .ws-eyebrow { animation: wsIn 0.4s both; }
.ws-stage.is-in .ws-title   { animation: wsIn 0.45s 0.05s both; }
.ws-stage.is-in .ws-text    { animation: wsIn 0.45s 0.1s both; }

.ws-stage.is-in .ws-feats li { animation: wsIn 0.4s both; }
.ws-stage.is-in .ws-feats li:nth-child(1) { animation-delay: 0.14s; }
.ws-stage.is-in .ws-feats li:nth-child(2) { animation-delay: 0.19s; }
.ws-stage.is-in .ws-feats li:nth-child(3) { animation-delay: 0.24s; }
.ws-stage.is-in .ws-feats li:nth-child(4) { animation-delay: 0.29s; }

.ws-stage.is-in .ws-visual { animation: wsPlate 0.55s both; }

@media (prefers-reduced-motion: reduce) {
    .ws-stage.is-in .ws-eyebrow,
    .ws-stage.is-in .ws-title,
    .ws-stage.is-in .ws-text,
    .ws-stage.is-in .ws-feats li,
    .ws-stage.is-in .ws-visual {
        animation: none;
    }

    .ws-marker { transition: none; }
}

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 1000px) {
    .ws-stage {
        grid-template-columns: minmax(0, 1fr);
    }

    .ws-stage-main {
        --ws-pad-x: 28px;
        border-right: 0;
        border-bottom: 1px solid var(--ws-line);
        padding: 30px var(--ws-pad-x) 0;
    }

    .ws-visual {
        min-height: 250px;
    }

    .ws-visual img {
        max-height: 200px;
    }
}

@media (max-width: 760px) {
    .ws-index {
        grid-template-columns: 1fr;
    }

    .ws-seg {
        min-height: 0;
        padding: 16px 20px 16px 22px;
        border-right: 0;
        border-bottom: 1px solid var(--ws-line);
    }

    .ws-seg:last-of-type {
        border-bottom: 0;
    }

    .ws-seg.active::before {
        content: '';
        position: absolute;
        left: 0;
        top: 0;
        bottom: 0;
        width: 2px;
        background: var(--text);
        opacity: 0.55;
    }

    .ws-marker {
        display: none;
    }

    .wseg-mark {
        top: 50%;
        margin-top: -3.5px;
    }
}

@media (max-width: 600px) {
    .web-services-section { padding: 40px 0; }

    #web-services .ws-header {
        margin-bottom: 24px !important;
        padding: 18px 16px !important;
    }

    #web-services .ws-header::before {
        left: -1200px !important;
        right: -1200px !important;
    }

    #web-services .ws-header h2 { font-size: 1.4rem !important; }
    #web-services .ws-header p { font-size: 0.8rem !important; }

    .ws-seg { padding: 14px 18px 14px 18px; }
    .wseg-title { font-size: 0.88rem; }
    .wseg-num { font-size: 0.72rem; }

    .ws-stage-main { --ws-pad-x: 18px; padding: 24px var(--ws-pad-x) 0; }
    .ws-title { font-size: 1.35rem; letter-spacing: -0.6px; }
    .ws-text { font-size: 0.84rem; line-height: 1.8; margin-bottom: 22px; }

    .ws-feats { grid-template-columns: 1fr; }
    .ws-feats li { padding: 11px 14px; font-size: 0.76rem; }

    .ws-visual { min-height: 200px; padding: 24px 18px; }
    .ws-visual img { max-height: 160px; }
}
