/* ==========================================================================
   CASE SINGLE — Visual Enhancement
   Улучшенная типографика и визуальный стиль текстовых блоков
   ========================================================================== */

/* ── Общий контейнер ── */
.case-content {
    counter-reset: case-section;
}

/* ── Секции: отступы и разделители ── */
.case-content .case-section {
    position: relative;
    padding-bottom: 48px;
    margin-bottom: 48px;
}
.case-content .case-section::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--color-gray-200) 20%, var(--color-gray-200) 80%, transparent);
}

/* ── Заголовки секций с акцентной полосой ── */
.case-content .case-section__title {
    position: relative;
    padding-left: 20px;
    margin-bottom: 32px;
    counter-increment: case-section;
}
.case-content .case-section__title::before {
    content: '';
    position: absolute;
    left: 0;
    top: 4px;
    bottom: 4px;
    width: 4px;
    border-radius: 4px;
    background: linear-gradient(180deg, var(--color-primary) 0%, #10b981 100%);
}

/* ── О клиенте: первый абзац ── */
.case-section__text p:first-child {
    font-size: var(--font-size-lg);
    line-height: 1.7;
    color: var(--color-text);
}
.case-section__text p:first-child::first-letter {
    float: left;
    font-family: var(--font-family-heading);
    font-weight: var(--font-weight-bold);
    font-size: 3.2em;
    line-height: 0.85;
    margin-right: 8px;
    margin-top: 4px;
    color: var(--color-primary);
}

/* ── Списки: Задача — нумерованные карточки ── */
.case-section__list ul {
    list-style: none;
    padding-left: 0;
    display: flex;
    flex-direction: column;
    gap: 12px;
    counter-reset: task-item;
}
.case-section__list li {
    counter-increment: task-item;
    position: relative;
    padding: 16px 20px 16px 60px;
    background: var(--color-gray-50);
    border-radius: var(--radius-xl);
    border: 1px solid var(--color-gray-100);
    line-height: 1.5;
    transition: border-color var(--transition-normal), box-shadow var(--transition-normal);
    list-style: none;
}
.case-section__list li:hover {
    border-color: rgba(5, 150, 105, 0.2);
    box-shadow: 0 2px 8px rgba(5, 150, 105, 0.06);
}
.case-section__list li::before {
    content: counter(task-item);
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--color-primary) 0%, #10b981 100%);
    color: #fff;
    font-family: var(--font-family-primary);
    font-weight: var(--font-weight-bold);
    font-size: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
    flex-shrink: 0;
}

/* ── Список: Что сделали — зелёные чекмарки ── */
.case-section__list--check ul {
    list-style: none;
    padding-left: 0;
    display: flex;
    flex-direction: column;
    gap: 10px;
    counter-reset: none;
}
.case-section__list--check li {
    position: relative;
    padding: 14px 20px 14px 56px;
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.04) 0%, rgba(16, 185, 129, 0.01) 100%);
    border-radius: var(--radius-xl);
    border: 1px solid rgba(16, 185, 129, 0.12);
    line-height: 1.5;
    transition: border-color var(--transition-normal), box-shadow var(--transition-normal), background var(--transition-normal);
}
.case-section__list--check li:hover {
    border-color: rgba(16, 185, 129, 0.25);
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.06) 0%, rgba(16, 185, 129, 0.02) 100%);
    box-shadow: 0 2px 8px rgba(16, 185, 129, 0.08);
}
.case-section__list--check li::before {
    content: '';
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: linear-gradient(135deg, #10B981 0%, #34D399 100%);
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='20 6 9 17 4 12'/%3E%3C/svg%3E");
    background-size: 16px 16px;
    background-repeat: no-repeat;
    background-position: center;
}

/* ── Текстовые блоки ── */
.case-text__paragraph {
    font-size: var(--font-size-lg);
    line-height: 1.75;
    color: var(--color-text);
}
.case-text__paragraph p {
    margin-bottom: 1.2em;
}
.case-text__paragraph p:last-child {
    margin-bottom: 0;
}
.case-text__paragraph strong {
    color: var(--color-gray-900);
    font-weight: var(--font-weight-semibold);
}
.case-text__paragraph ul {
    padding-left: 0;
    list-style: none;
    margin: 20px 0;
}
.case-text__paragraph ul li {
    position: relative;
    padding-left: 24px;
    margin-bottom: 10px;
    line-height: 1.6;
}
.case-text__paragraph ul li::before {
    content: '';
    position: absolute;
    left: 0;
    top: 10px;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--color-primary);
    opacity: 0.6;
}

/* ── Highlight блок — стеклянный эффект ── */
.case-text__highlight {
    position: relative;
    gap: 16px;
    padding: 20px 24px;
    background: linear-gradient(135deg, rgba(5, 150, 105, 0.06) 0%, rgba(5, 150, 105, 0.02) 100%);
    border: 1px solid rgba(5, 150, 105, 0.12);
    border-radius: var(--radius-2xl);
    margin-bottom: 32px;
    backdrop-filter: blur(8px);
    transition: border-color var(--transition-slow), box-shadow var(--transition-slow);
}
.case-text__highlight:hover {
    border-color: rgba(5, 150, 105, 0.2);
    box-shadow: 0 4px 20px rgba(5, 150, 105, 0.08);
}
.case-text__highlight-icon {
    width: 48px;
    height: 48px;
    background: linear-gradient(135deg, var(--color-primary) 0%, #10b981 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    box-shadow: 0 4px 12px rgba(5, 150, 105, 0.2);
}
.case-text__highlight-icon .case-text__icon {
    filter: brightness(0) invert(1);
}
.case-text__highlight-text {
    font-size: var(--font-size-base);
    line-height: 1.6;
    color: var(--color-primary-dark);
    font-weight: var(--font-weight-medium);
}

/* ── Результаты — премиальный стиль ── */
.case-results {
    background: linear-gradient(135deg, #F8FAFC 0%, #F1F5F9 100%);
    border: 1px solid var(--color-gray-200);
    border-radius: var(--radius-2xl);
    padding: 48px;
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.04);
    position: relative;
    overflow: hidden;
}
.case-results::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--color-primary) 0%, #34D399 50%, #FBBF24 100%);
}
.case-results__title {
    font-size: var(--font-size-3xl);
    font-weight: var(--font-weight-bold);
    margin-bottom: 36px;
    position: relative;
}
.case-results__list {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
}
.case-results__item {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px 20px;
    background: rgba(255, 255, 255, 0.8);
    border-radius: var(--radius-xl);
    border: 1px solid var(--color-gray-100);
    transition: transform var(--transition-normal), box-shadow var(--transition-normal), border-color var(--transition-normal);
}
.case-results__item:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.06);
    border-color: rgba(5, 150, 105, 0.15);
}
.case-results__icon {
    width: 48px;
    height: 48px;
    background: linear-gradient(135deg, var(--color-primary) 0%, #10b981 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    box-shadow: 0 4px 12px rgba(5, 150, 105, 0.15);
}
.case-results__icon .case-results__check {
    filter: brightness(0) invert(1);
    width: 20px;
    height: 20px;
}
.case-results__text {
    font-size: var(--font-size-sm);
    line-height: 1.4;
    color: var(--color-gray-600);
}
.case-results__text strong {
    font-weight: var(--font-weight-bold);
    font-size: var(--font-size-xl);
    display: block;
    margin-top: 4px;
    color: var(--color-gray-900);
    letter-spacing: -0.01em;
}

/* ── Кнопка «Читать дальше» ── */
.case-content .article-section__more {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    background: var(--color-gray-50);
    border: 1px solid var(--color-gray-200);
    border-radius: var(--radius-full);
    cursor: pointer;
    font-family: var(--font-family-primary);
    font-weight: var(--font-weight-medium);
    font-size: var(--font-size-sm);
    color: var(--color-primary);
    transition: all var(--transition-normal);
    margin-top: 8px;
}
.case-content .article-section__more:hover {
    background: rgba(5, 150, 105, 0.06);
    border-color: rgba(5, 150, 105, 0.2);
}
.case-content .article-section__more[aria-expanded="true"] .article-section__more-icon {
    transform: rotate(180deg);
}
.case-content .article-section__more-icon {
    transition: transform 0.3s ease;
}

/* ── Расширяемый текст ── */
.case-content .article-section__expand {
    max-height: 0;
    overflow: hidden;
    opacity: 0;
    transition: max-height 0.4s ease, opacity 0.3s ease, margin 0.3s ease;
    margin-top: 0;
}
.case-content .article-section__expand.active {
    max-height: 2000px;
    opacity: 1;
    margin-top: 20px;
}
.case-content .article-section__expand p {
    font-size: var(--font-size-lg);
    line-height: 1.75;
    color: var(--color-text);
    margin-bottom: 1.2em;
}

/* ── Графики: карточки ── */
.case-charts__card {
    border: 1px solid var(--color-gray-100);
    border-radius: var(--radius-2xl);
    transition: box-shadow var(--transition-slow), transform var(--transition-slow);
}
.case-charts__card:hover {
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.08);
    transform: translateY(-2px);
}

/* ── Галерея изображений клиента ── */
.case-section__images--four {
    gap: 16px;
    margin-top: 32px;
}
.case-section__image-card {
    background: linear-gradient(180deg, #F8FAFC 0%, #F1F5F9 100%);
    border: 1px solid var(--color-gray-100);
    border-radius: var(--radius-2xl);
    transition: transform var(--transition-normal), box-shadow var(--transition-normal);
    overflow: hidden;
}
.case-section__image-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.08);
}

/* ── Hero секция ── */
.case-hero__subtitle {
    position: relative;
    padding: 0 24px;
}

/* ── Адаптивность ── */
@media (max-width: 1024px) {
    .case-content .case-section__title::before {
        top: 2px;
        bottom: 2px;
    }
    .case-results {
        padding: 32px;
    }
    .case-results__list {
        gap: 16px;
    }
    .case-results__item {
        padding: 14px 16px;
    }
}

@media (max-width: 768px) {
    .case-content .case-section {
        padding-bottom: 32px;
        margin-bottom: 32px;
    }
    .case-content .case-section__title {
        padding-left: 16px;
    }
    .case-section__text p:first-child::first-letter {
        font-size: 2.6em;
    }
    .case-section__list li {
        padding: 12px 16px 12px 52px;
    }
    .case-section__list li::before {
        width: 28px;
        height: 28px;
        font-size: 12px;
        left: 12px;
    }
    .case-section__list--check li {
        padding: 12px 16px 12px 48px;
    }
    .case-section__list--check li::before {
        width: 24px;
        height: 24px;
        left: 12px;
        background-size: 14px 14px;
    }
    .case-text__highlight {
        flex-direction: column;
        padding: 16px 20px;
        border-radius: var(--radius-xl);
    }
    .case-text__highlight-icon {
        width: 40px;
        height: 40px;
    }
    .case-results {
        padding: 24px;
        border-radius: var(--radius-xl);
    }
    .case-results__list {
        grid-template-columns: 1fr;
        gap: 12px;
    }
    .case-results__item {
        padding: 12px 14px;
    }
    .case-results__icon {
        width: 40px;
        height: 40px;
    }
    .case-results__text strong {
        font-size: var(--font-size-lg);
    }
    .case-section__images--four {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 480px) {
    .case-section__text p:first-child::first-letter {
        font-size: 2.2em;
        margin-right: 6px;
    }
    .case-section__list li {
        padding: 10px 14px 10px 46px;
        font-size: var(--font-size-sm);
    }
    .case-section__list--check li {
        padding: 10px 14px 10px 44px;
        font-size: var(--font-size-sm);
    }
}

/* ============================================
   FAQ кейса (single-case.php, мета case_faq)
   ============================================ */
.case-faq {
    padding: 8px 0 24px;
}
.case-faq .wrap1062 {
    max-width: 1062px;
    margin: 0 auto;
    padding: 0 20px;
}
.case-faq__title {
    font-family: var(--font-family-heading);
    font-size: clamp(24px, 3vw, 34px);
    font-weight: 800;
    color: #111827;
    margin: 0 0 20px;
    letter-spacing: -0.01em;
}
.case-faq__list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}
.case-faq__item {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 16px;
    overflow: hidden;
    transition: border-color 0.25s ease, box-shadow 0.25s ease;
}
.case-faq__item[open] {
    border-color: #a7f3d0;
    box-shadow: 0 10px 30px rgba(5, 150, 105, 0.08);
}
.case-faq__q {
    list-style: none;
    cursor: pointer;
    padding: 20px 56px 20px 24px;
    font-size: 17px;
    font-weight: 700;
    color: #111827;
    position: relative;
    line-height: 1.4;
}
.case-faq__q::-webkit-details-marker {
    display: none;
}
.case-faq__q::after {
    content: "";
    position: absolute;
    right: 24px;
    top: 50%;
    width: 12px;
    height: 12px;
    border-right: 2px solid #059669;
    border-bottom: 2px solid #059669;
    transform: translateY(-65%) rotate(45deg);
    transition: transform 0.25s ease;
}
.case-faq__item[open] .case-faq__q::after {
    transform: translateY(-35%) rotate(-135deg);
}
.case-faq__q:hover {
    color: #047857;
}
.case-faq__a {
    padding: 0 24px 22px;
    color: #4b5563;
    font-size: 15.5px;
    line-height: 1.65;
}
.case-faq__a p {
    margin: 0 0 10px;
}
.case-faq__a p:last-child {
    margin-bottom: 0;
}
@media (max-width: 768px) {
    .case-faq__q {
        font-size: 16px;
        padding: 17px 48px 17px 18px;
    }
    .case-faq__a {
        padding: 0 18px 18px;
    }
}

/* ============================================
   Дорожная карта проекта (case_roadmap)
   ============================================ */
.case-roadmap__lead {
    color: #4b5563;
    font-size: 16px;
    margin: 0 0 24px;
}
.case-roadmap {
    list-style: none;
    counter-reset: rm;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 0;
}
.case-roadmap__step {
    counter-increment: rm;
    position: relative;
    display: grid;
    grid-template-columns: 150px 1fr;
    gap: 24px;
    padding: 0 0 28px 0;
}
.case-roadmap__step::before {
    content: counter(rm);
    position: absolute;
    left: 150px;
    top: 2px;
    transform: translateX(-50%);
    width: 34px;
    height: 34px;
    margin-left: -12px;
    background: #059669;
    color: #fff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 15px;
    z-index: 1;
}
.case-roadmap__step:not(:last-child)::after {
    content: "";
    position: absolute;
    left: 138px;
    top: 36px;
    bottom: 0;
    width: 2px;
    background: linear-gradient(#a7f3d0, #d1fae5);
}
.case-roadmap__period {
    text-align: right;
    padding-right: 34px;
    font-weight: 700;
    color: #047857;
    font-size: 14px;
    padding-top: 5px;
}
.case-roadmap__body {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 16px;
    padding: 20px 22px;
}
.case-roadmap__title {
    font-size: 18px;
    font-weight: 700;
    color: #111827;
    margin: 0 0 8px;
}
.case-roadmap__text {
    color: #4b5563;
    font-size: 15px;
    line-height: 1.6;
    margin: 0 0 12px;
}
.case-roadmap__result {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: #ecfdf5;
    color: #047857;
    border-radius: 10px;
    padding: 8px 14px;
    font-size: 14px;
    font-weight: 600;
}
.case-roadmap__result svg {
    flex: none;
    color: #059669;
}
@media (max-width: 700px) {
    .case-roadmap__step {
        grid-template-columns: 1fr;
        gap: 10px;
        padding-left: 46px;
    }
    .case-roadmap__step::before { left: 17px; margin-left: 0; }
    .case-roadmap__step:not(:last-child)::after { left: 16px; top: 36px; }
    .case-roadmap__period { text-align: left; padding-right: 0; padding-top: 0; }
}

/* ============================================
   Витрина KPI «было → стало» (case_kpis)
   ============================================ */
.case-kpis {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 14px;
}
.case-kpis__card {
    background: linear-gradient(160deg, #f0fdf4, #ffffff);
    border: 1px solid #d1fae5;
    border-radius: 16px;
    padding: 20px;
}
.case-kpis__label {
    font-size: 14px;
    color: #6b7280;
    margin-bottom: 12px;
    min-height: 34px;
}
.case-kpis__row {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 8px;
}
.case-kpis__before {
    font-size: 18px;
    color: #9ca3af;
    font-weight: 600;
}
.case-kpis__arrow { color: #059669; flex: none; }
.case-kpis__after {
    font-size: 26px;
    font-weight: 800;
    color: #059669;
    letter-spacing: -0.01em;
    font-variant-numeric: tabular-nums;
}
.case-kpis__meta {
    display: flex;
    align-items: baseline;
    gap: 8px;
    flex-wrap: wrap;
}
.case-kpis__delta {
    background: #059669;
    color: #fff;
    border-radius: 6px;
    padding: 2px 8px;
    font-size: 12.5px;
    font-weight: 700;
}
.case-kpis__unit {
    font-size: 13px;
    color: #6b7280;
}
@media (max-width: 900px) { .case-kpis { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 560px) { .case-kpis { grid-template-columns: 1fr; } }

/* ============================================
   Финальный CTA кейса (case-cta)
   ============================================ */
.case-cta {
    padding: 16px 0 64px;
}
.case-cta .wrap1062 { max-width: 1062px; margin: 0 auto; padding: 0 20px; }
.case-cta__box {
    display: grid;
    grid-template-columns: 1.3fr 1fr;
    gap: 32px;
    align-items: center;
    padding: 44px 48px;
    border-radius: 24px;
    background:
        radial-gradient(600px 300px at 88% -20%, rgba(16,185,129,0.25), transparent 60%),
        linear-gradient(150deg, #0f172a 0%, #0d1f1a 45%, #065f46 100%);
}
.case-cta__title {
    color: #fff;
    font-size: clamp(24px, 3vw, 32px);
    font-weight: 800;
    margin: 0 0 12px;
    letter-spacing: -0.01em;
    line-height: 1.2;
}
.case-cta__text {
    color: rgba(236,253,245,0.82);
    font-size: 16px;
    line-height: 1.6;
    margin: 0 0 16px;
}
.case-cta__list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    gap: 8px;
}
.case-cta__list li {
    color: #d1fae5;
    font-size: 15px;
    padding-left: 26px;
    position: relative;
}
.case-cta__list li::before {
    content: "✓";
    position: absolute;
    left: 0;
    color: #34d399;
    font-weight: 800;
}
.case-cta__actions {
    display: flex;
    flex-direction: column;
    gap: 12px;
    align-items: stretch;
}
.case-cta__actions .btn { justify-content: center; }
.case-cta__note {
    color: rgba(236,253,245,0.6);
    font-size: 13px;
    text-align: center;
}
@media (max-width: 800px) {
    .case-cta__box { grid-template-columns: 1fr; padding: 32px 24px; gap: 24px; }
}
