/* ─── page-level layout variables ───────────────────────────────────────── */
:root {
    --text-col: 60vw;   /* width of the text column in work item rows */
    --img-col:  1fr;    /* width of the image column in work item rows */
}

/* ─── h3 animated underline ──────────────────────────────────────────────── */
h3 {
    position: relative;
    line-height: 1.4em;
    margin-bottom: 42px;
}

h3::after {
    content: '';
    position: absolute;
    left: 0;
    bottom: -16px;
    height: 4px;
    width: 100%;
    border-radius: 30px;
    background-color: var(--green);
    animation: underline-grow 0.6s ease-out forwards;
}

@keyframes underline-grow {
    from { width: 0; }
    to   { width: 100%; }
}

/* ─── grid structure ─────────────────────────────────────────────────────── */
.GridContainer {
    display: grid;
    background-color: #3f4349;
    grid-gap: 1px;
    overflow: hidden;
}

.GridItem {
    color: var(--white);
}

.NestedGridItem {
    overflow: hidden;
    background-color: var(--bg-0);
}

/* ─── shared nested grid helpers ─────────────────────────────────────────── */

.CenteredGrid {
    position: relative;
}

.CenteredGrid img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: contain;
}

/* ─── image cell padding ─────────────────────────────────────────────────── */
.ImagePadding img {
    top: 24px;
    left: 24px;
    width: calc(100% - 48px);
    height: calc(100% - 48px);
}

/* ─── row 0 — page header ────────────────────────────────────────────────── */
.GridRow0 {
    display: flex;
    flex-direction: row;
    justify-content: space-between;
    background-color: var(--bg-0);
    padding-left: 100px;
}

#first_row_left_content {
    width: 50%;
    max-width: 420px;
    padding-top: 40px;
    padding-bottom: 40px;
}

#first_row_left_content h1 {
    color: var(--green);
}

#first_row_right_content {
    display: flex;
    justify-content: flex-end;
    width: 50%;
    position: relative;
    overflow: hidden;
}

.GridRow0 img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
}

/* ─── case study rows (tier 1) ───────────────────────────────────────────── */
.CaseStudyRow {
    display: grid;
    align-items: stretch;
}

.CaseStudyRow1 {
    grid-template-columns: var(--text-col) var(--img-col);
}

.CaseStudyRow2 {
    grid-template-columns: var(--text-col) var(--img-col);
}

.CaseStudyRow3 {
    grid-template-columns: var(--img-col) var(--text-col);
}

.case-study-text {
    padding: 40px 60px 40px 80px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 16px;
}

p.sector {
    font-size: 13pt;
    color: rgba(255, 255, 255, 0.75);
    font-style: italic;
    letter-spacing: -0.5px;
    margin-top: -28px; /* pull up close under h3 underline */
}

p.testimonial {
    font-style: italic;
    color: rgba(255, 255, 255, 0.75);
    font-size: 14pt;
    line-height: 1.5;
    border-left: 2px solid var(--blue);
    padding-left: 16px;
}

.testimonial-cite {
    font-size: 13pt;
    color: var(--blue);
    font-style: normal;
}

p.methods {
    font-size: 12pt;
    color: rgba(255, 255, 255, 0.75);
    letter-spacing: -0.5px;
}

.methods-label {
    color: var(--white);
    font-weight: 700;
}

a.case-study-link {
    font-size: 12pt;
    color: var(--green);
    letter-spacing: -0.5px;
    width: max-content;
}

a.case-study-link:hover {
    color: var(--blue);
}

/* ─── tier 2 — additional work rows ──────────────────────────────────────── */
.AdditionalWorkRow {
    display: grid;
    grid-template-columns: 60% 40%;
    align-items: stretch;
    min-height: 260px;
}

.additional-work-text {
    padding: 32px 48px 32px 80px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 12px;
}

.additional-work-text h3 {
    font-size: 16pt;
    margin-bottom: 24px;
}

.additional-work-text h3::after {
    bottom: -10px;
    height: 3px;
}

.additional-work-text p {
    font-size: 13pt;
    line-height: 1.6;
    letter-spacing: -0.5px;
}

/* ─── responsive ─────────────────────────────────────────────────────────── */
@media (max-width: 900px) {
    .CaseStudyRow1,
    .CaseStudyRow2,
    .CaseStudyRow3 {
        grid-template-columns: 1fr;
    }

    /* when stacked, ensure image cell has a visible height */
    .case-study-img {
        min-height: 300px;
    }

    /* text always first when stacked */
    .CaseStudyRow3 .case-study-text {
        order: -1;
    }

    .AdditionalWorkRow {
        grid-template-columns: 1fr;
    }

    /* give image cell a visible height when stacked */
    .AdditionalWorkRow .CenteredGrid {
        min-height: 250px;
    }
}

@media (max-width: 768px) {
    .GridRow0 {
        padding-left: 30px;
    }

    #first_row_left_content {
        width: 60%;
    }

    .case-study-text {
        padding: 30px 24px;
    }

    .additional-work-text {
        padding: 24px 24px;
    }

    .additional-work-text h3 {
        font-size: 14pt;
    }

    .additional-work-text p {
        font-size: 12pt;
    }
}