/* Project Overview — CodePix
   Sidebar filters (left, 400px) + grid (right)
   Uses Elementor color tokens and local --cpx-* tokens.
*/

.cpx-project-overview {
    /* Colors */
    --cpx-green: var(--e-global-color-primary);
    --cpx-black: var(--e-global-color-secondary);
    --cpx-gray: var(--e-global-color-accent);
    --cpx-light-gray: #E2E2E2;
    --cpx-white: #fff;

    /* Spacing */
    --cpx-gap-outer: 50px;
    --cpx-gap-grid: 30px;
    --cpx-card-radius: 0px;
    --cpx-pad-card: 24px;

    /* Typography */
    --cpx-label-size: 22px;
    --cpx-title-size: 22px;
    --cpx-meta-size: 16px;

    /* Components */
    --cpx-select-height: 55px;
    --cpx-select-radius: 0px;
    --cpx-select-border: 1px;

    /* Range */
    --cpx-range-height: 6px;
    --cpx-range-thumb: 32px;
}

/* Layout */
.cpx-project-overview {
    display: grid;
    grid-template-columns: 400px 1fr;
    column-gap: var(--cpx-gap-outer);
    align-items: start;
}

.cpx-project-overview__left {
    /* sidebar */
}

.cpx-project-overview__right {
    /* content */
}

/* Sidebar */
.cpx-filters__group+.cpx-filters__group {
    margin-top: 23px;
}

/* Disable crops filtering for now. We keep the functionality so we can turn this into another filter later on */
.cpx-filters__group.cpx-filters__group--crops {
    display: none;
}

.cpx-filters__label {
    display: block;
    margin-bottom: 8px;
    font-size: var(--cpx-label-size);
    font-weight: 800;
    letter-spacing: 0.02em;
    color: var(--cpx-black);
    text-transform: uppercase;
}

/* Custom select */
.cpx-select {
    position: relative;
    color: var(--e-global-color-secondary);
}

.cpx-select__input {
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;

    width: 100%;
    height: var(--cpx-select-height);

    padding-left: 18px;
    padding-right: 56px;

    border: var(--cpx-select-border) solid #E2E2E2;
    border-radius: var(--cpx-select-radius);
    background-color: var(--cpx-white);
    color: var(--cpx-black);
}

.cpx-select__input:focus {
    outline: none;
    border-color: var(--cpx-green);
    box-shadow: 0 0 0 2px color-mix(in srgb, var(--cpx-green), transparent 70%);
}

.cpx-select__icon {
    position: absolute;
    top: 0;
    right: 0;
    width: var(--cpx-select-height);
    height: var(--cpx-select-height);
    pointer-events: none;
}

.cpx-select__icon::after {
    content: "";
    position: absolute;
    top: 44%;
    left: 50%;
    width: 14px;
    height: 14px;
    transform: translate(-50%, -50%) rotate(45deg);
    border-right: 2px solid var(--cpx-green);
    border-bottom: 2px solid var(--cpx-green);
    border-radius: 2px;
}

/* Range (double slider) */
.irs--round .irs-handle {
    border-color: var(--e-global-color-primary);
}

.irs--round .irs-bar {
    background-color: var(--e-global-color-primary);
}

.cpx-range__labels,
.irs {
    color: var(--e-global-color-secondary)
}

.cpx-range__labels {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    margin-top: 13px;
}

.cpx-filters__group .irs {
    margin-top: -20px;
}

.cpx-project-overview .irs--round .irs-from,
.cpx-project-overview .irs--round .irs-to,
.cpx-project-overview .irs--round .irs-single,
.cpx-project-overview .irs--round .irs-min,
.cpx-project-overview .irs--round .irs-max,
.cpx-project-overview .irs--round .irs-from:before,
.cpx-project-overview .irs--round .irs-to:before,
.cpx-project-overview .irs--round .irs-single:before {
    display: none;
}

/* Grid */
.cpx-project-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: var(--cpx-gap-grid);
}

.cpx-project-empty {
    margin-top: 20px;
    font-size: 18px;
}

/* Card */
.cpx-card {
    border: 1px solid #E2E2E2;
    border-radius: var(--cpx-card-radius);
    overflow: hidden;
    background-color: #FCFCFC;
    color: var(--e-global-color-secondary);
    transition: all .3s ease-in-out;

    &:hover,
    &:focus {
        border-color: var(--cpx-green);
        transform: translateY(-5px);
    }
}

.cpx-card__image {
    width: 100%;
    aspect-ratio: 16 / 9;
    object-fit: cover;
    display: block;
}

.cpx-card__body {
    padding: var(--cpx-pad-card);
}

.cpx-card__title {
    margin: 0 0 14px 0;
    font-size: var(--cpx-title-size);
    font-weight: 800;
    color: var(--cpx-black);
    text-transform: uppercase;
}

.cpx-meta {
    display: grid;
    grid-template-columns: 1fr;
    row-gap: 12px;
}

.cpx-meta__item {
    display: grid;
    grid-template-columns: 22px 1fr;
    column-gap: 10px;
    align-items: start;
    font-size: var(--cpx-meta-size);
    color: var(--cpx-black);
}

.cpx-meta__icon {
    width: 22px;
    height: 22px;
    color: var(--cpx-green);
}

.cpx-meta__label {
    display: inline-block;
}

/* Responsive */
@media (max-width: 1200px) {
    .cpx-project-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 900px) {
    .cpx-project-overview {
        grid-template-columns: 1fr;
        row-gap: 36px;
    }

    .cpx-project-grid {
        grid-template-columns: 1fr;
    }
}

.cpx-card.is-hidden {
    display: none;
}

#cpx-project-empty[hidden] {
    display: none;
}

#cpx-project-empty {
    padding: 2rem 0;
    color: var(--e-global-color-secondary);
    font-weight: 600;
    text-align: center;
    background-color: #fafafa;
}

.cpx-project-reset {
    margin-top: 10px;
}