/* =========================================================
   WORK PAGE — modelled on a24films.com/films
   ========================================================= */

.work-page {
    background: #fff;
    color: #111;
}

/* ---- Nav: dark text on white ---- */
.work-page #nav {
    background: #fff;
    border-bottom: 1px solid #e8e8e8;
}

.work-page #nav.scrolled {
    background: rgba(255,255,255,0.96);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-bottom-color: #e8e8e8;
}

.work-page .nav-logo       { color: #111; }
.work-page .nav-logo:hover { color: #888; }
.work-page .burger         { color: #111; }
.work-page .burger:hover   { color: #888; }
.work-page .nav-dop        { color: #aaa; }

/* ---- Page label ---- */
.work-header {
    padding: calc(var(--nav-h) + 48px) 48px 32px;
}

.work-header .section-label { display: none; }

.work-title {
    font-size: 0.63rem;
    font-weight: 400;
    letter-spacing: 0.28em;
    text-transform: uppercase;
    color: #999;
}

/* ---- Grid: 3-column flexbox, gutters via negative margin ---- */
/* Mirrors: .grid { display:flex; flex-wrap:wrap; margin:-15px } + .media-tile { width:33% } */
.work-list {
    display: flex;
    flex-wrap: wrap;
    flex-direction: row;
    justify-content: flex-start;
    align-items: flex-start;
    align-content: flex-start;
    margin-left:  -15px;
    margin-right: -15px;
    padding: 0 33px 100px; /* 48px page pad − 15px gutter = 33px */
}

/* ---- Card ---- */
.work-item {
    width: 33.33333%;
    padding-left:  15px;
    padding-right: 15px;
    margin-bottom: 50px;
    text-decoration: none;
    color: #111;
    display: block;
    transition: color 100ms linear;
}

.work-item:hover { color: #888; }

/* ---- Image box: padding-bottom aspect-ratio trick ---- */
/* A24 source values:
     default  → padding-bottom: 77%     (slightly landscape)
     portrait → padding-bottom: 117.5%  (taller than wide)
     wide     → padding-bottom: 65.5%   (wider landscape)
   Pattern per 6-item cycle:
     pos 1, 6, 7, 12, 13 … → portrait
     pos 3, 4, 9, 10       → wide landscape
     all others             → default                         */
.work-item-image {
    position: relative;
    width: 100%;
    overflow: hidden;
    background: #f0f0f0;
    margin-bottom: 15px;
}

.work-item-image::before {
    content: '';
    display: block;
    padding-bottom: 77%; /* default */
}

/* Portrait positions */
.work-item:nth-child(1)     .work-item-image::before,
.work-item:nth-child(6n)    .work-item-image::before,
.work-item:nth-child(6n+1)  .work-item-image::before {
    padding-bottom: 117.5%;
}

/* Wider landscape positions */
.work-item:nth-child(3)  .work-item-image::before,
.work-item:nth-child(4)  .work-item-image::before,
.work-item:nth-child(9)  .work-item-image::before,
.work-item:nth-child(10) .work-item-image::before {
    padding-bottom: 65.5%;
}

.work-item-image img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: opacity 150ms linear;
}

.work-item:hover .work-item-image img { opacity: 0.85; }

/* ---- Text below image ---- */
.work-item-info {
    display: flex;
    flex-direction: column;
    gap: 3px;
}

/* Year — small gray, like A24's <h6> in figcaption */
.work-item-year {
    font-size: 11px;
    font-weight: 400;
    color: #888;
    line-height: 18px;
}

/* Title — clean, regular weight, like A24's <h3> */
.work-item-title {
    font-family: var(--font-display);
    font-size: 16px;
    font-weight: 400;
    letter-spacing: -0.01em;
    line-height: 1.2;
    color: inherit;
    margin: 0;
}

/* Category — very subtle, below title */
.work-item-category {
    font-size: 10px;
    color: #bbb;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    margin-top: 2px;
}

.work-item-meta  { display: none; }
.work-item-arrow { display: none; }

/* ---- Footer ---- */
.work-page footer {
    background: #fff;
    border-top: 1px solid #e8e8e8;
}

.work-page footer p { color: #bbb; }

/* ---- Responsive ---- */
@media screen and (min-width: 1024px) {
    .work-item { margin-bottom: 80px; }
}

@media (max-width: 640px) {
    .work-header {
        padding: calc(var(--nav-h) + 32px) 24px 24px;
    }

    .work-list {
        margin-left:  -9px;
        margin-right: -9px;
        padding: 0 15px 80px;
    }

    .work-item {
        width: 50%;
        padding-left:  9px;
        padding-right: 9px;
        margin-bottom: 32px;
    }

    /* Uniform aspect ratio on mobile — no staggering */
    .work-item:nth-child(1)    .work-item-image::before,
    .work-item:nth-child(6n)   .work-item-image::before,
    .work-item:nth-child(6n+1) .work-item-image::before,
    .work-item:nth-child(3)    .work-item-image::before,
    .work-item:nth-child(4)    .work-item-image::before,
    .work-item:nth-child(9)    .work-item-image::before,
    .work-item:nth-child(10)   .work-item-image::before {
        padding-bottom: 77%;
    }

    .work-item-title { font-size: 13px; }
}
