/* ==========================================================
   Portfolio Showcase - Estilos de la tarjeta (preview)
   ========================================================== */

.ps-portfolio-wrapper {
    display: flex;
    flex-direction: column;
    gap: 60px;
    max-width: 1200px;
    margin: 0 auto;
    padding: 40px 20px;
}

.ps-portfolio-item {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 60px;
    align-items: center;
    background: #f2f2f0;
    padding: 36px;
    border-radius: 8px;
}

.ps-portfolio-image {
    border-radius: 12px;
    overflow: hidden;
    line-height: 0;
}

/* Alterna la posición: en los elementos impares, la imagen pasa a la derecha */
.ps-portfolio-item--reverse .ps-portfolio-image {
    order: 2;
}

.ps-portfolio-item--reverse .ps-portfolio-content {
    order: 1;
}

.ps-portfolio-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.ps-portfolio-content {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.ps-portfolio-title {
    font-size: 2rem;
    line-height: 1.2;
    font-weight: 500;
    margin: 0;
    color: #1a1a1a;
}

.ps-portfolio-description {
    font-size: 1.05rem;
    line-height: 1.6;
    color: #333;
}

.ps-excerpt-clamp {
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 11;
    line-clamp: 11;
    overflow: hidden;
}

.ps-portfolio-button {
    align-self: flex-start;
    background: #3a3a3a;
    color: #fff;
    border: none;
    padding: 18px 36px;
    font-size: 0.85rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    cursor: pointer;
    border-radius: 50px;
    transition: background 0.2s ease;
}

.ps-portfolio-button:hover {
    background: #1a1a1a;
}

/* Responsive: apila imagen y texto en pantallas pequeñas */
@media (max-width: 782px) {
    .ps-portfolio-item {
        grid-template-columns: 1fr;
        gap: 24px;
        padding: 26px;
    }

    /* En mobile la imagen siempre va arriba del título,
       sin importar si el elemento es "reverse" en desktop. */
    .ps-portfolio-image,
    .ps-portfolio-item--reverse .ps-portfolio-image {
        order: 1;
    }

    .ps-portfolio-content,
    .ps-portfolio-item--reverse .ps-portfolio-content {
        order: 2;
    }

    .ps-portfolio-title {
        font-size: 1.6rem;
    }
}

/* ==========================================================
   Modal
   ========================================================== */

.ps-modal {
    position: fixed;
    inset: 0;
    z-index: 100000;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.ps-modal.is-open {
    opacity: 1;
    visibility: visible;
}

.ps-modal-dialog {
    transform: translateY(12px);
    transition: transform 0.3s ease;
}

.ps-modal.is-open .ps-modal-dialog {
    transform: translateY(0);
}

.ps-modal-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
}

.ps-modal-dialog {
    position: relative;
    background: #fff;
    max-width: 800px;
    width: 92%;
    max-height: 88vh;
    overflow: hidden;
    margin: 6vh auto;
    border-radius: 8px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

.ps-modal-scroll {
    max-height: 88vh;
    overflow-y: auto;
    padding-bottom: 30px;
}

.ps-modal-image {
    height: 320px;
    overflow: hidden;
}

.ps-modal-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    border-radius: 8px 8px 0 0;
}

.ps-modal-body {
    padding: 40px 50px 10px;
}

.ps-modal-body h2 {
    margin-top: 0;
    font-size: 1.6rem;
    font-weight: 500;
}

.ps-modal-close {
    position: absolute;
    top: 16px;
    right: 16px;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: none;
    background: rgba(255, 255, 255, 0.9);
    font-size: 1.6rem;
    line-height: 1;
    cursor: pointer;
    z-index: 5;
}

.ps-modal-close:hover {
    background: #fff;
}

/* En mobile, el botón de cerrar el modal se alinea a la izquierda */
@media (max-width: 782px) {
    .ps-modal-close {
        left: 16px;
        right: auto;
    }
}

/* Evita el scroll del body cuando el modal está abierto */
body.ps-modal-open {
    overflow: hidden;
}
