/*
 * Projects archive — integrated 1:1 from the supplied design (style.css).
 * Global selectors from the design (`*`, `body`) are scoped to
 * .mc-projects-page so the original header and footer are not affected.
 */

:root {
    --accent-color: #ff5c35;
    /* The signature orange color */
    --text-black: #000000;
    --text-gray: #777777;
    --bg-white: #ffffff;
    --border-light: #e0e0e0;
    --transition: all 0.4s cubic-bezier(0.165, 0.84, 0.44, 1);
}

.mc-projects-page,
.mc-projects-page *,
.mc-projects-page *::before,
.mc-projects-page *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

.mc-projects-page {
    font-family: 'Inter', sans-serif;
    background-color: var(--bg-white);
    color: var(--text-black);
    -webkit-font-smoothing: antialiased;
}

.mc-projects-page a {
    text-decoration: none;
    color: inherit;
}

.mc-projects-page .main-wrapper {
    /* Figma frame: 1764px content with 78px side margins at 1920px wide */
    max-width: 1844px;
    margin: 0 auto;
    padding: 0 40px 85px;
}

/* Hero Featured Section */

.hero-featured-section {
    display: grid;
    grid-template-columns: 1fr 1fr;
    /* Figma: ~102px gap between the two featured images at 1920px wide */
    gap: clamp(20px, 5.3vw, 102px);
    margin-bottom: 60px;
    margin-top: 100px;
}

/* Desktop only: pull the featured pair up and set their height to the Figma
   featured ratio (831x572 ≈ 1.45:1) so the boxes match the design instead of
   the natural (much taller) image ratio. */
@media (min-width: 769px) {
    .hero-featured-section {
        margin-top: 40px;
        margin-bottom: 48px;
    }

    .featured-item img {
        aspect-ratio: 1.45 / 1;
        height: auto;
    }
}


.featured-item {
    position: relative;
    width: 100%;
    display: block;
    overflow: hidden;
    will-change: opacity, transform;
}

.featured-item.reveal {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.8s ease, transform 0.8s ease;
}

.featured-item.reveal.revealed {
    opacity: 1;
    transform: translateY(0);
}

.featured-item img {
    width: 100%;
    height: auto;
    display: block;
    object-fit: cover;
    transition: var(--transition), transform 0.4s ease;
}

.featured-item:hover img {
    transform: scale(1.04);
}

.featured-info {
    padding: 20px 0;
    display: flex;
    justify-content: space-between;
    flex-direction: row-reverse;
    align-items: flex-start;
}

.featured-tags {
    display: flex;
    gap: 15px;
    margin-bottom: 10px;
}

.dot-tag {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: #000;
    font-size: 14px;
    font-style: normal;
    font-weight: 400;
    /* line-height:1 makes the line box equal the cap height so the dot
       centres against the text, not against the taller default line box. */
    line-height: 1;
}

.dot-tag::before {
    content: "";
    flex: 0 0 auto;
    width: 6px;
    height: 6px;
    background-color: var(--accent-color);
    border-radius: 50%;
    /* Lift the dot to the text's cap-height centre. align-items:center puts it
       at the line-box centre, which descender space pushes ~0.18em below the
       caps; this offset re-centres it (em-based so it scales with font-size). */
    transform: translateY(-0.18em);
}

.project-card h3,
.featured-info h3 {
    margin-bottom: 5px;
    color: #000;
    font-family: Inter;
    font-size: 24px;
    font-style: normal;
    font-weight: 400;
    line-height: normal;
}

.featured-info h3 {
    text-transform: uppercase;
}

.featured-info p {
    color: #999;
    font-size: 18px;
    font-style: normal;
    font-weight: 300;
    line-height: normal;
}

/* Filter Container */
.projects-filter-container {
    margin-bottom: 56px;
    width: 100%;
    display: flex;
    flex-direction: column;
}

.filter-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 0;
}

.projects-title {
    text-transform: uppercase;
    color: #000;
    font-family: 'Inter', sans-serif;
    font-size: 30px;
    font-style: normal;
    font-weight: 400;
    line-height: normal;
}

.filter-main-nav {
    display: grid;
    grid-template-columns: repeat(4, 150px);
    gap: 60px;
    width: 70%;
    justify-content: flex-end;
}

/* "All" is the only interactive control on this row; it clears every filter. */
.mc-projects-page .nav-item.nav-all {
    background: none;
    border: none;
    font-family: 'Inter', sans-serif;
    font-size: 18px;
    font-weight: 600;
    cursor: pointer;
    color: #000;
    transition: color 0.3s ease;
    padding: 0;
    min-width: 150px;
    width: auto;
    max-width: 200px;
    text-align: left;
    /* Override nav.css */
}

/* Location / Project Type / Sectors are non-clickable column headings. */
.filter-main-nav .nav-label {
    font-family: 'Inter', sans-serif;
    font-weight: 700;
    color: var(--accent-color);
    font-size: 20px;
    line-height: normal;
    min-width: 150px;
    text-align: left;
    cursor: default;
    user-select: none;
}

.filter-divider {
    height: 1px;
    background-color: #000;
    width: 100%;
    margin-bottom: 20px;
}

/* Filter Content Area */
.filter-content {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
}

.active-filters-area {
    width: 30%;
    font-size: 18px;
    font-weight: 300;
    color: var(--accent-color);
    line-height: 1.6;
}

.filter-columns {
    display: grid;
    grid-template-columns: repeat(4, 150px);
    gap: 60px;
    width: 70%;
    justify-content: flex-end;
}

#col-location {
    grid-column: 2;
}

#col-type {
    grid-column: 3;
}

#col-sectors {
    grid-column: 4;
}

.filter-col {
    display: flex;
    flex-direction: column;
    min-width: 150px;
}

.filter-col.hidden {
    display: none !important;
}

.col-options {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.mc-projects-page .col-options button {
    background: none;
    border: none;
    text-align: left;
    font-family: 'Inter', sans-serif;
    font-size: 18px;
    color: #000;
    font-weight: 300;
    cursor: pointer;
    transition: color 0.2s ease;
    padding: 2px 0;
    min-width: auto;
    /* Override nav.css */
}

.mc-projects-page .col-options button.active {
    color: var(--accent-color);
}

.mc-projects-page .col-options button:hover {
    color: var(--accent-color);
}

/* Column titles inside filter columns */
.col-title {
    display: block;
    color: var(--accent-color);
    font-size: 14px;
    font-weight: 700;
    text-transform: uppercase;
    margin-bottom: 15px;
    letter-spacing: 0.5px;
}

/* Hide mobile drawer elements on desktop */
.mobile-filter-btn {
    display: none;
}

.mobile-drawer-header {
    display: none;
}

@media screen and (min-width:769px) {
    .active-filters-area {
        order: 1;
    }

    .filter-columns {
        order: 2;
    }

    /* Desktop headings live in .filter-main-nav; in-column titles are
       mobile-only (shown inside the filter drawer). */
    .col-title {
        display: none;
    }
}

/* Responsive */
@media (max-width: 768px) {
    .filter-header {
        flex-direction: column;
        justify-content: flex-start;
        align-items: flex-start;
        width: 100%;
        gap: 35px;
    }

    .projects-filter-container {
        margin-bottom: 58px;
    }

    .filter-main-nav {
        display: none !important;
    }

    .mc-projects-page .mobile-filter-btn {
        display: inline-flex;
        align-items: center;
        background: none;
        border: none;
        color: #000;
        font-family: 'Inter', sans-serif;
        font-size: 16px;
        font-weight: 600;
        cursor: pointer;
        padding: 5px 0;
        border-bottom: 1.5px solid #000;
        min-width: auto;
        width: 100%;
    }

    .filter-divider {
        display: none !important;
    }

    .filter-content {
        position: fixed;
        top: 0;
        right: 0;
        bottom: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background-color: #ffffff;
        z-index: 10000;
        padding: 30px 24px;
        display: flex;
        flex-direction: column;
        overflow-y: auto;
        transform: translateX(100%);
        transition: transform 0.3s cubic-bezier(0.165, 0.84, 0.44, 1);
        gap: 0;
    }

    .filter-content.open {
        transform: translateX(0);
    }

    .mobile-drawer-header {
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding-bottom: 15px;
        border-bottom: 1.5px solid #000;
        margin-bottom: 40px;
        width: 100%;
    }

    .mobile-drawer-header span {
        font-size: 24px;
        font-weight: 500;
        color: #000;
        letter-spacing: -0.5px;
    }

    .mc-projects-page .close-drawer-btn {
        background: none;
        border: none;
        cursor: pointer;
        padding: 0;
        display: flex;
        align-items: center;
        color: #000;
        min-width: auto;
    }

    .filter-columns {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 50px 30px;
        width: 100%;
        margin-bottom: 40px;
    }

    .filter-col {
        min-width: unset;
        display: flex !important;
    }

    #col-location {
        grid-column: auto;
    }

    #col-type {
        grid-column: auto;
    }

    #col-sectors {
        grid-column: span 2;
    }

    .active-filters-area {
        width: 100%;
        margin-top: auto;
        padding-top: 30px;
        font-size: 16px;
        color: var(--accent-color);
        line-height: 1.6;
        font-weight: 400;
    }
}

/* Projects Grid
   Figma repeating pattern per 8 projects: row of 3, row of 3, row of 2.
   A 6-column grid lets the first six cards span 2 cols (three per row) and
   the last two span 3 cols (two per row). nth-child keeps the cycle going
   as more cards are appended, and auto-flow means rows are always full
   except a genuinely incomplete final row. */
.projects-grid {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    align-items: start;
    /* Figma: ~83px column gap at 1920px wide */
    gap: 77px clamp(40px, 4.3vw, 83px);
}

.project-card {
    overflow: hidden;
    display: block;
    grid-column: span 2;
}

/* 7th and 8th card of each cycle form the row of two (larger images). */
.projects-grid .project-card:nth-child(8n + 7),
.projects-grid .project-card:nth-child(8n) {
    grid-column: span 3;
}

.mc-projects-page .reveal {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.8s ease, transform 0.8s ease;
}

.mc-projects-page .reveal.revealed {
    opacity: 1;
    transform: translateY(0);
}

.project-card img {
    width: 100%;
    aspect-ratio: 4/3;
    object-fit: cover;
    transition: var(--transition), transform 0.4s ease, opacity 0.4s ease;
    display: block;
}

.project-card:hover img {
    transform: scale(1.05);
    opacity: 0.95;
}

.project-card-info {
    padding-top: 13px;
}

.project-card-tags {
    display: flex;
    gap: 12px;
    margin-bottom: 12px;
}

.project-card-tags span {
    font-size: 14px;
    font-weight: 400;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    /* Centre the dot against the text's cap height (see .dot-tag). */
    line-height: 1;
}

.project-card-tags span::before {
    content: "";
    flex: 0 0 auto;
    width: 6px;
    height: 6px;
    background-color: var(--accent-color);
    border-radius: 50%;
    /* See .dot-tag::before — re-centre the dot on the text cap height. */
    transform: translateY(-0.18em);
}

.project-card p {
    color: #999;
    font-family: Inter;
    font-size: 18px;
    font-style: normal;
    font-weight: 300;
    line-height: normal;
}

/* More Projects Button */
.more-projects {
    display: flex;
    justify-content: center;
    margin-top: 80px;
}

.mc-projects-page .load-more {
    border: none;
    background: none;
    display: inline-flex;
    column-gap: 26px;
    align-items: center;
    color: #E66830;
    font-family: Inter;
    font-size: 24px;
    font-style: normal;
    font-weight: 500;
    line-height: normal;
    letter-spacing: -0.72px;
    cursor: pointer;
    min-width: auto;
    /* Override nav.css */
    padding: 0;
    /* Override nav.css */
}

.plus-circle {
    width: 41px;
    height: 41px;
}

.plus-circle svg {
    height: 100%;
    width: 100%;
}

/* Mobile View */
@media (max-width: 1024px) {
    .projects-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    /* The 3-3-2 spanning pattern is desktop-only; fall back to 2 equal cols. */
    .projects-grid .project-card,
    .projects-grid .project-card:nth-child(8n + 7),
    .projects-grid .project-card:nth-child(8n) {
        grid-column: auto;
    }
}

@media (max-width: 768px) {
    .mc-projects-page .main-wrapper {
        padding: 0 14px 60px;
    }

    .featured-info {
        flex-direction: column;
        padding-top: 10px;
        padding-bottom: 0px;
    }

    .featured-tags {
        gap: 9px;
        margin-bottom: 12px;
    }

    .hero-featured-section {
        grid-template-columns: 1fr;
        gap: 37px;
        margin-top: 28px;
        margin-bottom: 41px;
    }

    .projects-title {
        font-size: 40px;
    }

    .project-card h3 {
        font-size: 14px;
    }

    .featured-info h3 {
        font-size: 15px;
    }

    .featured-info p {
        font-size: 14px;
    }

    .projects-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 20px;
    }

    .filter-nav {
        width: 100%;
        justify-content: space-between;
        gap: 10px;
    }

    .project-card p {
        font-size: 12px;
    }

    .projects-grid {
        grid-template-columns: 1fr 1fr;
        column-gap: 20px;
        row-gap: 49px;
    }

    /* Figma mobile: the 8-item cycle is two small-grid rows (six half-width
       boxes) followed by two full-width "big" boxes — mirroring the desktop
       3-3-2. Cards 7 and 8 of each cycle span the full width and stack. */
    .projects-grid .project-card:nth-child(8n + 7),
    .projects-grid .project-card:nth-child(8n) {
        grid-column: 1 / -1;
    }

    /* The theme applies `section:first-child { padding-top: 85px }`, which
       pushes the featured pair ~85px down from the header. The mobile design
       wants it right under the header (~28px, from the section's margin-top),
       so neutralise that padding here. */
    .mc-projects-page .hero-featured-section {
        padding-top: 0;
    }

    /* Mobile design boxes are 1:1 squares (featured 374x376, grid 177x177),
       taller than the desktop 4:3. Applies to the featured pair, the small
       grid boxes and the full-width big boxes, so all heights stay uniform. */
    .featured-item img,
    .project-card img {
        aspect-ratio: 1 / 1;
        height: auto;
    }

    .project-card-tags span {
        font-size: 10px;
    }

    .project-card-tags {
        gap: 7px;
        margin-bottom: 9px;
    }

    .mc-projects-page .load-more {
        font-size: 15px;
        gap: 13px;
    }

    .plus-circle {
        width: 23px;
        height: 23px;
    }
}

/* Integration helpers (not part of the visual design) */
body.drawer-open {
    overflow: hidden;
}

.projects-grid.is-loading {
    opacity: 0.45;
    pointer-events: none;
    transition: opacity 0.2s ease;
}

.projects-grid .no-projects {
    grid-column: 1 / -1;
    font-size: 18px;
    font-weight: 300;
    color: var(--text-gray);
    padding: 40px 0;
}

.mc-projects-page .load-more.is-loading {
    opacity: 0.5;
    pointer-events: none;
}
