/* Case Study Listing — Figma node 20889:18855 (1440 frame) */
.cs-list-page {
    --csl-blue: #0033ff;
    --csl-card-bg: #1d1d1d;
    --csl-page-bg: #101010;
    --csl-muted: #3a3a3a;
    position: relative;
    color: #ffffff;
    background-color: var(--csl-page-bg);
    overflow: clip;
}

.cs-list-page > * {
    position: relative;
    z-index: 1;
}

/* Blue fade under hero; Figma gap hero→cards = 100px (y 627→727) */
.cs-list-page > .estimator-hero {
    z-index: 0;
    padding: 10px 10px 100px;
}

/* ---------- Hero Frame 1000010226 (20889:18858) — 10px inset like Figma ---------- */
.cs-list-hero {
    position: relative;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    justify-content: flex-start;
    width: 100%;
    max-width: none;
    height: 617px;
    margin: 0;
    padding: 230px 139px 150px;
    border-radius: 40px;
    overflow: hidden;
}

/* Match Figma header inset (~45px from viewport / ~35px inside hero) on this page */
body:has(.cs-list-page) header .navbar > .container {
    max-width: none;
    width: 100%;
    padding-left: 35px;
    padding-right: 35px;
}

body:has(.cs-list-page) header .navbar {
    margin-left: 10px;
    margin-right: 10px;
}

.cs-list-hero__media {
    position: absolute;
    inset: 0;
    z-index: 0;
    pointer-events: none;
    border-radius: 40px;
    overflow: hidden;
    background-color: #101010;
}

/* Raw photo fills frame (Figma fill); darkening comes only from overlay below */
.cs-list-hero__img {
    position: absolute;
    inset: 0;
    display: block;
    width: 100%;
    max-width: none;
    height: 100%;
    object-fit: cover;
    object-position: center center;
    border-radius: 40px;
}

.cs-list-hero__overlay {
    display: none;
}

.cs-list-hero__content {
    position: relative;
    z-index: 2;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 30px;
    width: 1142px;
    max-width: 100%;
    margin: 0 auto;
    text-align: center;
    color: #ffffff;
}

.cs-list-hero__title {
    margin: 0;
    width: 100%;
    font-family: "Nohemi", sans-serif;
    font-size: 80px;
    font-weight: 500; /* project maps Nohemi Regular → 500 */
    line-height: 90px;
    letter-spacing: 2.4px;
    color: #ffffff;
    text-box-trim: trim-both;
    text-box-edge: cap alphabetic;
}

.cs-list-hero__desc {
    margin: 0;
    width: 857px;
    max-width: 100%;
    font-family: "Nohemi", sans-serif;
    font-size: 16px;
    font-weight: 300;
    line-height: 30px;
    letter-spacing: 0.48px;
    color: #ffffff;
}

.cs-list-hero__desc p {
    margin: 0;
    font: inherit;
    letter-spacing: inherit;
    color: inherit;
}

/* ---------- List Frame 1000010241 (20889:19009) — 1200 wide, gap 30 ---------- */
.cs-list-inner {
    box-sizing: border-box;
    width: 100%;
    max-width: 1200px;
    /* No negative pull-up — Figma keeps 100px under the hero image */
    margin: 0 auto;
    padding: 0;
    position: relative;
    z-index: 4;
}

.cs-list {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 30px;
    width: 100%;
}

/* Card shell: #1d1d1d, radius 25, padding 15 — Figma 20889:19010 = 1200×325 */
.cs-list-card {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    justify-content: flex-start;
    box-sizing: border-box;
    width: 100%;
    height: 325px;
    max-height: 325px;
    padding: 15px;
    border-radius: 25px;
    background: #1d1d1d;
    color: #ffffff;
    text-decoration: none;
    overflow: hidden;
    transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.cs-list-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 40px rgba(0, 51, 255, 0.12);
    color: #ffffff;
}

.cs-list-card:hover .cs-list-card__btn {
    filter: brightness(1.08);
}

.cs-list-card__row {
    display: flex;
    align-items: center;
    gap: 30px;
    width: 100%;
    height: 295px;
}

.cs-list-card__image {
    position: relative;
    flex: 0 0 442px;
    flex-shrink: 0;
    width: 442px;
    height: 295px;
    margin: 0;
    border-radius: 20px;
    overflow: hidden;
    background-color: #0a0a0a;
}

.cs-list-card__image img {
    position: absolute;
    inset: 0;
    display: block;
    width: 100%;
    max-width: none;
    height: 100%;
    object-fit: cover;
    border-radius: 20px;
}

.cs-list-card__content {
    display: flex;
    flex: 0 0 698px;
    flex-direction: column;
    align-items: flex-start;
    justify-content: center;
    gap: 30px;
    width: 698px;
    height: 295px;
    min-width: 0;
    overflow: hidden;
}

.cs-list-card__copy {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 30px;
    width: 100%;
    min-width: 0;
}

.cs-list-card__meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    gap: 20px;
}

.cs-list-card__eyebrow {
    margin: 0;
    font-family: "Nohemi", sans-serif;
    font-size: 14px;
    font-weight: 300;
    line-height: 20px;
    letter-spacing: 0.42px;
    color: #ffffff;
    opacity: 0.6;
    white-space: nowrap;
}

.cs-list-card__duration {
    display: inline-flex;
    flex-shrink: 0;
    align-items: center;
    justify-content: center;
    padding: 5px 10px 3px;
    border-radius: 50px;
    background: #0033ff;
    font-family: "Nohemi", sans-serif;
    font-size: 14px;
    font-weight: 300;
    line-height: 20px;
    letter-spacing: 0.42px;
    color: #ffffff;
    white-space: pre;
}

/* Beat global h2 { 80px/100px } from style.min.css */
.cs-list-card__title,
h2.cs-list-card__title {
    margin: 0;
    width: 100%;
    font-family: "Nohemi", sans-serif;
    font-size: 40px;
    font-weight: 500; /* project maps Regular → 500 */
    line-height: 45px;
    letter-spacing: 1.2px;
    color: #ffffff;
    text-box: trim-both cap alphabetic;
    text-box-trim: trim-both;
    text-box-edge: cap alphabetic;
}

.cs-list-card__desc {
    margin: 0;
    width: 100%;
    font-family: "Nohemi", sans-serif;
    font-size: 18px;
    font-weight: 300;
    line-height: 25px;
    letter-spacing: 0.54px;
    color: #ffffff;
    opacity: 0.6;
    /* Figma text box height ≈ 38px (2 lines + trim) */
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    overflow: hidden;
    text-box: trim-both cap alphabetic;
    text-box-trim: trim-both;
    text-box-edge: cap alphabetic;
}

/* Without text-box-trim, untrimmed glyphs inflate gaps — tighten to keep card ≈ 325px */
@supports not (text-box-trim: trim-both) {
    .cs-list-card__content {
        gap: 24px;
    }

    .cs-list-card__title,
    h2.cs-list-card__title {
        margin-block: -6px;
    }

    .cs-list-card__desc {
        margin-block: -4px;
    }
}

.cs-list-card__btn {
    display: inline-flex;
    flex-shrink: 0;
    align-items: center;
    justify-content: center;
    box-sizing: border-box;
    width: 125px;
    height: 55px;
    border-radius: 10px;
    background: #0033ff;
    font-family: "Nohemi", sans-serif;
    font-size: 15px;
    font-weight: 500;
    line-height: normal;
    letter-spacing: 0.45px;
    color: #ffffff;
    text-align: center;
    transition: filter 0.2s ease;
}

/* ---------- Pagination (gap 50 from list end) ---------- */
.cs-list-pagination {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    max-width: 1200px;
    margin: 50px auto 0;
    gap: 20px;
}

.cs-list-pagination__nav {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
    box-sizing: border-box;
    width: 125px;
    height: 44px;
    border: 1px solid var(--csl-muted);
    border-radius: 10px;
    background: var(--csl-page-bg);
    color: var(--csl-muted);
    font-family: "Nohemi", sans-serif;
    font-size: 14px;
    font-weight: 500;
    letter-spacing: 0.42px;
    text-decoration: none;
    pointer-events: none;
}

.cs-list-pagination__nav.is-active {
    border-color: var(--csl-blue);
    color: #ffffff;
    pointer-events: auto;
}

.cs-list-pagination__icon {
    display: block;
    width: 20px;
    height: 20px;
    object-fit: contain;
    opacity: 0.35;
}

.cs-list-pagination__nav.is-active .cs-list-pagination__icon {
    opacity: 1;
}

.cs-list-pagination__nav--next .cs-list-pagination__icon {
    transform: scaleX(-1);
}

.cs-list-pagination__pages {
    display: flex;
    align-items: center;
    gap: 25px;
}

.cs-list-pagination__page {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    box-sizing: border-box;
    width: 40px;
    height: 40px;
    border-radius: 10px;
    background: transparent;
    font-family: "Nohemi", sans-serif;
    font-size: 20px;
    font-weight: 300;
    letter-spacing: 0.6px;
    color: #ffffff;
    text-decoration: none;
}

.cs-list-pagination__page.is-active {
    background: var(--csl-blue);
    border: 1px solid var(--csl-blue);
}

/* ---------- Responsive ---------- */
@media (max-width: 1439px) {
    .cs-list-hero {
        height: auto;
        min-height: 520px;
        aspect-ratio: 1420 / 617;
        padding: 180px 80px 100px;
    }

    .cs-list-hero__title {
        font-size: clamp(42px, 5.2vw, 80px);
        line-height: 1.125;
        letter-spacing: 0.03em;
    }

    .cs-list-hero__content {
        width: 100%;
        max-width: 1142px;
    }

    .cs-list-hero__desc {
        width: 100%;
        max-width: 857px;
    }
}

@media (max-width: 1279px) {
    .cs-list-inner {
        padding: 0 40px;
    }

    .cs-list-card {
        height: auto;
        max-height: none;
        overflow: visible;
    }

    .cs-list-card__row {
        flex-wrap: wrap;
        height: auto;
    }

    .cs-list-card__image {
        flex: 1 1 100%;
        width: 100%;
        max-width: 100%;
        height: auto;
        aspect-ratio: 442 / 295;
    }

    .cs-list-card__image img {
        position: absolute;
    }

    .cs-list-card__content {
        flex: 1 1 100%;
        width: 100%;
        max-width: 100%;
        height: auto;
        overflow: visible;
    }

    .cs-list-card__copy {
        gap: 20px;
    }

    .cs-list-hero {
        padding: 160px 48px 90px;
        border-radius: 32px;
    }

    .cs-list-hero__media,
    .cs-list-hero__img,
    .cs-list-hero__overlay {
        border-radius: 32px;
    }
}

@media (max-width: 991px) {
    .cs-list-hero {
        width: 100%;
        min-height: 380px;
        aspect-ratio: auto;
        margin: 0;
        padding: 140px 24px 80px;
        border-radius: 24px;
    }

    .cs-list-hero__media,
    .cs-list-hero__img,
    .cs-list-hero__overlay {
        border-radius: 24px;
    }

    .cs-list-inner {
        padding: 0 20px;
    }

    .cs-list-card {
        height: auto;
        max-height: none;
        overflow: visible;
    }

    .cs-list-card__row {
        height: auto;
    }

    .cs-list-card__title,
    h2.cs-list-card__title {
        font-size: 28px;
        line-height: 34px;
    }

    .cs-list-card__content {
        height: auto;
        gap: 20px;
        overflow: visible;
    }

    .cs-list-card__copy {
        gap: 20px;
    }

    .cs-list-pagination {
        flex-wrap: wrap;
        justify-content: center;
        margin-top: 40px;
        gap: 24px;
    }
}

/* ---------- Mobile — Figma node 20889:20797 (375) ---------- */
@media (max-width: 767px) {
    /* Header: logo @ x20 y25, rule 335 @ y68 */
    body:has(.cs-list-page) header {
        top: 0;
    }

    body:has(.cs-list-page) header .navbar {
        margin: 0 20px;
        padding: 25px 0 15px;
    }

    body:has(.cs-list-page) header .navbar > .container {
        padding-left: 0;
        padding-right: 0;
    }

    /* Blue glow behind hero — Figma Rectangle 7, 375×727 */
    .cs-list-page::before {
        content: "";
        position: absolute;
        left: 0;
        top: 0;
        width: 100%;
        height: 727px;
        background-image: linear-gradient(176.21deg, #0033ff 5.243%, #101010 98.347%);
        pointer-events: none;
        z-index: 0;
    }

    /* Hero 365×595 @ 5px inset; cards start y650 → 50px under hero */
    .cs-list-page > .estimator-hero {
        width: 100%;
        padding: 5px 5px 50px !important;
        margin: 0;
        background: transparent !important;
    }

    .cs-list-hero {
        width: 100%;
        max-width: 365px;
        height: 595px;
        min-height: 595px;
        margin: 0 auto;
        padding: 175px 20px 111px;
        border-radius: 20px;
        aspect-ratio: auto;
        overflow: hidden;
    }

    .cs-list-hero__media {
        border-radius: 20px;
        overflow: hidden;
    }

    .cs-list-hero__overlay {
        border-radius: 20px;
    }

    /* Figma fill transform on hero photo */
    .cs-list-hero__img {
        inset: auto;
        top: -18.74%;
        left: -14.52%;
        width: 129.04%;
        height: 118.72%;
        max-width: none;
        border-radius: 0;
        object-fit: fill;
        object-position: unset;
    }

    .cs-list-hero__content {
        gap: 30px;
        width: 325px;
        max-width: 100%;
        margin: 0 auto;
    }

    .cs-list-hero__title {
        width: 325px;
        max-width: 100%;
        font-size: 40px !important;
        font-weight: 500; /* Regular */
        line-height: 50px !important;
        letter-spacing: 1.2px;
    }

    .cs-list-hero__desc {
        width: 325px;
        max-width: 100%;
        font-size: 15px !important;
        font-weight: 300;
        line-height: 25px !important;
        letter-spacing: 0.45px;
    }

    /* Cards — Frame 20889:21433 @ x15, 345 wide, 30px gap */
    .cs-list-inner {
        width: 345px;
        max-width: calc(100% - 30px);
        margin: 0 auto;
        padding: 0 !important;
    }

    .cs-list {
        gap: 30px;
    }

    .cs-list-card {
        width: 100%;
        height: auto;
        max-height: none;
        padding: 10px;
        border-radius: 20px;
        overflow: hidden;
    }

    .cs-list-card__row {
        flex-direction: column;
        flex-wrap: nowrap;
        align-items: flex-start;
        gap: 20px;
        width: 100%;
        height: auto;
    }

    .cs-list-card__image {
        flex: 0 0 auto;
        width: 100%;
        max-width: 325px;
        height: 180px !important;
        aspect-ratio: auto !important;
        border-radius: 15px;
    }

    .cs-list-card__image img {
        position: absolute;
        border-radius: 15px;
        object-fit: cover;
    }

    .cs-list-card__content {
        flex: 0 0 auto;
        width: 100%;
        max-width: 325px;
        height: auto;
        gap: 25px !important;
        justify-content: flex-start;
        overflow: visible;
    }

    .cs-list-card__copy {
        gap: 15px !important;
        width: 100%;
    }

    .cs-list-card__meta {
        flex-direction: column;
        align-items: flex-start;
        justify-content: flex-start;
        flex-wrap: nowrap;
        gap: 10px;
        width: 100%;
    }

    .cs-list-card__eyebrow {
        white-space: nowrap;
        font-size: 14px;
        font-weight: 300;
        line-height: 20px;
        letter-spacing: 0.42px;
        opacity: 0.6;
    }

    .cs-list-card__duration {
        padding: 5px 10px 3px;
        white-space: pre;
        text-align: right;
        font-size: 14px;
        font-weight: 300;
        line-height: 20px;
        letter-spacing: 0.42px;
    }

    .cs-list-card__title,
    h2.cs-list-card__title {
        width: 100%;
        font-size: 25px !important;
        font-weight: 400; /* Medium */
        line-height: 30px !important;
        letter-spacing: 0.75px;
        text-box-trim: trim-both;
        text-box-edge: cap alphabetic;
    }

    .cs-list-card__desc {
        width: 100%;
        font-size: 14px;
        font-weight: 300;
        line-height: 20px;
        letter-spacing: 0.42px;
        opacity: 0.6;
        display: block;
        -webkit-line-clamp: unset;
        line-clamp: unset;
        overflow: visible;
        text-box-trim: unset;
        text-box-edge: unset;
    }

    @supports not (text-box-trim: trim-both) {
        .cs-list-card__content {
            gap: 25px;
        }

        .cs-list-card__title,
        h2.cs-list-card__title,
        .cs-list-card__desc {
            margin-block: 0;
        }
    }

    .cs-list-card__btn {
        width: auto;
        min-width: 116px;
        height: 55px;
        padding: 22px 20px;
        font-size: 15px;
        font-weight: 500;
        letter-spacing: 0.45px;
    }

    /* Pagination — 275 wide, pages then Prev/Next (Figma 20889:20893) */
    .cs-list-pagination {
        flex-wrap: wrap;
        justify-content: space-between;
        align-items: center;
        width: 275px;
        /* Ensure buttons don't wrap inside the 345px container */
        max-width: 275px;
        margin: 30px auto 0;
        row-gap: 25px;
        column-gap: 25px;
    }

    .cs-list-pagination__pages {
        order: -1;
        flex: 0 0 100%;
        width: 100%;
        justify-content: center;
        gap: 25px;
    }

    .cs-list-pagination__page {
        width: 40px;
        height: 40px;
        font-size: 20px;
        font-weight: 300;
        letter-spacing: 0.6px;
    }

    .cs-list-pagination__nav {
        flex: 0 0 125px;
        width: 125px;
        height: 44px;
        /* Figma 20889:20893 — arrow pinned, text centered */
        position: relative;
        gap: 0;
        /* Reserve space so text is centered in the remaining area (like Figma). */
        padding-left: 40px;
        padding-right: 20px;
        justify-content: center;
        font-size: 14px;
        font-weight: 500;
        letter-spacing: 0.42px;
    }

    .cs-list-pagination__nav .cs-list-pagination__icon {
        position: absolute;
        top: 50%;
        left: 20px;
        transform: translateY(-50%);
    }

    .cs-list-pagination__nav--next .cs-list-pagination__icon {
        left: auto;
        right: 20px;
        transform: translateY(-50%) scaleX(-1);
    }

    .cs-list-pagination__nav--next {
        /* Shift text left by reserving more right padding (like Figma). */
        padding-left: 20px;
        padding-right: 40px;
    }

}
