/* =============================================================
   Proyectum Ebooks — peb.css
   ============================================================= */

/* ── Grid ── */
.peb-grid {
    display: grid;
    gap: 28px;
    padding: 8px 0;
}
.peb-cols-3 { grid-template-columns: repeat(3, 1fr); }
.peb-cols-2 { grid-template-columns: repeat(2, 1fr); }
.peb-cols-1 { grid-template-columns: 1fr; }

@media (max-width: 900px) {
    .peb-cols-3,
    .peb-cols-2 { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 580px) {
    .peb-cols-3,
    .peb-cols-2,
    .peb-cols-1 { grid-template-columns: 1fr; }
}

/* ── Card ── */
.peb-card {
    position: relative;
    background: #ffffff;
    border: 1px solid #e8eaf0;
    border-radius: 16px;
    padding: 0 0 28px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transition: box-shadow 0.25s ease, transform 0.25s ease;
}
.peb-card:hover {
    box-shadow: 0 12px 40px rgba(37, 99, 235, 0.10);
    transform: translateY(-3px);
}

/* ── Destacado ── */
.peb-badge {
    position: absolute;
    top: 16px;
    right: 16px;
    background: #2563eb;
    color: #fff;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: .04em;
    padding: 4px 12px;
    border-radius: 20px;
    z-index: 2;
}

/* ── Thumbnail ── */
.peb-thumbnail {
    background: #eef2fb;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 32px 40px 20px;
    min-height: 220px;
}
.peb-thumbnail img {
    max-height: 200px;
    width: auto;
    object-fit: contain;
    display: block;
    margin: 0 auto;
    filter: drop-shadow(0 8px 20px rgba(0,0,0,.14));
}

/* ── Meta ── */
.peb-categoria {
    display: inline-block;
    margin: 20px 24px 0;
    background: #eef2fb;
    color: #2563eb;
    font-size: 12px;
    font-weight: 600;
    padding: 3px 12px;
    border-radius: 20px;
}

.peb-title {
    font-size: 17px !important;
    font-weight: 700 !important;
    line-height: 1.35 !important;
    color: #0f172a !important;
    margin: 12px 24px 0 !important;
    padding: 0 !important;
}

.peb-excerpt {
    font-size: 13.5px;
    color: #64748b;
    line-height: 1.6;
    margin: 8px 24px 0 !important;
    flex-grow: 1;
}

.peb-tiempo {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 12px;
    color: #94a3b8;
    margin: 12px 24px 0 !important;
}
.peb-tiempo svg { flex-shrink: 0; }

/* ── Botón ── */
.peb-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin: 20px 24px 0;
    padding: 13px 20px;
    background: #2563eb;
    color: #fff !important;
    border: none;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 600;
    text-decoration: none !important;
    cursor: pointer;
    transition: background 0.2s ease, box-shadow 0.2s ease;
    font-family: inherit;
    line-height: 1;
}
.peb-btn:hover {
    background: #1d4ed8;
    box-shadow: 0 4px 16px rgba(37, 99, 235, 0.30);
}
.peb-btn--disabled {
    background: #cbd5e1;
    color: #94a3b8 !important;
    cursor: default;
    pointer-events: none;
}
.peb-btn--modal {
    /* mismo aspecto que .peb-btn */
}

/* ── Empty state ── */
.peb-empty {
    text-align: center;
    color: #94a3b8;
    padding: 32px 0;
}

/* ── Badge Destacado en Loop Item de Elementor ── */

/* El widget que contiene el badge lleva la clase peb-badge-wrap */
/* Cuando el dynamic tag devuelve vacío, el elemento queda vacío y se oculta */
.peb-badge-wrap:empty,
.peb-badge-wrap .elementor-widget-container:empty {
    display: none !important;
}

/* Estilo del pill "Destacado" */
.peb-badge-wrap .elementor-widget-container {
    display: inline-flex !important;
}

.peb-badge-wrap .elementor-heading-title,
.peb-badge-wrap p {
    display: inline-block;
    background: #2563eb;
    color: #fff !important;
    font-size: 11px !important;
    font-weight: 600 !important;
    letter-spacing: .04em;
    padding: 4px 12px;
    border-radius: 20px;
    line-height: 1.4;
    margin: 0 !important;
}

/* ── Botón shortcode [ebook_boton] ── */
.peb-btn-descarga {
    display: flex !important;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    padding: 14px 20px;
    background: #2563eb;
    color: #fff !important;
    border: none;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    text-align: center;
    transition: background 0.2s ease, box-shadow 0.2s ease;
    line-height: 1;
    margin: 0;
}
.peb-btn-descarga:hover {
    background: #1d4ed8;
    box-shadow: 0 4px 16px rgba(37, 99, 235, 0.35);
}
.peb-btn-descarga svg {
    flex-shrink: 0;
}
