/* Ongoing Projects. Every colour here resolves to a token from style.css:
   --primary-color for the eyebrow/number/dot, --logo-color for headings and the
   plain band, and two mixes of --secondary-color for the panel fill and hairline. */
.ongoing-page {
    /* style.css gives .full-page a left-only pad under 767px, which would knock the
       full-bleed rows off centre. */
    padding-left: 0;

    /* Each pair is a plain fallback followed by the mix, so a browser without
       color-mix still lands on an established colour. */
    --ongoing-panel: var(--secondary-color);
    --ongoing-panel: color-mix(in srgb, var(--secondary-color) 55%, #fff);
    --ongoing-line: var(--secondary-color);
    --ongoing-line: color-mix(in srgb, var(--secondary-color) 70%, #fff);
}

/* ---------- header ---------- */
.ongoing-header {
    padding: 3.5rem 3rem 3rem;
}

.ongoing-eyebrow {
    margin: 0 0 1rem;
    font-size: .78rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .14em;
    color: var(--primary-color);
}

/* Stated explicitly because style.css sets a global h2 { font-weight: 400 }. */
.ongoing-title {
    margin: 0;
    font-size: 3rem;
    font-weight: 800;
    line-height: 1.05;
    letter-spacing: -.01em;
    color: var(--logo-color);
}

.ongoing-intro {
    margin: 1.25rem 0 0;
    max-width: 46ch;
    font-size: 1.05rem;
    font-weight: 300;
    line-height: 1.6;
    color: #6c757d;
}

/* ---------- row ---------- */
.ongoing-row {
    display: grid;
    grid-template-columns: minmax(0, 5fr) minmax(0, 6fr);
    align-items: stretch;
    border-top: 1px solid var(--ongoing-line);
}

/* Placed rather than reordered, so the DOM always reads title before image
   and only the visual side alternates. */
.ongoing-row--media-left .ongoing-media,
.ongoing-row--media-right .ongoing-body {
    grid-column: 1;
    grid-row: 1;
}

.ongoing-row--media-left .ongoing-body,
.ongoing-row--media-right .ongoing-media {
    grid-column: 2;
    grid-row: 1;
}

.ongoing-body {
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 2.75rem 3rem;
}

.ongoing-index {
    display: flex;
    align-items: center;
    gap: .75rem;
    margin: 0 0 1rem;
}

.ongoing-num {
    font-size: .78rem;
    font-weight: 700;
    letter-spacing: .04em;
    color: var(--primary-color);
    opacity: .65;
}

.ongoing-rule {
    width: 28px;
    height: 2px;
    background-color: var(--secondary-color);
}

.ongoing-name {
    margin: 0;
    font-size: 1.6rem;
    font-weight: 800;
    line-height: 1.3;
    color: var(--logo-color);
}

.ongoing-meta {
    margin-top: 1.25rem;
}

.ongoing-client {
    margin: 0;
    font-size: .95rem;
    font-weight: 600;
    color: var(--logo-color);
}

.ongoing-loc {
    margin: .4rem 0 0;
    font-size: .9rem;
    font-weight: 300;
    color: #6c757d;
}

.ongoing-dot {
    display: inline-block;
    width: 6px;
    height: 6px;
    margin-right: .55rem;
    border-radius: 50%;
    vertical-align: middle;
    background-color: var(--primary-color);
    opacity: .7;
}

/* ---------- media panel ---------- */
.ongoing-media {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 260px;
    overflow: hidden;
    background-color: var(--ongoing-panel);
}

/* Landscape runs edge to edge, so it is taken out of flow and told to fill the
   panel however tall the text half happens to make it. */
.ongoing-row--landscape .ongoing-media picture {
    position: absolute;
    inset: 0;
    display: block;
}

.ongoing-row--landscape .ongoing-media img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Portrait and logo float on the panel instead of filling it. The panel floor is
   the image cap plus both pads, so a tall cover is never squeezed by its own frame. */
.ongoing-row--portrait .ongoing-media {
    min-height: 340px;
    padding: 2.5rem;
}

.ongoing-row--portrait .ongoing-media img {
    max-width: 100%;
    max-height: 260px;
    width: auto;
    object-fit: contain;
    box-shadow: 0 8px 20px rgba(0, 0, 0, .12);
}

.ongoing-row--logo .ongoing-media {
    padding: 2rem;
    background-color: var(--secondary-color);
    background-color: color-mix(in srgb, var(--secondary-color) 28%, #fff);
}

.ongoing-row--logo .ongoing-media img {
    max-width: 180px;
    max-height: 90px;
    object-fit: contain;
}

/* ---------- plain band (no image) ---------- */
.ongoing-row--plain {
    grid-template-columns: minmax(0, 1fr);
    border-top-color: transparent;
    background-color: var(--logo-color);
}

.ongoing-row--plain .ongoing-body {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    column-gap: 2.5rem;
    align-items: center;
}

.ongoing-row--plain .ongoing-index {
    grid-column: 1;
    grid-row: 1;
}

.ongoing-row--plain .ongoing-name {
    grid-column: 1;
    grid-row: 2;
    font-size: 1.9rem;
    color: #fff;
}

.ongoing-row--plain .ongoing-meta {
    grid-column: 2;
    grid-row: 1 / span 2;
    margin-top: 0;
    text-align: right;
}

.ongoing-row--plain .ongoing-num {
    color: #fff;
    opacity: .6;
}

.ongoing-row--plain .ongoing-rule {
    background-color: rgba(255, 255, 255, .35);
}

.ongoing-row--plain .ongoing-client {
    color: #fff;
}

.ongoing-row--plain .ongoing-loc {
    color: rgba(255, 255, 255, .75);
}

.ongoing-row--plain .ongoing-dot {
    background-color: var(--secondary-color);
    opacity: 1;
}

/* ---------- tablet: alternation kept, proportions tightened ---------- */
@media (max-width: 991px) {
    .ongoing-header {
        padding: 2.5rem 2rem 2rem;
    }

    .ongoing-title {
        font-size: 2.5rem;
    }

    .ongoing-intro {
        font-size: .95rem;
    }

    .ongoing-body {
        padding: 1.75rem 1.5rem;
    }

    .ongoing-name {
        font-size: 1.35rem;
    }

    .ongoing-row--plain .ongoing-name {
        font-size: 1.5rem;
    }

    .ongoing-media {
        min-height: 220px;
    }

    .ongoing-row--portrait .ongoing-media {
        min-height: 280px;
        padding: 1.75rem;
    }

    .ongoing-row--portrait .ongoing-media img {
        max-height: 200px;
    }

    .ongoing-row--logo .ongoing-media img {
        max-width: 140px;
        max-height: 70px;
    }
}

/* ---------- mobile: one column, image above the text ---------- */
@media (max-width: 767px) {
    .ongoing-header {
        padding: 2rem 1.25rem 1.75rem;
    }

    .ongoing-row,
    .ongoing-row--plain .ongoing-body {
        grid-template-columns: minmax(0, 1fr);
    }

    /* Overrides both side modifiers at once, so every row reads top down. The
       plain band is excluded: it has no media child and would otherwise be pushed
       into a second track behind an empty first one. */
    .ongoing-row:not(.ongoing-row--plain) .ongoing-media {
        grid-column: 1;
        grid-row: 1;
    }

    .ongoing-row:not(.ongoing-row--plain) .ongoing-body {
        grid-column: 1;
        grid-row: 2;
    }

    .ongoing-row .ongoing-body {
        padding: 1.5rem 1.25rem;
    }

    .ongoing-media {
        min-height: 0;
    }

    .ongoing-row--landscape .ongoing-media {
        aspect-ratio: 16 / 9;
    }

    .ongoing-row--portrait .ongoing-media,
    .ongoing-row--logo .ongoing-media {
        min-height: 0;
        padding: 1.5rem;
    }

    .ongoing-row--portrait .ongoing-media img {
        max-height: 160px;
    }

    /* The band loses its second column with everything else. */
    .ongoing-row--plain .ongoing-index,
    .ongoing-row--plain .ongoing-name,
    .ongoing-row--plain .ongoing-meta {
        grid-column: 1;
        grid-row: auto;
        text-align: left;
    }

    .ongoing-row--plain .ongoing-meta {
        margin-top: 1rem;
    }
}

@media (max-width: 560px) {
    .ongoing-title {
        font-size: 2rem;
    }

    .ongoing-intro {
        font-size: small;
    }

    .ongoing-name,
    .ongoing-row--plain .ongoing-name {
        font-size: 1.15rem;
    }

    .ongoing-client {
        font-size: small;
    }

    .ongoing-loc {
        font-size: smaller;
    }
}
