/* ==========================================================================
   SINGLE PROJECT PAGE  —  [sy_project_page]
   Markup: inc/single-project.php
   ========================================================================== */

.sy-pp {
    --sy-pp-ink: #2c2520;
    --sy-pp-body: #6b6256;
    --sy-pp-muted: #9a938a;
    --sy-pp-serif: 'Cormorant Garamond', 'Times New Roman', Georgia, serif;
    --sy-pp-sans: 'Raleway', Helvetica, Arial, sans-serif;
    --sy-pp-gutter: clamp(20px, 4vw, 64px);

    background: #ffffff;
}

/* Full-bleed helper. The theme sets body { overflow: hidden }, so 100vw
   cannot introduce a horizontal scrollbar. */
.sy-pp-hero,
.sy-pp-gallery {
    width: 100vw;
    max-width: 100vw;
    margin-left: calc(50% - 50vw);
    margin-right: calc(50% - 50vw);
}

/* ==========================================================================
   1. HERO
   ========================================================================== */

.sy-pp-hero {
    position: relative;
    height: clamp(340px, 46vw, 560px);
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #1a1714;
}

.sy-pp-hero-media {
    position: absolute;
    inset: 0;
}

.sy-pp-hero-media img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.sy-pp-hero-scrim {
    position: absolute;
    inset: 0;
    background: rgba(28, 22, 17, 0.28);
}

/*
 * Centred by absolute positioning, not by the parent's flex alignment.
 *
 * The banner is 560px tall and the content was still sitting near the top of
 * it. Rather than keep chasing which rule is winning over align-items, this
 * pins the block to the middle of the section outright: the parent is
 * position:relative, so top/left 50% with a -50%/-50% translate lands it dead
 * centre regardless of what the flex context is doing.
 */
.sy-pp-hero-content {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 100%;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: clamp(12px, 1.6vw, 20px);
    padding: 0 var(--sy-pp-gutter);
    text-align: center;
}

.sy-pp-hero-eyebrow {
    font-family: var(--sy-pp-sans);
    font-size: 10px;
    font-weight: 600;
    letter-spacing: 4.5px;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.88);
}

.sy-pp-hero-title {
    margin: 0;
    font-family: var(--sy-pp-serif);
    font-size: clamp(40px, 6.2vw, 92.8px);
    font-weight: 300;
    line-height: 1.05;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: #ffffff;
}

/* Rules either side, matching the CTA treatment used elsewhere. */
.sy-pp-hero-btn {
    display: inline-flex;
    align-items: center;
    gap: 14px;
    font-family: var(--sy-pp-sans);
    font-size: 10px;
    font-weight: 600;
    letter-spacing: 3px;
    text-transform: uppercase;
    color: #ffffff;
    text-decoration: none;
    padding: 14px 30px;
    border: 1px solid rgba(255, 255, 255, 0.5);
    background: rgba(44, 37, 32, 0.3);
    backdrop-filter: blur(2px);
    transition: background-color 0.45s cubic-bezier(0.22, 0.61, 0.36, 1),
                color 0.45s cubic-bezier(0.22, 0.61, 0.36, 1),
                border-color 0.45s cubic-bezier(0.22, 0.61, 0.36, 1);
}

.sy-pp-hero-btn::before,
.sy-pp-hero-btn::after {
    content: "";
    width: 18px;
    height: 1px;
    background: currentColor;
    opacity: 0.85;
}

.sy-pp-hero-btn:hover,
.sy-pp-hero-btn:focus-visible {
    background: #ffffff;
    border-color: #ffffff;
    color: var(--sy-pp-ink);
}

/* ==========================================================================
   2. INTRO
   ========================================================================== */

.sy-pp-intro {
    padding: clamp(48px, 6.5vw, 96px) var(--sy-pp-gutter) clamp(34px, 4.5vw, 58px);
}

.sy-pp-intro-row {
    display: grid;
    grid-template-columns: 1.05fr 1fr;
    gap: clamp(26px, 5vw, 80px);
    align-items: start;
    max-width: 1360px;
    margin: 0 auto;
}

.sy-pp-intro-heading {
    margin: 0;
    font-family: var(--sy-pp-serif);
    font-size: clamp(25.6px, 2.7vw, 40px);
    font-weight: 300;
    line-height: 1.34;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: var(--sy-pp-ink);
}

.sy-pp-intro-heading em {
    font-style: italic;
    font-weight: 400;
    text-transform: lowercase;
    letter-spacing: 0.01em;
    font-size: 1.1em;
}

.sy-pp-intro-body p {
    margin: 0 0 16px;
    font-family: var(--sy-pp-sans);
    font-size: 13px;
    line-height: 2.05;
    color: var(--sy-pp-body);
}

.sy-pp-intro-body p:last-child {
    margin-bottom: 0;
}

/* ==========================================================================
   3. FIVE-IMAGE MOSAIC
   One tall shot on the left, a two-by-two beside it.
   ========================================================================== */

.sy-pp-mosaic {
    padding: 0 var(--sy-pp-gutter);
}

.sy-pp-mosaic-grid {
    display: grid;
    grid-template-columns: 1.15fr 1fr 1fr;
    grid-template-rows: repeat(2, minmax(0, 1fr));
    gap: 8px;
    height: clamp(420px, 46vw, 640px);
    max-width: 1360px;
    margin: 0 auto;
}

/* The first image spans both rows; the other four fill the two-by-two. */
.sy-pp-m-item--1 {
    grid-row: 1 / 3;
}

.sy-pp-m-item {
    position: relative;
    overflow: hidden;
    background: #ede8e1;

    /* Same reveal as the About page mosaic: slide in from the left with a
       fade, staggered so they arrive in order rather than together. */
    opacity: 0;
    transform: translateX(-45px);
    transition: opacity 1.2s cubic-bezier(0.22, 0.61, 0.36, 1),
                transform 1.2s cubic-bezier(0.22, 0.61, 0.36, 1);
    transition-delay: calc((var(--sy-i, 1) - 1) * 0.16s);
    will-change: opacity, transform;
}

.sy-pp-m-item--visible {
    opacity: 1;
    transform: translateX(0);
}

.sy-pp-m-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

/* Admin-only diagnostic, printed when no gallery images could be found. */
.sy-pp-note {
    max-width: 1360px;
    margin: 0 auto;
    padding: 18px 22px;
    border: 1px dashed #b9a98f;
    background: #fbf7f0;
    font-family: var(--sy-pp-sans);
    font-size: 13px;
    line-height: 1.7;
    color: #6b5f4a;
}

.sy-pp-note code {
    background: #f0e7d8;
    padding: 1px 5px;
}

/* ==========================================================================
   4. GALLERY SLIDER
   Native scroll-snap does the moving; the JS only wires the arrows.
   ========================================================================== */

.sy-pp-gallery {
    position: relative;
    margin-top: clamp(34px, 4.5vw, 64px);
}

.sy-pp-gallery-track {
    display: flex;
    gap: 4px;
    overflow-x: auto;
    overscroll-behavior-x: contain;
    scroll-snap-type: x mandatory;
    scroll-behavior: smooth;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
}

.sy-pp-gallery-track::-webkit-scrollbar {
    display: none;
}

.sy-pp-g-item {
    /* One image fills the frame; the next sits entirely off-screen. */
    flex: 0 0 100%;
    scroll-snap-align: center;
    aspect-ratio: 16 / 9;
    background: #ede8e1;
    overflow: hidden;
}

.sy-pp-g-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

/* --- Arrows: a centred pair sitting inside the foot of the image ---------- */
.sy-pp-g-nav-group {
    position: absolute;
    bottom: clamp(16px, 2.6vw, 34px);
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 10px;
    z-index: 2;
}

.sy-pp-g-nav {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 46px;
    height: 46px;
    padding: 0;
    border: 1px solid rgba(255, 255, 255, 0.55);
    /* Its own scrim: a pale photograph would swallow a bare white outline. */
    background: rgba(44, 37, 32, 0.3);
    backdrop-filter: blur(2px);
    cursor: pointer;
    transition: background-color 0.4s cubic-bezier(0.22, 0.61, 0.36, 1),
                border-color 0.4s cubic-bezier(0.22, 0.61, 0.36, 1);
}

/* Chevrons drawn from two borders — no icon file for two marks. */
.sy-pp-g-nav::before {
    content: "";
    width: 10px;
    height: 10px;
    border-top: 1.5px solid currentColor;
    border-left: 1.5px solid currentColor;
    color: #ffffff;
}

.sy-pp-g-prev::before {
    transform: rotate(-45deg);
    margin-left: 4px;
}

.sy-pp-g-next::before {
    transform: rotate(135deg);
    margin-right: 4px;
}

.sy-pp-g-nav:hover,
.sy-pp-g-nav:focus-visible {
    background: rgba(255, 255, 255, 0.92);
    border-color: #ffffff;
}

.sy-pp-g-nav:hover::before,
.sy-pp-g-nav:focus-visible::before {
    color: var(--sy-pp-ink);
}

/* ==========================================================================
   5. NEXT PROJECT
   ========================================================================== */

.sy-pp-next {
    position: relative;
    height: clamp(240px, 26vw, 360px);
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #1a1714;
    max-width: 1360px;
    margin: clamp(40px, 5vw, 76px) auto clamp(40px, 5vw, 76px);
}

.sy-pp-next-media {
    position: absolute;
    inset: 0;
}

.sy-pp-next-media img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.sy-pp-next-scrim {
    position: absolute;
    inset: 0;
    background: rgba(28, 22, 17, 0.4);
}

.sy-pp-next-content {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    text-align: center;
    padding: 0 var(--sy-pp-gutter);
}

.sy-pp-next-eyebrow {
    font-family: var(--sy-pp-sans);
    font-size: 9px;
    font-weight: 600;
    letter-spacing: 5px;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.85);
}

.sy-pp-next-title {
    margin: 0;
    font-family: var(--sy-pp-serif);
    font-size: clamp(30.4px, 3.6vw, 51.2px);
    font-weight: 300;
    line-height: 1.08;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: #ffffff;
}

.sy-pp-next-btn {
    display: inline-flex;
    align-items: center;
    gap: 14px;
    font-family: var(--sy-pp-sans);
    font-size: 10px;
    font-weight: 600;
    letter-spacing: 3px;
    text-transform: uppercase;
    color: #ffffff;
    text-decoration: none;
    padding: 13px 28px;
    border: 1px solid rgba(255, 255, 255, 0.55);
    transition: background-color 0.45s ease, color 0.45s ease;
}

.sy-pp-next-btn::before,
.sy-pp-next-btn::after {
    content: "";
    width: 16px;
    height: 1px;
    background: currentColor;
    opacity: 0.85;
}

.sy-pp-next-btn:hover,
.sy-pp-next-btn:focus-visible {
    background: #ffffff;
    color: var(--sy-pp-ink);
}

/* ==========================================================================
   RESPONSIVE
   ========================================================================== */

@media (max-width: 1024px) {
    .sy-pp-intro-row {
        grid-template-columns: 1fr;
        gap: 24px;
    }

    .sy-pp-g-item {
        aspect-ratio: 3 / 2;
    }
}

@media (max-width: 767px) {
    /*
     * The three-column mosaic becomes two. The tall shot keeps its span so it
     * still reads as the lead image rather than one tile among five.
     */
    .sy-pp-mosaic-grid {
        grid-template-columns: 1fr 1fr;
        grid-template-rows: repeat(3, minmax(0, 1fr));
        height: clamp(420px, 116vw, 620px);
        gap: 6px;
    }

    .sy-pp-m-item--1 {
        grid-column: 1 / -1;
        grid-row: 1 / 2;
    }

    .sy-pp-g-item {
        aspect-ratio: 4 / 3;
    }

    .sy-pp-g-nav {
        width: 40px;
        height: 40px;
    }

    .sy-pp-hero {
        height: clamp(300px, 76vw, 420px);
    }

    .sy-pp-hero-btn {
        font-size: 9px;
        letter-spacing: 2.2px;
        padding: 12px 20px;
        gap: 10px;
    }

    .sy-pp-hero-btn::before,
    .sy-pp-hero-btn::after {
        width: 12px;
    }

    .sy-pp-next {
        margin-inline: 16px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .sy-pp-m-item {
        opacity: 1;
        transform: none;
        transition: none;
    }

    .sy-pp-gallery-track {
        scroll-behavior: auto;
    }
}
