/* ============================================================================
   CASE STUDIES — Business Automation
   All styles scoped under .custom-case-study
   ============================================================================ */

.custom-case-study,
.custom-case-study *,
.custom-case-study *::before,
.custom-case-study *::after {
    box-sizing: border-box;
}

a.btn_type1 {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    color: #4d61ff;
    font-size: 16px;
    font-weight: 500;
    line-height: normal;
    border-radius: 10px;
    padding: 13px;
    background: #fefeff;
    transition: all .5s;
    max-width: 230px;
    height: 50px;
    position: relative;
    border-top: 1px solid var(--Bestia-stroke-what-our, #e4ecfe);
    border-right: 1px solid var(--Bestia-stroke-what-our, #e4ecfe);
    border-bottom: 2px solid var(--Bestia-stroke-what-our, #e4ecfe);
    border-left: 1px solid var(--Bestia-stroke-what-our, #e4ecfe);
    box-shadow: 0 15px 7px -11px rgba(79, 12, 222, .57);
    margin: 0 auto;
}
a.btn_type1:hover {
    border-top: 1px solid var(--Bestia-stroke-button, #8a97ff);
    border-right: 1px solid var(--Bestia-stroke-button, #8a97ff);
    border-bottom: 2px solid var(--Bestia-stroke-button, #8a97ff);
    border-left: 1px solid var(--Bestia-stroke-button, #8a97ff);
    background: var(--Bestia-blue, #4d61ff);
    color: #fefeff;
    justify-content: center;
    gap: 0;
}
a.btn_type1:hover svg {
    visibility: hidden;
    opacity: 0;
    width: 0;
    transition: all .5s;
}
a.btn_type1 svg {
    width: 30px;
}


a.btn_type2 {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    color: #fefeff;
    font-size: 16px;
    font-weight: 500;
    line-height: normal;
    border-radius: 10px;
    padding: 13px;
    background: #4d61ff;
    transition: all .5s;
    max-width: 230px;
    height: 50px;
    position: relative;
    border-top: 1px solid var(--Bestia-stroke-button, #8a97ff);
    border-right: 1px solid var(--Bestia-stroke-button, #8a97ff);
    border-bottom: 2px solid var(--Bestia-stroke-button, #8a97ff);
    border-left: 1px solid var(--Bestia-stroke-button, #8a97ff);
    box-shadow: 0 15px 7px -11px rgba(79, 12, 222, .57);
    margin: 40px auto 0;
}
a.btn_type2:hover {
    border-top: 1px solid var(--Bestia-stroke-what-our, #e4ecfe);
    border-right: 1px solid var(--Bestia-stroke-what-our, #e4ecfe);
    border-bottom: 2px solid var(--Bestia-stroke-what-our, #e4ecfe);
    border-left: 1px solid var(--Bestia-stroke-what-our, #e4ecfe);
    background: var(--Bestia-blue, #fefeff);
    color: #4d61ff;
    justify-content: center;
    gap: 0;
}
a.btn_type2:hover svg {
    visibility: hidden;
    opacity: 0;
    width: 0;
    transition: all .5s;
}
a.btn_type2 svg {
    width: 30px;
}

body.case_study-template-single-ai-case-study footer .site-info,
body.case_study-template-single-ai-case-study2 footer .site-info {
    padding-top: 345px;
}

.custom-case-study {
    --cs-primary:       #4D61FF;
    --cs-primary-light: #8997FF;
    --cs-primary-dark:  #3B4FEA;
    --cs-dark:          #1A1A40;
    --cs-muted:         #5566AA;
    --cs-border:        #E0E6F5;
    --cs-border-light:  rgba(180, 203, 255, 0.7);
    --cs-bg-light:      #F4F7FE;
    --cs-bg-lighter:    #EEF3FE;
    --cs-bg-soft:       #F4F8FF;
    --cs-white:         #FEFEFF;
    --cs-accent:        #FACC15;

    --cs-radius-sm:  8px;
    --cs-radius-md:  12px;
    --cs-radius-lg:  16px;
    --cs-radius-xl:  20px;
    --cs-radius-2xl: 24px;

    --cs-font: 'Poppins', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;

    font-family: var(--cs-font);
    color: var(--cs-dark);
}

.custom-case-study img {
    max-width: 100%;
    height: auto;
    display: block;
}

.cs-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 24px;
}


/* ============================================================================
   BUTTONS
   ============================================================================ */
.custom-case-study .cs-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 14px;
    padding: 16px 32px;
    border-radius: var(--cs-radius-md);
    font-family: inherit;
    font-size: 13px;
    font-weight: 700;
    line-height: 1;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    text-decoration: none;
    border: none;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s, background 0.2s, color 0.2s;
    white-space: nowrap;
}
.custom-case-study .cs-btn svg {
    flex-shrink: 0;
    transition: transform 0.2s;
}
.custom-case-study .cs-btn:hover svg {
    transform: translateX(3px);
}

.custom-case-study .cs-btn--primary {
    background: var(--cs-primary);
    color: var(--cs-white);
    padding: 18px 36px;
    box-shadow: 0 12px 32px rgba(77, 97, 255, 0.45);
}
.custom-case-study .cs-btn--primary:hover {
    background: var(--cs-primary-dark);
    transform: translateY(-1px);
}

.custom-case-study .cs-btn--light {
    background: var(--cs-white);
    color: var(--cs-primary);
    padding: 18px 36px;
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.18);
}
.custom-case-study .cs-btn--light:hover {
    transform: translateY(-1px);
}

.custom-case-study .cs-btn--outline {
    background: transparent;
    color: var(--cs-primary);
    border: 1.5px solid var(--cs-primary);
    padding: 14px 36px;
}
.custom-case-study .cs-btn--outline:hover {
    background: var(--cs-primary);
    color: var(--cs-white);
}


/* ============================================================================
   HERO
   ============================================================================ */
.custom-case-study.cs-hero {
    position: relative;
    background: linear-gradient(135deg, #4D61FF 0%, #6675FF 55%, #8997FF 100%);
    color: var(--cs-white);
    padding: 180px 24px 120px;
    overflow: hidden;
    text-align: center;
}
.custom-case-study .cs-hero__bg {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    opacity: 0.6;
}
.custom-case-study .cs-hero__lines line {
    stroke: #fff;
    stroke-opacity: 0.1;
    stroke-width: 1;
}
.custom-case-study .cs-hero__dots circle {
    fill: #fff;
    fill-opacity: 0.4;
}
.custom-case-study .cs-hero__inner {
    position: relative;
    max-width: 690px;
}
.custom-case-study .cs-hero__eyebrow {
    display: inline-block;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.9);
    background: rgba(255, 255, 255, 0.14);
    padding: 8px 18px;
    border-radius: 999px;
    border: 1px solid rgba(255, 255, 255, 0.25);
    margin-bottom: 28px;
}
.custom-case-study .cs-hero__title {
    font-size: 56px;
    font-weight: 800;
    line-height: 1.1;
    letter-spacing: -0.02em;
    text-transform: uppercase;
    margin: 0 0 24px;
}
.custom-case-study .cs-hero__lead {
    font-size: 18px;
    font-weight: 400;
    line-height: 1.6;
    opacity: 0.95;
    margin: 0 0 14px;
}
.custom-case-study .cs-hero__lead--bold {
    opacity: 1;
    margin-bottom: 40px;
}


/* ============================================================================
   STATS STRIP
   ============================================================================ */
.custom-case-study.cs-stats {
    background: var(--cs-bg-light);
    padding: 32px 24px;
    border-bottom: 1px solid var(--cs-border);
}
.custom-case-study .cs-stats__grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 24px;
    text-align: center;
}
.custom-case-study .cs-stat__value {
    font-size: 32px;
    font-weight: 800;
    color: var(--cs-primary);
    letter-spacing: -0.02em;
    line-height: 1.1;
}
.custom-case-study .cs-stat__label {
    font-size: 13px;
    font-weight: 500;
    color: var(--cs-muted);
    margin-top: 4px;
}


/* ============================================================================
   SECTION TITLE / SUBTITLE
   ============================================================================ */
.custom-case-study .cs-section-title {
    font-size: 36px;
    font-weight: 700;
    color: var(--cs-dark);
    letter-spacing: -0.02em;
    line-height: 1.2;
    margin: 0;
}
.custom-case-study .cs-section-subtitle {
    font-size: 16px;
    color: var(--cs-muted);
    margin: 12px 0 0;
}


/* ============================================================================
   FEATURED CASE
   ============================================================================ */
.custom-case-study.cs-featured {
    background: linear-gradient(180deg, var(--cs-bg-soft), var(--cs-bg-lighter));
    padding: 80px 24px;
}
.custom-case-study .cs-featured__head {
    text-align: center;
    margin-bottom: 40px;
}
.custom-case-study .cs-featured__eyebrow {
    display: inline-block;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    color: var(--cs-primary);
    background: var(--cs-white);
    padding: 6px 14px;
    border-radius: 999px;
    border: 1px solid #C8CFE7;
    margin-bottom: 16px;
}
.custom-case-study .cs-featured__card {
    background: var(--cs-white);
    border-radius: var(--cs-radius-2xl);
    box-shadow: 0 12px 40px rgba(77, 97, 255, 0.08);
    overflow: hidden;
}
.custom-case-study .cs-featured__banner {
    aspect-ratio: 21 / 7;
    position: relative;
    display: flex;
    align-items: flex-end;
    padding: 32px;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    color: var(--cs-white);
}
.custom-case-study .cs-banner__overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, transparent 50%, rgba(0, 0, 0, 0.4));
}
.custom-case-study .cs-banner__content {
    position: relative;
}
.custom-case-study .cs-banner__tag {
    display: inline-block;
    background: var(--cs-white);
    color: var(--cs-primary);
    padding: 6px 14px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    margin-bottom: 12px;
}
.custom-case-study .cs-banner__title {
    font-size: 32px;
    font-weight: 700;
    line-height: 1.2;
    margin: 0;
}
.custom-case-study .cs-featured__body {
    padding: 40px;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 40px;
    align-items: start;
}


/* ============================================================================
   CONTENT BLOCKS (Use case / Solution / Baseline)
   ============================================================================ */
.custom-case-study .cs-block {
    margin-bottom: 20px;
}
.custom-case-study .cs-block:last-child {
    margin-bottom: 0;
}
.custom-case-study .cs-block__label {
    font-size: 11px;
    font-weight: 700;
    color: var(--cs-primary);
    letter-spacing: 0.1em;
    text-transform: uppercase;
    margin-bottom: 6px;
}
.custom-case-study .cs-block__label--results {
    margin-bottom: 14px;
}
.custom-case-study .cs-block__text {
    font-size: 14px;
    font-weight: 400;
    color: var(--cs-dark);
    line-height: 1.65;
    margin: 0;
}
.custom-case-study .cs-block__quote {
    font-size: 14px;
    font-weight: 400;
    color: var(--cs-dark);
    line-height: 1.6;
    margin: 0;
    padding: 14px 16px;
    background: var(--cs-bg-light);
    border-radius: 10px;
    border-left: 3px solid var(--cs-primary);
}
.custom-case-study .cs-block__quote strong {
    font-weight: 700;
}


/* Meta grid (Tech / Timeline / Integration) */
.custom-case-study .cs-meta-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    padding-top: 20px;
    margin-top: 24px;
    border-top: 1px solid var(--cs-border);
}
.custom-case-study .cs-meta__label {
    font-size: 10px;
    font-weight: 600;
    color: var(--cs-muted);
    letter-spacing: 0.1em;
    text-transform: uppercase;
    margin-bottom: 4px;
}
.custom-case-study .cs-meta__value {
    font-size: 13px;
    font-weight: 500;
    color: var(--cs-dark);
}


/* ============================================================================
   RESULTS GRID
   ============================================================================ */
.custom-case-study .cs-results {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}
.custom-case-study .cs-result {
    background: var(--cs-white);
    padding: 22px;
    border-radius: var(--cs-radius-lg);
    border: 1px solid var(--cs-border);
}
.custom-case-study .cs-result__value {
    font-size: 32px;
    font-weight: 800;
    line-height: 1;
    letter-spacing: -0.02em;
    color: var(--cs-primary);
    margin-bottom: 6px;
}
.custom-case-study .cs-result__label {
    font-size: 12px;
    font-weight: 500;
    color: var(--cs-muted);
    line-height: 1.4;
}
.custom-case-study .cs-result--primary {
    background: linear-gradient(135deg, var(--cs-primary-light), var(--cs-primary));
    border: none;
    color: var(--cs-white);
}
.custom-case-study .cs-result--primary .cs-result__value {
    color: var(--cs-white);
    font-size: 34px;
}
.custom-case-study .cs-result--primary .cs-result__label {
    color: var(--cs-white);
    opacity: 0.9;
}
.custom-case-study .cs-result--roi {
    background: var(--cs-dark);
    border: none;
    grid-column: 1 / -1;
    display: flex;
    align-items: center;
    justify-content: space-between;
    color: var(--cs-white);
}
.custom-case-study .cs-result--roi .cs-result__label {
    color: var(--cs-white);
    opacity: 0.7;
}
.custom-case-study .cs-result__value--accent {
    color: var(--cs-accent) !important;
    font-size: 34px;
}
.custom-case-study .cs-result__icon {
    flex-shrink: 0;
    opacity: 0.3;
}


/* ============================================================================
   FILTERS
   ============================================================================ */
.custom-case-study.cs-filters-section {
    background: var(--cs-white);
    padding: 80px 24px 24px;
}
.custom-case-study .cs-filters-section__head {
    text-align: center;
    margin-bottom: 36px;
}
.custom-case-study .cs-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: center;
}
.custom-case-study .cs-pill {
    padding: 9px 18px;
    border: 1px solid #C8CFE7;
    background: transparent;
    color: var(--cs-dark);
    border-radius: 999px;
    font-family: inherit;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}
.custom-case-study .cs-pill__count {
    font-weight: 500;
    color: var(--cs-muted);
    font-size: 12px;
}
.custom-case-study .cs-pill:hover {
    border-color: var(--cs-primary);
    color: var(--cs-primary);
}
.custom-case-study .cs-pill.is-active {
    background: var(--cs-primary);
    border-color: var(--cs-primary);
    color: var(--cs-white);
}
.custom-case-study .cs-pill.is-active .cs-pill__count {
    color: rgba(255, 255, 255, 0.75);
}


/* ============================================================================
   CARDS GRID
   ============================================================================ */
.custom-case-study.cs-grid-section {
    background: var(--cs-white);
    padding: 24px 24px 64px;
    margin-bottom: 147px;
}
.custom-case-study .cs-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
}
.custom-case-study .cs-card {
    border-radius: var(--cs-radius-xl);
    border: 1px solid var(--cs-border-light);
    background: rgba(255, 255, 255, 0.5);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    cursor: pointer;
    transition: transform 0.25s, box-shadow 0.25s, background 0.25s;
}
.custom-case-study .cs-card.is-hidden {
    display: none;
}
.custom-case-study .cs-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 14px 36px rgba(77, 97, 255, 0.14);
    background: var(--cs-white);
}

/* Hidden store for <template> blocks — захист на випадок якщо браузер не приховує hidden атрибут */
.custom-case-study .cs-detail-store,
.cs-detail-store {
    display: none !important;
}
.custom-case-study .cs-card__img {
    aspect-ratio: 16 / 10;
    position: relative;
    overflow: hidden;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
}
.custom-case-study .cs-card__tag {
    position: absolute;
    top: 14px;
    left: 14px;
    background: rgba(255, 255, 255, 0.95);
    color: var(--cs-primary);
    padding: 5px 12px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}
.custom-case-study .cs-card__num {
    position: absolute;
    top: 14px;
    right: 16px;
    background: rgba(26, 26, 64, 0.6);
    color: rgba(255, 255, 255, 0.9);
    font-size: 12px;
    font-weight: 800;
    letter-spacing: 0.05em;
    padding: 5px 10px;
    border-radius: var(--cs-radius-sm);
}
.custom-case-study .cs-card__body {
    padding: 22px;
    display: flex;
    flex-direction: column;
    flex: 1;
}
.custom-case-study .cs-card__title {
    font-size: 17px;
    font-weight: 700;
    color: var(--cs-dark);
    margin: 0 0 12px;
    line-height: 1.35;
}
.custom-case-study .cs-card__metrics {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 16px;
}
.custom-case-study .cs-metric {
    background: var(--cs-bg-lighter);
    color: var(--cs-primary);
    padding: 6px 11px;
    border-radius: var(--cs-radius-sm);
    font-size: 11px;
    font-weight: 700;
    white-space: nowrap;
}
.custom-case-study .cs-card__foot {
    margin-top: auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding-top: 14px;
    border-top: 1px solid var(--cs-bg-lighter);
}
.custom-case-study .cs-card__meta {
    font-size: 11px;
    font-weight: 500;
    color: var(--cs-muted);
}
.custom-case-study .cs-card__link {
    font-size: 12px;
    font-weight: 600;
    color: var(--cs-primary);
    display: inline-flex;
    align-items: center;
    gap: 4px;
    white-space: nowrap;
}

.custom-case-study .cs-loadmore-wrap {
    text-align: center;
    padding-top: 40px;
}


/* ============================================================================
   CTA + NDA
   ============================================================================ */
.custom-case-study.cs-cta {
    background: var(--cs-dark);
    color: var(--cs-white);
    padding: 64px 24px;
    text-align: center;
}
.custom-case-study .cs-cta__inner {
    max-width: 840px;
}
.cs-nda-badge {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 8px 16px;
    background: rgba(255, 255, 255, 0.8);
    border: 1px solid #C8CFE7;
    border-radius: 999px;
    margin-bottom: 24px;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--cs-accent);
}
.cs-cta__nda {
    font-size: 14px;
    line-height: 1.7;
    opacity: 0.85;
    margin: 0 0 36px;
}
.footer-top .footer-block .footer-content {
    text-align: center;
}

.custom-case-study .cs-cta__title {
    font-size: 32px;
    font-weight: 700;
    letter-spacing: -0.02em;
    line-height: 1.2;
    margin: 0 0 12px;
}
.custom-case-study .cs-cta__subtitle {
    font-size: 16px;
    opacity: 0.8;
    margin: 0 0 32px;
}


/* ============================================================================
   MODAL
   ============================================================================ */
.custom-case-study.cs-modal {
    position: fixed;
    inset: 0;
    z-index: 9999;
    background: rgba(26, 26, 64, 0.78);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    padding: 32px;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    display: none;
}
.custom-case-study.cs-modal.is-open {
    display: block;
}
.custom-case-study .cs-modal__dialog {
    max-width: 1100px;
    margin: 0 auto;
    background: var(--cs-white);
    border-radius: var(--cs-radius-2xl);
    overflow: hidden;
    box-shadow: 0 32px 80px rgba(0, 0, 0, 0.4);
    position: relative;
}
.custom-case-study .cs-modal__close {
    position: absolute;
    top: 20px;
    right: 20px;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.95);
    color: var(--cs-dark);
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    transition: transform 0.2s, background 0.2s;
}
.custom-case-study .cs-modal__close:hover {
    transform: rotate(90deg);
    background: var(--cs-white);
}

/* Modal banner (same as featured banner) */
.custom-case-study .cs-modal__banner {
    aspect-ratio: 21 / 7;
    position: relative;
    display: flex;
    align-items: flex-end;
    padding: 28px 32px;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    color: var(--cs-white);
}
.custom-case-study .cs-modal__banner-tag {
    position: absolute;
    top: 24px;
    left: 32px;
    background: rgba(255, 255, 255, 0.95);
    color: var(--cs-primary);
    padding: 6px 14px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}
.custom-case-study .cs-modal__banner-title {
    position: relative;
    font-size: 26px;
    font-weight: 700;
    color: var(--cs-white);
    margin: 0;
    line-height: 1.25;
}
.custom-case-study .cs-modal__content {
    padding: 32px 40px 40px;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 40px;
    align-items: start;
}
.custom-case-study .cs-modal__size {
    font-size: 13px;
    font-weight: 500;
    color: var(--cs-muted);
    margin-bottom: 24px;
}
.custom-case-study .cs-modal__discuss {
    margin-top: 24px;
    width: 100%;
    padding: 14px 28px;
    font-size: 12px;
}

/* prevent body scroll when modal open */
body.cs-modal-open {
    overflow: hidden;
}


/* ============================================================================
   CASE BANNER IMAGES — fallback color коли немає featured image
   Картинки тепер беруться з get_the_post_thumbnail_url у PHP
   та вставляються як inline background-image.
   Тут лише фолбек-кольори і базові стилі для card image / banner.
   ============================================================================ */
.custom-case-study .cs-card__img,
.custom-case-study .cs-featured__banner,
.custom-case-study .cs-modal__banner {
    background-color: #4D61FF;
    background-image: linear-gradient(135deg, #6675FF, #4D61FF);
}

/* Empty state */
.custom-case-study .cs-empty {
    text-align: center;
    font-size: 16px;
    color: var(--cs-muted);
    padding: 60px 20px;
    margin: 0;
}


/* ============================================================================
   SINGLE CASE STUDY — спеціальні правила для single-case_study.php
   ============================================================================ */

/* ---------- HERO BANNER ---------- */
.custom-case-study.cs-single-hero {
    padding: 0;
}
.custom-case-study .cs-single-hero__banner {
    position: relative;
    min-height: 480px;
    display: flex;
    align-items: flex-end;
    background-color: #4D61FF;
    background-image: linear-gradient(135deg, #6675FF, #4D61FF);
    background-size: cover;
    background-position: center;
    padding: 120px 0 56px;
}
.custom-case-study .cs-single-hero__banner .cs-banner__overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, rgba(26, 26, 64, 0.25) 0%, rgba(26, 26, 64, 0.78) 100%);
}
.custom-case-study .cs-single-hero__inner {
    position: relative;
    color: var(--cs-white);
}
.custom-case-study .cs-single-hero__back {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    font-weight: 600;
    letter-spacing: 0.02em;
    color: rgba(255, 255, 255, 0.85);
    text-decoration: none;
    margin-bottom: 28px;
    transition: gap 0.2s, color 0.2s;
}
.custom-case-study .cs-single-hero__back:hover {
    color: var(--cs-white);
    gap: 12px;
}
.custom-case-study .cs-single-hero__back svg {
    flex-shrink: 0;
    transition: transform 0.2s;
}
.custom-case-study .cs-single-hero__back:hover svg {
    transform: translateX(-3px);
}
.custom-case-study .cs-single-hero__tag {
    display: inline-block;
    background: var(--cs-white);
    color: var(--cs-primary);
    padding: 6px 14px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    margin-bottom: 16px;
}
.custom-case-study .cs-single-hero__title {
    font-size: 44px;
    font-weight: 800;
    color: var(--cs-white);
    line-height: 1.15;
    letter-spacing: -0.02em;
    margin: 0 0 16px;
    max-width: 920px;
}
.custom-case-study .cs-single-hero__meta {
    font-size: 14px;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.85);
}

/* ---------- BODY ---------- */
.custom-case-study.cs-single-body {
    background: linear-gradient(180deg, var(--cs-bg-soft), var(--cs-bg-lighter));
    padding: 64px 0 80px;
}
.custom-case-study .cs-single-body__grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 380px;
    gap: 48px;
    align-items: start;
}
.custom-case-study .cs-single-body__col--results {
    position: sticky;
    top: 24px;
}

/* Results card (right side, sticky) */
.custom-case-study .cs-results-card {
    background: var(--cs-white);
    border-radius: var(--cs-radius-2xl);
    padding: 32px;
    box-shadow: 0 12px 40px rgba(77, 97, 255, 0.08);
}
.custom-case-study .cs-results-card .cs-results {
    margin-top: 16px;
}
.custom-case-study .cs-results-card__cta {
    margin-top: 24px;
    width: 100%;
    padding: 14px 20px;
    font-size: 12px;
}

/* Inline image inside content blocks */
.custom-case-study .cs-block--image {
    margin: 24px 0;
}
.custom-case-study .cs-block--image img {
    width: 100%;
    height: auto;
    border-radius: var(--cs-radius-lg);
    display: block;
}

/* Optional rich content from the_content() */
.custom-case-study .cs-block--content {
    margin-bottom: 24px;
}
.custom-case-study .cs-block--content p {
    font-size: 15px;
    line-height: 1.7;
    color: var(--cs-dark);
    margin: 0 0 14px;
}
.custom-case-study .cs-block--content p:last-child {
    margin-bottom: 0;
}
.custom-case-study .cs-block--content ul,
.custom-case-study .cs-block--content ol {
    font-size: 15px;
    line-height: 1.7;
    color: var(--cs-dark);
    padding-left: 22px;
    margin: 0 0 14px;
}
.custom-case-study .cs-block--content h2 {
    font-size: 22px;
    font-weight: 700;
    color: var(--cs-dark);
    margin: 24px 0 12px;
}
.custom-case-study .cs-block--content h3 {
    font-size: 18px;
    font-weight: 700;
    color: var(--cs-dark);
    margin: 20px 0 10px;
}
.custom-case-study .cs-block--content a {
    color: var(--cs-primary);
}
.custom-case-study .cs-block--content img {
    border-radius: var(--cs-radius-md);
    margin: 16px 0;
    max-width: 100%;
    height: auto;
}

/* ---------- RELATED ---------- */
.custom-case-study.cs-related {
    background: var(--cs-white);
    padding: 80px 24px 64px;
}
.custom-case-study .cs-related__head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 32px;
    flex-wrap: wrap;
}
.custom-case-study .cs-related__all {
    font-size: 14px;
    font-weight: 600;
    color: var(--cs-primary);
    text-decoration: none;
    transition: color 0.2s;
}
.custom-case-study .cs-related__all:hover {
    color: var(--cs-primary-dark);
}
.custom-case-study .cs-grid--related {
    grid-template-columns: repeat(3, 1fr);
}
/* When .cs-card is an <a> (related uses link, not div) — reset styles */
.custom-case-study a.cs-card {
    text-decoration: none;
    color: inherit;
}
.custom-case-study a.cs-card:hover {
    text-decoration: none;
}


/* ============================================================================
   ADAPTIVE / RESPONSIVE
   ============================================================================ */

/* ---------- ≤1200px (large tablet / small desktop) ---------- */
@media (max-width: 1200px) {
    .custom-case-study .cs-hero__title { font-size: 48px; }
    .custom-case-study .cs-section-title { font-size: 32px; }
    .custom-case-study .cs-banner__title { font-size: 26px; }
}

/* ---------- ≤1024px (tablet) ---------- */
@media (max-width: 1024px) {
    .custom-case-study.cs-hero { padding: 90px 20px 70px; }
    .custom-case-study .cs-hero__title { font-size: 42px; }
    .custom-case-study .cs-hero__lead { font-size: 16px; }

    .custom-case-study.cs-featured,
    .custom-case-study.cs-filters-section { padding: 60px 20px; }
    .custom-case-study.cs-filters-section { padding-bottom: 24px; }
    .custom-case-study.cs-grid-section { padding: 24px 20px 56px; }

    .custom-case-study .cs-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 20px;
    }
    .custom-case-study .cs-featured__body { padding: 32px; gap: 32px; }
    .custom-case-study .cs-modal__content { padding: 24px 32px 32px; gap: 32px; }

    /* Single page */
    .custom-case-study .cs-single-hero__banner { min-height: 380px; padding: 100px 0 48px; }
    .custom-case-study .cs-single-hero__title { font-size: 36px; }
    .custom-case-study .cs-single-body__grid {
        grid-template-columns: minmax(0, 1fr) 320px;
        gap: 32px;
    }
    .custom-case-study .cs-results-card { padding: 24px; }
    .custom-case-study.cs-related { padding: 60px 20px 48px; }
}

/* ---------- ≤880px (small tablet — featured/modal/single stack) ---------- */
@media (max-width: 880px) {
    .custom-case-study .cs-featured__body,
    .custom-case-study .cs-modal__content {
        grid-template-columns: 1fr;
        gap: 28px;
    }
    .custom-case-study .cs-featured__banner,
    .custom-case-study .cs-modal__banner {
        aspect-ratio: 16 / 7;
        padding: 24px;
    }
    .custom-case-study .cs-banner__title,
    .custom-case-study .cs-modal__banner-title { font-size: 22px; }
    .custom-case-study .cs-stats__grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 24px 16px;
    }

    /* Single — стек, без sticky */
    .custom-case-study .cs-single-body__grid {
        grid-template-columns: 1fr;
        gap: 32px;
    }
    .custom-case-study .cs-single-body__col--results {
        position: static;
    }
    .custom-case-study .cs-grid--related {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* ---------- ≤640px (mobile) ---------- */
@media (max-width: 640px) {
    .cs-container { padding: 0 16px; }

    /* Hero */
    .custom-case-study.cs-hero { padding: 120px 16px 56px; }
    .custom-case-study .cs-hero__title { font-size: 32px; }
    .custom-case-study .cs-hero__lead { font-size: 15px; }
    .custom-case-study .cs-hero__lead--bold { margin-bottom: 28px; }
    .custom-case-study .cs-hero__eyebrow { margin-bottom: 20px; font-size: 11px; padding: 6px 14px; }
    .custom-case-study .cs-btn { padding: 14px 24px; font-size: 12px; gap: 10px; }
    .custom-case-study .cs-btn--primary,
    .custom-case-study .cs-btn--light { padding: 16px 28px; }

    /* Stats */
    .custom-case-study.cs-stats { padding: 24px 16px; }
    .custom-case-study .cs-stat__value { font-size: 26px; }
    .custom-case-study .cs-stat__label { font-size: 12px; }

    /* Sections */
    .custom-case-study.cs-featured,
    .custom-case-study.cs-filters-section { padding: 48px 16px; }
    .custom-case-study.cs-filters-section { padding-bottom: 20px; }
    .custom-case-study.cs-grid-section { padding: 20px 16px 48px; }
    .custom-case-study.cs-cta { padding: 48px 16px; }

    .custom-case-study .cs-section-title { font-size: 24px; }
    .custom-case-study .cs-section-subtitle { font-size: 14px; }

    /* Featured / Modal banner */
    .custom-case-study .cs-featured__head { margin-bottom: 28px; }
    .custom-case-study .cs-featured__banner,
    .custom-case-study .cs-modal__banner {
        aspect-ratio: 16 / 9;
        padding: 18px;
    }
    .custom-case-study .cs-banner__tag,
    .custom-case-study .cs-modal__banner-tag {
        font-size: 10px;
        padding: 5px 10px;
    }
    .custom-case-study .cs-modal__banner-tag {
        top: 16px;
        left: 16px;
    }
    .custom-case-study .cs-banner__title,
    .custom-case-study .cs-modal__banner-title { font-size: 18px; }
    .custom-case-study .cs-featured__body,
    .custom-case-study .cs-modal__content { padding: 24px 20px; gap: 24px; }

    /* Results */
    .custom-case-study .cs-results { gap: 10px; }
    .custom-case-study .cs-result { padding: 16px; }
    .custom-case-study .cs-result__value { font-size: 26px; }
    .custom-case-study .cs-result--primary .cs-result__value,
    .custom-case-study .cs-result__value--accent { font-size: 28px; }
    .custom-case-study .cs-result__label { font-size: 11px; }
    .custom-case-study .cs-result__icon { width: 36px; height: 36px; }

    /* Meta */
    .custom-case-study .cs-meta-grid { gap: 14px; padding-top: 16px; margin-top: 18px; }

    /* Filters */
    .custom-case-study .cs-filters {
        flex-wrap: nowrap;
        overflow-x: auto;
        justify-content: flex-start;
        margin: 0 -16px;
        padding: 4px 16px 12px;
        scrollbar-width: none;
        -ms-overflow-style: none;
    }
    .custom-case-study .cs-filters::-webkit-scrollbar { display: none; }
    .custom-case-study .cs-pill {
        flex-shrink: 0;
        padding: 8px 14px;
        font-size: 12px;
    }

    /* Grid */
    .custom-case-study .cs-grid {
        grid-template-columns: 1fr;
        gap: 16px;
    }
    .custom-case-study .cs-grid--related {
        grid-template-columns: 1fr;
    }
    .custom-case-study .cs-card__body { padding: 18px; }
    .custom-case-study .cs-card__title { font-size: 16px; }
    .custom-case-study .cs-loadmore-wrap { padding-top: 28px; }

    /* Single */
    .custom-case-study.cs-breadcrumbs { padding: 20px 16px 0; }
    .custom-case-study.cs-single-banner-section { padding: 24px 16px 48px; }
    .custom-case-study.cs-related { padding: 48px 16px; }
    .custom-case-study .cs-single-title { font-size: 22px; }
    .custom-case-study .cs-block--content p,
    .custom-case-study .cs-block--content ul,
    .custom-case-study .cs-block--content ol { font-size: 14px; }

    /* CTA */
    .custom-case-study .cs-cta__title { font-size: 24px; }
    .custom-case-study .cs-cta__subtitle { font-size: 14px; }
    .custom-case-study .cs-cta__nda { font-size: 13px; margin-bottom: 28px; }

    /* Modal */
    .custom-case-study.cs-modal { padding: 0; }
    .custom-case-study .cs-modal__dialog { border-radius: 0; min-height: 100vh; }
    .custom-case-study .cs-modal__close {
        top: 12px;
        right: 12px;
        width: 36px;
        height: 36px;
    }
    .custom-case-study .cs-modal__discuss {
        font-size: 11px;
        padding: 12px 20px;
    }

    /* Single */
    .custom-case-study .cs-single-hero__banner {
        min-height: 320px;
        padding: 80px 0 36px;
    }
    .custom-case-study .cs-single-hero__back { margin-bottom: 20px; font-size: 12px; }
    .custom-case-study .cs-single-hero__title { font-size: 26px; }
    .custom-case-study .cs-single-hero__tag { font-size: 10px; padding: 5px 10px; }
    .custom-case-study .cs-single-hero__meta { font-size: 13px; }
    .custom-case-study.cs-single-body { padding: 40px 0 56px; }
    .custom-case-study .cs-results-card { padding: 20px; border-radius: var(--cs-radius-xl); }
    .custom-case-study.cs-related { padding: 48px 16px; }
    .custom-case-study .cs-related__head {
        margin-bottom: 24px;
        text-align: center;
        justify-content: center;
    }
    .custom-case-study .cs-grid--related {
        grid-template-columns: 1fr;
        gap: 16px;
    }

    body.case_study-template-single-ai-case-study footer .site-info,
    body.case_study-template-single-ai-case-study2 footer .site-info {
        padding-top: 500px;
    }
}

/* ---------- ≤380px (very small) ---------- */
@media (max-width: 380px) {
    .custom-case-study .cs-hero__title { font-size: 28px; }
    .custom-case-study .cs-stats__grid { grid-template-columns: 1fr 1fr; gap: 16px; }
    .custom-case-study .cs-single-hero__title { font-size: 22px; }
}
