/* ===== MURO DE CREACIONES (aislado) ===== */
#ia-creaciones {
    display: block;
    position: relative;
    isolation: isolate;
    z-index: 1;
    margin: 32px auto 48px;
    max-width: 1200px;
}

#ia-creaciones .ia-header h1 {
    font-weight: 900;
    margin: 0 0 .25rem;
}

#ia-creaciones .ia-header p {
    opacity: .9;
    margin: 0 0 .75rem;
}

/* grid */
#ia-creaciones .ia-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 16px;
    margin-top: 1rem;
}

/* card */
#ia-creaciones .ia-card {
    background: #1a1a71;
    border-radius: 16px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    box-shadow: 0 8px 24px rgba(0, 0, 0, .18);
}

/* thumb */
#ia-creaciones .ia-thumb {
    position: relative;
    aspect-ratio: 16/9;
    background: #0b0b3a;
}

#ia-creaciones .ia-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    border: 0;
}

/* Overlay centrado: UNA línea + ellipsis (nada de cortes feos) */
#ia-creaciones .ia-overlay {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    display: inline-block;
    max-width: 90%;
    padding: .5rem .9rem;
    border-radius: 9999px;
    background: rgba(0, 0, 0, .55);
    color: #fff;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: .5px;
    text-align: center;
    line-height: 1.1;

    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;

    backdrop-filter: saturate(140%) blur(2px);
    box-sizing: border-box;
}

/* body */
#ia-creaciones .ia-body {
    padding: .9rem .9rem 1rem;
    display: grid;
    gap: .35rem;
    background: #1a1a71;
    border-top: 1px solid rgba(255, 255, 255, .06);
}

#ia-creaciones .ia-title {
    font-weight: 800;
    line-height: 1.2;
}

#ia-creaciones .ia-title--desc {
    font-weight: 800;
    line-height: 1.2;
    /* mostrar hasta 3 líneas */
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 3;
    line-clamp: 3;
    overflow: hidden;

    /* altura mínima para que TODAS las cards queden parejas */
    min-height: calc(1.2em * 3);
    /* 3 líneas x line-height */
}

#ia-creaciones .ia-meta {
    font-size: .9rem;
    opacity: .9;
}

/* acciones */
#ia-creaciones .ia-actions {
    display: flex;
    gap: .5rem;
    margin-top: .6rem;
}

#ia-creaciones .ia-btn {
    flex: 1 1 auto;
    text-align: center;
    border-radius: 10px;
    cursor: pointer;
    border: 0;
    padding: .55rem .8rem;
    font-weight: 800;
    color: #fff;
    background: linear-gradient(90deg, #ff9800, #ff5722);
}

#ia-creaciones .ia-btn.secondary {
    background: linear-gradient(90deg, #e0e0e0, #bdbdbd);
    color: #260055;
    font-weight: 900;
}

/* clamps */
#ia-creaciones .ia-title {
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 1;
    line-clamp: 1;
    overflow: hidden;
}

#ia-creaciones .ia-body p {
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    overflow: hidden;
}

/* ===== Paginador Creaciones ===== */
.ia-pager {
    display: flex;
    justify-content: center;
    align-items: center;
    margin-top: .5rem;
    gap: .5rem;
}

.ia-pager .pager-inner {
    display: inline-flex;
    align-items: center;
    gap: .75rem;
    padding: .5rem .75rem;
    background: rgba(255, 255, 255, .06);
    border-radius: 9999px;
    backdrop-filter: saturate(140%) blur(2px);
}

.ia-pager .pager-btn {
    appearance: none;
    border: 0;
    border-radius: 8px;
    padding: .35rem .6rem;
    font-weight: 900;
    color: #fff;
    background: linear-gradient(90deg, #ff9800, #ff5722);
    cursor: pointer;
}

.ia-pager .pager-btn:disabled {
    opacity: .5;
    cursor: not-allowed;
    background: linear-gradient(90deg, #9e9e9e, #bdbdbd);
    color: #260055;
}

.ia-pager .pager-dots {
    display: inline-flex;
    gap: .4rem;
}

.ia-pager .pager-dots .dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    border: 0;
    background: #bdbdbd;
    cursor: pointer;
}

.ia-pager .pager-dots .dot[aria-current="page"],
.ia-pager .pager-dots .dot.active {
    background: #ff9800;
    outline: 2px solid #fff3;
}

.ia-pager .pager-counter {
    font-size: .9rem;
    opacity: .9;
}


@supports (line-clamp:2) {

    #ia-creaciones .ia-title,
    #ia-creaciones .ia-body p {
        display: block;
        overflow: clip;
    }
}

/* ===== responsive ===== */
@media (max-width:767px) {
    #ia-creaciones {
        margin: 24px auto 36px;
        padding: 0 16px;
    }

    #ia-creaciones .ia-grid {
        grid-template-columns: 1fr;
        gap: 12px;
    }

    #ia-creaciones .ia-actions {
        flex-direction: column;
    }

    #ia-creaciones .ia-btn {
        width: 100%;
    }

    #ia-creaciones .ia-overlay {
        font-size: .95rem;
        padding: .45rem .8rem;
    }

    #ia-creaciones .ia-title--desc {
        -webkit-line-clamp: 4;
        line-clamp: 4;
        min-height: calc(1.2em * 4);
    }

    .ia-pager .pager-counter {
        display: none;
    }
}

@media (min-width:768px) and (max-width:1023px) {
    #ia-creaciones .ia-header {
        text-align: center;
    }

    #ia-creaciones .ia-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 14px;
    }

    #ia-creaciones .ia-body {
        min-height: 146px;
    }
}

@media (min-width:1024px) and (max-width:1279px) {
    #ia-creaciones .ia-header {
        text-align: center;
    }

    #ia-creaciones .ia-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 16px;
    }

    #ia-creaciones .ia-body {
        min-height: 146px;
    }
}

@media (min-width:1280px) {
    #ia-creaciones .ia-header {
        text-align: center;
    }

    #ia-creaciones .ia-grid {
        grid-template-columns: repeat(4, minmax(0, 1fr));
        gap: 20px;
    }

    #ia-creaciones .ia-body {
        min-height: 146px;
    }
}