/* Project Gallery — Editorial Layout
   Clean sections: info left, massive image right */

.project-gallery {
    padding: 0;
}

.project-gallery .container {
    max-width: none;
    padding: 0;
}

.project-gallery__grid-wrap {
    width: 100%;
    max-width: 100%;
    overflow: hidden;
    padding: 0;
    position: relative;
}

.project-gallery__grid {
    display: flex;
    flex-direction: column;
}


/* ============================================
   PROJECT SECTION — one per project
   ============================================ */
.proj-section {
    display: grid;
    grid-template-columns: 2fr 3fr;
    align-items: stretch;
    overflow: hidden;
    position: relative;
    background: transparent;
    border-top: 0.5px solid #c8c8c8;
}

/* ── Info side (left) ── */
.proj-section__info {
    padding: clamp(48px, 6vw, 80px) clamp(32px, 4vw, 64px);
    display: flex;
    justify-content: center;
    position: relative;
    z-index: 2;
}

/* Number sits to the left of the text — large display */
.proj-section__number {
    font-family: var(--font-heading);
    font-size: clamp(3rem, 5vw, 5rem);
    font-weight: 700;
    color: #eee;
    flex-shrink: 0;
    width: clamp(70px, 8vw, 110px);
    line-height: 1;
    padding-top: 4px;
}

/* Text block — name + desc inline */
.proj-section__text {
    flex: 1;
}

/* The inline paragraph: bold name then gray description */
.proj-section__inline {
    font-family: var(--font-heading);
    font-size: clamp(1.4rem, 2.2vw, 2rem);
    font-weight: 400;
    line-height: 1.35;
    letter-spacing: -0.015em;
    color: #bbb;
    margin: 0 0 clamp(20px, 2.5vw, 32px);
    min-height: 2.7em;
}

.proj-section__inline strong {
    font-weight: 700;
    color: #111;
}

/* Sector tag — small, above the text */
.proj-section__sector {
    font-family: var(--font-body);
    font-size: 0.6rem;
    font-weight: 600;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: #bbb;
    margin-bottom: var(--space-3);
    display: block;
}

/* Metrics row */
.proj-section__meta {
    display: flex;
    flex-wrap: wrap;
    gap: clamp(24px, 3vw, 40px);
    margin-bottom: clamp(20px, 2.5vw, 28px);
}

/* Small breathing room when a project has no meta values (e.g. CN — Milton) */
.proj-section__meta-spacer {
    height: clamp(12px, 1.4vw, 18px);
}

.proj-section__meta-item {
    line-height: 1.2;
}

.proj-section__meta-value {
    font-family: var(--font-heading);
    font-size: clamp(1rem, 1.3vw, 1.2rem);
    font-weight: 700;
    color: #111;
    display: block;
}

.proj-section__meta-label {
    font-size: 0.55rem;
    font-weight: 600;
    color: #ccc;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    margin-top: 2px;
    display: block;
}

/* CTA button — black pill */
.proj-section__cta {
    display: inline-flex;
    align-items: center;
    gap: 16px;
    font-family: var(--font-body);
    font-size: 1.15rem;
    font-weight: 600;
    color: #fff;
    background: #1a1814;
    border-radius: 100px;
    padding: 24px 48px;
    text-decoration: none;
    transition: background 0.25s ease, gap 0.25s ease;
    width: fit-content;
}

.proj-section__cta:hover {
    background: #333;
    gap: 20px;
}

.proj-section__cta svg {
    width: 20px;
    height: 20px;
}


/* ── Image side — drawing sheet ── */
.proj-section__images {
    position: relative;
    min-width: 0;
    display: flex;
    align-items: stretch;
    overflow: hidden;
    align-self: start;
    z-index: 2;
}

/* Projects + USA pages: stack images and arrows vertically */
#projects-grid .proj-section__images,
#usa-grid .proj-section__images {
    flex-direction: column;
}

/* Homepage: circle buttons overlapping images */
.proj-section__nav-circle {
    position: absolute;
    bottom: var(--space-6);
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 4;
    transition: background var(--duration-base) var(--ease-out);
    color: var(--color-pure-white);
    font-size: 1rem;
}

.proj-section__nav-circle:hover {
    background: rgba(255, 255, 255, 0.2);
}

.proj-section__nav-circle--prev {
    left: var(--space-6);
}

.proj-section__nav-circle--next {
    right: var(--space-6);
}

/* Drawing sheet — image container within the unified row sheet */
.proj-section__drawing {
    position: relative;
    width: 100%;
    overflow: hidden;
    display: flex;
    align-items: center;
}

/* Left + right edge panels — always visible over scrolling images */
.proj-section__drawing::before {
    content: '';
    position: absolute;
    inset: 0;
    z-index: 3;
    pointer-events: none;
    background: linear-gradient(
        to right,
        #fafaf8 0px, #fafaf8 28px,
        transparent 28px,
        transparent calc(100% - 28px),
        #fafaf8 calc(100% - 28px), #fafaf8 100%
    );
}


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

/* Placeholder — no-image projects */
.proj-section--no-image .proj-section__title-block {
    display: none;
}

.proj-section--no-image .proj-section__drawing::before {
    display: none;
}

.proj-section--no-image .proj-section__images {
    align-self: stretch;
    min-height: 280px;
}

.proj-section--no-image .proj-section__drawing {
    height: 100%;
}

/* Flip card container */
.proj-section__flip {
    width: 100%;
    height: 100%;
    perspective: 800px;
}

.proj-section__flip-inner {
    position: relative;
    width: 100%;
    height: 100%;
    transition: transform 0.5s ease;
    transform-style: preserve-3d;
}

.proj-section__flip-inner--flipped {
    transform: rotateY(180deg);
}

.proj-section__flip-front,
.proj-section__flip-back {
    width: 100%;
    height: 100%;
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
}

.proj-section__flip-back {
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    transform: rotateY(180deg);
}

.proj-section__placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    min-height: 80px;
}

.proj-section__placeholder svg {
    transition: transform 0.3s ease, filter 0.3s ease;
    filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.15));
}

.proj-section__flip:hover .proj-section__placeholder svg {
    transform: scale(1.15) translateY(-4px);
    filter: drop-shadow(0 10px 20px rgba(0, 0, 0, 0.25));
}

/* Shared card map */
.proj-section__card-map {
    width: 100%;
    height: 100%;
    background: #F5E6D3;
}

.proj-section__map-pin {
    background: none !important;
    border: none !important;
}

/* Title block — bottom-right corner stamp */
.proj-section__title-block {
    position: absolute;
    bottom: 0;
    right: 0;
    background: rgba(250, 250, 248, 0.95);
    border-top: 1.5px solid #c8c8c8;
    border-left: 1.5px solid #c8c8c8;
    border-bottom: 1.5px solid #c8c8c8;
    padding: 10px 14px;
    min-width: 180px;
    font-family: var(--font-body);
    z-index: 3;
}

/* Title block — bottom-left for flipped rows */
.proj-section--flipped .proj-section__title-block {
    right: auto;
    left: 0;
    border-left: none;
    border-right: 1.5px solid #c8c8c8;
}

.proj-section__title-block-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    padding-bottom: 5px;
    margin-bottom: 5px;
    border-bottom: 1px solid #e0e0e0;
}

.proj-section__title-block-sheet,
.proj-section__title-block-sector {
    font-size: 0.5rem;
    font-weight: 600;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: #aaa;
}

.proj-section__title-block-name {
    font-size: 0.75rem;
    font-weight: 700;
    color: #111;
    line-height: 1.25;
    margin-bottom: 5px;
}

.proj-section__title-block-meta {
    font-size: 0.5rem;
    font-weight: 500;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: #aaa;
}


/* ── The film strip — one continuous moving piece ──
   Sprocket holes are baked into the strip via radial-gradient
   so they tile infinitely and scroll with the frames. */
.proj-section__film-strip {
    display: flex;
    flex-direction: column;
    will-change: transform;
}

/* Strip width is driven by the track; sprocket rails stretch to match */
.proj-section__film-strip,
.proj-section__film-strip::before,
.proj-section__film-strip::after {
    min-width: max-content;
}

/* Sprocket rails — hidden */
.proj-section__film-strip::before,
.proj-section__film-strip::after {
    display: none;
}

/* ── Frames row ── */
.proj-section__film-track {
    display: flex;
    gap: 8px;
    padding: 0;
    background: transparent;
    align-items: center;
}

/* ── Film frames ── */
.proj-section__hero-wrap,
.proj-section__thumb {
    overflow: hidden;
    position: relative;
    height: clamp(260px, 30vw, 440px);
    border-radius: 4px;
    flex-shrink: 0;
    margin: 0;
}

.proj-section__hero-wrap {
    width: clamp(240px, 26vw, 400px);
}

.proj-section__thumb {
    width: clamp(160px, 18vw, 280px);
    cursor: pointer;
}

.proj-section__hero-img,
.proj-section__thumb-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: filter 0.5s ease;
}

.proj-section__hero-wrap:hover .proj-section__hero-img,
.proj-section__thumb:hover .proj-section__thumb-img {
    filter: brightness(1.05);
}

/* No separate .thumbs wrapper needed — frames sit flat in the track */
.proj-section__thumbs {
    display: contents;
}

/* ── Film splice — the diagonal cut/tape between loops ── */
.proj-section__splice {
    flex-shrink: 0;
    width: 28px;
    height: 100%;
    position: relative;
    background: #1a1814;
    overflow: hidden;
}

/* Diagonal cut line */
.proj-section__splice::before {
    content: '';
    position: absolute;
    top: -10%;
    left: 50%;
    width: 2px;
    height: 120%;
    background: #444;
    transform: rotate(12deg);
    transform-origin: center center;
}

/* Tape across the splice */
.proj-section__splice::after {
    content: '';
    position: absolute;
    top: 30%;
    left: -4px;
    right: -4px;
    height: 40%;
    background: rgba(180, 160, 100, 0.15);
    border-top: 1px solid rgba(180, 160, 100, 0.25);
    border-bottom: 1px solid rgba(180, 160, 100, 0.25);
    transform: rotate(12deg);
}

/* ── Manual scroll — left/right buttons instead of auto-scroll ── */
@keyframes filmstrip-pull {
    from { transform: translateX(0); }
    to   { transform: translateX(calc(-1 * var(--filmstrip-offset, 50%))); }
}

@keyframes filmstrip-push {
    from { transform: translateX(calc(-1 * var(--filmstrip-offset, 33.33%))); }
    to   { transform: translateX(0); }
}

/* Auto-scroll disabled on homepage featured section only */
#project-gallery-grid .proj-section__film-strip--animate,
#project-gallery-grid .proj-section__film-strip--animate-reverse {
    animation: none;
}

/* Projects page — also manual scroll */
#projects-grid .proj-section__film-strip--animate,
#projects-grid .proj-section__film-strip--animate-reverse {
    animation: none;
}

#projects-grid .proj-section__drawing {
    overflow-x: auto !important;
    overflow-y: hidden !important;
    scroll-behavior: smooth;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
}

#projects-grid .proj-section__drawing::-webkit-scrollbar {
    display: none;
}

#projects-grid .proj-section__drawing::before {
    display: none;
}

/* Card clips its film-strip to the pill's rounded corners.
   Inner drag-scroll still works because .proj-section__drawing
   has its own overflow-x: auto above. */
#projects-grid .proj-section {
    overflow: hidden;
}

#projects-grid .proj-section__images {
    overflow: hidden;
}

/* USA page — same manual scroll treatment */
#usa-grid .proj-section__film-strip--animate,
#usa-grid .proj-section__film-strip--animate-reverse {
    animation: none;
}

#usa-grid .proj-section__drawing {
    overflow-x: auto !important;
    overflow-y: hidden !important;
    scroll-behavior: smooth;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
}

#usa-grid .proj-section__drawing::-webkit-scrollbar {
    display: none;
}

#usa-grid .proj-section__drawing::before {
    display: none;
}

#usa-grid .proj-section {
    overflow: visible;
}

#usa-grid .proj-section__images {
    overflow: visible;
}

/* Video in film strip — fill frame like images */
.proj-section__hero-wrap--video video,
.proj-section__hero-video-active {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Play button overlay on hero image */
.proj-section__play-btn {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.5);
    border: 1.5px solid rgba(255, 255, 255, 0.4);
    color: var(--color-pure-white);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 4;
    transition: background var(--duration-base) var(--ease-out),
                transform var(--duration-base) var(--ease-out);
}

.proj-section__play-btn svg {
    width: 20px;
    height: 20px;
    margin-left: 2px;
}

.proj-section__play-btn:hover {
    background: rgba(0, 0, 0, 0.7);
    transform: translate(-50%, -50%) scale(1.08);
}

/* Hide edge overlays on all grids */
#project-gallery-grid .proj-section__drawing::before,
#projects-grid .proj-section__drawing::before,
#usa-grid .proj-section__drawing::before {
    display: none;
}

/* Make the drawing sheet scrollable — homepage only */
#project-gallery-grid .proj-section__drawing {
    overflow-x: auto !important;
    overflow-y: hidden !important;
    scroll-behavior: smooth;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
}

#project-gallery-grid .proj-section__drawing::-webkit-scrollbar {
    display: none;
}






/* ============================================
   FLIPPED — film strip on left, info on right
   ============================================ */
.proj-section--flipped {
    grid-template-columns: 3fr 2fr;
}



/* ============================================
   HIDDEN / FILTERING
   ============================================ */
.proj-section--hidden {
    display: none;
}


/* ============================================
   RESPONSIVE
   ============================================ */
@media (max-width: 900px) {
    .proj-section {
        grid-template-columns: 1fr;
    }

    .proj-section__images {
        order: -1;
    }

    .proj-section__film-strip::before,
    .proj-section__film-strip::after {
        height: 18px;
        background-size: 28px 18px;
    }

    .proj-section__hero-wrap,
    .proj-section__thumb {
        height: clamp(170px, 40vw, 260px);
    }

    .proj-section__hero-wrap {
        width: clamp(220px, 55vw, 340px);
    }

    .proj-section__thumb {
        width: clamp(150px, 38vw, 240px);
    }

    .proj-section__info {
        padding: clamp(24px, 4vw, 40px) clamp(20px, 3vw, 32px);
        border-right: none;
    }

    .proj-section__inline {
        font-size: clamp(1.2rem, 4vw, 1.6rem);
    }

    /* Full-bleed centered CTA on mobile — homepage featured + USA grid */
    .featured .proj-section__cta,
    .projects-grid-section .proj-section__cta {
        width: 100%;
        justify-content: center;
        padding-left: 24px;
        padding-right: 24px;
    }
}

/* USA project grid — full-width CTA buttons across all mobile/tablet
   widths, with reduced font size and tighter vertical padding so the
   button proportions feel right at narrow viewports. The wider
   breakpoint (1023px) catches tablet portrait. */
@media (max-width: 1023px) {
    #usa-grid .proj-section__cta,
    .projects-grid-section .proj-section__cta {
        width: calc(100% - 24px);
        margin-left: 12px;
        margin-right: 12px;
        justify-content: center;
        font-size: 0.95rem;
        padding: 16px 20px;
        gap: 12px;
    }
    #usa-grid .proj-section__cta svg,
    .projects-grid-section .proj-section__cta svg {
        width: 16px;
        height: 16px;
    }
}

/* Homepage featured cards — mobile (≤900px) only shows project name +
   square feet. Description text, sector tag, and Year/Duration meta
   items are hidden on mobile; desktop keeps the full text. */
@media (max-width: 900px) {
    .featured .proj-section__inline-desc,
    .featured .proj-section__sector,
    .featured .proj-section__meta-item:nth-child(1),
    .featured .proj-section__meta-item:nth-child(3) {
        display: none;
    }

    /* Collapse the empty space left behind when the description span
       inside .proj-section__inline is hidden: drop the min-height and
       tighten the bottom margin so the name sits close to the Area
       meta item. */
    .featured .proj-section__inline {
        min-height: 0;
        margin-bottom: 16px;
    }

    .featured .proj-section__meta {
        margin-bottom: 16px;
    }
}
