/*
   Baker Media — Projects Page Styles
   Shared across all individual project pages.
*/

/* ── Page background ── */
body {
    background-color: var(--cream);
}

/* ── Project Meta Section ── */
.project-meta {
    padding: clamp(180px, 10vw, 240px) clamp(24px, 1.875vw, 48px) clamp(32px, 2vw, 48px);
}

.project-meta .container {
    max-width: var(--container-max);
}

.project-meta .eyebrow {
    margin-bottom: clamp(16px, 0.78vw, 20px);
    color: var(--accent);
    font-size: 12px;
    letter-spacing: 2px;
}

.project-title {
    font-family: var(--font-heading);
    font-size: clamp(1.6rem, 2.5vw, 2.6rem);
    font-weight: 700;
    color: var(--black);
    line-height: 1.1;
    letter-spacing: -0.02em;
    margin-bottom: clamp(20px, 1.09vw, 28px);
    max-width: 820px;
}

/* Project description */
.project-description {
    font-family: var(--font-body);
    font-size: 15px;
    line-height: 1.7;
    color: var(--mid-gray);
    max-width: 780px;
}

.project-description p + p {
    margin-top: clamp(12px, 0.625vw, 16px);
}

/* ── Gallery Section ── */
.project-gallery-section {
    padding: 0 7% clamp(40px, 2.34vw, 60px);
}

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

/* Floating card */
.gallery-floating-card {
    background: var(--white);
    border-radius: 16px;
    padding: clamp(14px, 0.78vw, 20px) 0 clamp(14px, 0.78vw, 20px) clamp(14px, 0.78vw, 20px);
    box-shadow: var(--shadow-md);
    border: 1px solid rgba(0, 0, 0, 0.03);
    position: relative;
    overflow: hidden;
}

/* Horizontal scroll track */
.gallery-track {
    display: flex;
    align-items: flex-start;
    gap: clamp(14px, 0.78vw, 20px);
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    padding-bottom: clamp(30px, 1.72vw, 44px);
    padding-right: clamp(14px, 0.78vw, 20px);
    cursor: grab;
}

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

.gallery-track.is-grabbing {
    cursor: grabbing;
}

/* Individual photo item */
.gallery-item {
    flex: 0 0 auto;
    position: relative;
}

/* Image wrapper — masks hover scale so corners stay rounded */
.gallery-img-wrap {
    overflow: hidden;
    border-radius: 8px;
}

.gallery-item img {
    height: 46vh;
    width: auto;
    max-width: 90vw;
    object-fit: cover;
    display: block;
    transition: transform 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

.gallery-item:hover img {
    transform: scale(1.015);
}

/* Caption — just the number */
.gallery-caption {
    font-family: var(--font-body);
    font-size: 12px;
    font-weight: 500;
    color: var(--mid-gray);
    letter-spacing: 1.5px;
    margin-top: clamp(10px, 0.55vw, 14px);
    padding-left: 2px;
}

/* Mobile-only line break — hidden by default, shown in mobile query */
.mobile-break {
    display: none;
}

/* ── Scroll progress pill ── */
.scroll-progress-container {
    position: absolute;
    bottom: clamp(20px, 1.17vw, 30px);
    left: clamp(20px, 1.17vw, 30px);
}

.scroll-progress-track {
    width: 120px;
    height: 5px;
    background: rgba(58, 58, 58, 0.18);
    border-radius: 100px;
    overflow: hidden;
}

.scroll-progress-bar {
    height: 100%;
    width: 0%;
    background: var(--accent);
    border-radius: 100px;
    transition: width 0.1s linear;
}

/* ── Gallery expand/collapse (desktop only) ── */
@media (min-width: 1025px) {
    .project-meta,
    .gallery-item img,
    .gallery-floating-card,
    .project-gallery-section {
        transition: all 1s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    }

    .project-meta .container {
        transform-origin: top left;
        transition: transform 1s cubic-bezier(0.25, 0.46, 0.45, 0.94),
                    padding 1s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    }

    /* Default: gallery collapsed */
    .gallery-item img {
        height: 34vh;
    }

    .gallery-floating-card {
        padding-top: clamp(14px, 0.78vw, 20px);
        padding-bottom: clamp(12px, 0.625vw, 16px);
    }

    .project-gallery-section {
        padding-left: 14%;
        padding-right: 14%;
    }

    /* Expanded: gallery active */
    .gallery-active .gallery-item img {
        height: 52vh;
    }

    .gallery-active .gallery-floating-card {
        padding-top: clamp(14px, 0.78vw, 20px);
        padding-bottom: clamp(14px, 0.78vw, 20px);
    }

    .gallery-active .project-gallery-section {
        padding-left: 7%;
        padding-right: 7%;
    }

    /* Text compresses via scale (no layout reflow) */
    .gallery-active .project-meta {
        padding-top: clamp(120px, 6.25vw, 160px);
        padding-bottom: clamp(14px, 0.78vw, 20px);
    }

    .gallery-active .project-meta .container {
        transform: scale(0.88);
    }
}

/* ── Reveal animation ── */
.reveal {
    opacity: 0;
    transform: translateY(24px);
    transition: opacity 0.7s cubic-bezier(0.16, 1, 0.3, 1),
                transform 0.7s cubic-bezier(0.16, 1, 0.3, 1);
}

.reveal.visible {
    opacity: 1;
    transform: translateY(0);
}

/* Gallery card: never hide with opacity — prevents lazy-load race condition
   on mobile where browsers skip loading images inside opacity:0 containers.
   The translateY slide-up animation is kept. */
.gallery-floating-card.reveal {
    opacity: 1;
}

.reveal.delay-1 { transition-delay: 0.1s; }
.reveal.delay-2 { transition-delay: 0.2s; }

/* ── Laptop (13"–16" screens) ── */
@media (max-width: 1440px) and (min-width: 1025px) {
    .gallery-item img {
        max-width: 80vw;
    }

    .project-gallery-section {
        padding-left: 5%;
        padding-right: 5%;
    }

    .gallery-active .project-gallery-section {
        padding-left: 3%;
        padding-right: 3%;
    }
}

/* ── Mobile ── */
@media (max-width: 768px) {
    .mobile-break {
        display: block;
    }

    .project-meta {
        padding: clamp(160px, 24.7vw, 190px) clamp(18px, 3.13vw, 24px) clamp(48px, 7.8vw, 60px);
    }

    .project-meta .eyebrow {
        margin-bottom: clamp(16px, 2.6vw, 20px);
    }

    .project-title {
        margin-bottom: clamp(22px, 3.65vw, 28px);
    }

    .project-gallery-section {
        padding: 0 clamp(8px, 1.56vw, 12px) clamp(60px, 10.4vw, 80px);
    }

    .gallery-floating-card {
        border-radius: 20px;
        padding: clamp(10px, 1.82vw, 14px) 0 clamp(10px, 1.82vw, 14px) clamp(10px, 1.82vw, 14px);
    }

    .gallery-track {
        flex-direction: column;
        overflow-x: visible;
        overflow-y: visible;
        padding-right: clamp(10px, 1.82vw, 14px);
        padding-bottom: clamp(22px, 3.65vw, 28px);
        gap: clamp(10px, 1.82vw, 14px);
        cursor: default;
    }

    .gallery-caption {
        display: none;
    }

    .gallery-item {
        width: 100%;
    }

    .gallery-img-wrap {
        border-radius: 6px;
    }

    .gallery-item img {
        height: auto;
        width: 100%;
        max-width: 100%;
    }

    .scroll-progress-container {
        bottom: clamp(10px, 1.82vw, 14px);
        left: clamp(10px, 1.82vw, 14px);
    }
}

/* ── Tablet ── */
@media (max-width: 1024px) and (min-width: 769px) {
    .project-meta {
        padding: clamp(160px, 19.5vw, 200px) clamp(28px, 3.9vw, 40px) clamp(36px, 4.69vw, 48px);
    }

    .project-meta .eyebrow {
        margin-bottom: clamp(16px, 0.78vw, 20px);
    }

    .project-title {
        margin-bottom: clamp(20px, 1.09vw, 28px);
    }

    .project-description {
        max-width: 620px;
    }

    .project-gallery-section {
        padding: 0 3% 3%;
    }

    .gallery-floating-card {
        padding: clamp(14px, 0.78vw, 20px) 0 clamp(14px, 0.78vw, 20px) clamp(14px, 0.78vw, 20px);
    }

    .gallery-item img {
        height: 38vh;
    }
}
