/* ==========================================================
   INICIO PROYECTOS
   Nuestro proceso + Proyectos realizados
========================================================== */

.inicio-proyectos,
.inicio-proyectos * {
    box-sizing: border-box;
}

.inicio-proyectos {
    --vino: #7d0d2f;
    --vino-2: #9b2446;
    --texto: #241d1b;
    --muted: #786d68;
    --linea: rgba(72, 49, 43, .11);
    --crema: #fbf8f5;
    --crema-2: #f6f0eb;

    background: #fff;
    color: var(--texto);
    padding: 34px 0 28px;
}

.ip-wrap {
    width: min(1380px, calc(100% - 56px));
    margin: 0 auto;
}

/* ---------- títulos ---------- */

.ip-section-head {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 22px;
}

.ip-section-head--proceso {
    margin-bottom: 18px;
}

.ip-section-head--proyectos {
    margin: 38px 0 18px;
}

.ip-eyebrow {
    display: block;
    margin-bottom: 6px;
    color: var(--vino);
    font-size: 10px;
    font-weight: 500;
    letter-spacing: .18em;
    text-transform: uppercase;
}

.ip-section-head h2 {
    margin: 0;
    font-family: Georgia, "Times New Roman", serif;
    font-size: clamp(28px, 2.2vw, 36px);
    line-height: 1.08;
    font-weight: 400;
    letter-spacing: -.015em;
}

.ip-ver-todos {
    color: var(--vino);
    text-decoration: none;
    font-size: 12px;
    font-weight: 500;
    white-space: nowrap;
    transition: opacity .2s ease;
}

.ip-ver-todos:hover {
    opacity: .68;
}

.ip-ver-todos span {
    margin-left: 7px;
}

/* ---------- nuestro proceso ---------- */

.ip-proceso {
    display: grid;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    overflow: hidden;
    border: 1px solid var(--linea);
    border-radius: 15px;
    background: linear-gradient(180deg, #fff, var(--crema));
}

.ip-step {
    position: relative;
    min-height: 130px;
    padding: 22px 18px;
    display: grid;
    grid-template-columns: auto 44px 1fr;
    align-items: center;
    gap: 10px;
    border-right: 1px solid var(--linea);
}

.ip-step:last-child {
    border-right: 0;
}

.ip-step__numero {
    min-width: 39px;
    color: var(--vino);
    font-family: Georgia, "Times New Roman", serif;
    font-size: 31px;
    line-height: 1;
    font-weight: 400;
}

.ip-step__icon {
    width: 42px;
    height: 42px;
    display: grid;
    place-items: center;
    color: var(--vino);
}

.ip-step__icon i {
    font-size: 27px;
}

.ip-step__copy h3 {
    margin: 0 0 5px;
    font-size: 14px;
    line-height: 1.2;
    font-weight: 600;
}

.ip-step__copy p {
    margin: 0;
    color: var(--muted);
    font-size: 11px;
    line-height: 1.45;
}

.ip-step__arrow {
    position: absolute;
    right: -8px;
    top: 50%;
    z-index: 3;
    width: 16px;
    transform: translateY(-50%);
    color: rgba(125, 13, 47, .45);
    background: var(--crema);
    font-size: 14px;
    text-align: center;
}

/* ---------- proyectos / acordeón horizontal ---------- */

.ip-accordion-shell {
    width: 100%;
    overflow: hidden;
}

.ip-proyectos {
    display: flex;
    width: 100%;
    height: 560px;
    gap: 14px;
    justify-content: flex-start;
}

.ip-project {
    position: relative;
    flex: 1 1 0;
    min-width: 62px;
    height: 100%;
    padding: 0;
    overflow: hidden;
    border: 0;
    border-radius: 19px;
    background: #e8ded6;
    color: #fff;
    text-align: left;
    cursor: pointer;
    appearance: none;
    isolation: isolate;
    transition:
        flex .72s cubic-bezier(.2,.75,.2,1),
        min-width .72s cubic-bezier(.2,.75,.2,1),
        transform .28s ease,
        box-shadow .28s ease;
}

.ip-project.is-active {
    flex: 8.2 1 0;
    min-width: 58%;
    box-shadow: 0 18px 44px rgba(35, 20, 20, .16);
}

.ip-project__photo {
    position: absolute;
    inset: 0;
    z-index: -3;
    background-color: #ded4cc;
    background-size: cover;
    background-position: center center;
    transform: none;
    transition: filter .35s ease;
}

.ip-project::before {
    content: "";
    position: absolute;
    inset: 0;
    z-index: -2;
    background: linear-gradient(90deg, rgba(18, 13, 12, .34), rgba(18, 13, 12, .06) 55%, rgba(18, 13, 12, .03));
    opacity: .55;
    transition: opacity .4s ease;
}

.ip-project__shade {
    position: absolute;
    inset: 34% 0 0;
    z-index: -1;
    background: linear-gradient(to top, rgba(20, 15, 14, .72), rgba(20, 15, 14, .04) 76%, transparent);
    opacity: 0;
    transition: opacity .36s ease;
}

.ip-project.is-active::before {
    opacity: 1;
}

.ip-project.is-active .ip-project__shade {
    opacity: 1;
}

.ip-project.is-active .ip-project__photo {
    transform: none;
}

.ip-project__info {
    position: absolute;
    left: 30px;
    right: 30px;
    bottom: 28px;
    display: grid;
    gap: 7px;
    opacity: 0;
    transform: translateY(14px);
    pointer-events: none;
    transition: opacity .34s ease .12s, transform .42s ease .1s;
}

.ip-project.is-active .ip-project__info {
    opacity: 1;
    transform: translateY(0);
}

.ip-project__eyebrow {
    font-size: 9px;
    font-weight: 600;
    letter-spacing: .2em;
    text-transform: uppercase;
}

.ip-project__title {
    margin: 0;
    max-width: 520px;
    font-family: Georgia, "Times New Roman", serif;
    font-size: clamp(27px, 2.4vw, 40px);
    line-height: 1.04;
    font-weight: 400;
}

.ip-project__copy {
    margin: 0;
    max-width: 520px;
    font-size: 12px;
    line-height: 1.5;
    color: rgba(255,255,255,.9);
}

.ip-project__cta {
    width: fit-content;
    margin-top: 6px;
    padding: 10px 15px;
    border-radius: 999px;
    background: rgba(255,255,255,.94);
    color: #251d1b;
    font-size: 11px;
    font-weight: 600;
}

.ip-project__number {
    position: absolute;
    left: 50%;
    bottom: 18px;
    z-index: 2;
    color: rgba(255,255,255,.9);
    font-family: Georgia, "Times New Roman", serif;
    font-size: 18px;
    transform: translateX(-50%);
    opacity: 1;
    transition: opacity .25s ease;
}

.ip-project.is-active .ip-project__number {
    opacity: 0;
}

.ip-project:hover:not(.is-active) {
    transform: none;
}


.ip-project:focus-visible {
    outline: 2px solid var(--vino);
    outline-offset: 3px;
}

@media (max-width: 1050px) {
    .ip-proyectos { height: 500px; gap: 10px; }
    .ip-project { min-width: 52px; border-radius: 15px; }
    .ip-project.is-active { min-width: 56%; }
}

@media (max-width: 760px) {
    .ip-accordion-shell { overflow: visible; }
    .ip-proyectos {
        height: auto;
        display: grid;
        gap: 10px;
    }

    .ip-project,
    .ip-project.is-active {
        min-width: 0;
        width: 100%;
        height: 84px;
        flex: none;
        border-radius: 14px;
    }

    .ip-project.is-active { height: 420px; }
    .ip-project__info { left: 20px; right: 20px; bottom: 20px; }
    .ip-project__title { font-size: 28px; }
    .ip-project__number { left: auto; right: 18px; transform: none; }
}

/* ---------- lightbox ---------- */

.ip-lightbox {
    position: fixed;
    inset: 0;
    z-index: 99999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 42px 74px;
    background: rgba(10, 8, 8, .90);
    backdrop-filter: blur(8px);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity .28s ease, visibility .28s ease;
}

.ip-lightbox.is-open {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

.ip-lightbox__figure {
    position: relative;
    width: min(1180px, 88vw);
    height: min(78vh, 780px);
    margin: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.ip-lightbox__image {
    display: block;
    max-width: 100%;
    max-height: 100%;
    width: auto;
    height: auto;
    object-fit: contain;
    border-radius: 14px;
    box-shadow: 0 24px 80px rgba(0, 0, 0, .35);
    transform: scale(.965);
    opacity: .2;
    transition: transform .3s ease, opacity .3s ease;
}

.ip-lightbox.is-open .ip-lightbox__image {
    transform: scale(1);
    opacity: 1;
}

.ip-lightbox__caption {
    position: absolute;
    left: 50%;
    bottom: -34px;
    transform: translateX(-50%);
    color: #fff;
    font-size: 13px;
    font-weight: 400;
    letter-spacing: .02em;
    white-space: nowrap;
}

.ip-lightbox__close,
.ip-lightbox__nav {
    position: absolute;
    border: 0;
    background: rgba(255, 255, 255, .10);
    color: #fff;
    cursor: pointer;
    transition: background .2s ease, transform .2s ease;
}

.ip-lightbox__close:hover,
.ip-lightbox__nav:hover {
    background: rgba(255, 255, 255, .19);
}

.ip-lightbox__close {
    top: 22px;
    right: 28px;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    font-size: 34px;
    line-height: 40px;
    font-weight: 200;
}

.ip-lightbox__nav {
    top: 50%;
    width: 48px;
    height: 64px;
    transform: translateY(-50%);
    border-radius: 999px;
    font-size: 42px;
    line-height: 1;
    font-weight: 200;
}

.ip-lightbox__nav:hover {
    transform: translateY(-50%) scale(1.05);
}

.ip-lightbox__nav--prev { left: 24px; }
.ip-lightbox__nav--next { right: 24px; }

body.ip-lightbox-open {
    overflow: hidden;
}

/* ---------- responsive ---------- */

@media (max-width: 1180px) {
    .ip-wrap {
        width: min(100% - 32px, 1100px);
    }

    .ip-proceso {
        grid-template-columns: repeat(3, 1fr);
    }

    .ip-step:nth-child(3) {
        border-right: 0;
    }

    .ip-step:nth-child(-n+3) {
        border-bottom: 1px solid var(--linea);
    }

    .ip-proyectos {
        grid-template-columns: repeat(4, 1fr);
    }

    .ip-project {
        height: 100%;
    }
}

@media (max-width: 720px) {
    .inicio-proyectos {
        padding: 24px 0 20px;
    }

    .ip-wrap {
        width: calc(100% - 24px);
    }

    .ip-section-head {
        align-items: flex-start;
    }

    .ip-section-head h2 {
        font-size: 27px;
    }

    .ip-ver-todos {
        margin-top: 8px;
        font-size: 10px;
    }

    .ip-proceso {
        grid-template-columns: 1fr;
    }

    .ip-step {
        min-height: 94px;
        border-right: 0;
        border-bottom: 1px solid var(--linea);
        padding: 16px;
        grid-template-columns: 38px 42px 1fr;
    }

    .ip-step:last-child {
        border-bottom: 0;
    }

    .ip-step__arrow {
        display: none;
    }

    .ip-step__numero {
        font-size: 27px;
    }

    .ip-proyectos {
        display: flex;
        overflow-x: auto;
        gap: 10px;
        scroll-snap-type: x mandatory;
        padding-bottom: 5px;
    }

    .ip-project {
        flex: 0 0 72%;
        height: 240px;
        scroll-snap-align: start;
    }

    .ip-project__info {
        opacity: 1;
        transform: none;
    }
}


/* ---------- responsive del slide / lightbox ---------- */
@media (max-width: 1180px) {
    .ip-proyectos {
        --ip-card-w: 190px;
    }
}

@media (max-width: 720px) {
    .ip-slider {
        width: calc(100% + 16px);
        margin-right: -16px;
        -webkit-mask-image: none;
        mask-image: none;
    }

    .ip-proyectos {
        --ip-gap: 10px;
        --ip-card-w: min(72vw, 270px);
        animation-duration: 28s;
    }

    .ip-project {
        height: 260px;
    }

    .ip-project__info {
        opacity: 1;
        transform: none;
        padding: 24px 13px 12px;
    }

    .ip-lightbox {
        padding: 58px 16px 70px;
    }

    .ip-lightbox__figure {
        width: 100%;
        height: 72vh;
    }

    .ip-lightbox__nav {
        top: auto;
        bottom: 14px;
        width: 46px;
        height: 46px;
        transform: none;
        font-size: 34px;
    }

    .ip-lightbox__nav:hover {
        transform: scale(1.05);
    }

    .ip-lightbox__nav--prev { left: calc(50% - 58px); }
    .ip-lightbox__nav--next { right: calc(50% - 58px); }

    .ip-lightbox__close {
        top: 12px;
        right: 14px;
    }

    .ip-lightbox__caption {
        bottom: -30px;
        max-width: 85vw;
        overflow: hidden;
        text-overflow: ellipsis;
    }
}

@media (prefers-reduced-motion: reduce) {
    .ip-proyectos { animation: none; }
    .ip-project__photo,
    .ip-project__info,
    .ip-lightbox,
    .ip-lightbox__image { transition: none; }
}


@media (max-width: 760px) {
    .ip-slider-nav {
        width: 36px;
        height: 36px;
        font-size: 25px;
    }
    .ip-slider-nav--prev { left: -10px; }
    .ip-slider-nav--next { right: -10px; }
}
