/* ==========================================================================
   CRISTCAM — Proyectos
   Encabezado con datos · proyecto destacado · listado filtrable. Prefijo: px-
   ========================================================================== */

body {
    background: var(--surface);
    color: var(--fg);
}

/* ------------------------------------------------------------ Encabezado */
.px-hero {
    margin-top: calc(var(--header-h) * -1);
    padding: calc(var(--header-h) + clamp(36px, 5vw, 64px)) 0 0;
}

.px-hero__grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    align-items: end;
    gap: 16px clamp(32px, 6vw, 80px);
}

.px-hero__title {
    color: var(--ink);
    font: 700 clamp(2.1rem, 1.4rem + 2.2vw, 3.3rem)/1.06 var(--font-display);
    letter-spacing: -0.03em;
}

.px-hero__lead {
    color: var(--muted);
    font-size: 1.05rem;
    line-height: 1.7;
}

.px-facts {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    margin-top: clamp(32px, 4vw, 48px);
    border-top: 1px solid var(--line);
    border-bottom: 1px solid var(--line);
}

.px-facts > div {
    display: flex;
    flex-direction: column-reverse;
    gap: 4px;
    padding: 22px 0 22px 24px;
}

.px-facts > div:first-child {
    padding-left: 0;
}

.px-facts > div + div {
    border-left: 1px solid var(--line);
}

.px-facts dd {
    color: var(--ink);
    font: 700 clamp(1.4rem, 1.2rem + 0.8vw, 1.9rem)/1.1 var(--font-display);
    letter-spacing: -0.03em;
}

.px-facts dt {
    color: var(--muted);
    font-size: 13.5px;
}

/* ----------------------------------------------------------- Etiqueta */
.px-tag {
    color: var(--primary-dark);
    font-size: 13px;
    font-weight: 600;
}

/* ------------------------------------------------------------ Destacado */
.px-featured {
    padding: clamp(40px, 5vw, 64px) 0 0;
}

.px-feature {
    display: grid;
    grid-template-columns: 1.15fr 0.85fr;
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: var(--surface-soft);
}

.px-feature__media img {
    display: block;
    width: 100%;
    height: 100%;
    min-height: 360px;
    object-fit: cover;
}

.px-feature__body {
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: clamp(28px, 4vw, 48px);
}

.px-feature h2 {
    margin-top: 6px;
    color: var(--ink);
    font: 700 clamp(1.6rem, 1.2rem + 1.2vw, 2.2rem)/1.15 var(--font-display);
    letter-spacing: -0.025em;
}

.px-feature__body > p:not(.px-tag) {
    margin-top: 12px;
    color: var(--muted);
    line-height: 1.7;
}

.px-feature__data {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px 24px;
    margin-top: 26px;
    padding-top: 22px;
    border-top: 1px solid var(--line);
}

.px-feature__data dt {
    color: var(--muted);
    font-size: 13px;
}

.px-feature__data dd {
    margin-top: 2px;
    color: var(--ink);
    font-weight: 600;
}

/* -------------------------------------------------------------- Listado */
.px-list {
    padding: var(--section-y) 0;
}

.px-list__head {
    display: flex;
    flex-wrap: wrap;
    align-items: end;
    justify-content: space-between;
    gap: 16px 32px;
    margin-bottom: 28px;
}

.px-filter {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.px-filter button {
    padding: 9px 16px;
    border: 1px solid var(--line);
    border-radius: 6px;
    background: var(--surface);
    color: var(--fg);
    font: 600 14px/1 var(--font-body);
    cursor: pointer;
    transition: background-color 0.2s, color 0.2s, border-color 0.2s;
}

.px-filter button:hover {
    border-color: var(--ink);
}

.px-filter button[aria-pressed="true"] {
    border-color: var(--ink);
    background: var(--ink);
    color: #fff;
}

.px-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
    list-style: none;
}

.px-card {
    display: flex;
    flex-direction: column;
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: var(--surface);
}

.px-card[hidden] {
    display: none;
}

.px-card img {
    display: block;
    width: 100%;
    height: auto;
    aspect-ratio: 4 / 3;
    object-fit: cover;
    transition: transform 0.8s var(--ease);
}

.px-card:hover img {
    transform: scale(1.04);
}

.px-card__body {
    position: relative;
    padding: 18px 20px 22px;
    background: var(--surface);
}

.px-card h3 {
    margin-top: 4px;
    color: var(--ink);
    font: 700 1.15rem/1.25 var(--font-display);
    letter-spacing: -0.02em;
}

.px-card__meta {
    margin-top: 4px;
    color: var(--fg);
    font-size: 14px;
    font-weight: 500;
}

.px-card__body > p:last-child {
    margin-top: 8px;
    color: var(--muted);
    font-size: 14px;
    line-height: 1.55;
}

.px-empty {
    padding: 40px 0;
    color: var(--muted);
    text-align: center;
}

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

    .px-feature {
        grid-template-columns: 1fr;
    }

    .px-feature__media img {
        min-height: 0;
        aspect-ratio: 16 / 10;
    }
}

@media (max-width: 760px) {
    .px-hero__grid {
        grid-template-columns: 1fr;
    }

    .px-facts {
        grid-template-columns: repeat(2, 1fr);
    }

    .px-facts > div {
        padding: 18px 0 18px 18px;
    }

    .px-facts > div:nth-child(odd) {
        padding-left: 0;
        border-left: 0;
    }

    .px-facts > div:nth-child(n + 3) {
        border-top: 1px solid var(--line);
    }
}

@media (max-width: 600px) {
    .px-grid {
        grid-template-columns: 1fr;
    }

    .px-feature__data {
        grid-template-columns: 1fr;
    }
}
