/* Work overview (Figma 236-2962, 34-16880, 34-18252). Colours and fonts come from the theme tokens (base/_tokens.scss). */

.block--work-overview__grid,
.work-archive__grid {
    display: grid;
    /* minmax(0, 1fr): an auto track would grow to the longest word and scroll the page sideways. */
    grid-template-columns: minmax(0, 1fr);
    gap: 3.6875rem 1.25rem;
}

@media (min-width: 768px) {
    .block--work-overview__grid,
    .work-archive__grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

.block--work-overview__more {
    margin-top: 6.3125rem;
    text-align: center;
}

/* Work archive (Figma 12-4063). A template, not a page of blocks: the distances around the filter and
   load more are its own (SPEC wp-029, open question 3), like .block--work-overview__more. */

/* Edge to edge, under the floating header (Figma 52-20789). */
.work-archive__hero {
    margin-top: -100px;
    aspect-ratio: 1057 / 728;
    overflow: hidden;
}

.work-archive__hero picture,
.work-archive__hero-image {
    width: 100%;
    height: 100%;
}

.work-archive__hero-image {
    object-fit: cover;
}

/* Only for screen readers: Figma shows no page title. */
.work-archive__title {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip-path: inset(50%);
    white-space: nowrap;
}

.work-archive .archive-filter {
    margin-top: 2.5rem;
}

.work-archive__grid {
    margin-top: 4.5rem;
    /* Figma 177-1831: 41px between rows, closer than in the block. */
    row-gap: 2.5625rem;
}

.work-archive .archive-filter__more {
    margin-top: 6.3125rem;
}

/* Editor-only stand-in while there are no cards. */
.block--work-overview__placeholder {
    opacity: 0.4;
}

/* Project teaser, also used without the block (work archive). */

.work-teaser {
    position: relative;
    color: var(--color-dark);
}

.work-teaser__media {
    position: relative;
    aspect-ratio: 443 / 298;
    border-radius: var(--radius-image);
    overflow: hidden;
    background-color: color-mix(in srgb, var(--color-dark) 8%, transparent);
}

.work-teaser--services .work-teaser__media {
    border-radius: 1.875rem;
}

.work-teaser__media picture,
.work-teaser__image {
    display: block;
    width: 100%;
    height: 100%;
}

.work-teaser__image {
    object-fit: cover;
}

.work-teaser__labels {
    position: absolute;
    top: 0.5rem;
    left: 0.625rem;
    right: 0.625rem;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.375rem;
}

.work-teaser--services .work-teaser__labels {
    top: 1rem;
    left: 1.125rem;
    right: 1.125rem;
}

.work-teaser__label {
    padding: 0.375rem 0.75rem;
    border-radius: 100px;
    background-color: var(--color-off-white);
    line-height: 1.2;
    overflow-wrap: anywhere;
}

.work-teaser__label--on-view {
    padding: 0.3125rem 1.0625rem;
    background-color: var(--color-action);
    line-height: 1.4;
}

.work-teaser__body {
    padding: 1.625rem 0.625rem 0;
}

.work-teaser--services .work-teaser__body {
    padding: 1.6875rem 0.3125rem 0;
}

.work-teaser__client {
    margin: 0;
    line-height: 1.1;
    letter-spacing: -0.275px;
    overflow-wrap: anywhere;
}

.work-teaser__title {
    font-size: 1.5625rem;
    font-weight: 300;
    line-height: 1.1;
    letter-spacing: -0.275px;
    overflow-wrap: anywhere;
}

/* 48px for client and title together in Figma. */
.work-teaser__client + .work-teaser__title {
    margin-top: 0.1875rem;
}

/* The theme label opens the theme page: above the card link, which covers the whole card. */
.work-teaser__theme-link {
    position: relative;
    z-index: 1;
    display: inline-flex;
    color: inherit;
}

/* A 44px tall hit area; at most 3px to the sides, so it never covers "on view" or the next card. */
.work-teaser__theme-link::before {
    content: '';
    position: absolute;
    inset: 50% -3px auto;
    height: 2.75rem;
    transform: translateY(-50%);
}

.work-teaser__theme-link .work-teaser__label {
    transition: background-color var(--transition-base);
}

.work-teaser__theme-link:hover .work-teaser__label {
    background-color: color-mix(in srgb, var(--color-off-white), var(--color-dark) 10%);
}

/* The whole card is the link. */
.work-teaser__link::after {
    content: '';
    position: absolute;
    inset: 0;
}

.work-teaser__text {
    max-width: 26.25rem;
    margin: 0.4375rem 0 0;
    font-size: 1.125rem;
    line-height: 1.25;
    overflow-wrap: anywhere;
}

.work-teaser__pills {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 0.5625rem;
}

.work-teaser__pill {
    padding: 0.375rem 1.0625rem;
    border-radius: 100px;
    background-color: var(--color-beige);
    line-height: 1.4;
    letter-spacing: -0.154px;
    overflow-wrap: anywhere;
}

.block--beige .work-teaser__pill {
    background-color: var(--color-off-white);
}

/* In the editor a click on a card selects the block instead of following the link. */
.acf-block-preview .work-teaser__link {
    pointer-events: none;
}
