
/* Scroll gallery: a quiet title behind six staggered photographic frames. */
.home-365-editorial .home-365-content {
    display: block;
    padding: 0 0 5rem;
}
.home-365-editorial .home-365-heading {
    position: sticky;
    top: 0;
    height: 100svh;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    align-items: center;
    padding: clamp(6rem, 18svh, 12rem) 8vw 5rem;
    z-index: 0;
    max-width: none;
}
.home-365-project.home-365-editorial .home-365-heading h2.home-365-title {
    max-width: none;
    font-size: 1.6rem;
    line-height: 1.4;
    margin: 0;
    letter-spacing: 0.05em;
    text-wrap: balance;
}
.home-page .home-365-project.home-365-editorial .home-365-heading-copy {
    max-width: 52ch;
    margin: 1.5rem auto 0;
    color: rgba(255, 255, 255, 0.72);
}
/* The introduction sits on the page surface, so Light mode needs dark copy. */
html[data-theme="light"] .home-page .home-365-project.home-365-editorial .home-365-heading-copy {
    color: var(--color-text);
}
.home-365-editorial .home-365-scroll-sequence {
    height: auto;
    margin-top: 12svh;
    position: relative;
    z-index: 1;
}
.home-365-gallery {
    display: grid;
    grid-template-columns: repeat(12, minmax(0, 1fr));
    column-gap: 2vw;
    row-gap: clamp(6rem, 13vw, 15rem);
    padding: 0 4vw 8rem;
}
.home-365-gallery-item {
    min-width: 0;
    width: 92%;
    margin: 0;
    grid-column: 1 / 6;
}
.home-365-gallery-item:nth-child(1) { grid-row: 1; }
.home-365-gallery-item:nth-child(2) { grid-row: 2; }
.home-365-gallery-item:nth-child(3) { grid-row: 3; }
.home-365-gallery-item:nth-child(4) { grid-row: 4; }
.home-365-gallery-item:nth-child(5) { grid-row: 5; }
.home-365-gallery-item:nth-child(6) { grid-row: 6; }
.home-365-gallery-item:nth-child(3n + 2) { grid-column: 7 / 13; justify-self: end; }
.home-365-gallery-item:nth-child(3n + 3) { grid-column: 4 / 10; justify-self: center; }
.home-365-gallery-photo {
    position: relative;
    display: block;
    overflow: hidden;
    aspect-ratio: 3 / 2;
    background: #171717;
    color: inherit;
    clip-path: inset(0);
}
/* Keep photo links opaque on hover so the sticky heading behind them never shows through. */
.home-365-gallery-photo:hover,
.home-365-gallery-photo:focus-visible {
    opacity: 1;
}
.home-365-gallery-photo img {
    display: block;
    position: absolute;
    top: -10%;
    width: 100%;
    height: 120%;
    object-fit: cover;
    object-position: center;
    filter: grayscale(1);
    transform: translate3d(0, var(--gallery-shift, 0px), 0) scale(1);
    transition: scale 1.1s cubic-bezier(0.22, 1, 0.36, 1);
}
.home-365-gallery-item.is-gallery-pending .home-365-gallery-photo {
    clip-path: inset(100% 0 0 0);
}
.home-365-gallery-item.is-gallery-pending img { scale: 1.16; }
.home-365-gallery-item.is-gallery-revealed .home-365-gallery-photo {
    transition: clip-path 0.9s cubic-bezier(0.16, 1, 0.3, 1);
}
.home-365-gallery-caption {
    display: inline-flex;
    align-items: baseline;
    gap: 0.8rem;
    margin-top: 1rem;
    color: #fff;
    text-decoration: none;
}
.home-365-gallery-caption .home-365-month-year { flex: none; font-size: 1rem; }
.home-365-gallery-caption .home-365-month-name { font-size: clamp(1.6rem, 2.6vw, 2.8rem); }
.home-365-gallery-photo:focus-visible,
.home-365-gallery-caption:focus-visible {
    outline: 2px solid #fff;
    outline-offset: 6px;
}
.home-365-gallery-item:focus-within .home-365-gallery-photo { clip-path: inset(0); }
.home-365-gallery-item:focus-within img { scale: 1; }
.home-365-gallery-footer { display: flex; justify-content: center; padding: 0 1.5rem 2rem; }

@media (max-width: 900px) {
    .home-365-editorial .home-365-heading {
        position: relative;
        height: auto;
        min-height: 0;
        /* Match .home-intro-summary's 5.25rem / 5rem outer spacing. */
        padding: 5.25rem 7vw 5rem;
    }
    .home-365-project.home-365-editorial .home-365-heading h2.home-365-title {
        margin-bottom: var(--home-heading-copy-gap);
    }
    .home-page .home-365-project.home-365-editorial .home-365-heading-copy {
        margin-top: 0;
    }
    .home-365-editorial .home-365-scroll-sequence { margin-top: 0; }
    /* Match the 365 index's LIST view: month on the left, thumbnail on the right. */
    .home-365-gallery {
        display: flex;
        flex-direction: column;
        gap: 0;
        padding: 0 7vw 4rem;
    }
    .home-365-gallery-item {
        display: grid;
        grid-template-columns: minmax(0, 1fr) minmax(7.5rem, 32vw);
        align-items: center;
        gap: 1rem;
        width: 100%;
        min-height: 6.5rem;
        padding: 1rem 0;
        border-top: 1px solid var(--color-border);
    }
    .home-365-gallery-item:first-child {
        border-top: 0;
        padding-top: 0;
    }
    .home-365-gallery-item:last-child {
        border-bottom: 1px solid var(--color-border);
    }
    .home-365-gallery-photo {
        grid-column: 2;
        grid-row: 1;
        width: 100%;
        aspect-ratio: 16 / 9;
    }
    .home-365-gallery-item > figcaption {
        grid-column: 1;
        grid-row: 1;
        min-width: 0;
        text-align: center;
    }
    .home-365-gallery-caption {
        display: flex;
        justify-content: center;
        gap: clamp(0.8rem, 2vw, 1.4rem);
        margin-top: 0;
        color: var(--color-text);
    }
    .home-365-gallery-caption .home-365-month-year {
        font-size: clamp(0.95rem, 1.25vw, 1.15rem);
        color: var(--color-text);
    }
    .home-365-gallery-caption .home-365-month-name {
        font-size: clamp(1.7rem, 4vw, 3.2rem);
    }
    /* Small list thumbnails stay still and visible, including during fast scrolling. */
    .home-365-editorial .home-365-gallery-item .home-365-gallery-photo {
        clip-path: inset(0);
        transition: none;
    }
    .home-365-gallery-item .home-365-gallery-photo img {
        top: 0;
        height: 100%;
        transform: none;
        scale: 1;
        transition: none;
    }
    .home-365-gallery-photo:focus-visible,
    .home-365-gallery-caption:focus-visible {
        outline-color: var(--color-text);
    }
}
@media (max-width: 620px) {
    .home-365-gallery-item {
        grid-template-columns: minmax(0, 1fr) clamp(4rem, 20vw, 7.5rem);
    }
    .home-365-gallery-item > figcaption { text-align: left; }
    .home-365-gallery-caption {
        flex-direction: column;
        align-items: flex-start;
        justify-content: flex-start;
        gap: 0.4rem;
    }
}
@media (prefers-reduced-motion: reduce) {
    .home-365-gallery-item .home-365-gallery-photo {
        clip-path: inset(0);
        transition: none;
    }
    .home-365-gallery-item .home-365-gallery-photo img {
        transform: none;
        scale: 1;
        transition: none;
    }
}
