/* ==========================================================================
   1. BUSCADOR GIGANTE Y FILTROS
   ========================================================================== */
.projects-search-section {
    padding: 8rem 0 4rem 0;
    background-color: var(--color-white);
    border-bottom: 1px solid var(--color-border);
}

.dhema-search-form {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.5rem;
    max-width: 900px;
    margin: 0 auto;
}

.search-main-bar {
    position: relative;
    width: 100%;
    background-color: #f0f0f0;
    border-radius: 50px;
    padding: 0.5rem 1rem;
    display: flex;
    align-items: center;
}

.search-huge-input {
    width: 100%;
    background: transparent;
    border: none;
    padding: 1rem 4rem 1rem 1.5rem;
    font-size: 1.8rem;
    color: var(--color-text-muted);
    outline: none;
}

.search-huge-submit {
    position: absolute;
    right: 20px;
    background: transparent;
    border: none;
    color: var(--color-text-muted);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Filtros Avanzados (Píldoras) */
.search-advanced-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    justify-content: center;
}

.filter-pill {
    position: relative;
    background-color: #f0f0f0;
    border-radius: 30px;
    padding: 0.8rem 1.8rem;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background-color var(--transition-fast);
}

.filter-pill:hover {
    background-color: #e0e0e0;
}

.filter-select {
    background: transparent;
    border: none;
    font-size: 1rem;
    color: var(--color-text-muted);
    outline: none;
    cursor: pointer;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    text-align: center;
}

.pill-label {
    font-size: 1rem;
    color: var(--color-text-muted);
    user-select: none;
    margin-right: 0.5rem;
}

.pill-arrow {
    font-family: dashicons;
    font-size: 1.2rem;
    color: var(--color-text-muted);
    line-height: 1;
    transition: transform 0.3s ease;
}

.filter-dropdown-trigger.active .pill-arrow {
    transform: rotate(180deg);
}

/* Dropdown Custom para Área y Precio */
.filter-dropdown-content {
    position: absolute;
    top: 120%;
    left: 50%;
    transform: translateX(-50%);
    background: var(--color-white);
    border: 1px solid var(--color-border);
    box-shadow: 0 10px 25px rgba(0,0,0,0.1);
    padding: 1rem;
    border-radius: 10px;
    z-index: 100;
    opacity: 0;
    visibility: hidden;
    transition: all var(--transition-fast);
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.filter-dropdown-trigger.active .filter-dropdown-content {
    opacity: 1;
    visibility: visible;
    top: 110%;
}

.filter-mini-input {
    border: 1px solid var(--color-border);
    padding: 0.5rem;
    border-radius: 5px;
    width: 120px;
    outline: none;
}

.btn-apply-filters {
    background-color: var(--color-black);
    color: var(--color-white);
    border: none;
    border-radius: 30px;
    padding: 0.8rem 2rem;
    font-size: 1rem;
    cursor: pointer;
    transition: opacity var(--transition-fast);
}

.btn-apply-filters:hover {
    opacity: 0.8;
}

/* ==========================================================================
   2. DISEÑO PREMIUM DE LAS LISTAS (Custom Dropdown)
   ========================================================================== */
.custom-dropdown-content {
    position: absolute;
    top: 120%;
    left: 50%;
    transform: translateX(-50%);
    background-color: var(--color-white);
    border: none;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
    border-radius: 12px;
    z-index: 100;
    opacity: 0;
    visibility: hidden;
    transition: all var(--transition-fast);
    padding: 1rem 0;
    min-width: 180px;
    max-width: 250px;
}

.filter-dropdown-trigger.active .custom-dropdown-content {
    opacity: 1;
    visibility: visible;
    top: 110%;
}

.custom-dropdown-list {
    display: flex;
    flex-direction: column;
    gap: 0;
}

.custom-dropdown-item {
    font-size: 0.95rem;
    color: var(--color-text-muted);
    padding: 0.8rem 1.5rem;
    cursor: pointer;
    transition: all var(--transition-fast);
    user-select: none;
}

.custom-dropdown-item:hover {
    background-color: #f6f6f6;
    color: var(--color-black);
}

.custom-dropdown-item.active {
    font-weight: 600;
    color: var(--color-black);
    background-color: #f0f0f0;
}

/* ==========================================================================
   3. GRID DE PROYECTOS Y TARJETA CON FRANJA GRIS
   ========================================================================== */
.archive-projects-content {
    padding: 4rem 0 8rem 0;
    background-color: var(--color-white);
}

.projects-header,
.page-projects-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 4rem;
    gap: 4rem;
}

.projects-header .section-title {
    font-size: clamp(2.5rem, 4vw, 3.5rem);
    font-weight: 600;
    letter-spacing: -1.5px;
    margin: 0;
    flex-shrink: 0;
}

.projects-header .projects-desc {
    max-width: 600px;
    font-size: 1.1rem;
    line-height: 1.6;
}

.projects-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 4rem 2rem;
}

.project-card,
.page-project-card {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.project-image-wrapper {
    position: relative;
    width: 100%;
    aspect-ratio: 16 / 9;
    overflow: hidden;
    background-color: #f0f0f0;
}

.project-image-wrapper img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.page-project-card:hover .project-image-wrapper img,
.project-card:hover .project-image-wrapper img {
    transform: scale(1.04);
}

/* FRANJA GRIS DE DATOS (Overlay sobre la imagen) */
.project-data-strip {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    background-color: rgba(240, 240, 240, 0.95);
    display: flex;
    justify-content: space-between;
    padding: 0.8rem 1.5rem;
    z-index: 10;
}

.strip-col {
    display: flex;
    flex-direction: column;
}

.strip-label {
    font-size: 0.65rem;
    font-weight: 600;
    color: #888;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 0.2rem;
}

.strip-val {
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--color-black);
}

.project-title-external {
    font-size: 1.25rem;
    font-weight: 600;
    letter-spacing: -0.3px;
    margin-top: 0.5rem;
}

/* ==========================================================================
   4. RESPONSIVE (ARCHIVE)
   ========================================================================== */
@media (max-width: 992px) {
    .projects-header {
        flex-direction: column;
        gap: 2rem;
    }
}

@media (max-width: 768px) {
    .search-huge-input {
        font-size: 1.2rem;
    }
    
    .projects-grid {
        grid-template-columns: 1fr;
        gap: 4rem; /* Restaura el espacio respirable entre proyectos */
    }
    
    /* 1. El contenedor crece según su contenido, alineando sin espacios blancos */
    .project-image-wrapper {
        height: auto; 
        aspect-ratio: auto;
        display: flex;
        flex-direction: column;
        background-color: transparent;
        overflow: hidden;
        border-radius: 4px;
    }

    /* 2. Controlamos EXCLUSIVAMENTE el enlace/foto para no dañar el contenedor */
    .project-image-wrapper .project-thumb {
        width: 100%;
        aspect-ratio: 16 / 9; /* Altura controlada de la foto */
        display: block;
    }

    /* 3. La franja se acopla como un bloque debajo de la foto */
    .project-data-strip {
        position: relative;
        background-color: #f7f7f7;
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 1.2rem 1rem;
        padding: 1.5rem;
        border-top: none;
    }
    
    .strip-col {
        width: auto;
    }
}