/*
 * Grid de módulos para categorías de curso (loop-course.php)
 * Colores de marca: amarillo #FFCC00, negro #1A1A1A
 */

/* Un solo hijo directo de .site-main.grid para que el layout grid-2
   del tema padre no reparta grid y FAQ en dos columnas */
.curso-index-wrapper {
    display: block;
    /* ocupar las 2 columnas del layout grid-2 del padre, como hace su .page-header */
    grid-column: 1 / -1;
}

.curso-modulos-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
    gap: 14px;
    margin: 2rem 0;
    /* misma altura para todas las tarjetas de una fila */
    align-items: stretch;
}

.curso-modulo-card {
    border-radius: 12px;
    padding: 1.1rem 1.25rem;
    background: #ffffff;
    border: 1px solid #e5e5e5;
    /* columna flex a altura completa para poder anclar el candado al fondo */
    display: flex;
    flex-direction: column;
    height: 100%;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.12);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

/* Los envoltorios internos (enlace de la desbloqueada, div de la bloqueada)
   deben propagar la columna flex hasta el candado */
.curso-modulo-card > a,
.curso-modulo-locked {
    display: flex;
    flex-direction: column;
    flex: 1;
}

.curso-modulo-card.desbloqueado {
    background: #1A1A1A;
    border-color: #1A1A1A;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.25);
}

.curso-modulo-card.bloqueado {
    opacity: 0.75;
}

.curso-modulo-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 10px;
}

.curso-modulo-numero {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    font-weight: 500;
    font-size: 13px;
}

.desbloqueado .curso-modulo-numero {
    background: #FFCC00;
    color: #1A1A1A;
}

.bloqueado .curso-modulo-numero {
    background: #f1f1f1;
    color: #888;
    border: 1px solid #ddd;
}

.curso-modulo-candado-wrap {
    display: flex;
    justify-content: center;
    /* anclado al fondo de la tarjeta, con distancia fija al contenido de arriba */
    margin-top: auto;
    padding-top: 16px;
}

/* CSS width/height prevalece sobre los atributos width="16" height="16" del SVG */
.curso-modulo-candado {
    width: 32px;
    height: 32px;
    color: #999;
}

.curso-modulo-card h3 {
    font-size: 14px;
    font-weight: 500;
    margin: 0 0 4px;
}

.desbloqueado h3 {
    color: #ffffff;
}

.curso-modulo-card p {
    font-size: 12px;
    margin: 0;
}

.desbloqueado p {
    color: #cfcfcf;
}

/* Cinturón de seguridad: máximo 3 líneas de extracto aunque el texto sea largo */
.curso-modulo-excerpt {
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.bloqueado p {
    color: #666;
}

.curso-modulo-card a {
    text-decoration: none;
}

/* CTA de compra genérico (cabecera de la página, solo sin acceso) */
.curso-cta-compra {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    background: #1A1A1A;
    border-radius: 12px;
    padding: 1.1rem 1.4rem;
    margin-bottom: 1.5rem;
}

.curso-cta-titulo {
    margin: 0 0 2px;
    font-weight: 500;
    font-size: 15px;
    color: #ffffff;
}

.curso-cta-subtitulo {
    margin: 0;
    font-size: 13px;
    color: #cfcfcf;
}

.curso-cta-boton {
    background: #FFCC00;
    color: #1A1A1A;
    border: none;
    font-weight: 500;
    font-size: 13px;
    padding: 10px 18px;
    border-radius: 8px;
    white-space: nowrap;
    text-decoration: none;
    display: inline-block;
}

.curso-faq-bloque {
    /* va encima del grid: sin margen superior, separación hacia el grid de abajo */
    margin-top: 0;
    margin-bottom: 1.5rem;
    border-radius: 12px;
    border: 1px dashed #ccc;
    padding: 0.9rem 1.1rem;
    max-width: 460px;
    margin-left: auto;
    margin-right: auto;
}

.curso-faq-bloque p {
    margin: 0;
    font-size: 13px;
    color: #666;
}

.curso-faq-bloque a {
    font-weight: 500;
    font-size: 14px;
    color: #1A1A1A;
    text-decoration: none;
}

/* Rebote del candado y escala de tarjetas al hacer hover — solo escritorio con puntero real */
@media (hover: hover) and (pointer: fine) {
    .curso-modulo-candado {
        transition: transform 0.2s ease;
    }

    .curso-modulo-card:hover {
        transform: translateY(-2px);
        box-shadow: 0 8px 20px rgba(0, 0, 0, 0.18);
    }

    .curso-modulo-card.desbloqueado:hover {
        transform: translateY(-2px) scale(1.05);
        box-shadow: 0 8px 20px rgba(0, 0, 0, 0.3);
    }

    .curso-modulo-card.bloqueado:hover .curso-modulo-candado {
        animation: candado-rebote 0.5s ease;
    }

    @keyframes candado-rebote {
        0% {
            transform: scale(1);
        }
        50% {
            transform: scale(1.5);
        }
        70% {
            transform: scale(1.3);
        }
        85% {
            transform: scale(1.55);
        }
        100% {
            transform: scale(1);
        }
    }
}
