/* Work / Experiments / Projects views (homepage): the Grid view - a contact sheet of square tiles.
   Heroes take a 2x2 cell and always show their title on a soft ink scrim; other tiles
   show theirs on hover or keyboard focus. Titles wrap rather than truncate. */

.wv-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(132px, 1fr));
    grid-auto-flow: dense;
    gap: 6px;
}

.wv-tile {
    appearance: none;
    position: relative;
    display: block;
    width: 100%;
    aspect-ratio: 1;
    margin: 0;
    padding: 0;
    border: 0;
    background: none;
    color: inherit;
    font: inherit;
    text-align: left;
    cursor: pointer;
    /* Landing spot for the bio's employer links: clear the pinned switcher. */
    scroll-margin-top: 80px;
    transition: transform 0.35s var(--wv-ease), box-shadow 0.35s;
    -webkit-tap-highlight-color: transparent;
}

.wv-tile.is-hero {
    grid-column: span 2;
    grid-row: span 2;
}

.wv-tile:focus-visible {
    outline: 3px solid var(--highlight-yellow);
    outline-offset: 3px;
    border-radius: 8px;
}

.wv-tile-media {
    position: relative;
    display: block;
    height: 100%;
    overflow: hidden;
    border-radius: 6px;
    background: var(--wv-tint);
}

.wv-tile-media > img,
.wv-tile-media > video {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

@media (hover: hover) {
    .wv-tile:hover {
        z-index: 2;
        transform: scale(1.06);
        box-shadow: 0 14px 30px rgba(55, 44, 9, 0.25);
    }
}

/* ---- Labels: title on an ink scrim ---- */

.wv-tile-cap {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    display: block;
    padding: 28px 9px 7px;
    border-radius: 0 0 6px 6px;
    background: linear-gradient(to bottom, rgba(30, 24, 5, 0), rgba(30, 24, 5, 0.7));
    color: var(--bg-color);
    pointer-events: none;
}

.wv-tile-title {
    display: block;
    max-width: 100%;
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 0.8rem;
    line-height: 1.2;
    overflow-wrap: break-word;
    text-wrap: balance;
}

.wv-tile.is-hero .wv-tile-title {
    font-size: 1.1rem;
}

/* Heroes keep their label; the rest show theirs on hover or keyboard focus. */
.wv-tile:not(.is-hero) .wv-tile-cap {
    opacity: 0;
    transition: opacity 0.2s;
}

.wv-tile:not(.is-hero):hover .wv-tile-cap,
.wv-tile:not(.is-hero):focus-visible .wv-tile-cap {
    opacity: 1;
}

@media (max-width: 600px) {
    .wv-grid {
        grid-template-columns: repeat(auto-fill, minmax(92px, 1fr));
        gap: 4px;
    }

    .wv-tile-title {
        font-size: 0.7rem;
    }
}

@media (prefers-reduced-motion: reduce) {
    .wv-tile,
    .wv-tile-cap {
        transition: none;
    }
}
