/* =========================================
   LORENZANA - GALERÍAS DE CASOS
========================================= */

.lc-casos {
    width: 100%;
}

.lc-casos-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 34px 26px;
    align-items: stretch;
}


/* =========================================
   CARD
========================================= */

.lc-caso-card {
    margin: 0;
    height: 100%;
}

.lc-caso-open {
    display: flex;
    flex-direction: column;
    width: 100%;
    height: 100%;
    padding: 0;
    border: 0;
    background: #fff;
    color: inherit;
    text-align: left;
    cursor: pointer;
    font: inherit;

    border-radius: 18px;
    overflow: hidden;

    box-shadow:
        0 8px 28px rgba(0, 0, 0, 0.07),
        0 2px 8px rgba(0, 0, 0, 0.03);

    transition:
        transform .35s ease,
        box-shadow .35s ease;
}

.lc-caso-open:hover {
    transform: translateY(-6px);

    box-shadow:
        0 16px 38px rgba(0, 0, 0, 0.11),
        0 4px 12px rgba(0, 0, 0, 0.05);
}


/* =========================================
   IMAGEN
========================================= */

.lc-caso-image {
    position: relative;
    overflow: hidden;
    width: 100%;
    aspect-ratio: 4 / 5;
    background: #f5f3f3;
}

.lc-caso-image img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;

    transition:
        transform .5s ease,
        filter .5s ease;
}

.lc-caso-open:hover .lc-caso-image img {
    transform: scale(1.035);
}


/* Overlay muy discreto */
.lc-caso-overlay {
    position: absolute;
    inset: 0;

    display: flex;
    align-items: flex-end;

    padding: 22px;

    background:
        linear-gradient(
            to top,
            rgba(0,0,0,.48) 0%,
            rgba(0,0,0,.10) 35%,
            rgba(0,0,0,0) 65%
        );

    opacity: 0;

    transition:
        opacity .35s ease;
}

.lc-caso-open:hover .lc-caso-overlay {
    opacity: 1;
}

.lc-caso-overlay span {
    color: #fff;

    font-size: 12px;
    font-weight: 600;

    text-transform: uppercase;
    letter-spacing: .13em;
}


/* =========================================
   CONTENIDO
========================================= */

.lc-caso-content {
    display: flex;
    flex-direction: column;

    flex: 1;

    padding: 22px 22px 20px;
}

.lc-caso-content h2 {
    margin: 0 0 9px;

    color: #5c1269;

    font-size: clamp(21px, 1.6vw, 27px);
    line-height: 1.18;
    font-weight: 500;
    letter-spacing: -0.015em;
    
    
}

.lc-caso-content h2 {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    min-height: 38px;
}

.lc-caso-content p {
    margin: 0 0 18px;

    color: #6a6a6a;

    font-size: 14px;
    line-height: 1.6;
}

/* Empuja el link al fondo para igualar todas las cards */
.lc-caso-link {
    margin-top: auto;

    display: inline-flex;
    align-items: center;
    gap: 8px;

    color: #5c1269;

    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .09em;

    transition:
        opacity .25s ease,
        transform .25s ease;
}

.lc-caso-open:hover .lc-caso-link {
    opacity: 1;
    transform: translateX(3px);
}


/* =========================================
   LIGHTBOX
========================================= */

.lc-lightbox {
    position: fixed;
    inset: 0;

    z-index: 999999;

    display: none;
    flex-direction: column;

    background: rgba(12, 12, 12, .975);

    color: #fff;

    backdrop-filter: blur(4px);
}

.lc-lightbox.is-open {
    display: flex;
}

/* =========================================
   LIGHTBOX CON UNA SOLA IMAGEN
========================================= */

.lc-lightbox.is-single .lc-lightbox-stage {
    display: flex;
    justify-content: center;
    align-items: center;

    width: 100%;
    padding: 20px 32px 36px;
}

.lc-lightbox.is-single .lc-lightbox-image-wrap {
    width: 100%;
    height: 100%;

    display: flex;
    justify-content: center;
    align-items: center;
}

.lc-lightbox.is-single .lc-lightbox-image {
    width: auto;
    height: auto;

    max-width: min(92vw, 1600px);
    max-height: calc(100vh - 120px);

    object-fit: contain;
}


/* Header */
.lc-lightbox-header {
    flex: 0 0 auto;

    text-align: center;

    padding: 22px 70px 10px;
}

.lc-lightbox-title {
    margin: 0;

    color: #fff;

    font-size: clamp(20px, 2vw, 30px);
    line-height: 1.2;
    font-weight: 500;
}

.lc-lightbox-counter {
    margin-top: 7px;

    color: rgba(255,255,255,.65);

    font-size: 13px;
    letter-spacing: .04em;
}


/* Cerrar */
.lc-lightbox-close {
    position: absolute;

    top: 14px;
    right: 18px;

    z-index: 5;

    width: 46px;
    height: 46px;

    padding: 0;
    border: 0;

    background: transparent;
    color: #fff;

    font-family: Arial, sans-serif;
    font-size: 42px;
    line-height: 1;

    cursor: pointer;

    opacity: .82;

    transition:
        opacity .2s ease,
        transform .2s ease;
}

.lc-lightbox-close:hover {
    opacity: 1;
    transform: scale(1.05);
}


/* Escenario */
.lc-lightbox-stage {
    min-height: 0;

    flex: 1;

    display: grid;
    grid-template-columns: 72px minmax(0, 1fr) 72px;

    align-items: center;

    padding: 12px 0 28px;
}

.lc-lightbox-image-wrap {
    width: 100%;
    height: 100%;
    min-height: 0;

    display: flex;
    justify-content: center;
    align-items: center;
}

.lc-lightbox-image {
    display: block;

    width: min(90vw, 1500px);
    height: min(78vh, 900px);

    object-fit: contain;

    border-radius: 8px;

    box-shadow:
        0 20px 50px rgba(0,0,0,.35);

    transition:
        opacity .22s ease,
        transform .22s ease;
}


/* Flechas */
.lc-lightbox-arrow {
    border: 0;
    padding: 0;

    background: transparent;

    color: rgba(255,255,255,.78);

    font-family: Arial, sans-serif;
    font-size: 62px;
    line-height: 1;

    cursor: pointer;

    transition:
        color .2s ease,
        transform .2s ease;
}

.lc-lightbox-arrow:hover {
    color: #fff;
    transform: scale(1.07);
}


/* Evitar scroll */
body.lc-lightbox-open {
    overflow: hidden;
}


/* =========================================
   TABLET
========================================= */

@media (max-width: 1024px) {

    .lc-casos-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 28px 22px;
    }

    .lc-caso-open {
        border-radius: 16px;
    }

    .lc-caso-content {
        padding: 19px 18px 18px;
    }
}


/* =========================================
   MOBILE
========================================= */

@media (max-width: 767px) {

    .lc-casos-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 16px;
    }

    .lc-caso-open {
        border-radius: 12px;
    }

    .lc-caso-image {
        aspect-ratio: 4 / 5;
    }

    .lc-caso-overlay {
        display: none;
    }

    .lc-caso-content {
        padding: 12px 10px 11px;
    }

    .lc-caso-content h2 {
        margin: 0 0 8px;
        color: #5c1269;
        font-size: 16px;
        line-height: 1.2;
        font-weight: 600;
    }

    /* Ocultamos subtítulo en mobile */
    .lc-caso-content p {
        display: none;
    }

    .lc-caso-link {
        margin-top: auto;
        color: #5c1269;
        font-size: 10px;
        line-height: 1.2;
        letter-spacing: .06em;
    }

    /* Lightbox */
    .lc-lightbox-header {
        padding: 16px 54px 8px;
    }

    .lc-lightbox-title {
        font-size: 20px;
    }

    .lc-lightbox-close {
        top: 8px;
        right: 8px;
    }

    .lc-lightbox-stage {
        display: block;
        position: relative;
        padding: 4px 10px 48px;
    }

    .lc-lightbox-image-wrap {
        width: 100%;
        height: 100%;
    }

    .lc-lightbox-image {
        width: 94vw;
        height: 72vh;
        max-width: 100%;
        object-fit: contain;
        border-radius: 6px;
    }

    .lc-lightbox-arrow {
        position: absolute;
        top: 50%;
        transform: translateY(-50%);
        z-index: 3;
        width: 44px;
        height: 62px;
        background: rgba(0,0,0,.30);
        font-size: 48px;
        border-radius: 10px;
    }

    .lc-lightbox-prev {
        left: 4px;
    }

    .lc-lightbox-next {
        right: 4px;
    }
}