/* PDF p.10 — copy on the start side, filmstrip carousel on the other.
   The centred slide fills most of the stage; slivers of the neighbours
   peek past its edges thanks to the viewport's overflow clipping. */

.project-peek {
    display: grid;
    grid-template-columns: minmax(240px, 32vw) minmax(0, 1fr);
    align-items: start;
    min-height: 100vh;
    padding-block: clamp(72px, 8vh, 96px) 48px;
    padding-inline-start: clamp(24px, 11.67vw, 224px);
    padding-inline-end: 0;
    background: #FFFFFF;
    color: #14120F;
}

/* — Left column: script title, copy, "See More" — */

.project-peek__copy {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    max-width: 22em;
    padding-block-start: 6vh;
    padding-inline-end: 32px;
}

.project-peek__title {
    margin: 0 0 28px;
    font-family: var(--font-script);
    font-weight: 400;
    font-size: clamp(42px, 4.8vw, 78px);
    line-height: 1;
    color: #9A9590;
}

.project-peek__body {
    font-family: var(--font-serif);
    font-size: clamp(15px, 1.05vw, 18px);
    line-height: 1.85;
}

.project-peek__body p { margin: 0; }
.project-peek__body p + p { margin-block-start: 1.4em; }

.project-peek__cta {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-block-start: 36px;
    min-width: 130px;
    height: 36px;
    padding: 0 18px;
    background: #14120F;
    color: #FAF7F2;
    font-family: var(--font-serif);
    font-size: 14px;
    letter-spacing: 0.02em;
    text-decoration: none;
}

.project-peek__cta:hover { opacity: 0.82; }

/* — Right column: filmstrip carousel — */

.project-peek__stage {
    position: relative;
    min-width: 0;
    /* Slide width and viewport height. --peek-step-pct is authored so the
       CSS can drive the initial visual balance; JS just paints transforms. */
    --peek-slide-w: 78%;
    --peek-slide-h: 78vh;
    --peek-slide-h-max: 620px;
    --peek-gap: 20px;
}

.project-peek__viewport {
    position: relative;
    overflow: hidden;
    height: var(--peek-slide-h);
    max-height: var(--peek-slide-h-max);
}

.project-peek__track {
    display: flex;
    align-items: stretch;
    height: 100%;
    gap: var(--peek-gap);
    list-style: none;
    margin: 0;
    padding: 0;
    /* Track transform is written by JS so the current slide is centred. */
    transform: translateX(0);
    transition: transform 560ms cubic-bezier(0.76, 0, 0.24, 1);
    will-change: transform;
}

.project-peek__slide {
    flex: 0 0 var(--peek-slide-w);
    height: 100%;
}

.project-peek__shot {
    display: block;
    width: 100%;
    height: 100%;
    padding: 0;
    border: 0;
    background: #E8E2D8;
    cursor: pointer;
}

.project-peek__slide.is-current .project-peek__shot { cursor: zoom-in; }

.project-peek__shot img,
.project-peek__shot video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    pointer-events: none;
}

/* — Scrubber — */

.project-peek__rail {
    position: relative;
    height: 34px;
    margin-block-start: 22px;
    margin-inline-end: 6vw;
    touch-action: none;
}

.project-peek__rail-line {
    position: absolute;
    inset-inline: 0;
    top: 50%;
    height: 1px;
    background: #14120F;
    pointer-events: none;
}

.project-peek__rail-track {
    position: absolute;
    inset: 0;
    background: transparent;
    border: 0;
    padding: 0;
    cursor: pointer;
}

.project-peek__rail-dot {
    position: absolute;
    top: 50%;
    inset-inline-start: 0;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #14120F;
    transform: translate(-50%, -50%);
    pointer-events: none;
    transition: inset-inline-start 320ms cubic-bezier(0.76, 0, 0.24, 1);
}

.project-peek__rail.is-dragging .project-peek__rail-dot {
    transition: none;
}

/* — CMS module variants (`fwd/מודל 2, 3, 5, 6`) — */

/* One photo filling the stage instead of a filmstrip. Without the rail the
   photo takes the height the filmstrip + scrubber would have used. */
.project-peek--single {
    min-height: 0;
    padding-block: clamp(72px, 8vh, 96px);
}

.project-peek--single .project-peek__stage {
    --peek-slide-w: 100%;
    --peek-slide-h: 78vh;
    --peek-slide-h-max: none;
}

/* Mirror: photo on the start side, copy hugging the end margin. */
.project-peek--reverse {
    grid-template-columns: minmax(0, 1fr) minmax(240px, 32vw);
    padding-inline-start: 0;
    padding-inline-end: clamp(24px, 11.67vw, 224px);
}

.project-peek--reverse .project-peek__copy {
    grid-column: 2;
    grid-row: 1;
    justify-self: end;
    padding-inline-end: 0;
    padding-inline-start: 32px;
}

.project-peek--reverse .project-peek__stage {
    grid-column: 1;
    grid-row: 1;
}

/* Edge-to-edge filmstrip; neighbours peek on both sides. */
.project-peek--strip,
.project-peek--bare {
    grid-template-columns: minmax(0, 1fr);
    min-height: 0;
    padding-block: clamp(72px, 8vh, 96px);
}

.project-peek--strip { padding-inline: 0; }

.project-peek--strip .project-peek__copy {
    max-width: none;
    padding-block-start: 0;
    padding-block-end: 40px;
    padding-inline: clamp(24px, 11.67vw, 224px);
}

.project-peek--strip .project-peek__stage { --peek-slide-w: 62%; }

.project-peek--strip .project-peek__rail {
    margin-inline: clamp(24px, 11.67vw, 224px);
}

/* Copy surfaces line by line once the photos enter the frame. */
.project-peek[data-peek-reveal] .project-peek__copy > * {
    opacity: 0;
    transform: translateY(16px);
    transition:
        opacity 700ms cubic-bezier(0.22, 1, 0.36, 1),
        transform 700ms cubic-bezier(0.22, 1, 0.36, 1);
}

.project-peek[data-peek-reveal] .project-peek__copy > :nth-child(2) { transition-delay: 160ms; }
.project-peek[data-peek-reveal] .project-peek__copy > :nth-child(3) { transition-delay: 320ms; }

.project-peek[data-peek-reveal].is-revealed .project-peek__copy > * {
    opacity: 1;
    transform: none;
}

/* — Responsive — */

@media (max-width: 960px) {
    .project-peek--reverse,
    .project-peek--strip {
        grid-template-columns: 1fr;
        padding-inline: var(--space-5);
    }

    .project-peek--reverse .project-peek__copy,
    .project-peek--reverse .project-peek__stage {
        grid-column: auto;
        grid-row: auto;
        justify-self: stretch;
        padding-inline: 0;
    }

    .project-peek.project-peek--strip { padding-inline: 0; }

    .project-peek--strip .project-peek__copy { padding-inline: var(--space-5); }
    .project-peek--strip .project-peek__rail { margin-inline: var(--space-5); }

    .project-peek--strip .project-peek__stage { --peek-slide-w: 80%; }
    .project-peek--single .project-peek__stage { --peek-slide-h: 56vh; }

    .project-peek {
        grid-template-columns: 1fr;
        min-height: 0;
        padding-inline: var(--space-5);
        padding-block: var(--space-7);
    }

    .project-peek__copy {
        max-width: none;
        padding: 0 0 var(--space-5);
    }

    .project-peek__stage {
        --peek-slide-w: 88%;
        --peek-slide-h: 56vh;
        --peek-gap: 10px;
    }

    .project-peek__viewport { height: var(--peek-slide-h); }

    .project-peek__rail { margin-inline-end: 0; }
}
