/*
 * Restyle component styles. Loaded after style.css / mobile.css.
 *
 * Everything here is scoped to a page or component root, so it has no effect
 * on pages that have not been migrated yet. Add a section per page as it moves
 * across; delete the matching rules from style.css when it does.
 */

/* ==========================================================================
   Button
   ========================================================================== */

/* Figma trims text boxes to cap height, so its 33px button is 12 + 9 + 12.
   CSS uses the full 18px line box, which would make the same padding 42px.
   Setting the height explicitly keeps it at the designed 33px. */
.g-button {
    display: inline-flex;
    align-items: center;
    height: var(--g-button-height);
    padding: 0 16px;
    border: 0;
    border-radius: var(--g-radius);
    background: var(--g-surface-alt);
    color: var(--g-ink);
    font-family: var(--g-font);
    font-size: var(--g-button);
    line-height: var(--g-button-lh);
    text-decoration: none;
    white-space: nowrap;
    cursor: pointer;
}

.g-button:hover {
    background: var(--g-surface-alt-hover);
}

.g-button--primary {
    background: var(--g-accent);
    color: var(--g-on-accent);
}

.g-button--primary:hover {
    background: var(--g-accent);
}


/* ==========================================================================
   Paging dots — the product hero and the exhibition sliders
   ========================================================================== */

.g-dots {
    display: flex;
    gap: var(--g-dot-gap);
}

.g-dot {
    width: var(--g-dot-size);
    height: var(--g-dot-size);
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: var(--g-ink-faint);
    cursor: pointer;
    transition: background 0.2s ease;
}

.g-dot.is-active {
    background: var(--g-ink);
}

/* Sitting over an image, the dots invert. */
.g-dots--on-image .g-dot {
    background: rgba(255, 255, 255, 0.4);
}

.g-dots--on-image .g-dot.is-active {
    background: var(--g-on-image);
}

/* ==========================================================================
   Split section — heading in column one, content in the rest
   Used by the Stockroom collections, Product, Artist and Exhibitions.
   ========================================================================== */

.g-split {
    display: flex;
    align-items: flex-start;
    gap: var(--g-gap);
}

.g-split-heading {
    flex: 0 0 calc((100% - (var(--g-columns) - 1) * var(--g-gap)) / var(--g-columns));
    margin: 0;
    font-weight: var(--g-weight-medium);
    font-size: var(--g-heading);
    line-height: var(--g-heading-lh);
    letter-spacing: var(--g-heading-tracking);
}

/* The muted second line of a two-line heading. */
.g-heading-sub {
    display: block;
    color: var(--g-ink-faint);
}

.g-split-info {
    flex: 1 1 0;
    min-width: 0;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: var(--g-block-gap);
}

.g-body-text {
    margin: 0;
    font-size: var(--g-body);
    line-height: var(--g-body-lh);
    white-space: pre-wrap;
}

/* ==========================================================================
   Work card — the Stockroom grid, and reused by the works grids later
   ========================================================================== */

.work-card {
    display: block;
    color: inherit;
    text-decoration: none;
}

.work-card-image {
    position: relative;
    aspect-ratio: var(--g-card-aspect);
    overflow: hidden;
    background: var(--g-surface-alt);
}

.work-card-image img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.work-card-meta {
    display: flex;
    justify-content: space-between;
    gap: var(--g-gap);
    margin-top: var(--g-card-meta-gap);
    font-size: var(--g-meta);
    line-height: var(--g-meta-lh);
}

/* The muted line sits above the primary one in each corner of the card. */
.work-card-meta-label {
    display: block;
    color: var(--g-ink-muted);
}

.work-card-meta-end {
    max-width: 50%;
    text-align: right;
}

/* Materials can run long; clip rather than wrap under the dimensions. */
.work-card-meta-end .work-card-meta-label {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* ==========================================================================
   The Stockroom
   ========================================================================== */

.stockroom {
    background: var(--g-surface);
    color: var(--g-ink);
    font-family: var(--g-font);
    font-weight: var(--g-weight-regular);

    /* Initial space above the filter bar. This lives on the page rather than
       as padding on the bar itself so the bar stays compact once it sticks —
       in Figma the 220px is baked into the sticky element, which would leave a
       284px bar pinned to the viewport. */
    padding-top: calc(var(--g-filters-offset) - 20px);
}

/* Filters ---------------------------------------------------------------- */

.stockroom-filters {
    position: sticky;
    top: 0;
    z-index: 5;
    display: flex;
    align-items: flex-end;
    gap: var(--g-gap);
    padding: 20px var(--g-gutter);
    background: var(--g-surface);
    border-bottom: 1px solid var(--g-surface-alt);
}

.stockroom-title {
    flex: 0 0 calc((100% - (var(--g-columns) - 1) * var(--g-gap)) / var(--g-columns));
    margin: 0;
    font-weight: var(--g-weight-medium);
    font-size: var(--g-heading);
    line-height: var(--g-heading-lh);
    letter-spacing: var(--g-heading-tracking);
}

.stockroom-filter {
    flex: 1 1 0;
    min-width: 0;
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    font-weight: var(--g-weight-medium);
    font-size: var(--g-filter);
    line-height: var(--g-filter-lh);
    letter-spacing: var(--g-filter-tracking);
    white-space: nowrap;
}

.stockroom-filter-artists {
    display: flex;
    align-items: center;
    gap: 10px;
    text-align: right;
}

.stockroom-filter-artist {
    padding: 0;
    border: 0;
    background: none;
    font: inherit;
    letter-spacing: inherit;
    color: var(--g-ink-faint);
    cursor: pointer;
}

.stockroom-filter-artist:hover,
.stockroom-filter-artist.is-active {
    color: var(--g-ink);
}

/* Collections ------------------------------------------------------------ */

/* The topmost collection sits closer to the filters than the rest.
   Keyed off "has a visible collection above it" rather than :first-of-type,
   because filtering hides collections with [hidden] without moving them:
   :first-of-type would keep the full gap on whatever showed first after a
   filter, and the heading would jump. */
.stockroom-collection {
    padding-top: var(--g-collection-gap-first);
}

.stockroom-collection:not([hidden]) ~ .stockroom-collection:not([hidden]) {
    padding-top: var(--g-collection-gap);
}

.stockroom-collection[hidden] {
    display: none;
}

.stockroom-collection-header {
    display: flex;
    align-items: flex-start;
    gap: var(--g-gap);
    padding-inline: var(--g-gutter);
}

.stockroom-collection-heading {
    flex: 0 0 calc((100% - (var(--g-columns) - 1) * var(--g-gap)) / var(--g-columns));
    margin: 0;
    font-weight: var(--g-weight-medium);
    font-size: var(--g-heading);
    line-height: var(--g-heading-lh);
    letter-spacing: var(--g-heading-tracking);
}

.stockroom-collection-artist {
    display: block;
    color: var(--g-ink-faint);
}

.stockroom-collection-info {
    flex: 1 1 0;
    min-width: 0;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: var(--g-block-gap);
}

.stockroom-collection-description {
    margin: 0;
    font-size: var(--g-body);
    line-height: var(--g-body-lh);
    white-space: pre-wrap;
}

/* Buttons are shared across pages — see the .g-button block at the top. */

/* Works ------------------------------------------------------------------ */

.stockroom-works {
    padding: var(--g-block-gap) var(--g-gutter) 0;
}

/* Same cap-height compensation as .g-section-heading. */
.stockroom-works-heading {
    margin: 0 0 calc(var(--g-gap) - 0.16em);
    font-weight: var(--g-weight-medium);
    font-size: var(--g-heading);
    line-height: var(--g-heading-lh);
    letter-spacing: var(--g-heading-tracking);
}

.stockroom-works-grid {
    display: grid;
    grid-template-columns: repeat(var(--g-columns), minmax(0, 1fr));
    column-gap: var(--g-card-gap);
    row-gap: calc(var(--g-card-gap) + 20px);
}

@media (max-width: 768px) {
    .stockroom-filters {
        flex-direction: column;
        align-items: flex-start;
        gap: var(--g-block-gap);
    }

    .stockroom-filter {
        width: 100%;
    }

    .stockroom-filter-artists {
        flex-direction: column;
        /* The block stays right; its labels read left. */
        align-items: flex-start;
        text-align: left;
        /* Design pitch is 26px between cap heights. The 24.2px line box eats
           most of that, so the gap itself is what is left over. */
        gap: calc(26px - var(--g-filter) * var(--g-filter-lh));
    }

    .stockroom-collection-header {
        flex-direction: column;
        gap: var(--g-block-gap);
    }

    /* Cards run edge to edge on mobile while the copy keeps its gutter. */
    .stockroom-works-grid {
        margin-inline: calc(-1 * var(--g-gutter));
    }

    .work-card-meta {
        padding-inline: var(--g-gutter);
    }
}

/* ==========================================================================
   Product (a Work entry)
   ========================================================================== */

.product {
    background: var(--g-surface);
    color: var(--g-ink);
    font-family: var(--g-font);
    font-weight: var(--g-weight-regular);
}

/* Hero ------------------------------------------------------------------- */

.product-hero {
    display: flex;
    align-items: stretch;
    min-height: 100vh;
}

.product-panel {
    flex: 0 0 var(--g-panel-width);
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    padding: var(--g-panel-offset) var(--g-gutter) var(--g-gutter);
}

.product-title {
    margin: 0;
    font-weight: var(--g-weight-medium);
    font-size: var(--g-heading);
    line-height: var(--g-heading-lh);
    letter-spacing: var(--g-heading-tracking);
}

.product-description {
    margin: 33px 0 0;
    font-size: var(--g-body);
    line-height: var(--g-body-lh);
}

/* Artist on the left; year and edition sit together against the right edge,
   which is what puts the year at 412px in the 614px panel. */
.product-meta {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: var(--g-gap);
    width: 100%;
    margin-top: 97px;
    font-weight: var(--g-weight-medium);
    font-size: var(--g-filter);
    line-height: var(--g-filter-lh);
    letter-spacing: var(--g-filter-tracking);
    color: var(--g-ink-faint);
}

.product-meta a {
    color: inherit;
    text-decoration: none;
}

.product-meta-group {
    display: flex;
    gap: 68px;
}

.product-meta-year {
    color: var(--g-ink);
}

/* Details block, ruled top and bottom ------------------------------------ */

.product-details {
    display: flex;
    justify-content: space-between;
    gap: var(--g-gap);
    width: 100%;
    /* The rules sit 216px apart in the design, which is taller than the two
       specs need; the price hangs off the bottom of that space. */
    min-height: 176px;
    margin-top: 17px;
    padding: var(--g-gap) 0;
    border-top: 1px solid var(--g-surface-alt);
    border-bottom: 1px solid var(--g-surface-alt);
    font-size: var(--g-spec);
    line-height: var(--g-spec-lh);
}

.product-specs {
    margin: 0;
}

/* Each spec is a label above its value. */
.product-spec + .product-spec {
    margin-top: var(--g-spec-lh);
}

.product-spec-label {
    display: block;
    color: var(--g-ink-muted);
}

.product-spec-value {
    display: block;
    white-space: pre-line;
}

.product-price {
    align-self: flex-end;
    font-weight: var(--g-weight-medium);
    font-size: var(--g-filter);
    line-height: var(--g-filter-lh);
    letter-spacing: var(--g-filter-tracking);
    color: var(--g-ink-faint);
    text-align: right;
    white-space: nowrap;
}

/* Bottom row: tearsheet left, buttons right. */
.product-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--g-gap);
    width: 100%;
    margin-top: var(--g-gap);
}

.product-buttons {
    display: flex;
    gap: 10px;
}

.product-tearsheet {
    font-size: var(--g-caption);
    line-height: var(--g-caption-lh);
    color: var(--g-ink-muted);
    text-decoration: underline;
}

/* Hero media — native scroll-snap, so touch and trackpad work without JS.
   JS only mirrors scroll position onto the indicator. */

.product-media {
    position: relative;
    flex: 1 1 0;
    min-width: 0;
}

.product-media-track {
    height: 100vh;
    overflow-y: auto;
    scroll-snap-type: y mandatory;
    scrollbar-width: none;
}

.product-media-track::-webkit-scrollbar {
    display: none;
}

.product-media-slide {
    height: 100vh;
    scroll-snap-align: start;
}

.product-media-slide img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Dots sit where the track scrolls: down the right edge on desktop, along the
   bottom once the hero stacks. */
.product-media-dots {
    position: absolute;
    top: 50%;
    right: 14px;
    flex-direction: column;
    transform: translateY(-50%);
}

/* Artist ----------------------------------------------------------------- */

.product-artist-image {
    margin: var(--g-gutter);
    aspect-ratio: var(--g-artist-aspect);
    overflow: hidden;
}

.product-artist-image img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.g-section {
    padding: var(--g-section-gap) var(--g-gutter) 0;
}

/* Figma measures the 20px gap from the cap-height bottom, but the CSS line box
   carries ~0.16em of descender space below the glyphs. Subtracting it puts the
   visible gap at 20px, and keeps it there when the font size drops on mobile. */
.g-section-heading {
    margin: 0 0 calc(var(--g-gap) - 0.16em);
    font-weight: var(--g-weight-medium);
    font-size: var(--g-heading);
    line-height: var(--g-heading-lh);
    letter-spacing: var(--g-heading-tracking);
}

/* Works and exhibitions -------------------------------------------------- */

.g-works-grid {
    display: grid;
    grid-template-columns: repeat(var(--g-columns), minmax(0, 1fr));
    gap: var(--g-card-gap);
}

/* This grid shows images only — the work and artist names appear on hover,
   unlike the Stockroom card which carries a permanent meta line. */
.g-work {
    position: relative;
    display: block;
    aspect-ratio: var(--g-card-aspect);
    overflow: hidden;
    background: var(--g-surface-alt);
}

.g-work img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: filter 0.4s ease, transform 0.4s ease;
}

/* Hover veil: blurs and dims what is behind it, so labels stay legible.
   backdrop-filter blurs the backdrop rather than the image itself, which keeps
   the frame edges clean without scaling the image up. */
.g-veil {
    position: absolute;
    inset: 0;
    background: var(--g-veil);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
}

.g-veil-labels {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--g-gap);
    padding: 0 var(--g-tile-pad);
    /* Regular rather than Medium: at 22px the heavier weight was closing the
       letterforms up more than the tracking was. */
    font-weight: var(--g-weight-regular);
    font-size: var(--g-filter);
    line-height: var(--g-filter-lh);
    /* No tracking at all here, unlike --g-filter-tracking (-0.6px), which the
       Stockroom filters and exhibition captions still use. */
    letter-spacing: 0;
}

.g-veil-primary {
    color: var(--g-on-image);
}

.g-veil-secondary {
    color: var(--g-on-image-muted);
    text-align: right;
}

@media (hover: hover) {
    .g-work:hover .g-veil,
    .g-work:focus-visible .g-veil,
    .work-card:hover .g-veil,
    .work-card:focus-visible .g-veil,
    .g-exhibition:hover .g-veil,
    .g-exhibition:focus-visible .g-veil,
    .works-gallery-item:hover .g-veil,
    .works-gallery-item:focus-visible .g-veil {
        opacity: 1;
    }
}

/* The veil ignores pointer events; the add-to-projects control must not. */
.g-veil .works-gallery-plus-icon {
    pointer-events: auto;
}

.g-exhibitions-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: var(--g-gap);
}

.g-exhibition {
    display: block;
    color: inherit;
    text-decoration: none;
}

.g-exhibition-image {
    aspect-ratio: var(--g-exhibition-aspect);
    overflow: hidden;
    background: var(--g-surface-alt);
}

.g-exhibition-image img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.g-exhibition-image {
    position: relative;
}

.g-exhibition-caption {
    margin-top: var(--g-gap);
    font-size: var(--g-meta);
    line-height: var(--g-meta-lh);
}

.g-exhibition-status {
    display: block;
    color: var(--g-ink-muted);
    text-transform: uppercase;
}

.g-exhibition-date {
    display: block;
    margin-top: var(--g-meta-lh);
}

.g-footer-spacer {
    height: var(--g-section-gap);
}

/* The hero splits only when there is room for a usable info column. Below
   this the image moves above the panel and the track scrolls horizontally. */
@media (max-width: 1024px) {
    .product-hero {
        flex-direction: column;
        min-height: 0;
    }

    .product-panel {
        flex: 1 1 auto;
        width: 100%;
        padding-bottom: var(--g-gutter);
    }

    .product-media {
        order: -1;
    }

    .product-media-track {
        display: flex;
        height: auto;
        overflow-x: auto;
        overflow-y: hidden;
        scroll-snap-type: x mandatory;
    }

    .product-media-slide {
        flex: 0 0 100%;
        height: auto;
        aspect-ratio: 0.744;
    }

    .product-media-dots {
        top: auto;
        bottom: 14px;
        left: 50%;
        right: auto;
        flex-direction: row;
        transform: translateX(-50%);
    }
}

@media (max-width: 768px) {
    .product-title {
        line-height: var(--g-heading-lh-tight);
    }

    /*
     * Spacing below is trim-corrected, which is why it is literal px rather
     * than the gap tokens. The mobile info block is one 20px-gap column in
     * Figma (40px above it), but Figma trims text boxes to cap height where
     * CSS uses full line boxes. Measured in Neue Montreal, the trim is 6.5
     * below / 6.9 above the 12px body, 4.1 below / 4.4 above the 22px meta,
     * 5.5 below / 5.9 above the 12px specs, and nil against a rule or a
     * button box. Each gap here is the Figma value less the trim on both
     * sides of it; taken literally the block reads far too loose.
     */
    .product-description {
        margin-top: 30px;   /* 40 - 2.9 title - 6.9 body */
    }

    .product-meta {
        margin-top: 49px;   /* 60 - 6.5 body - 4.4 meta */
    }

    .product-actions {
        margin-top: 20px;   /* 20, both sides untrimmed: rule to button box */
    }

    /* The design splits the meta across the first rule: artist and year share
       a row above it, edition sits right-aligned on its own row below. */
    .product-meta {
        display: grid;
        grid-template-columns: 1fr 1fr;
        /* Stretch, not the desktop baseline: both cells must share a bottom
           edge or their borders read as two broken segments. */
        align-items: stretch;
        column-gap: 0;
        row-gap: 16px;      /* 20 - 4.4 edition */
    }

    .product-meta-group {
        display: contents;
    }

    .product-meta-artist {
        grid-area: 1 / 1;
    }

    .product-meta-year {
        grid-area: 1 / 2;
        text-align: right;
    }

    /* The rule is drawn under both cells so it reads as one line. */
    .product-meta-artist,
    .product-meta-year {
        padding-bottom: 16px;   /* 20 - 4.1 meta */
        border-bottom: 1px solid var(--g-surface-alt);
    }

    .product-meta-edition {
        grid-area: 2 / 1 / auto / -1;
        text-align: right;
    }

    /* Specs then price, each on its own row; the top rule is already drawn
       inside the meta. */
    .product-details {
        flex-direction: column;
        min-height: 0;
        gap: 10px;              /* 20 - 5.5 specs - 4.4 price */
        margin-top: 10px;       /* 20 - 4.1 edition - 5.9 specs */
        padding-top: 0;
        padding-bottom: 16px;   /* 20 - 4.1 price */
        border-top: 0;
    }

    .product-artist-image {
        margin: 0;
    }

    .g-works-grid,
    .g-exhibitions-grid {
        grid-template-columns: minmax(0, 1fr);
        gap: var(--g-card-gap);
        margin-inline: calc(-1 * var(--g-gutter));
    }

    .g-exhibitions-grid {
        row-gap: calc(var(--g-card-gap) + 20px);
    }

    .g-exhibition-caption {
        padding-inline: var(--g-gutter);
    }
}

/* ==========================================================================
   About
   ========================================================================== */

.about {
    background: var(--g-surface);
    color: var(--g-ink);
    font-family: var(--g-font);
    font-weight: var(--g-weight-regular);
    padding: var(--g-page-offset) var(--g-gutter) 0;
}

/* Desktop is two flex columns: the left one pins its contact block to the
   bottom, the right one holds the copy and its button. Mobile reflows this
   into grid areas — see the breakpoint at the end of this block. */
.about-intro {
    display: flex;
    align-items: stretch;
    gap: var(--g-gap);
}

.about-col-left {
    flex: 0 0 calc((100% - (var(--g-columns) - 1) * var(--g-gap)) / var(--g-columns));
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    gap: var(--g-block-gap);
}

.about-col-right {
    flex: 1 1 0;
    min-width: 0;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: var(--g-block-gap);
}

.about-title {
    margin: 0;
    font-weight: var(--g-weight-medium);
    font-size: var(--g-heading);
    line-height: var(--g-heading-lh);
    letter-spacing: var(--g-heading-tracking);
}

.about-contact {
    font-size: var(--g-contact);
    line-height: var(--g-contact-lh);
}

.about-contact-group + .about-contact-group {
    margin-top: var(--g-contact-lh);
}

.about-contact-label {
    display: block;
    color: var(--g-ink-muted);
}

.about-contact a {
    display: block;
    color: inherit;
    text-decoration: none;
}

.about-body-text {
    font-size: var(--g-body);
    line-height: var(--g-body-lh);
}

.about-body-text p {
    margin: 0;
}

.about-body-text p + p {
    margin-top: var(--g-body-lh);
}

/* Images ----------------------------------------------------------------- */

.about-images {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: var(--g-card-gap);
    margin-top: var(--g-gap);
}

.about-image {
    overflow: hidden;
    background: var(--g-surface-alt);
}

.about-image img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Slots one and four run the full width; two and three share a row. */
.about-image--1,
.about-image--4 {
    grid-column: 1 / -1;
    aspect-ratio: var(--g-about-wide-aspect);
}

.about-image--2,
.about-image--3 {
    aspect-ratio: var(--g-about-pair-aspect);
}

@media (max-width: 768px) {
    /* Flatten the two columns so all four items can be placed as grid areas:
       heading, then copy, then the contact block beside its button. */
    .about-intro {
        display: grid;
        grid-template-columns: 1fr auto;
        grid-template-areas:
            "title   title"
            "body    body"
            "contact action";
        align-items: end;
        row-gap: var(--g-block-gap);
    }

    .about-col-left,
    .about-col-right {
        display: contents;
    }

    .about-title {
        grid-area: title;
    }

    .about-body-text {
        grid-area: body;
    }

    .about-contact {
        grid-area: contact;
    }

    .about-action {
        grid-area: action;
    }

    /* Images run edge to edge while the copy keeps its gutter. */
    .about-images {
        grid-template-columns: minmax(0, 1fr);
        margin-inline: calc(-1 * var(--g-gutter));
    }

    /* The design stacks them 1, 3, 2, 4 with heights alternating tall, short.
       The rhythm belongs to the slot, not to the image in it. */
    .about-image--1 { order: 1; }
    .about-image--3 { order: 2; }
    .about-image--2 { order: 3; }
    .about-image--4 { order: 4; }

    .about-image--1,
    .about-image--2 {
        aspect-ratio: var(--g-about-tall-aspect);
    }

    .about-image--3,
    .about-image--4 {
        aspect-ratio: var(--g-about-short-aspect);
    }
}

/* ==========================================================================
   Artist
   ========================================================================== */

.artist {
    /*
     * Clears the fixed nav bar so the page starts below it rather than under
     * it: the bar reads as white on load, and the hero only slides beneath its
     * blur once you scroll. Uses the bar's own height, so it follows the
     * shorter mobile bar without a second value.
     */
    padding-top: var(--g-nav-bar-h);
    background: var(--g-surface);
    color: var(--g-ink);
    font-family: var(--g-font);
    font-weight: var(--g-weight-regular);
}

.artist-hero {
    aspect-ratio: var(--g-artist-hero-aspect);
    overflow: hidden;
    background: var(--g-surface-alt);
}

.artist-hero img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Register form ---------------------------------------------------------- */

.artist-register-intro {
    margin: 0;
    font-size: var(--g-body);
    line-height: var(--g-body-lh);
}

/* The consent line is set muted, below the instruction. */
.artist-register-consent {
    display: block;
    color: var(--g-ink-muted);
}

.artist-register-fields {
    display: flex;
    align-items: center;
    gap: var(--g-gap);
    width: 100%;
}

.artist-register-field {
    flex: 1 1 0;
    min-width: 0;
    height: 26px;
    padding: 0;
    border: 0;
    border-bottom: 1px solid var(--g-ink-muted);
    border-radius: 0;
    background: none;
    font-family: var(--g-font);
    font-size: var(--g-body);
    line-height: var(--g-body-lh);
    color: var(--g-ink);
}

/* style.css forces every input white for the blue modals, using
   input:focus / input:not(:focus) — (0,1,1), which outranks a lone class — plus
   a global white caret. This form is black on white, so restate both. */
.artist-register-field,
.artist-register-field:focus,
.artist-register-field:not(:focus) {
    color: var(--g-ink);
    caret-color: var(--g-ink);
}

.artist-register-field:-webkit-autofill {
    -webkit-text-fill-color: var(--g-ink);
}

.artist-register-field::placeholder {
    color: var(--g-ink-muted);
}

.artist-register-field:focus {
    outline: none;
    border-bottom-color: var(--g-ink);
}

.artist-register-message[data-kind='error'] {
    color: var(--g-accent);
}

.artist-register-message:empty {
    display: none;
}

@media (max-width: 768px) {
    .artist-register-fields {
        flex-direction: column;
        align-items: stretch;
        gap: var(--g-block-gap);
    }
}

@media (max-width: 768px) {
    .g-split {
        flex-direction: column;
        gap: var(--g-block-gap);
    }
}

.artist-register-form {
    width: 100%;
}

/* ==========================================================================
   Works / All Artists
   ========================================================================== */

.works-index {
    background: var(--g-surface);
    color: var(--g-ink);
    font-family: var(--g-font);
    font-weight: var(--g-weight-regular);
    padding-inline: var(--g-gutter);
}

.works-artist {
    padding-top: var(--g-works-artist-gap);
}

.works-artist:first-child {
    padding-top: var(--g-page-offset);
}

/* No rule between artists — the 40px here plus the 100px padding below keeps
   the designed 140px gap between one artist's works and the next name. */
.works-artist + .works-artist {
    margin-top: var(--g-block-gap);
}

/*
 * Three columns: the artist's details hold column one, their works fill
 * columns two and three, and the first work spans both.
 */
.works-artist-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: var(--g-card-gap);
}

.works-artist-info {
    grid-column: 1;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: var(--g-block-gap);
}

.works-artist-name {
    margin: 0;
    font-weight: var(--g-weight-medium);
    font-size: var(--g-heading);
    line-height: var(--g-heading-lh-tight);
    letter-spacing: var(--g-heading-tracking);
}

.works-artist-name a {
    color: inherit;
    text-decoration: none;
}

.works-artist-bio {
    margin: 0;
    max-width: 460px;
    font-size: var(--g-body);
    line-height: var(--g-body-lh);
    /* Bios carry their own paragraph breaks, as on the artist page. */
    white-space: pre-wrap;
}

.works-artist-lead {
    grid-column: 2 / span 2;
    display: block;
    aspect-ratio: var(--g-works-lead-aspect);
    overflow: hidden;
    background: var(--g-surface-alt);
}

.works-artist-lead img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.works-artist-rest {
    grid-column: 2 / span 2;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: var(--g-card-gap);
}

@media (max-width: 1024px) {
    /* No tablet frame exists; the details go full width and the works keep
       two columns beneath them. */
    .works-artist-grid {
        grid-template-columns: minmax(0, 1fr);
    }

    .works-artist-info,
    .works-artist-lead,
    .works-artist-rest {
        grid-column: 1;
    }

    .works-artist-info {
        margin-bottom: var(--g-block-gap);
    }
}

@media (max-width: 768px) {
    .works-artist-rest {
        grid-template-columns: minmax(0, 1fr);
    }

    /* Works run edge to edge while the details keep their gutter. */
    .works-artist-lead,
    .works-artist-rest {
        margin-inline: calc(-1 * var(--g-gutter));
    }
}

/* ==========================================================================
   All Exhibitions
   ========================================================================== */

.exhibitions-index {
    background: var(--g-surface);
    color: var(--g-ink);
    font-family: var(--g-font);
    font-weight: var(--g-weight-regular);
}

.exhibition-item {
    padding: var(--g-page-offset) var(--g-gutter) 0;
}

/* The heading sits at the top of its column and the caption at the bottom,
   level with the buttons opposite. */
.exhibition-headers {
    flex: 0 0 calc((100% - (var(--g-columns) - 1) * var(--g-gap)) / var(--g-columns));
    align-self: stretch;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    gap: var(--g-block-gap);
}

.exhibition-heading {
    margin: 0;
    font-weight: var(--g-weight-medium);
    font-size: var(--g-heading);
    line-height: var(--g-heading-lh);
    letter-spacing: var(--g-heading-tracking);
}

.exhibition-caption {
    font-weight: var(--g-weight-medium);
    font-size: var(--g-filter);
    line-height: var(--g-filter-lh);
    letter-spacing: var(--g-filter-tracking);
    color: var(--g-ink-faint);
}

.exhibition-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}

/* Media --------------------------------------------------------------- */

.exhibition-media {
    position: relative;
    display: flex;
    flex-direction: column;
    margin-top: var(--g-block-gap);
}

/* Sits inside the 40px gap above the images rather than adding to it. */
.exhibition-dots {
    position: absolute;
    right: 0;
    bottom: calc(100% + var(--g-gap));
}

.exhibition-track {
    display: flex;
    gap: var(--g-gap);
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    scrollbar-width: none;
}

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

.exhibition-slide {
    flex: 0 0 calc(
        (100% - (var(--g-exhibition-slides) - 1) * var(--g-gap)) / var(--g-exhibition-slides)
    );
    aspect-ratio: var(--g-exhibition-slide-aspect);
    scroll-snap-align: start;
    overflow: hidden;
    background: var(--g-surface-alt);
}

/* A portrait shot gets a portrait frame: 60% of the landscape width. Scaling
   the ratio by the same 0.6 keeps its height identical to its neighbours. */
.exhibition-slide--portrait {
    flex-basis: calc(
        var(--g-exhibition-portrait-scale) *
        (100% - (var(--g-exhibition-slides) - 1) * var(--g-gap)) / var(--g-exhibition-slides)
    );
    /* Scaling the ratio by the same factor keeps the height identical to its
       landscape neighbours. */
    aspect-ratio: calc(var(--g-exhibition-slide-aspect) * var(--g-exhibition-portrait-scale));
}

.exhibition-slide img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

@media (max-width: 768px) {
    /* Slides run edge to edge and the dots move below them, centred. */
    .exhibition-media {
        margin-inline: calc(-1 * var(--g-gutter));
    }

    /* Flatten both columns so the four pieces can be ordered freely:
       heading, copy, caption, then the buttons last. */
    .exhibition-headers,
    .exhibition-item .g-split-info {
        display: contents;
    }

    .exhibition-heading { order: 0; }
    .exhibition-item .g-body-text { order: 1; }
    .exhibition-caption { order: 2; }
    .exhibition-actions { order: 3; }

    .exhibition-dots {
        top: calc(100% + var(--g-gap));
        bottom: auto;
        left: 50%;
        right: auto;
        transform: translateX(-50%);
    }

    .exhibition-track {
        gap: 0;
    }
}

/* ==========================================================================
   Contact and Enquire panels

   Both templates already share the contact-form-* classes, so one rule set
   covers them. The .slide-* animation classes in style.css set transform with
   !important, so nothing here touches transform on the container.
   ========================================================================== */

.contact-form-modal,
.enquire-form-modal {
    position: fixed;
    inset: 0;
    /* Above the site header, which sits at 10006. */
    z-index: 10010;
}

.contact-form-container,
.enquire-form-container {
    position: absolute;
    top: 0;
    right: 0;
    width: var(--g-modal-width);
    /* main.js overrides --g-contact-width with a measured value; see below. */
    min-width: 0;
    max-width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    padding: 0;
    overflow: hidden;
    background: var(--g-accent);
    color: var(--g-on-accent);
    font-family: var(--g-font);
    font-weight: var(--g-weight-regular);
}

/* Keep the form above the watermark. */
.contact-form-header,
.contact-form-content,
.contact-form-footer {
    position: relative;
    z-index: 1;
}

/*
 * Contact is as wide as the distance from the nav's "Contact" to the right
 * edge, plus the heading's own inset, so its heading lands exactly on that
 * word when the panel is open. main.js measures it; the fallback is the
 * design's 653 of 1920. Enquire takes the same width so the two panels read
 * as one component, even though only Contact has a word to line up with.
 */
.contact-form-container,
.enquire-form-container {
    width: var(--g-contact-width, 34%);
}

/*
 * The same 60px bar the nav uses, with both labels centred in it, which puts
 * their cap line at 20 to match the nav and the design.
 */
.contact-form-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: var(--g-nav-bar-h);
    padding: 0 var(--g-gutter);
}

.contact-form-modal .modal-title,
.enquire-form-modal .modal-title,
.contact-form-close {
    margin: 0;
    padding: 0;
    border: 0;
    background: none;
    font-family: var(--g-font);
    font-weight: var(--g-weight-medium);
    /* The bar's size, not the row's: they match at 28 on desktop but the
       mobile bar is 22 where the row is 26, and this has to read as the same
       word as the nav's Contact. */
    font-size: var(--g-nav-bar);
    line-height: var(--g-nav-bar-lh);
    letter-spacing: var(--g-nav-tracking);
    text-transform: capitalize;
    white-space: nowrap;
}

.contact-form-modal .modal-title,
.enquire-form-modal .modal-title {
    color: var(--g-on-accent);
}

.contact-form-close {
    color: var(--g-on-accent-idle);
    cursor: pointer;
}

.contact-form-close:hover {
    color: var(--g-on-accent);
}

.contact-form-content {
    flex: 1 1 auto;
    padding: 55px var(--g-modal-pad) 0;
}

.contact-form-modal .contact-form-content,
.enquire-form-modal .contact-form-content {
    padding-top: var(--g-contact-pad-top);
}

.contact-form-instruction {
    margin: 0 0 32px;
    font-size: var(--g-body);
    line-height: var(--g-meta-lh);
    text-align: right;
    color: var(--g-on-accent);
}

.contact-form-row {
    display: flex;
    gap: 24px;
    margin-bottom: 40px;
}

.contact-form-field-wrapper {
    flex: 1 1 0;
    min-width: 0;
}

.contact-form-input {
    width: 100%;
    height: 18px;
    padding: 0;
    border: 0;
    border-bottom: 1px solid var(--g-on-accent-muted);
    border-radius: 0;
    background: none;
    font-family: var(--g-font);
    font-size: var(--g-caption);
    line-height: var(--g-caption-lh);
    color: var(--g-on-accent);
}

.contact-form-input::placeholder {
    color: var(--g-on-accent-muted);
}

.contact-form-input:hover,
.contact-form-input:focus {
    outline: none;
    border-bottom-color: var(--g-on-accent-hover);
}

.contact-form-input:hover::placeholder,
.contact-form-input:focus::placeholder {
    color: var(--g-on-accent-hover);
}

/*
 * Taller than the design's single line — this is the one free text field — but
 * the text still sits on the rule like every other field rather than floating
 * at the top of the box. The extra height reads as headroom above it.
 */
.contact-form-textarea {
    height: var(--g-textarea-h);
    /* Less the border as well as the line: without that the single line is a
       pixel taller than the content box and the field scrolls while empty. */
    padding-top: calc(var(--g-textarea-h) - var(--g-caption-lh) - 1px);
    resize: none;
    /* Still scrolls past one line, it just does not draw a bar to say so. */
    scrollbar-width: none;
}

.contact-form-textarea::-webkit-scrollbar {
    display: none;
}

.contact-form-submit-wrapper {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--g-gap);
    text-align: right;
}

.contact-form-note {
    margin: 0;
    font-size: var(--g-body);
    line-height: var(--g-meta-lh);
    text-align: left;
    color: var(--g-on-accent);
}

.contact-form-submit {
    padding: 10px;
    border: 0;
    background: none;
    font-family: var(--g-font);
    font-size: var(--g-body);
    line-height: 22px;
    color: var(--g-on-accent);
    cursor: pointer;
}

.contact-form-message {
    font-size: var(--g-caption);
    line-height: var(--g-caption-lh);
    text-align: right;
    color: var(--g-on-accent);
}

/* Footer ----------------------------------------------------------------- */

.contact-form-footer {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: var(--g-gap);
    padding: 0 var(--g-gutter) var(--g-modal-pad);
    font-size: var(--g-body);
    line-height: var(--g-meta-lh);
}

.contact-form-footer-heading {
    margin: 0;
    font-size: inherit;
    font-weight: var(--g-weight-regular);
    line-height: inherit;
    color: var(--g-on-accent-muted);
}

.contact-form-footer-text {
    margin: 0;
    color: var(--g-on-accent);
}

.contact-form-footer-text a,
.contact-form-link {
    color: var(--g-on-accent);
}

.contact-form-link,
.contact-form-underline {
    text-decoration: underline;
}

.contact-form-footer-left {
    flex: 1 1 auto;
}

/* Keep the address on one line, as designed. */
.contact-form-footer-left .contact-form-footer-text {
    white-space: nowrap;
}

.contact-form-social {
    flex: 0 0 auto;
    text-align: left;
}

.contact-form-watermark {
    position: absolute;
    /* Right aligned, hard against the wall — the mark bleeds to the edge
       rather than sitting inside the gutter. */
    right: 0;
    bottom: -9px;
    left: auto;
    width: 488px;
    height: 522px;
    transform: none;
    pointer-events: none;
    z-index: 0;
}

.contact-form-watermark-logo {
    display: block;
    width: 100%;
    height: 100%;
}

@media (max-width: 768px) {
    .contact-form-container,
    .enquire-form-container {
        width: 100%;
    }

    /* No nav "Contact" to line up with at this width. */
    .contact-form-container {
        width: 100%;
    }

    .contact-form-modal .contact-form-content {
        padding-top: 55px;
    }

    .contact-form-submit-wrapper {
        flex-direction: column;
        align-items: flex-start;
    }

    .contact-form-row {
        flex-direction: column;
        gap: 40px;
    }
}

/* ==========================================================================
   Footer — restyled ahead of the rest of the footer, which is still legacy
   ========================================================================== */

/* style.css sets this uppercase at the 70px heading size; the client wants
   sentence case at 28px. */
.site-footer-heading {
    font-size: 28px;
    letter-spacing: -0.6px;
    text-transform: none;
}

/* Figma puts the newsletter row 89px below the footer top; the heading box
   ends at 48px, so the gap between them is the remainder. The 10px in
   style.css was spaced for the old 70px heading. */
.site-footer-heading {
    margin-bottom: 41px;
}

.site-footer-input,
.site-footer-button {
    height: 28px;
}

/* Overlay nav ============================================================= */

/*
 * The menu and artists overlays are the same screen: an inline row anchored to
 * the right edge and centred vertically, Contact above it, the mark bottom
 * right. Only the active item is black; the rest sit at 16%.
 *
 * Selectors here are deliberately scoped to their container rather than left as
 * bare classes. The items still carry .menu-overlay-item and .menu-overlay-text
 * so main.js keeps working, and style.css styles both — .menu-overlay-text at
 * heading size and uppercase, button.menu-overlay-item at zero padding — at a
 * specificity a single class cannot beat. Flattening these back to one class
 * puts the row back to 28px labels rendered as headings.
 */

/*
 * Anchored to the left edge of the works grid's last column rather than held a
 * fixed distance off the right edge, so the nav occupies the same third of the
 * page as the image grid does at any width. At 1920 that is within a few px of
 * where it already sat; the difference shows as the screen narrows.
 */
.nav-column {
    position: absolute;
    top: 0;
    /*
     * The grid's last column while the row fits inside it, and hard against
     * the right gutter once it does not — below about 1640 the row is simply
     * wider than a third of the page. Never capped to the column, because
     * capping it is what made About drop to a second line.
     */
    left: min(
        var(--g-grid-last-col),
        calc(100% - var(--g-gutter) - var(--g-nav-row-w))
    );
    right: auto;
    display: flex;
    align-items: center;
    /* Shrink-wraps the row, which is what lets Contact track its left edge. */
    width: max-content;
    max-width: none;
    height: 100%;
}

.nav-row {
    display: flex;
    /* One line, always: the column moves to make room rather than wrapping. */
    flex-wrap: nowrap;
    align-items: center;
    justify-content: flex-end;
}

.nav-row .nav-row-item,
.artists-list .nav-row-item,
.nav-column .nav-contact,
.site-header .nav-contact,
.site-header .nav-bar-menu {
    position: relative;
    display: block;
    width: auto;
    margin: 0;
    padding: var(--g-nav-pad-y) var(--g-nav-pad-x);
    border: 0;
    background: none;
    font-family: var(--g-font);
    font-weight: var(--g-weight-medium);
    font-size: var(--g-nav);
    line-height: var(--g-nav-lh);
    letter-spacing: var(--g-nav-tracking);
    color: var(--g-nav-idle);
    text-align: center;
    text-decoration: none;
    text-transform: none;
    white-space: nowrap;
    cursor: pointer;
}

/* Undo the old vertical menu's heading treatment on the label span. */
.nav-row .menu-overlay-text {
    font: inherit;
    letter-spacing: inherit;
    line-height: inherit;
    text-transform: none;
}

/*
 * Pinned to the top of the column, so it keeps the row's left edge. Centred in
 * the bar rather than offset from the top: Figma's 10px is measured to a box
 * trimmed to cap height, and anchoring the full line box at 10px put the label
 * 12.5px low. Centring lands the cap where the design has it at any size.
 */
.nav-column .nav-contact {
    position: absolute;
    top: 0;
    left: 0;
    display: flex;
    align-items: center;
    height: var(--g-nav-bar-h);
}

.nav-row .nav-row-item.is-active,
.artists-list .nav-row-item.is-active {
    color: var(--g-ink);
}

/* Only the nav row's active item is inert; a cycling artist name is still a
   link to that artist. */
.nav-row .nav-row-item.is-active {
    cursor: default;
}

/* The design gives no hover state, but every item bar the active one is a
   control, so they resolve to the active colour. */
.site-header .nav-bar-menu:hover,
.nav-row .nav-row-item:not(.is-active):hover,
.artists-list .nav-row-item:not(.is-active):hover {
    color: var(--g-ink);
}

/* Contact goes to the panel's own blue rather than the active colour, so the
   hover previews what opens. */
.site-header .nav-contact:hover,
.nav-column .nav-contact:hover {
    color: var(--g-accent);
}

/* Except over the hero, where that blue disappears into the photograph.
   --g-ink is white inside .home. */
.home .nav-column .nav-contact:hover {
    color: var(--g-ink);
}

.nav-row .nav-row-count {
    position: absolute;
    /* 2, not the design's 4: that 4 is measured from a cap-trimmed box, and
       the 22px line box here hangs 20px lower for the same number. */
    bottom: 2px;
    left: 50%;
    transform: translateX(-50%);
    font-weight: var(--g-weight-regular);
    font-size: var(--g-nav-count);
    line-height: var(--g-nav-count-lh);
    letter-spacing: 0;
}

/* The count belongs to the item you are on or pointing at — Figma's "01"
   button variant is the full-colour label and its count together, and it is
   used for both. Absolutely positioned, so revealing it shifts nothing. */
.nav-row .nav-row-item:not(.is-active):not(:hover) .nav-row-count {
    display: none;
}

/*
 * Projects is last in the row and stays hidden until you log in, so About ends
 * the row most of the time and its comma would dangle. :has lets the row see
 * the inline display that updateAuthNav toggles.
 */
.nav-row:has(.menu-overlay-projects-link[style*="none"]) .nav-row-item:nth-last-child(2) .nav-row-comma {
    display: none;
}

/*
 * Stands in for the nav bar's Menu once the overlay it opened is showing —
 * same corner, same cap line, same soft grey.
 */
.nav-close {
    position: absolute;
    top: 0;
    right: 12px;
    display: flex;
    align-items: center;
    height: var(--g-nav-bar-h);
    padding: 0 var(--g-nav-pad-x);
    border: 0;
    background: none;
    font-family: var(--g-font);
    font-weight: var(--g-weight-medium);
    font-size: var(--g-nav);
    line-height: var(--g-nav-lh);
    letter-spacing: var(--g-nav-tracking);
    color: var(--g-nav-idle);
    white-space: nowrap;
    cursor: pointer;
}

.nav-close:hover {
    color: var(--g-ink);
}

/*
 * The plain nav bar. Unlike the home and overlay variants this one has a
 * background of its own — it sits over page content rather than empty white —
 * and carries a Menu button, which the other two do not need because their
 * full row is already on screen.
 */
.site-header.nav-bar {
    display: block;
    height: var(--g-nav-bar-h);
    padding: 0;
    background: var(--g-nav-bar-bg);
    backdrop-filter: blur(var(--g-nav-bar-blur));
    -webkit-backdrop-filter: blur(var(--g-nav-bar-blur));
}

.site-header .nav-contact,
.site-header .nav-bar-menu {
    position: absolute;
    top: 0;
    display: flex;
    align-items: center;
    height: var(--g-nav-bar-h);
}

/* The same grid column, so it holds the line Contact sits on site-wide. */
.site-header .nav-contact {
    left: var(--g-grid-last-col);
}

.site-header .nav-bar-menu {
    right: 12px;
}

.nav-logo {
    position: absolute;
    right: var(--g-gutter);
    bottom: var(--g-gutter);
    width: var(--g-nav-logo-w);
    height: var(--g-nav-logo-h);
}

.nav-logo img {
    display: block;
    width: 100%;
    height: 100%;
}

/* Artist names run from the left gutter on the nav row's centre line. The
   negative pad-x pulls the first name's box back so its text starts on the
   gutter rather than 8px inside it. */
.artists-list {
    position: absolute;
    top: 50%;
    left: calc(var(--g-gutter) - var(--g-nav-pad-x));
    transform: translateY(-50%);
    display: flex;
    /* All three restated: the old vertical list stacked, centred and spaced. */
    flex-direction: row;
    flex-wrap: wrap;
    align-items: center;
    justify-content: flex-start;
    gap: 0;
    max-width: calc(100% - 2 * var(--g-gutter));
}

/*
 * Hover images sit centred on the two lines that divide the page into thirds,
 * rather than pinned near the outer edges as they were.
 *
 * Percentages hold that at any width. Width is a third of the page less the
 * gap, which makes the space between the pair that gap at every width — a
 * fixed size closes them up as the thirds shrink. The px cap stops them
 * growing past the size the client signed off on wide screens.
 */
.artists-overlay-image {
    left: auto;
    right: auto;
    width: calc(
        var(--g-artist-hover-scale) *
        min(var(--g-artist-hover-w), calc(100% / 3 - var(--g-artist-hover-gap)))
    );
    max-width: none;
    transform: translate(-50%, -50%);
}

.artists-overlay-image-left {
    left: 33.3333%;
}

.artists-overlay-image-right {
    left: 66.6667%;
    right: auto;
}

.artists-overlay-image img {
    width: 100%;
    max-width: none;
    height: auto;
}

/*
 * Sized exactly as the home page is — top and bottom pinned, height left to
 * follow — rather than to the 100vh style.css gives them. On a phone 100vh is
 * the height with the toolbar hidden, so a full-height overlay centres its row
 * lower than the home page does and anything pinned to its bottom sits under
 * the toolbar. That was the jump between home and the artist menu, and the
 * clipped last name.
 */
.menu-overlay,
.artists-overlay {
    top: 0 !important;
    bottom: 0 !important;
    height: auto !important;
}

/*
 * The design has no site header on either overlay — Contact inside the column
 * replaces it. style.css deliberately floats the header above the overlay with
 * display/visibility/z-index all !important, so this has to match that weight
 * to put it away.
 */
body.menu-open .site-header,
body.artists-open .site-header {
    display: none !important;
}

@media (max-width: 768px) {
    /*
     * "Menu — MOBILE" (2056:6443). A different layout, not a squeezed desktop:
     * the row loses Menu and spreads across the full width, Contact and a
     * Close Menu button share a 44px bar, and the artist names stack in the
     * bottom left beside a square thumbnail.
     *
     * The column stops shrink-wrapping and becomes the full-screen positioning
     * context for all three, since none of them line up with each other here.
     */
    .nav-column {
        left: 0;
        right: auto;
        display: block;
        width: 100%;
        max-width: none;
    }

    .nav-column .nav-contact,
    .nav-close {
        position: absolute;
        top: 0;
        padding: 0;
        font-size: var(--g-nav-bar);
        line-height: var(--g-nav-bar-h);
    }

    .nav-column .nav-contact {
        left: var(--g-nav-gutter);
    }

    .nav-close {
        display: block;
        right: var(--g-nav-gutter);
        border: 0;
        background: none;
        font-family: var(--g-font);
        font-weight: var(--g-weight-medium);
        letter-spacing: var(--g-nav-tracking);
        color: var(--g-ink);
        text-align: right;
        white-space: nowrap;
        cursor: pointer;
    }

    .nav-row {
        position: absolute;
        top: 50%;
        left: 0;
        transform: translateY(-50%);
        width: 100%;
        padding-inline: var(--g-nav-gutter);
        flex-wrap: nowrap;
        justify-content: space-between;
    }

    .nav-row .nav-row-item,
    .artists-list .nav-row-item {
        padding: 0;
    }

    /* Close Menu does this job on mobile. */
    .nav-row .nav-row-item--menu {
        display: none;
    }

    /* The mobile frames carry no counts. */
    .nav-row .nav-row-count {
        display: none;
    }

    /* Same 44px bar the mobile menu uses, both labels on its gutter. */
    .site-header.nav-bar {
        height: var(--g-nav-bar-h);
    }

    .site-header .nav-contact,
    .site-header .nav-bar-menu {
        height: var(--g-nav-bar-h);
        padding: 0;
        font-size: var(--g-nav-bar);
    }

    .site-header .nav-contact {
        left: var(--g-nav-gutter);
    }

    .site-header .nav-bar-menu {
        right: var(--g-nav-gutter);
    }

    /* Names stack, so they read as a list rather than a sentence. */
    .artists-list {
        top: auto;
        bottom: var(--g-nav-artist-inset);
        left: var(--g-nav-gutter);
        transform: none;
        flex-direction: column;
        flex-wrap: nowrap;
        align-items: flex-start;
        /* The pitch is the line box now, so no gap on top of it. */
        gap: 0;
        max-width: calc(100% - var(--g-nav-thumb) - 3 * var(--g-nav-gutter));
    }

    .artists-list .nav-row-item {
        line-height: var(--g-nav-artist-pitch);
    }

    .artists-list .nav-row-comma {
        display: none;
    }

    /* Names are nowrap, so without this a long one would run under the
       thumbnail rather than stopping at the list's width. */
    .artists-list .nav-row-item {
        max-width: 100%;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    /* The two desktop hover wells collapse to one square, bottom right.
       mobile.css hides both with display:none !important for the old design,
       so restoring the left one has to match that weight. */
    .artists-overlay-image-left {
        display: block !important;
        top: auto;
        left: auto;
        right: var(--g-nav-gutter);
        bottom: var(--g-nav-artist-inset);
        width: var(--g-nav-thumb);
        height: var(--g-nav-thumb);
        max-width: none;
        transform: none;
    }

    .artists-overlay-image-left img {
        width: 100%;
        height: 100%;
        max-width: none;
        object-fit: cover;
    }

    .artists-overlay-image-right {
        display: none;
    }

    /* The thumbnail takes that corner. */
    .nav-logo {
        display: none;
    }
}

/* Home hero =============================================================== */

/*
 * A full-bleed image with the nav over it and the artist names on a wheel in
 * the bottom left. The nav is the same component as the overlays; it only
 * needs recolouring, which is done by resetting the two custom properties it
 * reads rather than by restating any of its rules.
 */

.home {
    --g-ink: #ffffff;
    --g-nav-idle: var(--g-home-nav-idle);

    position: fixed;
    inset: 0;
    overflow: hidden;
    background: var(--g-ink-strong, #000);
}

.home-media {
    position: absolute;
    inset: 0;
}

.home-media-image {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0;
    transition: opacity var(--g-home-fade) ease;
}

.home-media-image.is-active {
    opacity: 1;
}

/*
 * One slot tall, with the names above and below deliberately overflowing it —
 * they are faded out by colour rather than clipped, which is how the design
 * draws them. Sits --g-home-drop below the nav row's centre line.
 */
.home-carousel {
    position: absolute;
    left: var(--g-gutter);
    top: calc(50% + var(--g-home-drop));
    height: var(--g-home-slot);
    transform: translateY(-50%);
}

.home-carousel-track {
    position: absolute;
    top: 0;
    left: 0;
    transition: transform var(--g-home-fade) ease;
}

.home-carousel-name {
    display: flex;
    align-items: center;
    height: var(--g-home-slot);
    font-family: var(--g-font);
    font-weight: var(--g-weight-medium);
    font-size: var(--g-nav);
    line-height: var(--g-nav-lh);
    letter-spacing: var(--g-nav-tracking);
    /* Anything past the second name either side is present but invisible. */
    color: transparent;
    /* Decorative: the ticker is not a nav, so it takes no pointer at all. */
    pointer-events: none;
    user-select: none;
    white-space: nowrap;
    transition: color var(--g-home-fade) ease;
}

.home-carousel-name.is-far {
    color: var(--g-home-name-far);
}

.home-carousel-name.is-near {
    color: var(--g-home-name-near);
}

.home-carousel-name.is-active {
    color: var(--g-ink);
}

/* Desktop pairs a background with each artist name; mobile pairs one with each
   nav section instead, so only one set is ever in play. */
.home-media-image--section {
    display: none;
}

@media (max-width: 768px) {
    /*
     * Home — MOBILE (2056:6524). No wheel: the nav row itself is the cycle,
     * each section taking a turn in white over its own background.
     */
    .home-carousel {
        display: none;
    }

    .home-media-image--artist {
        display: none;
    }

    .home-media-image--section {
        display: block;
    }

    /* The highlighted section here is a real link, unlike the nav row's own
       active item, which is the page you are already on. */
    .home .nav-row .nav-row-item.is-active {
        cursor: pointer;
    }
}
