/* Work, Journal and Experience pages (built by tools/build-site.mjs).
   Loaded after styles.css and uses its colour variables. */

/* ── Index pages ─────────────────────────────────────────── */

.work-index {
    padding-top: 3rem;
}

.index-head {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 2fr);
    gap: 4rem;
    align-items: end;
    padding-bottom: 2rem;
    margin-bottom: 2.5rem;
    border-bottom: 1px solid var(--border);
}

.index-title {
    margin: 0;
}

.index-lede {
    margin: 0;
    max-width: 34em;
    font-size: clamp(1.1rem, 1.5vw, 1.35rem);
    line-height: 1.55;
    color: var(--text-primary);
}

/* Cards are real links now (crawlable, open in new tab, etc.) */
a.project-card {
    display: block;
    text-decoration: none;
    color: inherit;
}

.project-card-image img {
    transition: transform 0.6s var(--transition);
}

a.project-card:hover .project-card-image img {
    transform: scale(1.03);
}

.project-card-tags {
    margin: 0.9rem 0 0;
    font-size: 0.72rem;
    line-height: 1.6;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: var(--text-secondary);
    transition: color 0.3s;
}

a.project-card:hover .project-card-tags {
    color: var(--accent);
}

/* ── Project / photography page ──────────────────────────── */

.work {
    max-width: 1400px;
    padding-top: 2rem;
}

.work-crumb {
    margin: 0 0 1rem;
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.18em;
}

.work-crumb a {
    color: var(--text-secondary);
    text-decoration: none;
    transition: color 0.3s;
}

.work-crumb a::before {
    content: '← ';
}

.work-crumb a:hover {
    color: var(--accent);
}

/* The labels stay beside the title, against the photo's right edge. As the
   window narrows, they go onto more lines before the title does */
.work-head {
    display: grid;
    grid-template-columns: auto minmax(13rem, 1fr);
    align-items: end;
    gap: 1.5rem 2.5rem;
    margin-bottom: 1.5rem;
}

.work-title {
    margin: 0;
    font-size: clamp(2.5rem, 6vw, 4.5rem);
}

/* The discipline labels: the "one person did all of this" line */
.work-tags {
    --dot: 1.4em;
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    /* Every label has a dot after it. The last one on each line is cut off */
    margin: 0 calc(-1 * var(--dot)) 0 0;
    clip-path: inset(0 var(--dot) 0 0);
    font-size: 0.75rem;
    line-height: 1.7;
    text-align: right;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: var(--text-secondary);
}

/* Each label stays in one piece */
.work-tags span {
    position: relative;
    padding-right: var(--dot);
}

.work-tags span::after {
    content: '·';
    content: '·' / '';
    position: absolute;
    right: 0;
    bottom: 0;
    width: var(--dot);
    text-align: center;
    letter-spacing: 0;
}

.work-hero {
    margin: 0 0 2.5rem;
}

.work-hero img,
.work-row img {
    display: block;
    width: 100%;
    height: auto;
    background: var(--bg-secondary);
}

.work-intro {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 2fr);
    gap: 4rem;
    padding-bottom: 3rem;
    margin-bottom: 3rem;
    border-bottom: 1px solid var(--border);
}

.work-meta {
    display: grid;
    gap: 1rem;
    margin: 0;
    align-content: start;
}

.work-meta dt,
.work-label,
.work-credits span,
.work-section-meta {
    font-size: 0.68rem;
    font-weight: 400;
    text-transform: uppercase;
    letter-spacing: 0.16em;
    color: var(--text-secondary);
}

.work-meta dd {
    margin: 0;
    font-size: 0.95rem;
    line-height: 1.5;
    color: var(--text-primary);
}

.work-lede p:first-child {
    font-size: clamp(1.15rem, 1.6vw, 1.45rem);
    line-height: 1.55;
    color: var(--text-primary);
}

.work-credits {
    font-size: 0.85rem;
    line-height: 1.6;
}

.work-credits span {
    margin-right: 0.5rem;
}

.work-label {
    line-height: 1.4;
    margin-bottom: 2rem;
}

/* Experience pages: work done at another firm, credited to the firm */
.work-attribution {
    margin: 0;
    font-size: 0.85rem;
    letter-spacing: 0.04em;
    color: var(--text-secondary);
    text-align: right;
}

.work-attribution strong {
    font-weight: 400;
    color: var(--text-primary);
}

.work-scope .work-label,
.work-related .work-label {
    margin-bottom: 1.25rem;
}

.work-myrole {
    margin: 0.5rem 0 0.5rem;
}

.work-myrole .work-label {
    margin-bottom: 0.6rem;
}

.work-myrole p {
    font-size: 0.95rem;
    line-height: 1.7;
    color: var(--text-primary);
}

/* Scope: numbered so the page reads as a sequence, first sketch to final photo */
.work-scope {
    margin-bottom: 3rem;
}

.work-scope ol {
    list-style: none;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 2rem 3rem;
}

.work-scope li {
    padding-top: 1rem;
    border-top: 1px solid rgba(26, 25, 21, 0.25);
}

.work-step {
    display: block;
    margin-bottom: 0.5rem;
    font-size: 0.75rem;
    letter-spacing: 0.1em;
    color: var(--accent);
}

.work-scope h3 {
    margin-bottom: 0.5rem;
    font-size: 0.85rem;
    color: var(--text-primary);
}

.work-scope p {
    margin: 0;
    font-size: 0.92rem;
    line-height: 1.6;
}

/* Gallery: landscapes full width, portraits paired side by side */
.work-gallery {
    display: grid;
    gap: 1.5rem;
    margin-bottom: 3rem;
}

.work-row--pair {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
}

.work-row--portrait img {
    width: auto;
    max-width: 100%;
    max-height: 92vh;
    margin: 0 auto;
}

/* Project gallery. tools/gallery-layout.mjs works out where each photo
   goes, once for computers and once for phones (the --m… values). Everything is
   a share of the gallery's width, so it's cropped the same at any screen size */
.work-gallery--sized {
    display: block;
    position: relative;
    aspect-ratio: var(--shape);
}

.work-tile {
    position: absolute;
    left: var(--x);
    top: var(--y);
    width: var(--w);
    height: var(--h);
}

.work-tile a.work-zoom,
.work-tile img,
.work-tile .work-video {
    display: block;
    width: 100%;
    height: 100%;
    max-width: none !important; /* a tall video sets its own limit */
}

.work-tile img {
    object-fit: cover;
    background: var(--bg-secondary);
}

@media (max-width: 768px) {
    .work-gallery--sized {
        aspect-ratio: var(--mshape);
    }

    .work-tile {
        left: var(--mx);
        top: var(--my);
        width: var(--mw);
        height: var(--mh);
    }
}

/* Sub-projects (e.g. each court under Buckets & Borders) */
.work-section {
    padding-top: 3rem;
    border-top: 1px solid var(--border);
}

.work-section-head {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 2fr);
    gap: 4rem;
    margin-bottom: 1.5rem;
}

.work-section-head h2 {
    margin: 0;
    font-size: clamp(1.5rem, 3vw, 2.2rem);
}

.work-section-meta {
    margin-bottom: 1rem;
}

.work-section-head p {
    line-height: 1.65;
}

.work-related {
    padding-top: 3rem;
    border-top: 1px solid var(--border);
}

.work-related .projects-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    margin-bottom: 0;
}

@media (max-width: 768px) {
    .work-index,
    .work {
        padding-top: 2rem;
    }

    .index-head,
    .work-intro,
    .work-section-head {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }

    .index-head {
        margin-bottom: 2.5rem;
        padding-bottom: 2rem;
    }

    /* Phones: below the title, on the left */
    .work-head {
        grid-template-columns: minmax(0, 1fr);
    }

    /* The dots go before the labels, so the first one on each line is cut off */
    .work-tags {
        justify-content: flex-start;
        margin: 0 0 0 calc(-1 * var(--dot));
        clip-path: inset(0 0 0 var(--dot));
    }

    .work-tags span {
        padding: 0 0 0 var(--dot);
    }

    .work-tags span::after {
        right: auto;
        left: 0;
        top: 0;
        bottom: auto;
    }

    .work-tags,
    .work-attribution {
        text-align: left;
    }

    .work-hero {
        margin-bottom: 2.5rem;
    }

    .work-intro {
        padding-bottom: 3rem;
        margin-bottom: 3rem;
    }

    .work-gallery,
    .work-row--pair {
        gap: 0.75rem;
    }

    .work-gallery {
        margin-bottom: 3rem;
    }

    .work-row--portrait img {
        max-height: none;
    }

    .work-related .projects-grid {
        grid-template-columns: 1fr;
    }
}

.work-meta dd a {
    color: var(--text-primary);
    text-decoration-color: var(--accent);
    text-underline-offset: 0.2em;
}

.work-meta dd a:hover {
    color: var(--accent);
}

/* ── Work filters (/work/ and /work/<discipline>/) ──────── */

.work-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem 1.75rem;
    margin: -2rem 0 2rem;
}

/* Work + filter pages have no visible heading: the filter row comes first,
   and the highlighted filter says where you are */
.work-index--grid {
    padding-top: 1.75rem;
}

.work-index--grid .work-filters {
    margin-top: 0;
}

.work-filter {
    --pad: 0.35rem; /* keeps the tap area bigger than the word */
    position: relative;
    padding: var(--pad) 0 calc(var(--pad) + 1px);
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.16em;
    color: var(--text-secondary);
    text-decoration: none;
    transition: color 0.3s;
}

/* Underline: just below the letters, inside the padding, and stopping at the
   last letter (not at the letter-spacing after it) */
.work-filter::after {
    content: '';
    position: absolute;
    right: 0.16em;
    bottom: calc(var(--pad) + 1px);
    left: 0;
    border-bottom: 1px solid transparent;
    transition: border-color 0.3s;
}

.work-filter:hover {
    color: var(--accent);
}

.work-filter.is-active {
    color: var(--text-primary);
}

.work-filter.is-active::after {
    border-bottom-color: var(--accent);
}

@media (max-width: 768px) {
    .work-index--grid {
        padding-top: 1.5rem;
    }

    /* Filters are one line that swipes sideways, out to the screen's edges. Words
       fade out on the right to show there are more (and on the left once swiped).
       Each link is about 44px tall; the margins leave 24px between the words and
       the header line, and the words and the first photo, like the sides. They
       were measured on screen, so check a screenshot after changing them */
    .work-filters,
    .work-index--grid .work-filters {
        --fade: 1.5rem; /* the page's script widens it while there's more to the right */
        position: relative; /* the page's script measures from here */
        flex-wrap: nowrap;
        gap: 1.25rem;
        margin: calc(6px - 1.5rem) -1.5rem 6px;
        padding-left: 1.5rem;
        overflow-x: auto;
        overscroll-behavior-x: contain;
        scrollbar-width: none;
        -webkit-mask-image: linear-gradient(to right, transparent, #000 1.5rem, #000 calc(100% - var(--fade)), transparent);
        mask-image: linear-gradient(to right, transparent, #000 1.5rem, #000 calc(100% - var(--fade)), transparent);
    }

    .work-filters::-webkit-scrollbar {
        display: none;
    }

    /* Room at the end (with the gap before it, 1.5rem), so the last word
       finishes in line with the photos */
    .work-filters::after {
        content: '';
        flex: 0 0 0.25rem;
    }

    /* Cards sit close together on phones, to keep scrolling short */
    .work-index--grid .projects-grid,
    .work-related .projects-grid {
        gap: 1rem;
    }

    .project-card-tags {
        margin-top: 0.5rem;
        line-height: 1.45;
    }

    .work-filter {
        --pad: 0.75rem;
        flex: none;
        font-size: 0.7rem;
        line-height: 1.2rem;
        letter-spacing: 0.12em;
        white-space: nowrap;
    }

    .work-filter::after {
        right: 0.12em;
    }

    .work-filter:focus-visible {
        outline-offset: -2px; /* the strip would cut off an outline outside the link */
    }
}

/* Fixed card grid: every card keeps two lines of space for its tags, used or
   not, so rows of photos are always the same distance apart. It's a set height
   (not a minimum), so a rare third line sits in the row gap instead of moving
   the grid. Phones show one column and keep their tighter spacing above */
@media (min-width: 769px) {
    .projects-grid {
        row-gap: 1.5rem;
    }

    .project-card-tags {
        margin-top: 0.75rem;
        line-height: 1.5;
        height: 3em; /* 2 lines x 1.5 */
    }
}

/* ── Full-screen photo viewer (src/viewer.js) ────────────── */

a.work-zoom {
    display: block;
    cursor: zoom-in;
}

.work-row--portrait a.work-zoom {
    width: fit-content;
    max-width: 100%;
    margin: 0 auto;
}

a.work-zoom:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 4px;
}

html.viewer-open {
    overflow: hidden;
}

.viewer {
    position: fixed;
    inset: 0;
    z-index: 300;
    background: #0c0c0a;
    animation: fadeIn 0.25s var(--transition);
}

.viewer[hidden] {
    display: none;
}

.viewer-stage {
    position: absolute;
    inset: 3.5rem 4.5rem;
    margin: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.viewer-img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    cursor: default;
}

/* The "+" arrows reuse .carousel-arrow from styles.css; a bit larger here */
.viewer .carousel-arrow {
    font-size: 2.25rem;
}

.viewer .carousel-arrow--prev {
    left: 1rem;
}

.viewer .carousel-arrow--next {
    right: 1rem;
}

.viewer-close {
    position: absolute;
    top: 0.75rem;
    right: 1rem;
    z-index: 2;
    width: 44px;
    height: 44px;
    padding: 0;
    background: none;
    border: none;
    cursor: pointer;
    font-family: inherit;
    font-size: 2rem;
    font-weight: 300;
    line-height: 1;
    color: #fff;
    transition: color 0.3s;
}

.viewer-close:hover {
    color: var(--accent);
}

.viewer-close:focus-visible,
.viewer .carousel-arrow:focus-visible {
    outline: 1px solid rgba(255, 255, 255, 0.6);
}

.viewer-counter {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 1rem;
    margin: 0;
    text-align: center;
    font-size: 0.75rem;
    letter-spacing: 0.18em;
    color: rgba(255, 255, 255, 0.7);
}

@media (max-width: 768px) {
    .viewer-stage {
        inset: 3.5rem 0.5rem;
    }

    .viewer .carousel-arrow {
        top: auto;
        bottom: 0.25rem;
        transform: none;
    }
}

/* ── Journal (dated posts; /journal/ shows the recent ones in full) ── */

.journal-post {
    margin-bottom: 3rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border);
}

.journal-post-head {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 2fr);
    gap: 4rem;
    margin-bottom: 2.5rem;
}

.journal-date {
    margin: 0 0 0.75rem;
    font-size: 0.68rem;
    line-height: 1.6;
    text-transform: uppercase;
    letter-spacing: 0.16em;
    color: var(--text-secondary);
}

.journal-title {
    margin: 0;
    font-size: clamp(1.6rem, 3.2vw, 2.4rem);
    line-height: 1.15;
}

.work--journal .journal-title {
    font-size: clamp(2.2rem, 5vw, 3.6rem);
}

.journal-title a {
    color: inherit;
    text-decoration: none;
    transition: color 0.3s;
}

.journal-title a:hover {
    color: var(--accent);
}

.journal-note p {
    margin: 0 0 1em;
    max-width: 38em;
    font-size: 1.05rem;
    line-height: 1.7;
    color: var(--text-primary);
}

.journal-note p:last-child {
    margin-bottom: 0;
}

.journal-post .work-gallery {
    margin-bottom: 1.75rem;
}

.journal-more {
    margin: 0 0 2rem;
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.16em;
}

.journal-more a,
.journal-archive a,
.journal-pager a {
    color: var(--text-secondary);
    text-decoration: none;
    transition: color 0.3s;
}

.journal-more a:hover,
.journal-archive a:hover,
.journal-pager a:hover {
    color: var(--accent);
}

.journal-archive ul {
    list-style: none;
    margin: 0;
    padding: 0;
}

.journal-archive li {
    border-top: 1px solid var(--border);
}

.journal-archive a {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 2fr);
    gap: 4rem;
    padding: 0.9rem 0;
    color: var(--text-primary);
}

.journal-archive time {
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.14em;
    color: var(--text-secondary);
}

.journal-pager {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
    padding-top: 3rem;
    border-top: 1px solid var(--border);
}

.journal-pager a {
    font-size: 1.1rem;
    line-height: 1.4;
    color: var(--text-primary);
}

.journal-pager span {
    display: block;
    margin-bottom: 0.4rem;
    font-size: 0.68rem;
    text-transform: uppercase;
    letter-spacing: 0.16em;
    color: var(--text-secondary);
}

.journal-pager-older {
    grid-column: 2;
    text-align: right;
}

@media (max-width: 768px) {
    .journal-post-head,
    .journal-archive a {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    .journal-archive a {
        gap: 0.2rem;
    }

    .journal-post {
        margin-bottom: 3rem;
    }

    .journal-pager {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }

    .journal-pager-older {
        grid-column: 1;
        text-align: left;
    }
}

/* Journal post about a piece of work: link to the full project */
.journal-work {
    display: flex;
    align-items: center;
    gap: 1.25rem;
    max-width: 34rem;
    margin: 0 0 1.75rem;
    padding: 0.75rem;
    border: 1px solid var(--border);
    color: var(--text-primary);
    text-decoration: none;
    transition: border-color 0.3s, color 0.3s;
}

.journal-work:hover {
    border-color: var(--accent);
    color: var(--accent);
}

.journal-work img {
    flex-shrink: 0;
    width: 96px;
    height: 72px;
    object-fit: cover;
}

.journal-work-label {
    display: block;
    margin-bottom: 0.2rem;
    font-size: 0.68rem;
    text-transform: uppercase;
    letter-spacing: 0.16em;
    color: var(--text-secondary);
}

.work--journal .journal-work {
    margin-top: -2rem;
    margin-bottom: 4rem;
}

/* "From the journal" on a work page */
.work-journal {
    padding-top: 3rem;
    margin-bottom: 3rem;
    border-top: 1px solid var(--border);
}

.work-journal ul {
    list-style: none;
    margin: 0;
    padding: 0;
}

.work-journal li {
    border-top: 1px solid var(--border);
}

.work-journal a {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 2fr);
    gap: 4rem;
    padding: 0.9rem 0;
    color: var(--text-primary);
    text-decoration: none;
    transition: color 0.3s;
}

.work-journal a:hover {
    color: var(--accent);
}

.work-journal time {
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.14em;
    color: var(--text-secondary);
}

@media (max-width: 768px) {
    .work-journal a {
        grid-template-columns: 1fr;
        gap: 0.2rem;
    }

    .work--journal .journal-work {
        margin-top: -1rem;
        margin-bottom: 3rem;
    }
}

/* Embedded Vimeo / YouTube videos (in the gallery or at the top of a page) */
.work-video {
    position: relative;
    width: 100%;
    margin: 0 auto;
    background: #0c0c0a;
}

.work-video iframe {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    border: 0;
}

/* ── Journal carousel (src/carousel.js) ──────────────────── */
/* Photos sit side by side at one height, each at its own shape, and scroll sideways */

.jc {
    position: relative;
    margin-bottom: 1.75rem;
}

.work--journal .jc {
    margin-bottom: 4rem;
}

.jc-track {
    --jc-h: clamp(320px, 72vh, 820px);
    display: flex;
    align-items: center;
    gap: 0.75rem;
    overflow-x: auto;
    overscroll-behavior-x: contain;
    scroll-snap-type: x mandatory;
    scrollbar-width: none;
}

.jc-track::-webkit-scrollbar {
    display: none;
}

@media (prefers-reduced-motion: no-preference) {
    .jc-track {
        scroll-behavior: smooth;
    }
}

.jc-track:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 4px;
}

.jc-slide {
    flex: 0 0 auto;
    scroll-snap-align: start;
}

.jc-slide img {
    display: block;
    width: auto;
    height: var(--jc-h);
    max-width: none;
    background: var(--bg-secondary);
}

.jc-slide .work-video {
    width: auto;
    height: var(--jc-h);
    max-width: none !important;
}

.jc .carousel-arrow[hidden] {
    display: none;
}

.jc-meta {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 1.5rem;
    margin-top: 0.75rem;
}

.jc-counter,
.jc-note {
    margin: 0;
    font-size: 0.68rem;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: var(--text-secondary);
}

.jc-counter {
    flex-shrink: 0;
}

.jc-counter[hidden] {
    visibility: hidden;
}

.jc-note--gallery {
    margin: -1rem 0 1.75rem;
}

/* Journal: one page, each post is title, then note, then photos */
.journal .journal-title {
    margin-bottom: 1.25rem;
}

.journal .journal-note {
    margin-bottom: 2rem;
}

.journal-post {
    scroll-margin-top: 6rem;
}

/* "Inquire about a print" in the full-screen viewer (journal photos) */
.viewer-print {
    position: absolute;
    right: 1.25rem;
    bottom: 0.9rem;
    z-index: 2;
    padding: 0.4rem 0;
    font-size: 0.72rem;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: #fff;
    text-decoration: none;
    border-bottom: 1px solid rgba(255, 255, 255, 0.5);
    transition: color 0.3s, border-color 0.3s;
}

.viewer-print:hover {
    color: var(--accent);
    border-color: var(--accent);
}

.viewer-print[hidden] {
    display: none;
}

@media (max-width: 768px) {
    .jc-track {
        gap: 0.5rem;
    }

    .jc-slide img {
        height: auto;
        max-width: 88vw;
        max-height: 70vh;
    }

    .jc-slide .work-video {
        width: 88vw;
        height: auto;
    }
}

@media (max-width: 768px) {
    /* Phones: in the dark bar at the top, level with the ×, clear of the photo */
    .viewer-print {
        top: 0.75rem;
        right: auto;
        bottom: auto;
        left: 1rem;
        height: 44px;
        display: flex;
        align-items: center;
        padding: 0;
        border-bottom: none;
        text-decoration: underline;
        text-decoration-color: rgba(255, 255, 255, 0.45);
        text-underline-offset: 0.35em;
        white-space: nowrap;
    }

    .jc-meta {
        flex-direction: column-reverse;
        gap: 0.5rem;
    }

    .jc-counter {
        align-self: flex-end;
    }
}

/* ── Project header carousel (same script as the journal: src/carousel.js) ── */
/* One photo at a time. Every photo fills the full width of the frame and is
   cropped evenly from the centre. The frame is the shape of the first photo
   (3:2 if that one is vertical), up to 85% of the window height. The gallery
   further down and the full-screen viewer show the whole photo */

.jc--hero {
    margin-bottom: 2.5rem;
}

.jc--hero .jc-track {
    gap: 0;
}

.jc--hero .jc-slide {
    flex: 0 0 100%;
    aspect-ratio: var(--hero-ratio);
    max-height: 85vh;
}

.jc--hero .jc-slide a.work-zoom {
    width: 100%;
    height: 100%;
}

.jc--hero .jc-slide img {
    width: 100%;
    height: 100%;
    max-width: none;
    max-height: none;
    object-fit: cover;
}

/* Centre the arrows on the photo, not on photo + counter */
.jc--hero .carousel-arrow {
    top: calc(50% - 1rem);
}

@media (max-width: 768px) {
    .jc--hero {
        margin-bottom: 2.5rem;
    }

    .jc--hero .jc-meta {
        flex-direction: row;
    }
}

/* ── Project pages on phones: tighter vertical spacing ───── */
/* Last in the file so it wins over the phone rules above. `.work` is only on
   project and experience pages, so the Work grid and Journal aren't affected */

@media (max-width: 768px) {
    .work {
        padding-top: 1.25rem;
        padding-bottom: 0;
    }

    .work .work-crumb {
        margin-bottom: 0.75rem;
    }

    .work .work-head {
        gap: 0.75rem;
        margin-bottom: 1.25rem;
    }

    .work .work-hero,
    .work .jc--hero {
        margin-bottom: 1.5rem;
    }

    .work .jc--hero .jc-meta {
        margin-top: 0.5rem;
    }

    .work .work-intro {
        gap: 1.5rem;
        padding-bottom: 1.75rem;
        margin-bottom: 1.75rem;
    }

    .work .work-meta {
        gap: 0.75rem;
    }

    .work .work-lede p,
    .work .work-section-head p {
        margin-bottom: 1rem;
    }

    .work .work-section-head .work-section-meta {
        margin-bottom: 0.5rem;
    }

    .work .work-lede > :last-child,
    .work .work-section-head p:last-child {
        margin-bottom: 0;
    }

    .work .work-scope .work-label,
    .work .work-related .work-label {
        margin-bottom: 1rem;
    }

    .work .work-scope {
        margin-bottom: 2rem;
    }

    .work .work-scope ol {
        gap: 1.25rem;
    }

    .work .work-scope li {
        padding-top: 0.75rem;
    }

    .work .work-step,
    .work .work-scope h3 {
        margin-bottom: 0.25rem;
    }

    .work .work-gallery {
        margin-bottom: 2rem;
    }

    .work .work-section,
    .work .work-related {
        padding-top: 2rem;
    }

    .work .work-section-head {
        gap: 0.75rem;
        margin-bottom: 1.25rem;
    }
}

/* ── Focus points (set on a cover in the editor) ─────────── */
/* Centres a cropped photo on its focus point (--fx across, --fy down, as 0–1),
   stopping at the photo's edges so the frame is always filled. --ar is the
   photo's width / height; its frame needs .focal-frame, so cqw/cqh are the
   frame's own width and height. tools/editor/editor.css has the same sums for
   its previews. Browsers without cqw crop from the centre instead */

.focal-frame {
    container-type: size;
}

@supports (width: 1cqw) {
    img.has-focus {
        --photo-w: max(100cqw, 100cqh * var(--ar));
        --photo-h: max(100cqh, 100cqw / var(--ar));
        object-position:
            clamp(100cqw - var(--photo-w), 50cqw - var(--photo-w) * var(--fx), 0px)
            clamp(100cqh - var(--photo-h), 50cqh - var(--photo-h) * var(--fy), 0px);
    }
}

/* ── Press ───────────────────────────────────────────────── */

.press-award {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 2fr);
    gap: 4rem;
    align-items: start;
    margin-bottom: 2.5rem;
    scroll-margin-top: 140px; /* clear of the sticky header */
}

.press-award figure {
    margin: 0;
}

.press-award img {
    display: block;
    width: 100%;
    height: auto;
    background: var(--bg-secondary);
}

.press-award .work-label {
    margin-bottom: 1rem;
}

.press-award h2 {
    margin: 0 0 0.5rem;
    font-size: clamp(1.5rem, 2.2vw, 2.1rem);
    line-height: 1.2;
    text-wrap: balance;
}

.press-award .press-photo-title {
    margin-bottom: 1.5rem;
    font-size: 1.1rem;
    color: var(--text-primary);
}

.press-award-text p {
    line-height: 1.65;
}

.press-links {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem 1.75rem;
    margin: 1.5rem 0 0;
}

.press-links a,
.press-list a {
    color: var(--text-primary);
    text-decoration-color: var(--accent);
    text-underline-offset: 0.2em;
    transition: color 0.3s;
}

.press-links a:hover,
.press-list a:hover {
    color: var(--accent);
}

.press-list .work-label {
    margin-bottom: 1rem;
}

.press-list ul {
    margin: 0 0 2.5rem;
    padding: 0;
    list-style: none;
}

.press-list li {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) minmax(0, 1fr);
    gap: 4rem;
    padding: 0.9rem 0;
    border-top: 1px solid var(--border);
}

.press-year {
    color: var(--text-secondary);
}

@media (max-width: 768px) {
    .press-award {
        grid-template-columns: 1fr;
        gap: 1.5rem;
        margin-bottom: 2rem;
        scroll-margin-top: 110px;
    }

    .press.work-index {
        padding-top: 1.5rem;
    }

    .press .index-head {
        gap: 0.4rem;
        padding-bottom: 1.25rem;
        margin-bottom: 1.5rem;
    }

    .press-award .work-label {
        margin-bottom: 0.6rem;
    }

    .press-award .press-photo-title {
        margin-bottom: 1rem;
    }

    .press-links {
        margin-top: 1rem;
    }

    /* Photo first */
    .press-award figure {
        order: -1;
    }

    .press-list li {
        grid-template-columns: 1fr;
        gap: 0.2rem;
    }
}
