/* Projetos Page Specific Styles */

/* =========================================
   PROJECTS HERO
========================================= */
.projetos-hero-section {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    padding: var(--header-height) 2.5rem 0;
}

.projetos-hero-section .hero-content-inner {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding-bottom: 2.5rem;
    padding-top: 2rem;
}

.projetos-hero-section .hero-visual-wrapper {
    flex: 1;
    min-height: 0;
    border-radius: var(--radius-lg);
    overflow: hidden;
    margin-bottom: 2rem;
    position: relative;
}

.projetos-hero-section .hero-video {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.projetos-hero-section .hero-editorial-row {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
}

.projetos-hero-section .contact-title {
    margin: 0;
    line-height: 0.9;
    font-size: clamp(3rem, 6vw, 5rem);
}

.projetos-hero-section .editorial-right {
    text-align: right;
}

/* =========================================
   DIRECTORY FILTER BAR
========================================= */
.directory-filter-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 50px;
    flex-wrap: wrap;
    gap: 1.5rem;
    position: relative;
    z-index: 100;
}

.filter-left .directory-title {
    font-size: 1.4rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: -0.02em;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin: 0;
}

.filter-left .count {
    font-size: 0.95rem;
    color: var(--color-text-muted);
    font-weight: 400;
}

.filter-right {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
}

.custom-dropdown {
    position: relative;
    display: inline-block;
}

.dropdown-trigger {
    background: transparent;
    border: 1px solid var(--color-border);
    border-radius: 100px;
    padding: 0.7rem 1.4rem;
    font-family: var(--font-primary);
    font-size: 0.95rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--color-text-main);
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.dropdown-trigger svg {
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.dropdown-trigger:hover,
.custom-dropdown.open .dropdown-trigger {
    background: var(--color-text-main);
    color: var(--color-bg-main);
}

.custom-dropdown.open .dropdown-trigger svg {
    transform: rotate(180deg);
}

.dropdown-menu {
    position: absolute;
    top: calc(100% + 0.5rem);
    left: 0;
    background-color: var(--color-bg-main);
    border: 1px solid var(--color-border);
    border-radius: 20px;
    padding: 0.5rem;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    min-width: 220px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.3s cubic-bezier(0.2, 0.8, 0.2, 1);
    z-index: 9999;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.05);
}

.custom-dropdown.open .dropdown-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.dropdown-item {
    background: transparent;
    border: none;
    border-radius: 12px;
    padding: 0.8rem 1.2rem;
    font-family: var(--font-primary);
    font-size: 0.9rem;
    font-weight: 500;
    text-align: left;
    color: var(--color-text-muted);
    cursor: pointer;
    transition: all 0.2s ease;
}

.dropdown-item:hover,
.dropdown-item.active {
    background: rgba(0, 0, 0, 0.03);
    color: var(--color-text-main);
}

.sup-count {
    font-size: 0.7rem;
    line-height: 1;
    margin-top: 0.1rem;
    opacity: 0.7;
}

.filter-divider {
    width: 1px;
    height: 28px;
    background-color: var(--color-border);
    margin: 0 0.5rem;
}

.view-toggles {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.3rem;
    border: 1px solid var(--color-border);
    border-radius: 100px;
    background: rgba(0, 0, 0, 0.01);
    margin-left: 0.5rem;
}

.view-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    border: none;
    background: transparent;
    color: var(--color-text-muted);
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.view-btn:hover {
    color: var(--color-text-main);
}

.view-btn.active {
    background: var(--color-text-main);
    color: var(--color-bg-main);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08);
}

/* Responsiveness */
@media (max-width: 992px) {
    .directory-filter-bar {
        flex-direction: column;
        align-items: flex-start;
    }

    .filter-right {
        width: 100%;
        flex-direction: column;
        align-items: stretch;
        gap: 0.75rem;
    }
    
    .custom-dropdown {
        width: 100%;
    }
    
    .dropdown-menu {
        width: 100%;
        min-width: 100%;
    }
    
    .dropdown-trigger {
        width: 100%;
        justify-content: space-between;
    }

    .filter-divider {
        display: none;
    }

    .view-toggles {
        margin-left: 0;
        margin-top: 0.5rem;
        justify-content: center;
        align-self: center;
        width: 100%;
    }
}

/* =========================================
   PROJECTS DIRECTORY LIST/GRID VIEWS
========================================= */
.projects-container {
    display: flex;
    flex-direction: column;
    width: 100%;
}

.projects-container.list-view {
    gap: 2.5rem;
}

/* LIST VIEW (Horizontal Rounded Cards) */
.projects-container.list-view .dir-project-item {
    display: flex;
    align-items: center;
    padding: 2.5rem;
    border: 1px solid var(--color-border);
    border-radius: 40px;
    background-color: rgba(0, 0, 0, 0.01);
    /* Very subtle card background */
    text-decoration: none;
    color: var(--color-text-main);
    transition: all 0.4s cubic-bezier(0.2, 0.8, 0.2, 1);
    gap: 3.5rem;
}

.projects-container.list-view .dir-project-item:hover {
    background-color: transparent;
    border-color: var(--color-text-main);
    transform: translateY(-5px);
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.08);
    transition: all 0.1s ease-out;
}

.projects-container.list-view .dir-thumb {
    width: 380px;
    height: 260px;
    border-radius: 24px;
    overflow: hidden;
    flex-shrink: 0;
}

.dir-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s cubic-bezier(0.2, 0.8, 0.2, 1);
}



.projects-container.list-view .dir-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: stretch;
    gap: 1.5rem;
}

.projects-container.list-view .dir-details {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1.5rem;
}

.projects-container.list-view .dir-desc {
    flex: 1;
    font-size: 1.05rem;
    color: var(--color-text-muted);
    margin: 0;
    line-height: 1.5;
    padding: 0 1.5rem;
    border-left: 1px solid var(--color-border);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.dir-title {
    font-size: 2.8rem;
    font-weight: 500;
    margin: 0;
    letter-spacing: -0.03em;
}

.projects-container.list-view .dir-meta {
    display: grid;
    grid-template-columns: repeat(2, auto);
    gap: 0.5rem;
    align-items: start;
    justify-content: start;
}

.dir-tag {
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: 0.4rem 1rem;
    border: 1px solid var(--color-border);
    border-radius: 2rem;
    color: var(--color-text-muted);
    text-align: center;
}

.dir-year {
    font-family: var(--font-secondary);
    font-size: 1.25rem;
    color: var(--color-text-muted);
    width: 80px;
    text-align: right;
}

.dir-action {
    width: 40px;
    display: flex;
    justify-content: flex-end;
}

.dir-action svg {
    width: 36px;
    height: 36px;
    transition: transform 0.3s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.dir-project-item:hover .dir-action svg {
    transform: translateX(5px) scale(1.1);
}

/* GRID VIEW */
.projects-container.grid-view {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 2.5rem;
    border: none;
    padding-top: 1rem;
}

.projects-container.grid-view .dir-project-item {
    display: flex;
    flex-direction: column;
    text-decoration: none;
    color: var(--color-text-main);
    border: 1px solid var(--color-border);
    border-radius: 40px;
    padding: 2.5rem;
    background-color: rgba(0, 0, 0, 0.01);
    gap: 2rem;
    transition: all 0.4s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.projects-container.grid-view .dir-project-item:hover {
    background-color: transparent;
    border-color: var(--color-text-main);
    transform: translateY(-5px);
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.08);
    transition: all 0.1s ease-out;
}

.projects-container.grid-view .dir-thumb {
    width: 100%;
    height: 380px;
    border-radius: 24px;
    margin-bottom: 0;
}

.projects-container.grid-view .dir-info {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 1rem;
    width: 100%;
}

.projects-container.grid-view .dir-title {
    font-size: 1.75rem;
}

.projects-container.grid-view .dir-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    align-items: center;
    justify-content: flex-start;
}

.projects-container.grid-view .dir-year,
.projects-container.grid-view .dir-action {
    display: none;
}

.projects-container.grid-view .dir-details {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 1rem;
    width: 100%;
}

.projects-container.grid-view .dir-desc {
    padding-left: 0;
    border-left: none;
}

/* Responsive constraints */
@media (max-width: 992px) {
    .projects-container.list-view .dir-project-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 1.5rem;
        padding: 1.5rem;
        border-radius: 24px;
    }

    .projects-container.list-view .dir-project-item:hover {
        transform: translateY(-3px);
    }

    .projects-container.list-view .dir-thumb {
        width: 100%;
        height: 250px;
    }

    .projects-container.list-view .dir-info {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
        width: 100%;
    }

    .projects-container.list-view .dir-details {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }

    .projects-container.list-view .dir-desc {
        padding-left: 0;
        border-left: none;
    }

    .projects-container.list-view .dir-meta {
        margin-right: 0;
    }

    .projects-container.list-view .dir-year,
    .projects-container.list-view .dir-action {
        display: none;
    }

    /* Fix Grid View on Mobile (Show 2 items per row but compact) */
    .projects-container.grid-view {
        grid-template-columns: repeat(2, 1fr);
        gap: 1rem;
    }

    .projects-container.grid-view .dir-project-item {
        padding: 1rem;
        border-radius: 16px;
        gap: 1rem;
    }

    .projects-container.grid-view .dir-thumb {
        height: 150px;
        border-radius: 12px;
    }
    
    .projects-container.grid-view .dir-title {
        font-size: 1.1rem;
    }
    
    .projects-container.grid-view .dir-desc {
        font-size: 0.85rem;
        line-height: 1.4;
    }
    
    .projects-container.grid-view .dir-tag {
        font-size: 0.7rem;
        padding: 0.2rem 0.5rem;
    }
}

/* =========================================
   PROJECTS PAGE: FOOTER CTA OVERRIDES
========================================= */
/* We override the home.css base styles here so the Home page remains untouched */
.projects-directory-section~section .projects-section-footer {
    padding: 0 !important;
    margin-top: 4rem !important;
    height: 45rem !important;
    min-height: 0 !important;
    justify-content: center !important;
}

.projects-directory-section~section .footer-cta-title {
    max-width: 100% !important;
    white-space: nowrap !important;
}

@media (max-width: 768px) {
    .projects-directory-section~section .projects-section-footer {
        padding: 1.5rem 1rem !important;
    }

    .projects-directory-section~section .footer-cta-title {
        white-space: normal !important;
    }
}

/* =========================================
   PROJECTS CTA SECTION
========================================= */
.cta-section {
    padding: 8rem 0 4rem;
    display: flex;
    justify-content: center;
}

.cta-container {
    text-align: center;
    max-width: 800px;
    padding: 4.5rem;
    background-color: var(--color-bg-card);
    border: 1px solid var(--color-border);
    border-radius: 40px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.5rem;
}

.cta-heading {
    font-size: 3.5rem;
    font-weight: 500;
    letter-spacing: -0.03em;
    color: var(--color-text-main);
    line-height: 1.1;
    margin: 0;
}

.cta-sub {
    font-size: 1.2rem;
    color: var(--color-text-muted);
    max-width: 500px;
    margin-bottom: 1rem;
    line-height: 1.6;
}

@media (max-width: 768px) {
    .cta-container {
        padding: 3rem 1.5rem;
        border-radius: 24px;
    }

    .cta-heading {
        font-size: 2.5rem;
    }

    .cta-sub {
        font-size: 1.1rem;
    }
}

/* =========================================
   CUSTOM AJAX HERO ANIMATIONS
========================================= */
body.is-ajax .projetos-hero-section .header-top {
    --delay-text-1: 0.40s;
}

body.is-ajax .projetos-hero-section .hero-visual-wrapper {
    --delay-img: 0.55s;
}

body.is-ajax .projetos-hero-section .hero-editorial-row {
    --delay-text-2: 0.70s;
}

/* =========================================
   MOBILE RESPONSIVE CONSTRAINTS
========================================= */
@media (max-width: 768px) {

    /* Hero Section Parity with Sobre */
    .projetos-hero-section {
        padding: 9.125rem 1.5rem 3rem !important;
        /* Just enough to clear the logo (6rem top + 3.125rem height) */
        min-height: auto !important;
    }

    .projetos-hero-section .hero-content-inner {
        margin-top: 2rem;
        padding-top: 0;
        padding-bottom: 0;
        flex: none;
        /* remove flex stretch to let it be auto height */
    }

    .projetos-hero-section .hero-visual-wrapper {
        height: 50vh !important;
        /* Fixed height for video on mobile */
        flex: none;
    }

    .projetos-hero-section .hero-editorial-row {
        flex-direction: column;
        align-items: flex-start;
        gap: 1.5rem;
    }

    .projetos-hero-section .editorial-right {
        text-align: left !important;
    }

    .projetos-hero-section .contact-title {
        font-size: clamp(2.5rem, 10vw, 3rem) !important;
    }

    /* Global 24px lateral padding for main container */
    .projects-directory-section {
        padding-top: 50px !important;
        padding-bottom: 50px !important;
    }

    .projects-directory-section .container-large {
        padding-left: 1.5rem !important;
        padding-right: 1.5rem !important;
    }

    /* Fix directory title on mobile */
    .filter-left .directory-title {
        font-size: 1.2rem;
    }

    /* CTA Section Mobile Parity */
    .projetos-cta-section {
        padding-bottom: 150px !important;
        padding-top: 50px !important;
        border: none !important;
        box-shadow: none !important;
        outline: none !important;
        position: relative !important;
        z-index: 10 !important;
    }
}

/* =========================================
   PROJECTS CTA SECTION
========================================= */
.projetos-cta-section {
    padding-bottom: 100px;
}