/* ==========================================================================
   Block: Projects Section — Figma node 4490:8487
   Background: #ffffff (White)
   Layout: flex-col gap-40px — header (text+nav) / 3-col grid / footer CTA
   Padding: 80px 60px
   ========================================================================== */

.projects-section {
    background-color: var(--color-white);
    padding: 80px 60px;
}

/* ── Outer wrapper — flex-col, 40px gap between header / grid / footer ──── */
.projects-section__inner {
    max-width: var(--max-width);
    margin-inline: auto;
    display: flex;
    flex-direction: column;
    gap: 40px;
}

/* ── Header row: text left / arrows right ─────────────────────────────────── */
.projects-section__header {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 40px;
    flex-wrap: nowrap;
}

/* Left: label + H2 + description — gap-[28px] per Figma */
.projects-section__header-text {
    display: flex;
    flex-direction: column;
    gap: 28px;
}

/* ── Label — 14px Geist Medium, uppercase, #1c1c1c ───────────────────────── */
.projects-section__label {
    font-family: var(--font-body);
    font-size: 14px;
    font-weight: 500;
    line-height: 1;
    letter-spacing: 0;
    text-transform: uppercase;
    color: var(--color-dark);
}

/* ── H2 — 40px Freight Neo Book, lh 1.15 ─────────────────────────────────── */
.projects-section__heading {
    font-family: var(--font-heading);
    font-size: clamp(2rem, 3.5vw, 2.5rem); /* 40px at desktop */
    font-weight: 400;
    line-height: 1.15;
    color: var(--color-dark);
}

/* ── Description — 16px Geist Light, lh 1.39, max 705px ─────────────────── */
.projects-section__description {
    font-family: var(--font-body);
    font-size: 16px;
    font-weight: 300;
    line-height: 1.39;
    color: var(--color-dark);

}

/* ── Arrow nav — pill buttons matching Figma px-16 py-10 ─────────────────── */
.projects-section__nav {
    display: flex;
    gap: 6px;
    align-items: center;
    flex-shrink: 0;
}

.projects-section .arrow-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 10px 16px;
    border: 1px solid var(--color-dark);
    border-radius: 1000px;
    background-color: transparent;
    color: var(--color-dark);
    cursor: pointer;
    transition: background-color 0.2s, color 0.2s;
    flex-shrink: 0;
}

.projects-section .arrow-btn:hover {
    background-color: var(--color-dark);
    color: var(--color-white);
}

.projects-section .arrow-btn:disabled {
    opacity: 0.3;
    cursor: not-allowed;
    pointer-events: none;
}

.projects-section .arrow-btn svg {
    display: block;
    flex-shrink: 0;
}

/* ── Slider viewport — clips to one row; track slides horizontally ──────── */
.projects-section__viewport {
    container-type: inline-size;
    container-name: projects-slider;
    overflow: hidden;
    width: 100%;
}

.projects-section__track {
    display: flex;
    flex-wrap: nowrap;
    gap: 20px;
    transition: transform 0.45s ease;
    will-change: transform;
}

.projects-section__track .project-card {
    flex: 0 0 calc((100cqw - (var(--projects-columns, 3) - 1) * 20px) / var(--projects-columns, 3));
    min-width: 0;
}

/* Legacy class alias (blocks / older markup) */
.projects-section__grid {
    display: flex;
    flex-wrap: nowrap;
    gap: 20px;
}

/* ── Footer CTA — centered, pt-20px ──────────────────────────────────────── */
.projects-section__footer {
    display: flex;
    justify-content: center;
    padding-top: 20px;
}

/* ── Project Card ─────────────────────────────────────────────────────────── */
.project-card {
    display: flex;
    flex-direction: column;
    gap: 32px;                           /* Figma: image → body gap */
}

/* Image: 7:8 aspect ratio (280×320) */
.project-card__image-link {
    display: block;
    overflow: hidden;
    aspect-ratio: 7 / 8;
    width: 100%;
}

.project-card__image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    display: block;
    transition: transform 0.5s ease;
}

.project-card:hover .project-card__image {
    transform: scale(1.03);
}

/* Card body: gap-[12px] */
.project-card__body {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

/* Title: 24px Geist Medium, lh 1.1 */
.project-card__title {
    font-family: var(--font-body);
    font-size: 24px;
    font-weight: 500;
    line-height: 1.1;
    color: var(--color-dark);
}

.project-card__title a {
    color: var(--color-dark);
    text-decoration: none;
    transition: opacity 0.2s;
}

.project-card__title a:hover {
    opacity: 0.7;
}

.project-card__excerpt {
    font-family: var(--font-body);
    font-size: 16px;
    font-weight: 300;
    line-height: 1.39;
    color: var(--color-dark);
    margin: 0;
}

/* "Discover More" — 16px Geist Light, border-bottom underline, ls 0.16px */
.project-card__link {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-family: var(--font-body);
    font-size: 16px;
    font-weight: 300;
    line-height: 1;
    letter-spacing: 0.16px;
    color: var(--color-dark);
    text-decoration: none;
    border-bottom: 1px solid var(--color-dark);
    padding-bottom: 2px;
    align-self: flex-start;
    transition: opacity 0.2s ease;
}

.project-card__link:hover {
    opacity: 0.65;
}

/* ── Responsive ───────────────────────────────────────────────────────────── */
@media (max-width: 1100px) {
    .projects-section {
        padding: 60px 40px;
    }

    .projects-section__track .project-card {
        flex: 0 0 calc((100cqw - 20px) / 2);
    }
}

/* ── Responsive — 768px mobile: horizontal scroll carousel ───────────────── */
/* Figma node 5224:19208                                                      */
@media (max-width: 768px) {
    .projects-section__header{
        flex-wrap: wrap;
    }

    /* Section: py-80, 0 inline padding (cards bleed to edges) */
    .projects-section {
        padding: 80px 0;
    }

    /* Inner: full-width, 16px inline padding for header/footer */
    .projects-section__inner {
        max-width: none;
        padding-inline: 16px;
    }

    /* Header: stack vertically — text → arrows — gap-[40px] */
    .projects-section__header {
        flex-direction: column;
        align-items: flex-start;
        gap: 40px;                         /* Figma: Header Container gap-[40px] */
    }

    /* Text container: gap-[20px] on mobile (label → H2 → description) */
    .projects-section__header-text {
        gap: 20px;
    }

    /* H2: 32px Freight Neo Book, lh 1 */
    .projects-section__heading {
        font-size: 32px;
        line-height: 1;
    }

    /* Viewport: horizontal scroll track — gap-[20px], card 290px */
    .projects-section__viewport {
        overflow-x: auto;
        scroll-snap-type: x mandatory;
        margin-inline: -16px;
        margin-left: 0;
        padding-inline: 16px;
        padding-bottom: 4px;
        scrollbar-width: none;
        -ms-overflow-style: none;
    }

    .projects-section__viewport::-webkit-scrollbar {
        display: none;
    }

    .projects-section__track {
        transform: none !important;
        transition: none;
    }

    .projects-section__track .project-card {
        flex: 0 0 290px;
        scroll-snap-align: start;
    }

    /* Legacy grid class on mobile — Figma 7778:38207 */
    .projects-section__grid {
        display: flex;
        flex-direction: row;
        flex-wrap: nowrap;
        gap: 20px;
        overflow-x: auto;
        scroll-snap-type: x mandatory;
        width: 100%;
        padding-bottom: 4px;
        scrollbar-width: none;
        -ms-overflow-style: none;
    }

    .projects-section__grid .project-card {
        flex: 0 0 300px;
        scroll-snap-align: start;
    }

    .projects-section__grid::-webkit-scrollbar {
        display: none;
    }

    /* Image: keep desktop 7:8 portrait ratio — matches Figma mobile */
    .project-card__image-link {
        aspect-ratio: 7 / 8;
    }

    /* Card title: 20px on mobile — Figma Mobile/H4 */
    .project-card__title {
        font-size: 20px;
    }

    .project-card__excerpt {
        font-size: 14px;
    }

    /* CTA button: full-width on mobile — Figma: flex-[1_0_0] */
    .projects-section__footer {
        padding-top: 20px;
    }

    .projects-section__footer .btn {
        width: 100%;
        justify-content: center;
    }
}
