/* =============================================================
   PÁGINA TRABALHOS — lista editorial dos cases (releitura de uma lista de
   serviços com imagem que segue o cursor): título grande à esquerda, tags à
   direita, filetes entre as linhas. No hover (mouse) a capa do case aparece
   e acompanha o ponteiro; no toque, cada linha mostra a capa em miniatura.
   Mesma largura das páginas de case (1280px, 32px de margem). Cores pelos
   tokens de nav.css, claro e escuro. Instrument Serif nos títulos.
   ============================================================= */

.trabalhos-page {
    --muted: color-mix(in srgb, var(--fg) 45%, transparent);
    --soft: color-mix(in srgb, var(--fg) 72%, transparent);
}

.trabalhos-page .site-copyright {
    visibility: hidden;
}

.tr {
    position: relative;
    z-index: 1;
    background: var(--bg);
    padding: clamp(112px, 14vw, 168px) max(32px, calc((100% - 1216px) / 2)) clamp(120px, 14vw, 200px);
    border-radius: 0 0 28px 28px;
    box-shadow: 0 30px 60px -30px rgba(0, 0, 0, 0.45);
    min-height: 100svh;
}

.tr-head {
    padding-bottom: clamp(28px, 4vw, 48px);
    border-bottom: 1px solid var(--line);
}

/* O rótulo é o h1 da página (SEO e leitores de tela), com a aparência do rótulo dos cases. */
.tr-head .work-block-label {
    margin: 0;
}

/* --- Lista --- */

.tr-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.tr-row {
    border-bottom: 1px solid var(--line);
}

.tr-link {
    display: grid;
    grid-template-columns: 44px minmax(0, 1fr) auto 56px;
    align-items: center;
    column-gap: clamp(16px, 3vw, 40px);
    padding: clamp(20px, 2.6vw, 34px) 0;
    color: inherit;
    text-decoration: none;
    transition: opacity 0.35s ease;
}

/* Com um item em foco, os outros recuam. */
.tr-list:has(.tr-link:hover) .tr-link:not(:hover),
.tr-list:has(.tr-link:focus-visible) .tr-link:not(:focus-visible) {
    opacity: 0.32;
}

.tr-num,
.tr-year {
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.06em;
    color: var(--muted);
    font-variant-numeric: tabular-nums;
}

.tr-year {
    text-align: right;
}

.tr-title {
    font-family: "Instrument Serif", serif;
    font-size: clamp(38px, 6vw, 88px);
    line-height: 1;
    letter-spacing: -0.015em;
    overflow-wrap: anywhere;
    transition: transform 0.45s cubic-bezier(0.22, 1, 0.36, 1);
}

.tr-link:hover .tr-title,
.tr-link:focus-visible .tr-title {
    transform: translateX(10px);
}

.tr-tags {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 6px 0;
    max-width: 360px;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.07em;
    text-transform: uppercase;
    color: var(--soft);
}

.tr-tags > span + span::before {
    content: "";
    display: inline-block;
    width: 4px;
    height: 4px;
    margin: 0 12px 1px;
    border-radius: 50%;
    background: currentColor;
    opacity: 0.55;
}

.tr-link:focus-visible {
    outline: 2px solid var(--fg);
    outline-offset: 4px;
    border-radius: 4px;
}

/* Miniatura da capa: só aparece onde não há hover (toque). */
.tr-thumb {
    display: none;
}

/* --- Rastro de imagens (só mouse): camada fixa sobre a página --- */

.tr-trail {
    position: fixed;
    inset: 0;
    z-index: 40;
    overflow: hidden;
    pointer-events: none;
}

.tr-trail-img {
    position: absolute;
    top: 0;
    left: 0;
    width: clamp(150px, 14vw, 210px);
    aspect-ratio: 1.1;
    border-radius: 12px;
    overflow: hidden;
    opacity: 0;
    background: var(--surface);
    box-shadow: 0 24px 48px -18px rgba(0, 0, 0, 0.4);
    will-change: transform, opacity;
}

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

@media (hover: none), (pointer: coarse) {
    .tr-trail {
        display: none;
    }

    .tr-list:has(.tr-link:hover) .tr-link:not(:hover) {
        opacity: 1;
    }
}

/* --- Celular --- */

@media (max-width: 767.98px) {
    .tr {
        padding-top: 104px;
        padding-left: 20px;
        padding-right: 20px;
        border-radius: 0 0 20px 20px;
    }

    .tr-link {
        grid-template-columns: minmax(0, 1fr) 96px;
        grid-template-areas:
            "num   thumb"
            "title thumb"
            "tags  thumb";
        row-gap: 10px;
        align-items: start;
        padding: 22px 0;
    }

    .tr-num {
        grid-area: num;
    }

    .tr-title {
        grid-area: title;
        font-size: clamp(34px, 11vw, 48px);
    }

    .tr-tags {
        grid-area: tags;
        justify-content: flex-start;
        gap: 4px 14px;
        max-width: none;
        font-size: 10.5px;
    }

    /* Sem separador: quando as tags quebram de linha, o ponto ficaria órfão. */
    .tr-tags > span + span::before {
        display: none;
    }

    .tr-year {
        display: none;
    }

    .tr-thumb {
        grid-area: thumb;
        display: block;
        width: 96px;
        aspect-ratio: 4 / 5;
        object-fit: cover;
        border-radius: 8px;
        background: var(--surface);
    }

}

@media (prefers-reduced-motion: reduce) {
    .tr-title,
    .tr-link {
        transition: none;
    }

    .tr-link:hover .tr-title {
        transform: none;
    }
}
