/*
 * City pages: jsz/city-work, jsz/city-local, jsz/city-areas.
 * Loaded by inc/city-page.php only on pages that use one of these blocks.
 * Colours are the theme palette tokens (theme.json custom imt colours).
 *
 * ClickUp 86aj9qd5x
 * @since 1.30
 */

.jsz-city {
    --jsz-city-ink: var(--wp--custom--imt--color--palette--background--neutral--800, #191B1A);
    --jsz-city-ink-soft: var(--wp--custom--imt--color--palette--background--neutral--600, #4B524E);
    --jsz-city-panel: var(--wp--custom--imt--color--palette--background--accent--3--100, #F8F8F4);
    --jsz-city-sage: var(--wp--custom--imt--color--palette--background--primary--500, #568279);
    --jsz-city-sage-deep: var(--wp--custom--imt--color--palette--background--primary--700, #36504B);
    --jsz-city-forest: var(--wp--custom--imt--color--palette--background--primary--900, #15201E);
    position: relative;
}

.jsz-city .imt-heading {
    text-wrap: balance;
}

.jsz-city .imt-paragraphs p {
    text-wrap: pretty;
}

.jsz-city__accent {
    margin-top: 0;
}

/* ---------- Our Work ---------- */

.jsz-city-work__intro {
    display: grid;
    grid-template-columns: 5fr 6fr;
    gap: 48px;
    align-items: start;
    margin-bottom: 48px;
}

/* Top-align the columns: the heading's first line sits level with the
   paragraph's, so the theme's stacked margins are cleared on both sides. */
.jsz-city-work__intro .imt-heading,
.jsz-city-work__intro .imt-paragraphs p {
    margin-top: 0;
}

.jsz-city-work__intro .imt-paragraphs {
    max-width: 52ch;
}

.jsz-city-work__intro .imt-paragraphs p:last-child {
    margin-bottom: 0;
}

.jsz-city-work__intro .imt-buttons {
    margin-top: 24px;
}

.jsz-city-work__intro .imt-btn {
    margin: 0;
}

.jsz-city-work__grid {
    display: grid;
    grid-template-columns: 7fr 5fr;
    grid-template-rows: 1fr 1fr;
    gap: 16px;
    height: 640px;
}

.jsz-city-work__grid--1 {
    grid-template-columns: 1fr;
    grid-template-rows: 1fr;
}

.jsz-city-work__grid--2 {
    grid-template-rows: 1fr;
}

.jsz-city-work__tile {
    position: relative;
    display: block;
    overflow: hidden;
    text-decoration: none;
    color: var(--jsz-city-ink);
    background: var(--jsz-city-panel);
}

.jsz-city-work__grid--3 .jsz-city-work__tile:first-child {
    grid-row: 1 / span 2;
}

.jsz-city-work__tile img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform .8s ease;
}

.jsz-city-work__tile:hover img {
    transform: scale(1.03);
}

.jsz-city-work__name {
    position: absolute;
    left: 0;
    bottom: 0;
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px 22px 12px;
    background: #fff;
    font-family: var(--font-family--h--2);
    font-size: 19px;
    line-height: 1.25;
}

.jsz-city-work__view {
    font-family: var(--font-family--default);
    font-size: 11px;
    letter-spacing: .1em;
    text-transform: uppercase;
    color: var(--jsz-city-sage-deep);
    transition: transform .2s;
}

.jsz-city-work__tile:hover .jsz-city-work__view {
    transform: translateX(3px);
}

/* ---------- Local landscape ---------- */
/* Option 2 (11/11): layered photo stack left, ruled text column right. */

.jsz-city-local__grid {
    display: grid;
    grid-template-columns: 6fr 5fr;
    gap: 72px;
    align-items: center;
}

.jsz-city-local__stack {
    position: relative;
    height: 640px;
}

.jsz-city-local__stack img {
    position: absolute;
    max-width: none;
    object-fit: cover;
}

/* Later photos sit on top; the white outline separates the overlaps. */
.jsz-city-local__stack img:nth-child(1) {
    left: 0;
    top: 0;
    width: 62% !important;
    height: 56% !important;
}

.jsz-city-local__stack img:nth-child(2) {
    right: 0;
    top: 18%;
    width: 48% !important;
    height: 44% !important;
    outline: 10px solid #fff;
}

.jsz-city-local__stack img:nth-child(3) {
    left: 12%;
    bottom: 0;
    width: 66% !important;
    height: 40% !important;
    outline: 10px solid #fff;
}

/* Fewer photos: fill the space instead of leaving holes. */
.jsz-city-local__stack--1 img:nth-child(1) {
    width: 100% !important;
    height: 100% !important;
}

.jsz-city-local__stack--2 {
    height: 520px;
}

.jsz-city-local__stack--2 img:nth-child(1) {
    width: 70% !important;
    height: 70% !important;
}

.jsz-city-local__stack--2 img:nth-child(2) {
    top: auto;
    bottom: 0;
    width: 55% !important;
    height: 55% !important;
}

.jsz-city-local__text .imt-heading {
    margin-top: 0;
}

.jsz-city-local__text .jsz-city__accent {
    margin-bottom: 28px;
}

.jsz-city-local__list .imt-paragraphs {
    padding: 18px 0;
    border-top: 1px solid var(--wp--custom--imt--color--palette--background--neutral--200, #D8DBD9);
}

.jsz-city-local__list .imt-paragraphs:last-child {
    border-bottom: 1px solid var(--wp--custom--imt--color--palette--background--neutral--200, #D8DBD9);
}

.jsz-city-local .jsz-city-local__list .imt-paragraphs p {
    margin: 0 !important; /* theme paragraph margins otherwise unbalance the ruled rows */
}

/* ---------- Neighborhoods ---------- */

.jsz-city-areas {
    background: var(--jsz-city-sage-deep);
    color: #fff;
}

.jsz-city-areas .imt-heading,
.jsz-city-areas p {
    color: #fff;
}

.jsz-city-areas__grid {
    display: grid;
    grid-template-columns: 6fr 5fr;
    gap: 64px;
    align-items: stretch;
}

.jsz-city-areas__map {
    position: relative;
    min-height: 440px;
    background: var(--jsz-city-forest);
}

.jsz-city-areas__map img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: 35% 45%;
}

.jsz-city-areas__credit {
    position: absolute;
    right: 0;
    bottom: 0;
    padding: 2px 6px;
    background: rgba(255, 255, 255, .8);
    color: var(--jsz-city-ink-soft);
    font-size: 10px;
    line-height: 1.4;
}

.jsz-city-areas p.jsz-city-areas__lede {
    margin: 22px 0 18px;
    color: rgba(255, 255, 255, .86);
}

.jsz-city-areas__list {
    columns: 2;
    column-gap: 32px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.jsz-city-areas__list li {
    margin: 0;
    padding: 11px 0;
    border-top: 1px solid rgba(255, 255, 255, .2);
    font-family: var(--font-family--h--2);
    font-size: 21px;
    line-height: 1.3;
    break-inside: avoid;
}

.jsz-city-areas__list li::before,
.jsz-city-areas__list li::marker {
    content: none;
}

.jsz-city-areas__nearby {
    margin-top: 28px;
    padding-top: 22px;
    border-top: 1px solid rgba(255, 255, 255, .2);
    font-size: 14px;
}

.jsz-city-areas__nearby p {
    color: rgba(255, 255, 255, .86);
}

.jsz-city-areas .jsz-city-areas__nearby a {
    color: #fff !important; /* theme link colour is too dark on the sage band */
    text-decoration: underline;
    text-decoration-color: rgba(255, 255, 255, .5);
    text-underline-offset: 3px;
}

.jsz-city-areas .jsz-city-areas__nearby a:hover {
    text-decoration-color: #fff;
}

/* ---------- Mobile ---------- */

@media (max-width: 860px) {
    .jsz-city-work__intro {
        grid-template-columns: 1fr;
        gap: 16px;
    }

    .jsz-city-work__grid,
    .jsz-city-work__grid--1,
    .jsz-city-work__grid--2 {
        grid-template-columns: 1fr;
        grid-template-rows: none;
        height: auto;
    }

    .jsz-city-work__tile,
    .jsz-city-work__grid--3 .jsz-city-work__tile:first-child {
        grid-row: auto;
        aspect-ratio: 4 / 3;
    }

    .jsz-city-local__grid {
        grid-template-columns: 1fr;
        gap: 36px;
    }

    .jsz-city-local__stack {
        height: 420px;
        order: 2;
    }

    .jsz-city-local__stack img:nth-child(2),
    .jsz-city-local__stack img:nth-child(3) {
        outline-width: 6px;
    }

    .jsz-city-areas__grid {
        grid-template-columns: 1fr;
        gap: 36px;
    }

    .jsz-city-areas__map {
        min-height: 300px;
        order: 2;
    }

    .jsz-city-areas__list li {
        font-size: 19px;
    }
}

@media (max-width: 420px) {
    .jsz-city-areas__list {
        columns: 1;
    }
}
