/* Case study detail — Figma 821:45135 */

/* No underlines under section headings */
.page--single-case-study .case-detail-header,
.page--single-case-study .case-detail-header--on-dark,
.page--single-case-study .case-detail-header--primary-border,
.page--single-case-study .case-detail-header--impact,
.page--single-case-study .case-detail-header--borderless {
    border-bottom: none;
    padding-bottom: 0;
}

.page--single-case-study .case-result-item h3 {
    border-bottom: none;
    padding-bottom: 0;
    margin-bottom: 8px;
}

/* Main content block: Executive Summary → Business Problem */
.case-study-detail__body {
    display: flex;
    flex-direction: column;
    gap: 40px;
    padding: 60px 0 0;
}

.case-study-detail__body > .case-detail-section {
    padding: 0;
    background: transparent;
}

.case-detail-section.business-problem-section {
    padding-bottom: 40px;
}

.case-study-detail__body .case-detail-group,
.case-study-detail__body--lower .case-detail-group {
    gap: 14px;
}

.case-study-detail__body .case-detail-header h2 {
    margin: 0;
    font-family: "Open Sans", sans-serif;
    font-weight: 700;
    font-size: 24px;
    line-height: 1.48;
    color: #150f2d;
}

.case-study-detail__body .case-detail-header p {
    margin: 8px 0 0;
    font-size: 14px;
    line-height: 1.48;
    color: #544f69;
}

.case-study-detail__body .case-detail-text,
.case-study-detail__body .case-detail-text--small {
    font-size: 14px;
    line-height: 1.48;
    color: #544f69;
}

.case-study-detail__body .case-context-cards {
    gap: 14px;
}

.case-study-detail__body .case-context-card {
    min-height: 142px;
    padding: 16px 14px;
    gap: 30px;
}

.case-study-detail__body .case-context-card p {
    font-family: "Manrope", sans-serif;
    font-size: 14px;
    font-weight: 600;
    line-height: 1.4;
}

.case-study-detail__body .case-problem-columns {
    gap: 14px;
}

/* Solution overview — full-width light band */
.case-solution-overview-band {
    width: 100%;
    padding: 30px 0 40px;
    background: #e6f5fa;
}

.case-solution-overview-band .case-detail-group {
    gap: 24px;
}

.case-solution-overview-band .case-detail-header h2 {
    margin: 0;
    font-family: "Open Sans", sans-serif;
    font-weight: 700;
    font-size: 24px;
    line-height: 1.48;
    color: #150f2d;
}

.case-solution-overview-band .case-solution-rows {
    gap: 24px;
}

.case-solution-overview-band .case-solution-block--row ul {
    margin: 0;
    padding-left: 21px;
    list-style: disc;
    color: #544f69;
    font-size: 14px;
    line-height: 1.48;
}

/* Architecture Overview — between Solution Overview and Execution Flow */
.case-detail-section--architecture {
    padding: 60px 0 40px;
    background: #fff;
}

.case-detail-section--architecture .case-detail-group {
    gap: 24px;
}

.case-architecture-overview-stack {
    width: 100%;
}

/* One diagram — full width */
.case-architecture-overview-stack--single {
    display: flex;
    flex-direction: column;
}

.case-architecture-overview-stack--single .case-architecture-image--overview {
    width: 100%;
    max-width: 1200px;
    margin-left: auto;
    margin-right: auto;
}

/* Two or more diagrams — two columns */
.case-architecture-overview-stack--grid {
    display: flex;
    flex-wrap: wrap;
    gap: 24px;
}

.case-architecture-overview-stack--grid .case-architecture-image--overview {
    flex: 1 1 calc(50% - 12px);
    min-width: min(320px, 100%);
    max-width: none;
    margin: 0;
    box-sizing: border-box;
}

/* Three diagrams — two columns, then full-width row */
.case-architecture-overview-stack--grid:has(.case-architecture-image--overview:nth-child(3)) {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 24px;
}

.case-architecture-overview-stack--grid:has(.case-architecture-image--overview:nth-child(3)) .case-architecture-image--overview {
    flex: none;
    min-width: 0;
    margin: 0;
}

.case-architecture-overview-stack--grid:has(.case-architecture-image--overview:nth-child(3)) .case-architecture-image--overview:nth-child(3) {
    grid-column: 1 / -1;
    max-width: 1200px;
    width: 100%;
    justify-self: center;
}

.case-detail-section--architecture .case-detail-header h2 {
    margin: 0;
    font-family: "Open Sans", sans-serif;
    font-weight: 700;
    font-size: 24px;
    line-height: 1.48;
    color: #150f2d;
}

.case-detail-section--architecture .case-architecture-image--overview {
    aspect-ratio: var(--case-architecture-aspect, 1200 / 625);
    border-radius: 8px;
    overflow: hidden;
    background: #fafbfc;
}

.case-detail-section--architecture .case-architecture-image--overview img {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: contain;
    object-position: center;
}

.case-detail-section--architecture + .case-detail-section--execution {
    padding-top: 0;
}

/* Detailed Execution Flow — standalone white section */
.case-detail-section--execution {
    padding: 60px 0;
    background: #fff;
}

.case-detail-section--execution .case-detail-container {
    gap: 24px;
}

.case-detail-section--execution .case-detail-group {
    gap: 24px;
}

.case-detail-section--execution .case-detail-header h2 {
    margin: 0;
    font-family: "Open Sans", sans-serif;
    font-weight: 700;
    font-size: 24px;
    line-height: 1.48;
    color: #150f2d;
}

.case-detail-section--execution .case-flow-rows {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.case-detail-section--execution .case-flow-row {
    display: flex;
    flex-wrap: wrap;
    gap: 24px;
}

.case-detail-section--execution .case-flow-row .case-flow-step {
    flex: 1 1 calc(33.333% - 16px);
    min-width: min(280px, 100%);
    box-sizing: border-box;
}

.case-detail-section--execution .case-flow-step ul {
    font-size: 14px;
    line-height: 1.5;
}

/* .case-flow-step--last .case-flow-step__rule {
    display: none;
} */

/* Dark band: Technology Stack → Scalability */
.case-tech-section {
    background: #11273f;
    padding: 60px 0;
}

.case-tech-section .case-detail-container {
    display: flex;
    flex-direction: column;
    gap: 60px;
}

.case-tech-section .case-detail-header--on-dark h2 {
    margin: 0;
    font-family: "Open Sans", sans-serif;
    font-weight: 700;
    font-size: 24px;
    line-height: 1.48;
    color: #fff;
}

/* .case-tech-section .case-decision-item {
    min-height: 177px;
} */

/* Lower content: Business Impact → Capabilities */
.case-study-detail__body--lower {
    padding: 40px 0;
}

.case-study-detail__body--lower > .case-detail-section,
.case-study-detail__body--lower > .case-results-section {
    padding: 0;
    background: transparent;
}


.case-study-detail__body--lower .case-results-grid {
    gap: 24px;
}

.case-study-detail__body--lower .case-capabilities-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 14px;
}

.case-study-detail__body--lower .case-capabilities-grid .case-capability-item {
    flex: 1 1 calc(20% - 11.2px);
    min-width: min(160px, 100%);
}

.case-study-detail__body--lower .case-capability-item {
    min-height: 142px;
    padding: 16px 14px;
    gap: 30px;
}

.case-study-detail__body--lower .case-capability-item h3,
.case-study-detail__body--lower .case-capability-item__title {
    font-family: "Manrope", sans-serif;
    font-size: 14px;
    font-weight: 600;
    line-height: 1.4;
}

/* Latest case studies */
.case-latest-section {
    padding: 40px 0 60px;
    background: #f7f7f7;
}

.case-latest-section .section__header {
    text-align: center;
    margin-bottom: 2.5rem;
}

.case-latest-section .section__title {
    font-family: "Manrope", sans-serif;
    font-weight: 800;
    font-size: 34px;
    line-height: 1.4;
    color: #150f2d;
}

@media (max-width: 1024px) {
    .case-detail-section--execution .case-flow-row .case-flow-step {
        flex: 1 1 calc(50% - 12px);
    }

    .case-study-detail__body .case-problem-column {
        flex: 1 1 calc(50% - 7px);
    }

    .case-study-detail__body--lower .case-capabilities-grid .case-capability-item {
        flex: 1 1 calc(33.333% - 9.34px);
    }
}

@media (max-width: 768px) {
    .case-study-detail__body,
    .case-study-detail__body--lower {
        padding-top: 48px;
        padding-bottom: 32px;
        gap: 32px;
    }

    .case-solution-overview-band {
        padding: 24px 0 32px;
    }

    .case-detail-section--architecture {
        padding: 48px 0 32px;
    }

    .case-architecture-overview-stack--grid .case-architecture-image--overview {
        flex: 1 1 100%;
    }

    .case-architecture-overview-stack--grid:has(.case-architecture-image--overview:nth-child(3)) {
        grid-template-columns: 1fr;
    }

    .case-architecture-overview-stack--grid:has(.case-architecture-image--overview:nth-child(3)) .case-architecture-image--overview:nth-child(3) {
        grid-column: auto;
        max-width: none;
    }

    .case-detail-section--execution {
        padding: 48px 0;
    }

    .case-study-detail__body .case-context-card,
    .case-detail-section--execution .case-flow-row .case-flow-step,
    .case-study-detail__body .case-problem-column,
    .case-study-detail__body--lower .case-capabilities-grid .case-capability-item {
        flex: 1 1 100%;
    }

    .case-solution-overview-band .case-solution-row {
        flex-direction: column;
    }

    .case-solution-overview-band .case-solution-row__connector {
        display: none;
    }
}
